Closed lsoares closed 2 years ago
I would need to take a look to the WebDriverManager logs (better, at TRACE
level).
For getting the WebDriverManager logs, you need to include a Logback configuration file (for example, like this) in your project classpath. The name of this file should be src/test/resources/logback-test.xml
(if you want logs only for your tests) or src/test/resources/logback.xml
(if you want logs for both tests and application code). Then, you need to use the following line to set the level to TRACE
:
<logger name="io.github.bonigarcia" level="TRACE" />
After that, when running a test, your should see something like this:
2021-12-03 11:54:24 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.checkValidity(156) -- Removing resolution chrome=96 from cache (expired on Thu Nov 25 15:43:32 CET 2021)
2021-12-03 11:54:24 [main] TRACE i.g.b.wdm.versions.VersionDetector.getVersionsInputStream(315) -- Reading online commands.properties to find out driver version
2021-12-03 11:54:24 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getBrowserVersionFromTheShell(205) -- Detecting chrome version using online commands.properties
2021-12-03 11:54:24 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(65) -- Running command on the shell: [cmd.exe, /C, wmic, datafile, where, name="%PROGRAMFILES(X86):\=\\%\\Google\\Chrome\\Application\\chrome.exe", get, Version, /value]
2021-12-03 11:54:24 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(69) -- Result: Version=96.0.4664.45
2021-12-03 11:54:24 [main] TRACE i.g.b.wdm.versions.VersionDetector.getBrowserVersionUsingCommand(284) -- Detected browser version is 96.0.4664.45
2021-12-03 11:54:24 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.checkValidity(156) -- Removing resolution chrome96=96.0.4664.45 from cache (expired on Thu Nov 25 18:45:50 CET 2021)
2021-12-03 11:54:25 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getDriverVersionFromRepository(127) -- Latest version of chromedriver according to https://chromedriver.storage.googleapis.com/LATEST_RELEASE_96 is 96.0.4664.45
2021-12-03 11:54:25 [main] INFO i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(1012) -- Using chromedriver 96.0.4664.45 (resolved driver for Chrome 96)
2021-12-03 11:54:25 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) -- Storing resolution chrome=96 in cache (valid until 12:54:25 03/12/2021 CET)
2021-12-03 11:54:25 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) -- Storing resolution chrome96=96.0.4664.45 in cache (valid until 11:54:25 04/12/2021 CET)
2021-12-03 11:54:25 [main] TRACE i.g.b.wdm.cache.CacheHandler.getDriverFromCache(83) -- Checking if chromedriver exists in cache
2021-12-03 11:54:25 [main] TRACE i.g.b.wdm.cache.CacheHandler.filterCacheBy(68) -- Filter cache by chromedriver -- input list [C:\Users\boni\.cache\selenium\chromedriver\win32\81.0.4044.138\chromedriver.exe, C:\Users\boni\.cache\selenium\chromedriver\win32\83.0.4103.39\chromedriver.exe, C:\Users\boni\.cache\selenium\chromedriver\win32\95.0.4638.69\chromedriver.exe, C:\Users\boni\.cache\selenium\chromedriver\win32\96.0.4664.45\chromedriver.exe, C:\Users\boni\.cache\selenium\geckodriver\win64\0.30.0\geckodriver.exe, C:\Users\boni\.cache\selenium\msedgedriver\win64\95.0.1020.53\msedgedriver.exe, C:\Users\boni\.cache\selenium\msedgedriver\win64\96.0.1054.29\msedgedriver.exe, C:\Users\boni\.cache\selenium\msedgedriver\win64\96.0.1054.34\msedgedriver.exe, C:\Users\boni\.cache\selenium\operadriver\win64\94.0.4606.61\operadriver.exe, C:\Users\boni\.cache\selenium\operadriver\win64\95.0.4638.54\operadriver.exe, C:\Users\boni\.cache\selenium\resolution.properties] -- output list [C:\Users\boni\.cache\selenium\chromedriver\win32\81.0.4044.138\chromedriver.exe, C:\Users\boni\.cache\selenium\chromedriver\win32\83.0.4103.39\chromedriver.exe, C:\Users\boni\.cache\selenium\chromedriver\win32\95.0.4638.69\chromedriver.exe, C:\Users\boni\.cache\selenium\chromedriver\win32\96.0.4664.45\chromedriver.exe]
2021-12-03 11:54:25 [main] TRACE i.g.b.wdm.cache.CacheHandler.filterCacheBy(68) -- Filter cache by 96.0.4664.45 -- input list [C:\Users\boni\.cache\selenium\chromedriver\win32\81.0.4044.138\chromedriver.exe, C:\Users\boni\.cache\selenium\chromedriver\win32\83.0.4103.39\chromedriver.exe, C:\Users\boni\.cache\selenium\chromedriver\win32\95.0.4638.69\chromedriver.exe, C:\Users\boni\.cache\selenium\chromedriver\win32\96.0.4664.45\chromedriver.exe] -- output list [C:\Users\boni\.cache\selenium\chromedriver\win32\96.0.4664.45\chromedriver.exe]
2021-12-03 11:54:25 [main] TRACE i.g.b.wdm.cache.CacheHandler.filterCacheBy(68) -- Filter cache by WIN -- input list [C:\Users\boni\.cache\selenium\chromedriver\win32\96.0.4664.45\chromedriver.exe] -- output list [C:\Users\boni\.cache\selenium\chromedriver\win32\96.0.4664.45\chromedriver.exe]
2021-12-03 11:54:25 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.manage(968) -- Driver chromedriver 96.0.4664.45 found in cache
2021-12-03 11:54:25 [main] INFO i.g.bonigarcia.wdm.WebDriverManager.exportDriver(1067) -- Exporting webdriver.chrome.driver as C:\Users\boni\.cache\selenium\chromedriver\win32\96.0.4664.45\chromedriver.exe
For further info about logging with with SLF4J and Logback you can see the following tutorial.
thanks for the tip. here it is (this is what happens before the stack trace I posted above):
/Users/lsoares/.cache/selenium/msedgedriver/mac-arm64/99.0.1150.46/msedgedriver.exe: /Users/lsoares/.cache/selenium/msedgedriver/mac-arm64/99.0.1150.46/msedgedriver.exe: cannot execute binary file
2022-03-23 13:17:57 [Test worker] DEBUG i.g.b.wdm.cache.ResolutionCache.checkKeyInResolutionCache(186) -- Resolution edge=99 in cache (valid until 14:12:16 23/03/2022 WET)
2022-03-23 13:17:57 [Test worker] DEBUG i.g.b.wdm.cache.ResolutionCache.checkKeyInResolutionCache(186) -- Resolution edge99=99.0.1150.46 in cache (valid until 13:12:16 24/03/2022 WET)
2022-03-23 13:17:57 [Test worker] INFO i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(1093) -- Using msedgedriver 99.0.1150.46 (resolved driver for Edge 99)
2022-03-23 13:17:57 [Test worker] TRACE i.g.b.wdm.cache.CacheHandler.getDriverFromCache(83) -- Checking if msedgedriver exists in cache
2022-03-23 13:17:57 [Test worker] TRACE i.g.b.wdm.cache.CacheHandler.filterCacheBy(68) -- Filter cache by msedgedriver -- input list [/Users/lsoares/.cache/selenium/chromedriver/mac-arm64/99.0.4844.51/chromedriver, /Users/lsoares/.cache/selenium/msedgedriver/mac-arm64/99.0.1150.46/msedgedriver.exe, /Users/lsoares/.cache/selenium/resolution.properties] -- output list [/Users/lsoares/.cache/selenium/msedgedriver/mac-arm64/99.0.1150.46/msedgedriver.exe]
2022-03-23 13:17:57 [Test worker] TRACE i.g.b.wdm.cache.CacheHandler.filterCacheBy(68) -- Filter cache by 99.0.1150.46 -- input list [/Users/lsoares/.cache/selenium/msedgedriver/mac-arm64/99.0.1150.46/msedgedriver.exe] -- output list [/Users/lsoares/.cache/selenium/msedgedriver/mac-arm64/99.0.1150.46/msedgedriver.exe]
2022-03-23 13:17:57 [Test worker] TRACE i.g.b.wdm.cache.CacheHandler.filterCacheBy(68) -- Filter cache by MAC -- input list [/Users/lsoares/.cache/selenium/msedgedriver/mac-arm64/99.0.1150.46/msedgedriver.exe] -- output list [/Users/lsoares/.cache/selenium/msedgedriver/mac-arm64/99.0.1150.46/msedgedriver.exe]
2022-03-23 13:17:57 [Test worker] TRACE i.g.b.wdm.cache.CacheHandler.filterCacheBy(68) -- Filter cache by ARM64 -- input list [/Users/lsoares/.cache/selenium/msedgedriver/mac-arm64/99.0.1150.46/msedgedriver.exe] -- output list [/Users/lsoares/.cache/selenium/msedgedriver/mac-arm64/99.0.1150.46/msedgedriver.exe]
2022-03-23 13:17:57 [Test worker] DEBUG i.g.bonigarcia.wdm.WebDriverManager.manage(1049) -- Driver msedgedriver 99.0.1150.46 found in cache
2022-03-23 13:17:57 [Test worker] INFO i.g.bonigarcia.wdm.WebDriverManager.exportDriver(1148) -- Exporting webdriver.edge.driver as /Users/lsoares/.cache/selenium/msedgedriver/mac-arm64/99.0.1150.46/msedgedriver.exe|
Your drive cache is corrupt for some reason. Please run your test with:
WebDriverManager.edgedriver().clearDriverCache().setup();
... and post the logs again, please.
GitHub won't let me paste here as it's too big. I pasted here.
It seems there is a corner case for Edge in macOS for ARM64 architecture. I've just committed a patch to try to solve it. Unfortunately, I don't have a Mac to test it. @lsoares Could you please have try with WebDriverManager version 5.1.1-SNAPSHOT?
For that, you should to bump WebDriverManager to that version in your project and run your test again. This version (which contains the latest patches) is in the Sonatype snapshots repositories. If using Maven, you also need to include the following in your pom.xml:
<repositories>
<repository>
<id>oss.sonatype.org-snapshot</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
... or its equivalent in Gradle:
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
I think it is kind of fixed. I see Edge open and close quickly. it's a different issue I believe (maybe some missing flags not sure):
I updated Edge and it works now! Thank you for the quick fix!
@lsoares There was a problem with my last patch (related to other architectures). I changed a bit that logic and re-uploaded a new snapshot version (still 5.1.1-SNAPSHOT). Could you please run your test again? Please use:
WebDriverManager.edgedriver().clearDriverCache().setup();
I did it and it still works but I don't have the previous version of Edge anymore (I deleted Gradle cache just to be sure).
Thanks @lsoares . This fix will be available for next version.
This is already available in WebDriverManager 5.1.1, just released.
Description of the problem: Although I'm in a Mac, the Windows binary is being downloaded:
Browser and version: Microsoft Edge 99.0.1150.39
Operating system: macOS Monterey 12.3
WebDriverManager version: 5.1.0
WebDriverManager call:
Error log: