SessionNotCreatedException: This version of ChromeDriver only supports Chrome version 84 using ChromeDriver and Chrome through Selenium and Python
Asked Answered
B

4

13

I am using python 3 on windows 7, selenium, chromedriver version 84 (latest) to automate my chrome browser.

I am using this script:

from selenium import webdriver
#import chromedriver_binary  # Adds chromedriver binary to path

driver = webdriver.Chrome()
driver.get("http://www.python.org")

and I always get this error upon running it.

Traceback (most recent call last):
  File "D:\Huzefa\Desktop\zzzzzz.py", line 4, in <module>
    driver = webdriver.Chrome()
  File "C:\Users\Huzefa\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 81, in __init__
    desired_capabilities=desired_capabilities)
  File "C:\Users\Huzefa\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\Huzefa\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Users\Huzefa\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\Huzefa\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 84

My ChromeDriver is in path. Also i have used other versions of chromedriver but i am not able to navigate to a website!

Banwell answered 2/6, 2020 at 15:25 Comment(2)
The error message seems self-explanatory: either you need to use Chrome >= 84, or an earlier version of Selenium. What is the installed version of Selenium?Gooch
Maybe you need to uninstall Selenium IDE, then download and install an appropriate earlier version of it from selenium.dev/downloads using the link to "Previous IDE versions"Gooch
B
10

Your ChromeDriver version and your installed version of Chrome need to match up. You are using ChromeDriver for Chrome version 84, which at the time of this answer, is a beta (non-stable) build of Chrome; you're probably not using it. Likely you're on version 83.

Check your Chrome version (Help -> About) and then find the correct ChromeDriver release. You could instead use webdriver-manager which can handle this for you.

Bernadettebernadina answered 2/6, 2020 at 16:32 Comment(0)
H
11

We can automate the task of downloading the binary and configuring the path.

We dont have to worry about the browser version or the binary version

This can be done by using webdriver-manager

pip install webdriver-manager

Now the above code in the question will work simply with the below change,

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager

driver = webdriver.Chrome(ChromeDriverManager().install())
 

The same can be used to set Firefox, Edge, and ie binaries.

Original Answer - https://mcmap.net/q/63927/-selenium-using-python-geckodriver-executable-needs-to-be-in-path

Hartung answered 17/12, 2020 at 2:35 Comment(0)
B
10

Your ChromeDriver version and your installed version of Chrome need to match up. You are using ChromeDriver for Chrome version 84, which at the time of this answer, is a beta (non-stable) build of Chrome; you're probably not using it. Likely you're on version 83.

Check your Chrome version (Help -> About) and then find the correct ChromeDriver release. You could instead use webdriver-manager which can handle this for you.

Bernadettebernadina answered 2/6, 2020 at 16:32 Comment(0)
E
4

This error message...

selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 84

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


Analysis

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

  • You are using chromedriver=84
  • Release Notes of chromedriver=84 clearly mentions:

Supports Chrome version 84

  • Presumably you are using chrome=83 the latest push for Chrome.

Google Chrome is up to date

So there is a clear mismatch between ChromeDriver v84 and the Chrome Browser v83


Solution

There are two (2) solutions to this issue.

Additionally also ensure that:

  • Selenium is upgraded to current levels Version 3.141.59.
  • If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
  • Take a System Reboot.
  • Execute your @Test as non-root user.
  • Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.
Effeminate answered 2/6, 2020 at 23:12 Comment(0)
B
0

Chromedriver needs to be updated.

Download and install the latest chromedriver from https://chromedriver.chromium.org/downloads

Bohr answered 2/9, 2022 at 7:7 Comment(1)
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From ReviewCosgrove

© 2022 - 2024 — McMap. All rights reserved.