The method attachToEdgeChrome() is undefined for the type InternetExplorerOptions using selenium-server-4.0.0-alpha-2

1.7k views Asked by At

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

1

There are 1 answers

0
undetected Selenium On

As per the ChangeLogs 0f Selenium v4.0.0.0-alpha-2:

  • Add Chromium-based Edge support. This involves adding a new Chromium driver to the tree too.

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 and beta releases, you should always prefer the GA releases to execute your tests and you can pickup anyone from the following options:

  • Selenium v4.1.3
  • Selenium v4.1.2
  • Selenium v4.1.1
  • Selenium v4.1.0
  • Selenium v4.0.0