bonigarcia / webdrivermanager

Automated driver management and other helper features for Selenium WebDriver in Java
https://bonigarcia.dev/webdrivermanager/
Apache License 2.0
2.58k stars 676 forks source link

HTTP 404 when downloading microsoft edgedriver #1320

Closed majusmisiak closed 3 months ago

majusmisiak commented 3 months ago

Description of the problem:

We are running MS Edge tests on Linux OS.

Microsoft sometimes publishes different architectures (different builds) of the same version of EdgeDriver at different times. For example right now the latest version for x64 Windows is 126.0.2592.113 but the latest version for Linux and Mac is 126.0.2592.102.

obraz

WebDriver manager searches Edge repository, so it will find the latest version - in this case 126.0.2592.113 - even if it does not exist for the given OS / architecture. Afterwards it will try to download the version and fail with HTTP 404.

obraz

When this happens tests are failing, until Microsoft publishes the same version for all architectures.

Seems like the edge version resolver should account for the OS / architecture.

Browser and version: Microsoft Edge Version 126.0.2592.102 (Official build) (64-bit)

Operating system and architecture: Linux / Debian 12 Bookworm 64 bit

Selenium version: Selenium 4.20.0

WebDriverManager version 5.9.1

WebDriverManager call: WebDriverManager.edgedriver().setup();

WebDriverManager traces:

17:06:38.955 DEBUG i.g.bonigarcia.wdm.WebDriverManager - Using WebDriverManager 5.9.1
17:06:39.119 DEBUG i.g.b.wdm.cache.ResolutionCache - Created new resolution cache file at /home/devops/.cache/selenium/resolution.properties
17:06:39.263 DEBUG i.g.b.wdm.versions.VersionDetector - Detecting edge version using online commands.properties
17:06:39.265 DEBUG i.g.bonigarcia.wdm.versions.Shell - Running command on the shell: [/usr/bin/microsoft-edge, --version]
17:06:39.267 DEBUG i.g.bonigarcia.wdm.versions.Shell - There was a problem executing command </usr/bin/microsoft-edge --version> on the shell: Cannot run program "/usr/bin/microsoft-edge" (in directory "."): error=2, No such file or directory
17:06:39.268 DEBUG i.g.bonigarcia.wdm.versions.Shell - Result: 
17:06:39.268 DEBUG i.g.bonigarcia.wdm.versions.Shell - Running command on the shell: [microsoft-edge, --version]
17:06:39.269 DEBUG i.g.bonigarcia.wdm.versions.Shell - There was a problem executing command <microsoft-edge --version> on the shell: Cannot run program "microsoft-edge" (in directory "."): error=2, No such file or directory
17:06:39.270 DEBUG i.g.bonigarcia.wdm.versions.Shell - Result: 
17:06:39.270 DEBUG i.g.b.wdm.versions.VersionDetector - Browser version for edge not detected using online properties (using local commands.properties)
17:06:39.270 DEBUG i.g.bonigarcia.wdm.versions.Shell - Running command on the shell: [/usr/bin/microsoft-edge, --version]
17:06:39.272 DEBUG i.g.bonigarcia.wdm.versions.Shell - There was a problem executing command </usr/bin/microsoft-edge --version> on the shell: Cannot run program "/usr/bin/microsoft-edge" (in directory "."): error=2, No such file or directory
17:06:39.272 DEBUG i.g.bonigarcia.wdm.versions.Shell - Result: 
17:06:39.272 DEBUG i.g.bonigarcia.wdm.versions.Shell - Running command on the shell: [microsoft-edge, --version]
17:06:39.274 DEBUG i.g.bonigarcia.wdm.versions.Shell - There was a problem executing command <microsoft-edge --version> on the shell: Cannot run program "microsoft-edge" (in directory "."): error=2, No such file or directory
17:06:39.274 DEBUG i.g.bonigarcia.wdm.versions.Shell - Result: 
17:06:39.274 DEBUG i.g.bonigarcia.wdm.WebDriverManager - The driver version for EDGE is unknown ... trying with latest
17:06:39.339 DEBUG i.g.b.wdm.versions.VersionDetector - Latest version of msedgedriver according to https://msedgedriver.azureedge.net/LATEST_STABLE is 126.0.2592.113
17:06:39.349 DEBUG i.g.bonigarcia.wdm.WebDriverManager - Using URL built from repository pattern: https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/126.0.2592.113/edgedriver_linux64.zip
17:06:39.350 INFO  i.g.bonigarcia.wdm.WebDriverManager - Reading https://msedgedriver.azureedge.net/?restype=container&comp=list to seek msedgedriver
17:06:40.046 DEBUG i.g.bonigarcia.wdm.WebDriverManager - Driver to be downloaded edgedriver 126.0.2592.113
17:06:40.048 DEBUG i.g.bonigarcia.wdm.WebDriverManager - Using URL built from repository pattern: https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/126.0.2592.113/edgedriver_linux64.zip
17:06:40.049 INFO  i.g.bonigarcia.wdm.online.Downloader - Downloading https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/126.0.2592.113/edgedriver_linux64.zip
17:06:40.567 ERROR i.g.bonigarcia.wdm.online.HttpClient - Error HTTP 404 executing https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/126.0.2592.113/edgedriver_linux64.zip
17:06:40.569 WARN  i.g.bonigarcia.wdm.WebDriverManager - There was an error managing msedgedriver 126.0.2592.113 (Error HTTP 404 executing https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/126.0.2592.113/edgedriver_linux64.zip) ... trying again using latest driver stored in cache
17:06:40.570 DEBUG i.g.bonigarcia.wdm.WebDriverManager - The driver version for EDGE is unknown ... trying with latest
17:06:40.581 DEBUG i.g.b.wdm.versions.VersionDetector - Latest version of msedgedriver according to https://msedgedriver.azureedge.net/LATEST_STABLE is 126.0.2592.113
17:06:40.583 DEBUG i.g.bonigarcia.wdm.WebDriverManager - Using URL built from repository pattern: https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/126.0.2592.113/edgedriver_linux64.zip
17:06:40.584 INFO  i.g.bonigarcia.wdm.WebDriverManager - Reading https://msedgedriver.azureedge.net/?restype=container&comp=list to seek msedgedriver
17:06:41.050 DEBUG i.g.bonigarcia.wdm.WebDriverManager - Driver to be downloaded edgedriver 126.0.2592.113
17:06:41.051 DEBUG i.g.bonigarcia.wdm.WebDriverManager - Using URL built from repository pattern: https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/126.0.2592.113/edgedriver_linux64.zip
17:06:41.052 INFO  i.g.bonigarcia.wdm.online.Downloader - Downloading https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/126.0.2592.113/edgedriver_linux64.zip
17:06:41.547 ERROR i.g.bonigarcia.wdm.online.HttpClient - Error HTTP 404 executing https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/126.0.2592.113/edgedriver_linux64.zip
17:06:41.547 ERROR i.g.bonigarcia.wdm.WebDriverManager - There was an error managing msedgedriver 126.0.2592.113 (Error HTTP 404 executing https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/126.0.2592.113/edgedriver_linux64.zip)
io.github.bonigarcia.wdm.config.WebDriverManagerException: Error HTTP 404 executing https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/126.0.2592.113/edgedriver_linux64.zip
    at io.github.bonigarcia.wdm.online.HttpClient.execute(HttpClient.java:172)
    at io.github.bonigarcia.wdm.online.Downloader.downloadAndExtract(Downloader.java:136)
    at io.github.bonigarcia.wdm.online.Downloader.download(Downloader.java:91)
    at io.github.bonigarcia.wdm.WebDriverManager.download(WebDriverManager.java:1273)
    at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1184)
    at io.github.bonigarcia.wdm.WebDriverManager.fallback(WebDriverManager.java:1437)
    at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:1415)
    at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1190)
    at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:427)
    at drivers.WebDriverFactory.initBrowser(WebDriverFactory.java:377)
    at drivers.WebDriverFactory.initDriver(WebDriverFactory.java:90)
    at extensions.JunitWebDriverExtension.beforeEach(JunitWebDriverExtension.java:62)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeBeforeEachCallbacks$2(TestMethodTestDescriptor.java:166)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeBeforeMethodsOrCallbacksUntilExceptionOccurs$6(TestMethodTestDescriptor.java:202)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeBeforeMethodsOrCallbacksUntilExceptionOccurs(TestMethodTestDescriptor.java:202)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeBeforeEachCallbacks(TestMethodTestDescriptor.java:165)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:132)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:68)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
    at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
    at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:55)
    at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:223)
    at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:175)
    at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:139)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:456)
    at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:169)
    at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:595)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:581)
majusmisiak commented 3 months ago

This is the same issue as https://github.com/bonigarcia/webdrivermanager/issues/1297 (unresolved)

Harish879 commented 3 months ago

https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/126.0.2592.113/edgedriver_.zip - End Point is not working in Linux and mac. In windows it's working.

NadiaUoM commented 3 months ago

I am also facing the same the strange part is when i am executing the code from eclipse with the same configuration its working fine. Where as if i am executing the code from my linux or jenkin job its failing.

bonigarcia commented 3 months ago

Thanks for reporting. Indeed, there was a problem resolving the latest version of msedgedriver in non Windows hosts. I have fixed the issue in the master branch. I will release a new version of WebDriverManager with the fix soon.

bonigarcia commented 3 months ago

This problem should be fixed in WebDriverManager 5.9.2, just released.

NadiaUoM commented 3 months ago

Hi,

Thanks for providing the fix. After updating to 5.9.2. I got below exception:

org.openqa.selenium.SessionNotCreatedException: session not created from unknown error: cannot find msedge binary Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'AP-5CG3430ZL2', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.153.1-microsoft-standard-WSL2', java.version: '11.0.23' Driver info: driver.version: EdgeDriver remote stacktrace: #0 0x55d7d6f76f3e

1 0x55d7d6c14946

2 0x55d7d6c4c9b4

3 0x55d7d6c48eb0

4 0x55d7d6c94147

5 0x55d7d6c933df

6 0x55d7d6c86853

7 0x55d7d6c5704d

8 0x55d7d6c57d3e

9 0x55d7d6f46121

10 0x55d7d6f4936d

11 0x55d7d6f48deb

12 0x55d7d6f497d5

13 0x55d7d6f378a2

14 0x55d7d6f49b5d

15 0x55d7d6f22be5

16 0x55d7d6f673b8

17 0x55d7d6f675d7

18 0x55d7d6f75d01

19 0x7f3790d9fac3

Thanks.

bonigarcia commented 3 months ago

That (org.openqa.selenium.SessionNotCreatedException) is a Selenium exception, not WebDriverManager. The error message (cannot find msedge binary) says Edge is not available, maybe it is not installed.