SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.58k stars 8.17k forks source link

[🐛 Bug]: Unable to launch Edge/Chrome on Windows 10 #14632

Open visa-leapwork opened 3 days ago

visa-leapwork commented 3 days ago

What happened?

We are facing issues with launching the Edge browser on multiple machines with Windows 10 after recent Windows updates. Everything was working correctly before these updates, and this issue does not occur on Windows 11. When attempting to launch the browser using Selenium, we receive the following error:

OpenQA.Selenium.NoSuchDriverException: Unable to obtain MicrosoftEdge using Selenium Manager; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location ---> OpenQA.Selenium.WebDriverException: Error starting process: C:\Program Files\XXXXXX\XXX\selenium-manager/windows/selenium-manager.exe --browser "MicrosoftEdge" --output json ---> OpenQA.Selenium.WebDriverException: Selenium Manager process exited abnormally with -1073740791 code: C:\Program Files\XXXXXX\XXX\selenium-manager/windows/selenium-manager.exe --browser "MicrosoftEdge" --output json at OpenQA.Selenium.SeleniumManager.RunCommand(String fileName, String arguments)

The Windows 10 updates installed are:

We are currntly using Selenium 4.11 but we replaced selenium-manager.exe with 4.25, this works fine in Windows 11 but does not work with Windows 10

How can we reproduce the issue?

Try to launch web browser with selenium-manager
OS must be windows 10 with following updates-

- KB5044091
- KB5044273
- KB5045998

Relevant log output

[24048] XXXX.Logic.Factories.Web.Builders.BaseLocalWebInspectorBrowserBuilder 2024-10-21 15:05:51.3687 - Error
Message: Could not create XXXX.Models.Models.Web.Services.SeleniumDriverServiceWrapper`1[OpenQA.Selenium.Edge.EdgeDriverService] web service.
OpenQA.Selenium.NoSuchDriverException: Unable to obtain MicrosoftEdge using Selenium Manager; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location ---> OpenQA.Selenium.WebDriverException: Error starting process: C:\Program Files\XXXX\XX\selenium-manager/windows/selenium-manager.exe  --browser "MicrosoftEdge" --output json ---> OpenQA.Selenium.WebDriverException: Selenium Manager process exited abnormally with -1073740791 code: C:\Program Files\XXXX\XX\selenium-manager/windows/selenium-manager.exe  --browser "MicrosoftEdge" --output json

   at OpenQA.Selenium.SeleniumManager.RunCommand(String fileName, String arguments)
   --- End of inner exception stack trace ---
   at OpenQA.Selenium.SeleniumManager.RunCommand(String fileName, String arguments)
   at OpenQA.Selenium.SeleniumManager.DriverPath(DriverOptions options)
   at OpenQA.Selenium.DriverFinder.FullPath(DriverOptions options)
   --- End of inner exception stack trace ---
   at OpenQA.Selenium.DriverFinder.FullPath(DriverOptions options)
   at OpenQA.Selenium.Edge.EdgeDriverService.CreateDefaultService(EdgeOptions options)
   at OpenQA.Selenium.Edge.EdgeDriverService.CreateDefaultService()
   at XXXX.Logic.Factories.Web.Builders.LocalWebInspectorBrowserBuilder.<>c.<CreateBrowser>b__4_12() in C:\Agents\CPH1\_work\1\s\Main\XXXX.Logic\Factories\Web\Builders\LocalWebInspectorBrowserBuilder.cs:line 119
   at XXXX.Logic.Factories.Web.Builders.BaseLocalWebInspectorBrowserBuilder.CreateServiceSafe[TService](Func`1 createService, BrowserAttributes attributes, BrowserName browserName) in C:\Agents\CPH1\_work\1\s\Main\XXXX.Logic\Factories\Web\Builders\BaseLocalWebInspectorBrowserBuilder.cs:line 200    at OpenQA.Selenium.DriverFinder.FullPath(DriverOptions options)
   at OpenQA.Selenium.Edge.EdgeDriverService.CreateDefaultService(EdgeOptions options)
   at OpenQA.Selenium.Edge.EdgeDriverService.CreateDefaultService()
   at XXXX.Logic.Factories.Web.Builders.LocalWebInspectorBrowserBuilder.<>c.<CreateBrowser>b__4_12() in C:\Agents\CPH1\_work\1\s\Main\XXXX.Logic\Factories\Web\Builders\LocalWebInspectorBrowserBuilder.cs:line 119
   at XXXX.Logic.Factories.Web.Builders.BaseLocalWebInspectorBrowserBuilder.CreateServiceSafe[TService](Func`1 createService, BrowserAttributes attributes, BrowserName browserName) in C:\Agents\CPH1\_work\1\s\Main\XXXX.Logic\Factories\Web\Builders\BaseLocalWebInspectorBrowserBuilder.cs:line 200

Operating System

Windows 10

Selenium version

Selenium 4.11

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

Chrome 129/130 Edge 129/130

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

ChromeDriver130, Edge Driver 130

Are you using Selenium Grid?

No

github-actions[bot] commented 3 days ago

@visa-leapwork, 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!

visa-leapwork commented 1 day ago

The problem is caused by Microsoft update KB5044273. As a work-around, one can run the task as an admin user. Also, if one starts the task as a different user and provide the current user's credentials, it will work.