webdrivermanager icon indicating copy to clipboard operation
webdrivermanager copied to clipboard

Chromedriver 114 is resolved for Chrome 116 (using WebDriverManager 5.5.0)

Open davidrwood opened this issue 3 years ago • 38 comments

Edit: For anyone having this issue, the solution is to update to at least version 5.5.2 and clear the cache. This is well described in this comment https://github.com/bonigarcia/webdrivermanager/issues/1115#issuecomment-1698717610

Chromedriver 114 is being resolved for Chrome 116 on linux even when using WebDriverManager version 5.5.0 and Selenium 4.11.0.

(For others reading this: Make sure you have updated to at least Selenium 4.11.0 and WebDriverManager version 5.5.0. Chrome changed how versions are released at version 115 as per https://bonigarcia.dev/webdrivermanager/#support-for-chromedriver-115 .)

I've deleted both ~/.cache/selenium and ~/.m2/repository/webdriver.

As per the log below, Chromedriver 114 is being resolved for Chrome 116.

Using org.seleniumhq.selenium 4.11.0 (highest that seems to be available).

Browser and version: Google Chrome 116.0.5845.110

Operating system: Ubuntu 18.04.6 LTS

WebDriverManager version: 5.5.0

WebDriverManager call: (Scala) private val manager = WebDriverManager.getInstance(DriverManagerType.CHROME) ...

manager.clearResolutionCache()
manager.clearDriverCache()
manager.setup()```

WebDriverManager traces:

08/24 10:46:19 INFO  c.s.t.s.Browsers$Local$ - Setting up Chrome driver (headless = true)
08/24 10:46:20 DEBUG i.g.b.w.c.ResolutionCache - Resolution chrome=116 in cache (valid until 11:42:28 24/08/2023 UTC)
08/24 10:46:20 DEBUG i.g.b.w.c.ResolutionCache - Resolution chrome116=114.0.5735.90 in cache (valid until 10:42:28 25/08/2023 UTC)
08/24 10:46:20 INFO  i.g.b.w.WebDriverManager - Using chromedriver 114.0.5735.90 (resolved driver for Chrome 116)
08/24 10:46:20 TRACE i.g.b.w.c.CacheHandler - Checking if chromedriver exists in cache
08/24 10:46:20 TRACE i.g.b.w.c.CacheHandler - Filter cache by chromedriver -- input list [/home/ubuntu/.cache/selenium/chromedriver/linux64/114.0.5735.90/chromedriver, /home/ubuntu/.cache/selenium/resolution.properties] -- output list [/home/ubuntu/.cache/selenium/chromedriver/linux64/114.0.5735.90/chromedriver] 
08/24 10:46:20 TRACE i.g.b.w.c.CacheHandler - Filter cache by 114.0.5735.90 -- input list [/home/ubuntu/.cache/selenium/chromedriver/linux64/114.0.5735.90/chromedriver] -- output list [/home/ubuntu/.cache/selenium/chromedriver/linux64/114.0.5735.90/chromedriver] 
08/24 10:46:20 TRACE i.g.b.w.c.CacheHandler - Filter cache by LINUX -- input list [/home/ubuntu/.cache/selenium/chromedriver/linux64/114.0.5735.90/chromedriver] -- output list [/home/ubuntu/.cache/selenium/chromedriver/linux64/114.0.5735.90/chromedriver] 
08/24 10:46:20 DEBUG i.g.b.w.WebDriverManager - Driver chromedriver 114.0.5735.90 found in cache
08/24 10:46:20 INFO  i.g.b.w.WebDriverManager - Exporting webdriver.chrome.driver as /home/ubuntu/.cache/selenium/chromedriver/linux64/114.0.5735.90/chromedriver

Error log:

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: This version of ChromeDriver only supports Chrome version 114

davidrwood avatar Aug 24 '23 11:08 davidrwood

For anyone else stuck for the moment, I've worked-around by downgrading Chrome to 114 again. Which isn't simple! See my comments on this: https://unix.stackexchange.com/a/590412/390558

davidrwood avatar Aug 24 '23 11:08 davidrwood

For anyone else stuck for the moment, I've worked-around by downgrading Chrome to 114 again. Which isn't simple! See my comments on this: https://unix.stackexchange.com/a/590412/390558

Our organization managed chrome cannot be downgraded. Is there any other work around available?

anjanamoorthy avatar Aug 24 '23 11:08 anjanamoorthy

@anjanamoorthy

Our organization managed chrome cannot be downgraded. Is there any other work around available?

I don't know of one but make sure you're running WebDriverManager 5.5.0 and Selenium 4.11.0 as using earlier versions will not work.

Also clear the cached version either by deleting it or calling manager.clearResolutionCache() + manager.clearDriverCache().

davidrwood avatar Aug 24 '23 11:08 davidrwood

The traces indicates the cache is not being properly cleaned:

08/24 10:46:20 DEBUG i.g.b.w.c.ResolutionCache - Resolution chrome=116 in cache (valid until 11:42:28 24/08/2023 UTC)
08/24 10:46:20 DEBUG i.g.b.w.c.ResolutionCache - Resolution chrome116=114.0.5735.90 in cache (valid until 10:42:28 25/08/2023 UTC

bonigarcia avatar Aug 24 '23 14:08 bonigarcia

Is that something that I can do or does that require a fix? I assume it's a fix since I've deleted the local cache on disk.

davidrwood avatar Aug 24 '23 15:08 davidrwood

We have the same issue. Stack trace contains 404 errors:

VersionDetector:io.github.bonigarcia.wdm.versions.VersionDetector.getDriverVersionFromRepository(VersionDetector.java:145) - Exception reading https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json to get version of chromedriver (No route to host)
HttpClient:io.github.bonigarcia.wdm.online.HttpClient.execute(HttpClient.java:176) - Error HTTP 404 executing https://chromedriver.storage.googleapis.com/LATEST_RELEASE_116
VersionDetector:io.github.bonigarcia.wdm.versions.VersionDetector.getDriverVersionFromRepository(VersionDetector.java:162) - Exception reading https://chromedriver.storage.googleapis.com/LATEST_RELEASE_116 to get latest version of chromedriver (Error HTTP 404 executing https://chromedriver.storage.googleapis.com/LATEST_RELEASE_116)

Already tried to add wdm properties suggested in this comment - did not help

WebDriverManager - 5.5.0 Selenium - 4.11.0 Chrome - 116.0.5845.110

TanyaOstrovskaya avatar Aug 25 '23 09:08 TanyaOstrovskaya

@TanyaOstrovskaya You have a connectivy problem while connecting the CfT endpoints:

Exception reading https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json to get version of chromedriver (No route to host)

I have just released WebDriverManager 5.5.2, which in addition to the CfT endpoints, also allows to request to "old way" (e.g. this). Can you please have a try with WebDriverManager 5.5.2?

bonigarcia avatar Aug 25 '23 12:08 bonigarcia

@davidrwood

Is that something that I can do or does that require a fix? I assume it's a fix since I've deleted the local cache on disk.

I would try WebDriverManager 5.5.2, just released. When the cache is cleaned, at TRACE level, you should see something like this:

2023-08-25 13:10:11 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.clearDriverCache(880) - Clearing driver cache at C:\Users\boni\.cache\selenium
2023-08-25 13:10:12 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.<init>(77) - Created new resolution cache file at C:\Users\boni\.cache\selenium\resolution.properties
2023-08-25 13:10:12 [main] TRACE i.g.b.wdm.versions.VersionDetector.getVersionsInputStream(364) - Reading online commands.properties to find out driver version
2023-08-25 13:10:12 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getBrowserVersionFromTheShell(253) - Detecting chrome version using online commands.properties
2023-08-25 13:10:12 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(65) - Running command on the shell: [cmd.exe, /C, wmic, datafile, where, name="%PROGRAMFILES:\=\\%\\Google\\Chrome\\Application\\chrome.exe", get, Version, /value]
2023-08-25 13:10:12 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(69) - Result: Version=116.0.5845.110
2023-08-25 13:10:12 [main] TRACE i.g.b.wdm.versions.VersionDetector.getBrowserVersionUsingCommand(332) - Detected browser version is 116.0.5845.110
2023-08-25 13:10:12 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(1280) - Using chromedriver 116.0.5845.96 (resolved driver for Chrome 116)
2023-08-25 13:10:12 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) - Storing resolution chrome=116 in cache (valid until 14:10:12 25/08/2023 CEST)
2023-08-25 13:10:12 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) - Storing resolution chrome116=116.0.5845.96 in cache (valid until 13:10:12 26/08/2023 CEST)
2023-08-25 13:10:12 [main] TRACE i.g.b.wdm.cache.CacheHandler.getDriverFromCache(83) - Checking if chromedriver exists in cache
2023-08-25 13:10:12 [main] TRACE i.g.b.wdm.cache.CacheHandler.filterCacheBy(68) - Filter cache by chromedriver -- input list [C:\Users\boni\.cache\selenium\resolution.properties] -- output list [] 
2023-08-25 13:10:12 [main] TRACE i.g.b.wdm.cache.CacheHandler.filterCacheBy(68) - Filter cache by 116.0.5845.96 -- input list [] -- output list [] 
2023-08-25 13:10:12 [main] TRACE i.g.b.wdm.cache.CacheHandler.filterCacheBy(68) - Filter cache by WIN -- input list [] -- output list [] 
2023-08-25 13:10:12 [main] TRACE i.g.b.wdm.cache.CacheHandler.getDriverFromCache(105) - Avoid filtering for architecture 64 with chromedriver in Windows
2023-08-25 13:10:12 [main] TRACE i.g.b.wdm.cache.CacheHandler.getDriverFromCache(119) - chromedriver not found in cache
2023-08-25 13:10:12 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.logSeekRepo(1631) - Reading https://chromedriver.storage.googleapis.com/ to seek chromedriver
2023-08-25 13:10:12 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.createUrlHandler(1516) - Driver to be downloaded chromedriver 116.0.5845.96
2023-08-25 13:10:12 [main] TRACE i.g.bonigarcia.wdm.WebDriverManager.createUrlHandler(1525) - Driver URLs after filtering for version: []
2023-08-25 13:10:12 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler.filterByOs(141) - URLs before filtering by OS (WIN): []
2023-08-25 13:10:12 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler.filterByOs(145) - URLs after filtering by OS (WIN): []
2023-08-25 13:10:12 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler.filterByArch(151) - URLs before filtering by architecture (64): []
2023-08-25 13:10:12 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler.filterByArch(160) - URLs after filtering by architecture (64): []
2023-08-25 13:10:12 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler.filterByBeta(127) - URLs before filtering by beta versions: []
2023-08-25 13:10:12 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler.filterByBeta(134) - URLs after filtering by beta versions: []
2023-08-25 13:10:12 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.buildUrl(156) - Using URL built from repository pattern: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/win64/chromedriver-win64.zip
2023-08-25 13:10:12 [main] TRACE i.g.bonigarcia.wdm.online.Downloader.getTarget(123) - Target file for URL https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/win64/chromedriver-win64.zip driver version 116.0.5845.96 = C:\Users\boni\.cache\selenium\chromedriver\win64\116.0.5845.96/chromedriver-win64.zip
2023-08-25 13:10:12 [main] INFO  i.g.bonigarcia.wdm.online.Downloader.downloadAndExtract(131) - Downloading https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/win64/chromedriver-win64.zip
2023-08-25 13:10:12 [main] TRACE i.g.bonigarcia.wdm.online.Downloader.downloadAndExtract(137) - Target folder C:\Users\boni\.cache\selenium\chromedriver\win64\116.0.5845.96 ... using temporal file C:\Users\boni\AppData\Local\Temp\15824197595769158441\chromedriver-win64.zip
2023-08-25 13:10:13 [main] INFO  i.g.bonigarcia.wdm.online.Downloader.extract(192) - Extracting driver from compressed file chromedriver-win64.zip
2023-08-25 13:10:13 [main] TRACE i.g.bonigarcia.wdm.online.Downloader.unZip(220) - Unzipping chromedriver-win64/LICENSE.chromedriver (size: 215994 KB, compressed size: 35448 KB)
2023-08-25 13:10:13 [main] TRACE i.g.bonigarcia.wdm.online.Downloader.unZip(220) - Unzipping chromedriver-win64/chromedriver.exe (size: 14312960 KB, compressed size: 7094251 KB)
2023-08-25 13:10:13 [main] TRACE i.g.bonigarcia.wdm.online.Downloader.deleteFile(330) - Deleting file C:\Users\boni\AppData\Local\Temp\15824197595769158441\chromedriver-win64.zip
2023-08-25 13:10:13 [main] TRACE i.g.bonigarcia.wdm.WebDriverManager.postDownload(1371) - Found driver in post-download: C:\Users\boni\AppData\Local\Temp\15824197595769158441\chromedriver-win64\chromedriver.exe
2023-08-25 13:10:13 [main] TRACE i.g.bonigarcia.wdm.online.Downloader.deleteFile(330) - Deleting file C:\Users\boni\AppData\Local\Temp\15824197595769158441\chromedriver-win64\LICENSE.chromedriver
2023-08-25 13:10:13 [main] TRACE i.g.bonigarcia.wdm.online.Downloader.deleteFolder(340) - Deleting folder C:\Users\boni\AppData\Local\Temp\15824197595769158441
2023-08-25 13:10:13 [main] TRACE i.g.bonigarcia.wdm.online.Downloader.downloadAndExtract(163) - Driver after extraction C:\Users\boni\.cache\selenium\chromedriver\win64\116.0.5845.96\chromedriver.exe
2023-08-25 13:10:13 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.exportDriver(1333) - Exporting webdriver.chrome.driver as C:\Users\boni\.cache\selenium\chromedriver\win64\116.0.5845.96\chromedriver.exe

bonigarcia avatar Aug 25 '23 12:08 bonigarcia

Sorry, WedDriverManager 5.5.1 has a bug at the very beginning of the management algorithm. I'm releasing 5.5.2 now.

bonigarcia avatar Aug 25 '23 12:08 bonigarcia

WebDriverManager 5.5.2 is out.

bonigarcia avatar Aug 25 '23 13:08 bonigarcia

Thank you! Will try as soon as I am able to get to the machine.

davidrwood avatar Aug 25 '23 16:08 davidrwood

This is still not resolved :( even with WebDriverManager 5.5.2 .

adilimroz avatar Aug 28 '23 17:08 adilimroz

Apologies, something was amiss at my end. WebDriverManager 5.5.2 effectively resolved the initial issue described in this ticket.

adilimroz avatar Aug 28 '23 18:08 adilimroz

5.5.2 fixed this for us as well, thanks @bonigarcia

hennr avatar Aug 29 '23 08:08 hennr

@TanyaOstrovskaya Is your problem fixed with WebDriverManager 5.5.2?

bonigarcia avatar Aug 29 '23 11:08 bonigarcia

@bonigarcia 5.5.2 does it! 🙂 Thanks! I'll leave it to you close this once you're happy.

FYI for others - I needed to clear the cache first with one of these (not sure which, as I just called both):

manager.clearResolutionCache()
manager.clearDriverCache()

davidrwood avatar Aug 29 '23 13:08 davidrwood

Just is case anyone is facing this issue along with above mentioned main issue: possible causes are invalid address of the remote server or browser start-up failure

Below steps and versions solved both the issues for me.

  • Chrome : 116 (mine was 116.0.5845.140)
  • WebDriverManager : 5.5.2
    <dependency>
       <groupId>io.github.bonigarcia</groupId>
       <artifactId>webdrivermanager</artifactId>
       <version>5.5.2</version>
   </dependency>

Selenium version : 4.8.3

   <dependency>
       <groupId>org.seleniumhq.selenium</groupId>
       <artifactId>selenium-java</artifactId>
       <version>4.8.3</version>
   </dependency>

Also, to ensure that the wrong version has not been cached in the cache, you can refresh completely the cache folder (at least once) as follows:

WebDriverManager.chromedriver().clearDriverCache().setup(); WebDriverManager.chromedriver().clearResolutionCache().setup();

Tushar-Rastogi avatar Aug 30 '23 08:08 Tushar-Rastogi

@Tushar-Rastogi @bonigarcia can you please advise what POM combination worked for you

Selenium 4.8.3 + webdrivermanager 5.5.2 selenium-chrome-driver 4.8.3 Chrome browser at my end 116

Aug 31, 2023 12:24:56 PM io.github.bonigarcia.wdm.WebDriverManager resolveDriverVersion INFO: Using chromedriver 116.0.5845.96 (resolved driver for Chrome 116) Aug 31, 2023 12:24:56 PM io.github.bonigarcia.wdm.WebDriverManager logSeekRepo INFO: Reading https://chromedriver.storage.googleapis.com/ to seek chromedriver Aug 31, 2023 12:24:57 PM io.github.bonigarcia.wdm.online.Downloader downloadAndExtract INFO: Downloading https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/win64/chromedriver-win64.zip Aug 31, 2023 12:24:59 PM io.github.bonigarcia.wdm.cache.ResolutionCache clear INFO: Clearing WebDriverManager resolution cache Aug 31, 2023 12:24:59 PM io.github.bonigarcia.wdm.WebDriverManager handleException WARNING: There was an error managing chromedriver 116.0.5845.96 (Premature end of Content-Length delimited message body (expected: 7130021; received: 6370768)) ... trying again avoiding reading release from repository Aug 31, 2023 12:24:59 PM io.github.bonigarcia.wdm.WebDriverManager logSeekRepo INFO: Reading https://chromedriver.storage.googleapis.com/ to seek chromedriver Aug 31, 2023 12:25:01 PM io.github.bonigarcia.wdm.online.Downloader downloadAndExtract INFO: Downloading https://chromedriver.storage.googleapis.com/114.0.5735.90/chromedriver_win32.zip Aug 31, 2023 12:25:02 PM io.github.bonigarcia.wdm.online.Downloader extract INFO: Extracting driver from compressed file chromedriver_win32.zip Aug 31, 2023 12:25:02 PM io.github.bonigarcia.wdm.WebDriverManager exportDriver INFO: Exporting webdriver.chrome.driver as C:\Users\Vaibhav.Sharma.cache\selenium\chromedriver\win32\114.0.5735.90\chromedriver.exe Aug 31, 2023 12:25:02 PM io.github.bonigarcia.wdm.cache.ResolutionCache clear

WebDriverManager.chromedriver().clearDriverCache().setup(); WebDriverManager.chromedriver().clearResolutionCache().setup(); Thread.sleep(2000); // Sleep for 2 seconds WebDriverManager.chromedriver().setup();

Then I see SessionNotCreated Could not start a new session. Response code 500. Message: session not created: This version of ChromeDriver only supports Chrome version 114 Current browser version is 116.0.5845.111 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe

VaibhavMTH avatar Aug 31 '23 07:08 VaibhavMTH

For Gradle add in dependencies{ compile ('org.seleniumhq.selenium:selenium-java:4.11.0') implementation group: 'io.github.bonigarcia', name: 'webdrivermanager', version: '5.5.2' }

For Maven io.github.bonigarcia webdrivermanager 5.5.2

org.seleniumhq.selenium selenium-java 4.11.0

Famirov avatar Aug 31 '23 07:08 Famirov

@bonigarcia Thanks for quick fix. v5.5.2 resolved the pressing it with our automation stack.

maulikpatel890 avatar Aug 31 '23 09:08 maulikpatel890