2

A few days ago I was able to run my test in selenium. I attempted to run my code today and received the following error message:

ChromeDriver was started successfully.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 94
Current browser version is 96.0.4664.55 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

Google chrome will open up briefly and close immediately without the actual test running. I uninstalled and reinstalled google chrome and receive the same issue. I'm currently using a mac and running my automation test using Java.

May I have some help to get pass this so I may continue working.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • 2
    Downgrade your chrome version or upgrade the chromedriver. – Arundeep Chohan Nov 24 '21 at 22:16
  • The Chrome browser on your machine auto-updated. You need to manually update the version of your chromedriver. – SiKing Nov 24 '21 at 22:17
  • Chrome in particular will not allow you to get too far behind current browser version. For example, it seems you have chrome driver (.exe) version 94 and it gave you this error when the browser updated to version 96. This means that it worked with version 95. You probably didn't notice, but you would get a warning indicating that the browser version you were using (v.95) wasn't tested with your current driver version. From this, you learn that you should periodically check driver versions and upgrade as soon as possible to avoid this in the future. – hfontanez Nov 24 '21 at 22:31

2 Answers2

0

This error message...

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 94
    Current browser version is 96.0.4664.55 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

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

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

  • You are using chrome=96.0.4664.55
  • Release Notes of ChromeDriver v96.0 clearly mentions the following :

Supports Chrome version 96

  • But you are using chromedriver=94.0
  • Release Notes of chromedriver=94.0 clearly mentions the following :

Supports Chrome version 94

So there is a clear mismatch between chromedriver=91.0 and the chrome=96.0.4664.45


Solution

Ensure that:

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • https://stackoverflow.com/questions/70121909/sessionnotcreatedexception-could-not-start-a-new-session-possible-causes-are-i Can u try to answer here. I have latest jar and chrome but still getting issue – Suraj Gupta Nov 26 '21 at 10:04
0

Please equal your chrome and chromedriver version. Easy way to do that all the time by this Library

https://bonigarcia.dev/webdrivermanager/

Steps :

  1. Add this dependency to your pom

    <dependency>
       <groupId>io.github.bonigarcia</groupId>
       <artifactId>webdrivermanager</artifactId>
       <version>5.0.3</version>
       <scope>test</scope></dependency>
    
  2. Initialize the driver by

WebDriverManager.chromedriver().setup();

Jayanth Bala
  • 758
  • 1
  • 5
  • 11
  • https://stackoverflow.com/questions/70121909/sessionnotcreatedexception-could-not-start-a-new-session-possible-causes-are-i @Jayanth Can u check this. Everything looks ok to me but still getting similar error – Suraj Gupta Nov 26 '21 at 10:02