4

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.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Kenji Otsuka
  • 83
  • 1
  • 1
  • 7

5 Answers5

1

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

1

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' }

0

I also got the same error for chrome version 116. Steps I followed: 1- Type latest version of chrome driver in browser 2- It will navigate to https://chromedriver.chromium.org/downloads 3- Download the latest version. if 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 download the driver zip file, unzip the file and point to the chromedrive.exe file path.

0

webdrivermanager version should be updated to the latest

  • 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](/help/how-to-answer). – Community Sep 02 '23 at 11:24
-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,

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352