bonigarcia / webdrivermanager

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

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

Closed davidrwood closed 1 year ago

davidrwood commented 1 year ago

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 commented 1 year ago

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

anjanamoorthy commented 1 year ago

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?

davidrwood commented 1 year ago

@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().

bonigarcia commented 1 year ago

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
davidrwood commented 1 year ago

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.

TanyaOstrovskaya commented 1 year ago

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

bonigarcia commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

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

bonigarcia commented 1 year ago

WebDriverManager 5.5.2 is out.

davidrwood commented 1 year ago

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

adilimroz commented 1 year ago

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

adilimroz commented 1 year ago

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

hennr commented 1 year ago

5.5.2 fixed this for us as well, thanks @bonigarcia

bonigarcia commented 1 year ago

@TanyaOstrovskaya Is your problem fixed with WebDriverManager 5.5.2?

davidrwood commented 1 year ago

@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()
Tushar-Rastogi commented 1 year ago

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.

    <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();

VaibhavMTH commented 1 year ago

@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

Famirov commented 1 year ago

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
maulikpatel890 commented 1 year ago

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

VaibhavMTH commented 1 year ago

@Tushar-Rastogi @bonigarcia I tried 4.11 selenium java + webdrivermanager 5.5.2 (using eclipse) should I explicitly define selenium-chrome-driver 4.11 too?

Aug 31, 2023 3:32:51 PM io.github.bonigarcia.wdm.WebDriverManager resolveDriverVersion INFO: Using chromedriver 116.0.5845.96 (resolved driver for Chrome 116) Aug 31, 2023 3:32:51 PM io.github.bonigarcia.wdm.WebDriverManager logSeekRepo INFO: Reading https://chromedriver.storage.googleapis.com/ to seek chromedriver Aug 31, 2023 3:32:54 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 3:32:55 PM io.github.bonigarcia.wdm.online.HttpClient execute SEVERE: Error HTTP 403 executing https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/win64/chromedriver-win64.zip Aug 31, 2023 3:32:55 PM io.github.bonigarcia.wdm.cache.ResolutionCache clear INFO: Clearing WebDriverManager resolution cache Aug 31, 2023 3:32:55 PM io.github.bonigarcia.wdm.WebDriverManager handleException WARNING: There was an error managing chromedriver 116.0.5845.96 (Error HTTP 403 executing https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/win64/chromedriver-win64.zip) ... trying again avoiding reading release from repository Aug 31, 2023 3:32:55 PM io.github.bonigarcia.wdm.WebDriverManager logSeekRepo INFO: Reading https://chromedriver.storage.googleapis.com/ to seek chromedriver Aug 31, 2023 3:32:56 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 3:32:57 PM io.github.bonigarcia.wdm.online.Downloader extract

In resolution.properties i see

WebDriverManager Resolution Cache

Thu Aug 31 15:33:27 IST 2023

chrome=116 chrome116-ttl=15\:33\:27 01/09/2023 IST chrome-ttl=16\:33\:27 31/08/2023 IST chrome116=114.0.5735.90

danish469 commented 1 year ago

@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

@Tushar-Rastogi , I was also facing the same issue, mine was resolved by using personal network, earlier I PC was connected to office network/VPN. By switching to personal network I was able to resolve it temporarily, It helped the project status from blocker to running(temp fix). Ofcouse in long run it requires a permanent fix for the above statement @bonigarcia .

VaibhavMTH commented 1 year ago

Hi @danish469 'mine was resolved by using personal network' so is something blocking this? Can you please ellaborate

Iuryck commented 1 year ago

How do you install webdriver manager 5.5.2 into python?

danish469 commented 1 year ago

Hi @danish469 'mine was resolved by using personal network' so is something blocking this? Can you please ellaborate

@VaibhavMTH , As I work in mine organization laptop and the web application also accessible outside organization networkor without VPN.

Mine guess is, that organization network is configured in such way that .cache/win32/114 chrome version is not getting cleaned correctly. Even f I delete this webdriver version manually from File Explorer. Webdriver 5.5.2 downloads the old 114 chrome verision and try to use that version in mine organization network.

As the project url is accessible outside mine organization network also. I connected to personal network and ran the project, webdriver manager cached the new chrome version at .cache/win64/116 thus I was able to execute mine test cases successfully.

I didn't performed any specific debugging. But this worked out for me, but it's a temp fix cause db connection won't work on personal network.

somkhitp commented 1 year ago

Thanks for the information, after updating my webdrivermanager to the latest 5.5.0 version, it resolved my chromedriver crashing issue at strartup!!

VaibhavMTH commented 1 year ago

Hi @danish469 'mine was resolved by using personal network' so is something blocking this? Can you please ellaborate

@VaibhavMTH , As I work in mine organization laptop and the web application also accessible outside organization networkor without VPN.

Mine guess is, that organization network is configured in such way that .cache/win32/114 chrome version is not getting cleaned correctly. Even f I delete this webdriver version manually from File Explorer. Webdriver 5.5.2 downloads the old 114 chrome verision and try to use that version in mine organization network.

As the project url is accessible outside mine organization network also. I connected to personal network and ran the project, webdriver manager cached the new chrome version at .cache/win64/116 thus I was able to execute mine test cases successfully.

I didn't performed any specific debugging. But this worked out for me, but it's a temp fix cause db connection won't work on personal network. Thanks @@danish469 I see the same at my end I deleted manually it pulls 114... we need that fix since we cannot use our personal NW

TestAutomationMaster commented 1 year ago

Just upgraded on a new server and version 5.5.2 is resolving ChromeDriver 114 for Chrome version 116. 11:14:46 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 11:14:46 Current browser version is 116.0.5845.112 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe

VaibhavMTH commented 1 year ago

Just upgraded on a new server and version 5.5.0 is resolving ChromeDriver 114 for Chrome version 116. 11:14:46 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 11:14:46 Current browser version is 116.0.5845.112 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe

Please try the POM combination if it works for you...above and update the community as we are facing issue.

TestAutomationMaster commented 1 year ago

Just upgraded on a new server and version 5.5.0 is resolving ChromeDriver 114 for Chrome version 116. 11:14:46 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 11:14:46 Current browser version is 116.0.5845.112 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe

Please try the POM combination if it works for you...above and update the community as we are facing issue.

What POM combination? And sry, misquoted the version, it's 5.5.2.

And it's not a caching issue, this was the first time running WebDriverManager on this server

vlad8x8 commented 1 year ago

what I got from my logs: we are using chromedriver().driverVersion("116").setup(); it was working for 114, but now it needs full version name "116.0.5845.96" because webdrivermanager is trying to download https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116/win64/chromedriver-win64.zip @bonigarcia is it possible to get full version 116.whatever is actual from short form "106" and download the right version? I guess https://googlechromelabs.github.io/chrome-for-testing/latest-versions-per-milestone-with-downloads.json is a good source to get that full version name from short name

bonigarcia commented 1 year ago

For the people reporting errors in this issue.

WebDriverManager 5.5.2 works for Chrome 116. I have explained it in multiple issues and created a known issues section in the WebDriverManager doc.

The troubles reported here are caused by connectivity problems at your end. Concretely, when connecting to https://edgedl.me.gvt1.com/ to download chromedriver, e.g., with this URL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/win64/chromedriver-win64.zip

I see the following info in your traces:

Aug 31, 2023 3:32:55 PM io.github.bonigarcia.wdm.online.HttpClient execute
SEVERE: Error HTTP 403 executing https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/win64/chromedriver-win64.zip
WARNING: There was an error managing chromedriver 116.0.5845.96 (Premature end of Content-Length delimited message body (expected: 7130021; received: 6370768)) 

I don't know the underlying cause of that connectivity issue. I suppose you are behind a proxy or firewall forbidding the connections to https://edgedl.me.gvt1.com/. When that happens, WebDriverManager fallbacks to the old chromedriver repository (https://chromedriver.storage.googleapis.com/), which for some reason, is not prohibited at your end, but it only contains up to chromedriver 114, which is the version downloaded. From my side, I will remove this fallback for the next version of WebDriverManager.

But for these problems, I cannot fix the connectivity problem at your end, so you need to figure out why your environment forbids that connection.

Some tips:

vlad8x8 commented 1 year ago

Hi @bonigarcia If I'm using chromedriver().driverVersion("116").setup(); in my code then getting fail: https://gist.githubusercontent.com/vlad-velichko/076a0f576e78e5198232de05abccee55/raw/525a4ed95c45e1dcb4de567b72c5c03c49fd817d/log as you can see, webdrivermanager is trying to download from the wrong URL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116/win64/chromedriver-win64.zip There is 116 instead of expected 116.0.5845.96 in the link So, maybe it's not only connectivity issues?

bonigarcia commented 1 year ago

driverVersion() is for full driver versions, not only the major. Use browserVersion() (see doc).

VaibhavMTH commented 1 year ago

For the people reporting errors in this issue.

WebDriverManager 5.5.2 works for Chrome 116. I have explained it in multiple issues and created a known issues section in the WebDriverManager doc.

The troubles reported here are caused by connectivity problems at your end. Concretely, when connecting to https://edgedl.me.gvt1.com/ to download chromedriver, e.g., with this URL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/win64/chromedriver-win64.zip

I see the following info in your traces:

Aug 31, 2023 3:32:55 PM io.github.bonigarcia.wdm.online.HttpClient execute
SEVERE: Error HTTP 403 executing https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/win64/chromedriver-win64.zip
WARNING: There was an error managing chromedriver 116.0.5845.96 (Premature end of Content-Length delimited message body (expected: 7130021; received: 6370768)) 

I don't know the underlying cause of that connectivity issue. I suppose you are behind a proxy or firewall forbidding the connections to https://edgedl.me.gvt1.com/. When that happens, WebDriverManager fallbacks to the old chromedriver repository (https://chromedriver.storage.googleapis.com/), which for some reason, is not prohibited at your end, but it only contains up to chromedriver 114, which is the version downloaded. From my side, I will remove this fallback for the next version of WebDriverManager.

But for these problems, I cannot fix the connectivity problem at your end, so you need to figure out why your environment forbids that connection.

Some tips:

  • If you are behind a proxy, you can specify it using the method proxy() in the WebDriverManager API (see details in doc).
  • You can enable the WebDriverManager traces for further details (see doc).
  • You can find a basic working repo with WebDriverManager here.

Thanks You @bonigarcia will reach IT Team.

bonigarcia commented 1 year ago

I have just released WebDriverManager 5.5.3. This version works almost the same as 5.5.2, being the main difference is that 5.5.3 does not fall back to chromedriver 114 when 115+ has some problem happen.

Also, I have included a new section about connectivity problems in the known issues section of the WebDriverManager doc.

I'm closing this issue. If some problem reported here is persistent, consider opening a new one.

doktorgaja commented 1 year ago

Hi, im experiencing a problem with my chromedriver, in fact my python code won't work at all. I'm trying to declare an executable path but as soon as I do it, it goes yellow underline and a warning for an Unexpected argument. I have updated my Python version, serached for a chromedriver that is compatible with my Chrome version (116.0.5845.141) but wasn't successful. What should I do to make it work? image

ViliusS commented 1 year ago

One more note on this: be sure to NOT run testing with old WebDriver Manager versions at any point in time, because it could corrupt cache again.

This was our case. We fixed the issue by updating WebDriver manager to 5.5.3 and Selenium to 4.12.1, cleared the cache, but later someone repeated an old test job from Jenkins UI with old versions. We had to clear cache again and delete old test jobs from Jenkins so they won't be run again.