erdi / webdriver-binaries-gradle-plugin

A Gradle plugin that downloads and caches WebDriver binaries specific to the OS the build runs on
Apache License 2.0
36 stars 13 forks source link

Extra folder in ChromeDriver zip file in v115 #39

Closed askucins closed 1 year ago

askucins commented 1 year ago

Recently I've updated the version of ChromeDriver in my tests to 115.0.5790.102 which, as suggested on https://chromedriver.chromium.org/downloads required also slightly different urls - that part went just fine - com.github.erdi.webdriver-binaries in version 3.1 picked that new chromedriver and unzipped it.

But here the problems starts - in the logs of my tests there is this:

Driver info: driver.version: CustomizedChromeDriver
org.openqa.selenium.remote.NoSuchDriverException: chromedriver located at /home/askuci/.gradle/webdriver/chromedriver/115.0.5790.102/chromedriver-linux64/b167mo42xtxmk2zrfv1mlr05x/chromedriver, but invalid

and indeed, there is an extra folder in that zip file (so the same exists after it's extracted), like:

askuci@nighthawk:~/tmp/chromedriver$ /home/askuci/.gradle/webdriver/chromedriver/115.0.5790.102/chromedriver-linux64/b167mo42xtxmk2zrfv1mlr05x/chromedriver-linux64/chromedriver -version
ChromeDriver 115.0.5790.102 (90efd4b0ad6aa15eeafcdabd5817ae939f7ba059-refs/branch-heads/5790_90@{#9})

Please compare the content of v114 vs v115

v114

askuci@nighthawk:~/tmp/chromedriver$ zipinfo -1 chromedriver_linux64-114.zip 
chromedriver
LICENSE.chromedriver

v115

askuci@nighthawk:~/tmp/chromedriver$ zipinfo -1 chromedriver-linux64-115.zip 
chromedriver-linux64/LICENSE.chromedriver
chromedriver-linux64/chromedriver

Is there maybe any quick fix I can do to this on my side? (I mean of course manually copying that chromedriver to the parent folder worked just fine, but I mean something less manual so to speak :)

erdi commented 1 year ago

One workaround that comes to my mind is to repack v115 to not contain the additional directory, upload it to a location accessible by the build and then use a custom driver urls configuration json file pointing at the custom location with repacked zip for v115.

erdi commented 1 year ago

Fixed in #40.

askucins commented 1 year ago

It works now like a charm! Thanks a lot!