Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 Bug]: Edge in IE mode not working for selenium 4 #10615

Closed
shinojnmp opened this issue May 6, 2022 · 5 comments
Closed

[🐛 Bug]: Edge in IE mode not working for selenium 4 #10615

shinojnmp opened this issue May 6, 2022 · 5 comments
Labels

Comments

@shinojnmp
Copy link

shinojnmp commented May 6, 2022

What happened?

I was testing the usage of Edge in IE mode with Selenium 3.141 and 4.1.4 and on both instance below error got displayed

Setup 1:

Selenium 4.1.4
IEDriver: 4.0.0 (x64,x86)

Opened Edge driver (localhost ) then got below error
Error :
"Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Unexpected error launching Internet Explorer. Could not find an Internet Explorer window belonging to the process with ID 23304 within 10000 milliseconds."

Setup2:

Selenium 3.141.59
IEDriver: 4.0.0 (x64,x86)

Opened Edge driver (localhost ) then got below error
Error:
"Unexpected error launching Internet Explorer. Could not find an Internet Explorer window belonging to the process with ID 16072 within 10 milliseconds."

How can we reproduce the issue?

in Selenium 4.1.4
public static void main(String[] args)  {
        System.setProperty("webdriver.ie.driver", "C:\\TEMP\\Setups\\Drivers\\IEDriverServer_Win32_4.0.0\\IEDriverServer.exe");
        InternetExplorerOptions ieOptions = new InternetExplorerOptions();
        ieOptions.attachToEdgeChrome();
        ieOptions.withAttachTimeout(Duration.ofSeconds(10));
        ieOptions.withEdgeExecutablePath("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe");     // Edge Browser directory path
        WebDriver driver = new InternetExplorerDriver(ieOptions);
        driver.get("https://github.com/");
        driver.close();

    }


in selenium 3.141

public static void main(String[] args)  {
        System.setProperty("webdriver.ie.driver", "C:\\TEMP\\Setups\\Drivers\\IEDriverServer_x64_4.0.0\\IEDriverServer.exe");
        InternetExplorerOptions edgeIe11Options = new InternetExplorerOptions();
        Map<String, Object> ops = (Map<String, Object>) edgeIe11Options.getCapability("se:ieOptions");
        ops.put("ie.edgechromium", true);
        ops.put("browserAttachTimeout",10);

        ops.put("ie.edgepath", "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe");     // Edge Browser directory path

        edgeIe11Options.introduceFlakinessByIgnoringSecurityDomains();
        edgeIe11Options.ignoreZoomSettings();
        edgeIe11Options.enablePersistentHovering();
        edgeIe11Options.takeFullPageScreenshot();
        edgeIe11Options.disableNativeEvents();
        edgeIe11Options.requireWindowFocus();
        edgeIe11Options.destructivelyEnsureCleanSession();

        edgeIe11Options.setCapability("ignoreProtectedModeSettings", true);
        edgeIe11Options.setUnhandledPromptBehaviour(UnexpectedAlertBehaviour.IGNORE);
        WebDriver driver;
        try {

            driver = new InternetExplorerDriver(edgeIe11Options);
            System.out.println("===" + driver.getWindowHandles().size());
            wait = new WebDriverWait(driver, 25);
            driver.get("https://github.com/");
            driver.close();
        }catch(Exception ex){
            System.out.println(ex.getMessage());
        }
        System.out.println("test");

    }


output selenium 3.141:
Started InternetExplorerDriver server (64-bit)
4.0.0.0
Listening on port 29571
Only local connections are allowed
Unexpected error launching Internet Explorer. Could not find an Internet Explorer window belonging to the process with ID 16072 within 10 milliseconds.
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'XPE1-D36660', ip: '10.174.0.238', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_301'
Driver info: driver.version: InternetExplorerDriver
remote stacktrace: 
test

Relevant log output

Console output for selenium 4.1.4

Started InternetExplorerDriver server (64-bit)
4.0.0.0
Listening on port 50805
Only local connections are allowed
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Unexpected error launching Internet Explorer. Could not find an Internet Explorer window belonging to the process with ID 23304 within 10000 milliseconds.
Build info: version: '4.1.4', revision: '535d840ee2'
System info: host: 'XPE1-D36660', ip: '10.174.0.238', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_301'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: internet explorer, se:ieOptions: {browserAttachTimeout: 10000, ie.edgechromium: true, ie.edgepath: C:\Program Files (x86)\Micr...}}], desiredCapabilities=Capabilities {browserAttachTimeout: 10000, browserName: internet explorer, ie.edgechromium: true, ie.edgepath: C:\Program Files (x86)\Micr..., se:ieOptions: {browserAttachTimeout: 10000, ie.edgechromium: true, ie.edgepath: C:\Program Files (x86)\Micr...}}}]
Capabilities {}
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:84)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:62)
	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:567)
	at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:248)
	at org.openqa.selenium.ie.InternetExplorerDriver.run(InternetExplorerDriver.java:188)
	at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:180)
	at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:156)
	at com.testing.testhooks.Setup.main(Setup.java:71)

Process finished with exit code 1

Operating System

Windows 10

Selenium version

Java 4.1.4

What are the browser(s) and version(s) where you see this issue?

Edge

What are the browser driver(s) and version(s) where you see this issue?

IEDriver 4.0.0.0

Are you using Selenium Grid?

No

@github-actions
Copy link

github-actions bot commented May 6, 2022

@shinojnmp, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@shinojnmp shinojnmp changed the title [🐛 Bug]: Edge in IE mode not working [🐛 Bug]: Edge in IE mode not working for selenium 4 May 6, 2022
@manu141
Copy link

manu141 commented May 6, 2022

@shinojnmp
you are adding browser timeout pls remove "ops.put("browserAttachTimeout",10);" and try it should work
it's working for me on the same version, 3.141 and 4+

@diemol
Copy link
Member

diemol commented May 7, 2022

I cannot reproduce this either. Thanks for the comment, @manu141

@shinojnmp please check the docs and be sure the setup is following the recommendations https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium/ie-mode and also use driver.quit() instead of driver.close().

@diemol
Copy link
Member

diemol commented May 7, 2022

If the issue still happens, please provide a complete example with the latest version of Selenium.

@github-actions
Copy link

github-actions bot commented Jun 7, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants