Could not start a new session. Response code 500. Message: session not created: This version of ChromeDriver only supports Chrome version 105
Asked Answered
M

5

6

I'm developing an application that uses selenium.

  • OS: macOS with Apple Silicon
  • Language: Kotlin
  • JDK: Java 18

But it fails.

Output

Starting ChromeDriver 105.0.5195.19 (b9c217c128c16f53d12f9a02933fcfdec1bf49af-refs/branch-heads/5195@{#176}) on port 50362
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
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 105
Current browser version is 104.0.5112.79 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Build info: version: '4.4.0', revision: 'e5c75ed026a'
System info: host: 'mymac.local', ip: '2400:2200:6f0:7919:347b:3223:3841:9545%en0', os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '12.3', java.version: '18.0.2'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}], desiredCapabilities=Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}}]
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:144)
    ......

build.gradle.kts

dependencies {
    testImplementation(kotlin("test"))
    implementation(compose.desktop.currentOs)

    // Selenium
    // https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java
    implementation("org.seleniumhq.selenium:selenium-java:4.4.0")
    // https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-chrome-driver
    implementation("org.seleniumhq.selenium:selenium-chrome-driver:4.4.0")
}

Code

fun launch() {
    System.setProperty(
        "webdriver.chrome.driver",
        "/driver/path/chromedriver"
    );
    ChromeDriver();
}

Chrome driver version 105.0.5195.19 is one of the driver I saved at /driver/path/chromedriver. 104.0.5112.79 is the version of Chrome I installed on my macOS.

Do I have to use the chromedriver version 104? or is there any way to use one of version 105?

I'm not sure why chrome version on the macOS is needed when I set webdriver.chrome.driver.

Mortie answered 12/8, 2022 at 17:16 Comment(0)
S
1

This error message...

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 105

...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. session.

Your main issue is the incompatibility between the version of the binaries you are using as follows:

  • You are using chromedriver=105.0
  • Release Notes of chromedriver=105.0 clearly mentions the following :

Supports Chrome version 105

  • Presumably you are using the latest chrome=104.0

So there is a clear mismatch between chromedriver=105.0 and the chrome=104.0


Solution

Ensure that:

Also ensure,

Sheeb answered 12/8, 2022 at 21:47 Comment(2)
I'm confused. So, I have to use the same version of chrome driver file as chrome browser that i installed in the computer right?Mortie
Yeap, that's correct.Sheeb
U
0

You can check you current Google Chrome version and if is not 105 you can updated.

In my case was :

Version 104.0.5112.102

Or another solutions would be downgrade the chrome driver

Unravel answered 2/9, 2022 at 18:30 Comment(0)
B
0

I also got the same error for Chrome version 116. Steps I followed:

  1. Type the latest version of Chrome driver in the browser
  2. It will navigate to https://chromedriver.chromium.org/downloads
  3. Download the latest version. if the latest version is not available then it will give you the path to download Chromedriver latest version for testing like below.
    • If you are using Chrome version 115 or newer, please consult the Chrome for Testing Availability dashboard. This page provides convenient JSON endpoints for specific ChromeDriver version downloading.--
  4. After downloading the driver zip file, unzip the file and point to the chromedrive.exe file path.
Broadspectrum answered 29/8, 2023 at 22:2 Comment(0)
K
0

You can use this :

dependencies{
    compile ('org.seleniumhq.selenium:selenium-java:4.11.0')
    implementation group: 'io.github.bonigarcia', name: 'webdrivermanager', version: '5.5.2'
}
Koblick answered 31/8, 2023 at 7:52 Comment(0)
M
0

Webdrivermanager version should be updated to the latest

Moynihan answered 31/8, 2023 at 18:41 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Verine

© 2022 - 2024 — McMap. All rights reserved.