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]: Could not find an Internet Explorer window when running Edge in IE mode #15378

Open
rathimayur opened this issue Mar 5, 2025 · 5 comments

Comments

@rathimayur
Copy link

What happened?

Unable to instantiate InternetExplorerDriver instance on on Windows 11.
Getting below Exception on driver instantiation.

Exception:
Unexpected error launching Internet Explorer. Could not find an Internet Explorer window belonging to the process with ID 5216 within 60000 milliseconds. (SessionNotCreated)

How can we reproduce the issue?

Source Code:
var ieOptions = new InternetExplorerOptions
{
    AttachToEdgeChrome = true
};

ieOptions.EnsureCleanSession = true;
ieOptions.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
ieOptions.ElementScrollBehavior = InternetExplorerElementScrollBehavior.Bottom;
ieOptions.EnableNativeEvents = true;
ieOptions.PageLoadStrategy = OpenQA.Selenium.PageLoadStrategy.Default;

ieOptions.BrowserAttachTimeout = TimeSpan.FromMinutes(1);
ieOptions.ImplicitWaitTimeout = TimeSpan.FromMinutes(1);
ieOptions.PageLoadTimeout = TimeSpan.FromMinutes(1);
ieOptions.EdgeExecutablePath = @"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe";
ieOptions.IgnoreZoomLevel = true;
string driverPAthWithFileName = @"C:\\Users\\mayurrat\\source\\repos\\TestChromeDriver\\bin\\Debug\\net8.0-windows\IEDriverServer.exe";
InternetExplorerDriverService driverService = InternetExplorerDriverService.CreateDefaultService(driverPAthWithFileName);

try
{
    Driver = new InternetExplorerDriver((InternetExplorerDriverService)driverService, ieOptions, TimeSpan.FromSeconds(Convert.ToInt32(600)));
}
catch (Exception ex)
{

}

Relevant log output

Unexpected error launching Internet Explorer. Could not find an Internet Explorer window belonging to the process with ID 5216 within 60000 milliseconds. (SessionNotCreated)
Stack Trace:
at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)
   at OpenQA.Selenium.WebDriver.<ExecuteAsync>d__63.MoveNext()
   at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.WebDriver.StartSession(ICapabilities capabilities)
   at OpenQA.Selenium.WebDriver..ctor(ICommandExecutor executor, ICapabilities capabilities)
   at OpenQA.Selenium.IE.InternetExplorerDriver..ctor(InternetExplorerDriverService service, InternetExplorerOptions options, TimeSpan commandTimeout)
   at TestChromeDriver.ChromeDriverSample.button1_Click(Object sender, EventArgs e) in C:\Users\mayurrat\source\repos\TestChromeDriver\ChromeDriverSample.cs:line 131

Operating System

Windows 11

Selenium version

C# 4.29.0

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

Microsoft Edge Version 133.0.3065.92 (Official build) (64-bit)

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

IEDriverServer 4.14.0.0

Are you using Selenium Grid?

No response

Copy link

github-actions bot commented Mar 5, 2025

@rathimayur, 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!

@diemol
Copy link
Member

diemol commented Mar 5, 2025

I've only seen this error with the combination you mention if the code is being executed under an admin user.

You can try to set IgnoreProcessMatch to true.

See 1976dbe

@rathimayur
Copy link
Author

I've only seen this error with the combination you mention if the code is being executed under an admin user.

You can try to set IgnoreProcessMatch to true.

See 1976dbe

Thanks, seems working with basic code, still let me verify the same.
BTW what could be the root cause ? Is there anything related to Windows 11.
Also I don't see mention of Windows 11, in docs of IEDriverServer.exe on below URL
https://www.selenium.dev/documentation/ie_driver_server/

@cgoldberg cgoldberg changed the title [🐛 Bug]: [🐛 Bug]: Could not find an Internet Explorer window when running Edge in IE mode Mar 6, 2025
@cgoldberg
Copy link
Contributor

@rathimayur I added a title to this issue. Please update it if it's not accurate.

@diemol
Copy link
Member

diemol commented Mar 6, 2025

I've only seen this error with the combination you mention if the code is being executed under an admin user.
You can try to set IgnoreProcessMatch to true.
See 1976dbe

Thanks, seems working with basic code, still let me verify the same. BTW what could be the root cause ? Is there anything related to Windows 11. Also I don't see mention of Windows 11, in docs of IEDriverServer.exe on below URL https://www.selenium.dev/documentation/ie_driver_server/

Running the script in admin mode is the root cause, but I don't know if that is your case. There is no mention of this because we have not updated the docs. Would you like to improve those based on your findings?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants