webdrivermanager icon indicating copy to clipboard operation
webdrivermanager copied to clipboard

WebDriverManager downloads the wrong EdgeDriver for MAC M1

Open ynot408 opened this issue 1 year ago • 2 comments

Description of the problem: java -jar webdrivermanager-5.3.0-fat.jar resolveDriverFor edge Above command downloads the arm64 version for windows edge driver.

Expected: Edge driver for mac M1 should have been downloaded.

Browser and version: edge 105

Operating system: MAC M1 (mac os Monterey 12.5.1)

WebDriverManager version: webdrivermanager-5.3.0

WebDriverManager call: java -jar webdrivermanager-5.3.0-fat.jar resolveDriverFor edge

WebDriverManager traces:

[INFO] Using WebDriverManager to resolve edge
[DEBUG] Detecting edge version using online commands.properties
[DEBUG] Running command on the shell: [/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge, -version]
[DEBUG] Result: Microsoft Edge 105.0.1343.33
[DEBUG] Latest version of msedgedriver according to https://msedgedriver.azureedge.net/LATEST_RELEASE_105_MACOS is 105.0.1343.34
[INFO] Using msedgedriver 105.0.1343.34 (resolved driver for Edge 105)
[INFO] Reading https://msedgedriver.azureedge.net/?restype=container&comp=list to seek msedgedriver
[DEBUG] Driver to be downloaded edgedriver 105.0.1343.34
[DEBUG] Using URL built from repository pattern: https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/105.0.1343.34/edgedriver_arm64.zip
[INFO] Downloading https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/105.0.1343.34/edgedriver_arm64.zip
[INFO] Extracting driver from compressed file edgedriver_arm64.zip
[INFO] Driver location: /Users/Pthomas/projects/work/automation/newuiauto/libs/msedgedriver.exe

Error log: The url downloaded was wrong - https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/105.0.1343.34/edgedriver_arm64.zip Expected url - https://msedgedriver.azureedge.net/105.0.1343.33/edgedriver_mac64_m1.zip

The downloads are happening from Beta channel and the beta channel has no build for mac

ynot408 avatar Sep 12 '22 08:09 ynot408

+1 for this, For mac m1 pro, its downloading the windows driver "exe" file

selenium/msedgedriver/mac-arm64/105.0.1343.42/msedgedriver.exe: cannot execute binary file

rehmanuet avatar Sep 19 '22 09:09 rehmanuet

I have just tested this in an macOS M1. Indeed, the downloaded driver for an Edge 105 is edgedriver_arm64, nevertheless, this driver works for driving Selenium tests:

2022-09-20 09:18:43 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getBrowserVersionFromTheShell(205) -- Detecting edge version using online commands.properties
2022-09-20 09:18:43 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(65) -- Running command on the shell: [/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge, -version]
2022-09-20 09:18:43 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(69) -- Result: Microsoft Edge 105.0.1343.42
2022-09-20 09:18:44 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getDriverVersionFromRepository(127) -- Latest version of msedgedriver according to https://msedgedriver.azureedge.net/LATEST_RELEASE_105_MACOS is 105.0.1343.42
2022-09-20 09:18:44 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(1237) -- Using msedgedriver 105.0.1343.42 (resolved driver for Edge 105)
2022-09-20 09:18:44 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) -- Storing resolution edge=105 in cache (valid until 10:18:44 20/09/2022 CEST)
2022-09-20 09:18:44 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) -- Storing resolution edge105=105.0.1343.42 in cache (valid until 09:18:44 21/09/2022 CEST)
2022-09-20 09:18:44 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.manage(1192) -- Driver msedgedriver 105.0.1343.42 found in cache
2022-09-20 09:18:44 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.exportDriver(1290) -- Exporting webdriver.edge.driver as /Users/bonigarcia/.cache/selenium/msedgedriver/mac-arm64/105.0.1343.42/msedgedriver
Starting Microsoft Edge WebDriver 105.0.1343.42 (a7d028ad84939118c075a140c44731eec59a559e) on port 49718
To submit feedback, report a bug, or suggest new features, please visit https://github.com/MicrosoftEdge/EdgeWebDriver

Only local connections are allowed.
Please see https://aka.ms/WebDriverSecurity for suggestions on keeping Microsoft Edge WebDriver safe.

Microsoft Edge WebDriver was started successfully.

So, I do not understand the difference with the M1 version.

Moreover, WebDriverManager uses the metadata provided my msedgedriver to find out the proper driver version. In the case of Edge 105 for macOS, the announced driver version is found reading this file:

https://msedgedriver.azureedge.net/LATEST_RELEASE_105_MACOS

Which, as you can see, is 105.0.1343.34, and not 105.0.1343.33.

bonigarcia avatar Sep 20 '22 07:09 bonigarcia

This has recently started to happen to me as well. Seems to be related to the edge version. For example 101.0.1210.53 correctly downloads the mac version of the webdriver and 105.0.1343.53 downloads the windows version.

image

As a quick fix (workaround), I've downloaded the proper msedgedriver for version 105 from https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ and I extracted it to the default location that webdriver manager uses (/Users/YOUR_USER/.cache/selenium/msedgedriver/mac-arm64/105.0.1343.53)

SealviewTW avatar Sep 27 '22 07:09 SealviewTW

Native M1 builds for Mac are now available too https://github.com/MicrosoftEdge/EdgeWebDriver/issues/17#issuecomment-1258326485

bwalderman avatar Sep 28 '22 17:09 bwalderman

still present for v106, I had to manually download the m1 mac version from microsoft and put in the .cache folder

SealviewTW avatar Oct 04 '22 07:10 SealviewTW

Thanks for reporting. I am in peek of work now, but I try to solve and release a new version it as soon as possible.

bonigarcia avatar Oct 04 '22 08:10 bonigarcia

@bonigarcia I experienced the same problem on my Mac M1. I found a solution, see PR https://github.com/bonigarcia/webdrivermanager/pull/921

P.S. This is my info:

shortDriverName="edgedriver"
driverVersion = "106.0.1370.47"
getLatest = false
os="MAC"
architecture="ARM64"
isEdgeArm64=true
isMac=true
builtUrl="https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/106.0.1370.47/edgedriver_arm64.zip"

BUT file name "edgedriver_arm64.zip" is incorrect - it downloads a *.exe file for Windows. For Mac M1, we need file "edgedriver_mac64_m1.zip".

asolntsev avatar Oct 17 '22 21:10 asolntsev

Thanks for contributing, @asolntsev. Your PR is merged now, it will be available for next version (I think I will release it in November).

bonigarcia avatar Oct 22 '22 13:10 bonigarcia

This fix is available on WebDriverManager 5.3.1, just released.

bonigarcia avatar Nov 04 '22 10:11 bonigarcia