Closed
Description
What happened?
Since IE is no longer supported, I need to move my scripts to work on MS Edge browser.
The application under test only works in IE and Edge browsers and while launching Edge browser, the IE mode needs to be enabled.
I am following the Microsoft has provided steps to run MS EDGE browser in IE Mode. While trying the steps suggested, am getting an exception as given below.
Am using the 32 bit driver for IE. There are 2 browser windows opening and then the exception is thrown. Attaching the screenshot
How can we reproduce the issue?
I tried this from a similar bug reported earlier at https://github.com/SeleniumHQ/selenium/issues/10411
import java.time.Duration;
import org.openqa.selenium.By;
import org.openqa.selenium.UnexpectedAlertBehaviour;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.ie.InternetExplorerOptions;
public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.ie.driver",".\\src\\drivers\\IEDriverServer_32_4.8.exe");
InternetExplorerOptions ieOptions = new InternetExplorerOptions();
ieOptions.attachToEdgeChrome();
ieOptions.withEdgeExecutablePath("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe");
ieOptions.ignoreZoomSettings();
ieOptions.introduceFlakinessByIgnoringSecurityDomains();
ieOptions.disableNativeEvents();
ieOptions.requireWindowFocus();
ieOptions.setUnhandledPromptBehaviour(UnexpectedAlertBehaviour.ACCEPT);
ieOptions.destructivelyEnsureCleanSession();
ieOptions.enablePersistentHovering();
ieOptions.withAttachTimeout(Duration.ofSeconds(100));
WebDriver driver = new InternetExplorerDriver(ieOptions);
driver.get("https://www.bing.com/");
}
Relevant log output
Exception Message:
Started InternetExplorerDriver server (32-bit)
4.8.0.0
Listening on port 41340
Only local connections are allowed
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '4.8.0', revision: '267030adea'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_291'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: internet explorer, se:ieOptions: {browserAttachTimeout: 100000, enablePersistentHover: true, ie.edgechromium: true, ie.edgepath: C:\Program Files (x86)\Micr..., ie.ensureCleanSession: true, ignoreProtectedModeSettings: true, ignoreZoomSetting: true, nativeEvents: false, requireWindowFocus: true}, unhandledPromptBehavior: accept}], desiredCapabilities=Capabilities {browserName: internet explorer, se:ieOptions: {browserAttachTimeout: 100000, enablePersistentHover: true, ie.edgechromium: true, ie.edgepath: C:\Program Files (x86)\Micr..., ie.ensureCleanSession: true, ignoreProtectedModeSettings: true, ignoreZoomSetting: true, nativeEvents: false, requireWindowFocus: true}, unhandledPromptBehavior: accept}}]
Capabilities {}
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:561)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:229)
at org.openqa.selenium.ie.InternetExplorerDriver.run(InternetExplorerDriver.java:153)
at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:140)
at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:117)
at ForEdgeBrowserConfig.main(ForEdgeBrowserConfig.java:70)
Caused by: java.lang.RuntimeException: NettyHttpHandler request execution error
at org.openqa.selenium.remote.http.netty.NettyHttpHandler.makeCall(NettyHttpHandler.java:76)
at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)
at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:56)
at org.openqa.selenium.remote.http.netty.NettyHttpHandler.execute(NettyHttpHandler.java:49)
at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)
at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:56)
at org.openqa.selenium.remote.http.netty.NettyClient.execute(NettyClient.java:99)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:124)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:106)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:67)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)
at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:167)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:142)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
... 5 more
Caused by: java.util.concurrent.ExecutionException: java.util.concurrent.TimeoutException: Request timeout to localhost/127.0.0.1:41340 after 180000 ms
at java.util.concurrent.CompletableFuture.reportGet(Unknown Source)
at java.util.concurrent.CompletableFuture.get(Unknown Source)
at org.asynchttpclient.netty.NettyResponseFuture.get(NettyResponseFuture.java:206)
at org.openqa.selenium.remote.http.netty.NettyHttpHandler.makeCall(NettyHttpHandler.java:59)
... 18 more
Caused by: java.util.concurrent.TimeoutException: Request timeout to localhost/127.0.0.1:41340 after 180000 ms
at org.asynchttpclient.netty.timeout.TimeoutTimerTask.expire(TimeoutTimerTask.java:43)
at org.asynchttpclient.netty.timeout.RequestTimeoutTimerTask.run(RequestTimeoutTimerTask.java:50)
at io.netty.util.HashedWheelTimer$HashedWheelTimeout.run(HashedWheelTimer.java:715)
at io.netty.util.concurrent.ImmediateExecutor.execute(ImmediateExecutor.java:34)
at io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:703)
at io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:790)
at io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:503)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Unknown Source)
Operating System
Windows 10
Selenium version
Selenium-Java 4.8
What are the browser(s) and version(s) where you see this issue?
Microsoft Edge Version 109.0.1518.78 (Official build) (64-bit)
What are the browser driver(s) and version(s) where you see this issue?
IEDriverServer 4.8
Are you using Selenium Grid?
No