I want test the IE mode for Edge browser with Selenium. I found the solution on the MS site here: https://learn.microsoft.com/en-us/microsoft-edge/webdriver-chromium/ie-mode?tabs=java
I am using the following code as given in the above link:
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.ie.InternetExplorerOptions;
InternetExplorerOptions ieOptions = new InternetExplorerOptions();
ieOptions.attachToEdgeChrome();
ieOptions.withEdgeExecutablePath("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe");
WebDriver driver = new InternetExplorerDriver(ieOptions);
I can get the error that the methods "attachToEdgeChrome()"
and "withEdgeExecutablePath()"
are not defined in the InternetExplorerOptions. Is there anything I am missing here?
Note: My selenium jar is selenium-server-4.0.0-alpha-2.jar
As per the ChangeLogs 0f Selenium v4.0.0.0-alpha-2:
So ideally, the code block from the documentation Use Internet Explorer Driver to automate IE mode in Microsoft Edge should have worked seamlessly.
However, as per best practices instead of using the
alpha
andbeta
releases, you should always prefer the GA releases to execute your tests and you can pickup anyone from the following options: