SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81
I am currently new to robot framework.I am currently using latest window version of chrome and chromedriver which is 80 but when i try to run the test it gives the message "SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81" in pycharm but currently beta version of 81 is only available. I have tried uninstalling everthing and reinstalling it again but nothing works can anyone help me with this.Thank you!
Screenshots below:
Solution 1:
I solved these kinds of problems using the webdrive manager.
You can automatically use the correct chromedriver by using the webdrive-manager. Install the webdrive-manager:
pip install webdriver-manager
Then use the driver in python as follows
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(ChromeDriverManager().install())
This answer is taken from https://stackoverflow.com/a/52878725/10741023
Solution 2:
Do below steps :
-
Check the version of chrome browser.
-
download chromedriver of same version from https://sites.google.com/chromium.org/driver/home
-
Give correct path in the pycharm and run the code.
Solution 3:
I got the same message on MacOS:
"selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81"
Then I run this command, it's gone:
# Homebrew 3
brew upgrade chromedriver
# Homebrew < 3
brew cask upgrade chromedriver
Solution 4:
This error message...
SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81
...implies that the ChromeDriver v81 was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser where is version is other then 81.0.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
- You mentioned about using chromedriver=80 and chrome=80 but somehow while your program execution ChromeDriver v 81.0 is used.
-
So, it's quite evident your have chromedriver=81.0 present within your system and is present within the system
PATH
variable which gets invoked while you:driver = webdriver.Chrome()
Solution
There are two solutions:
- Either you upgrade chrome to Chrome Version 81.0 level. (as per ChromeDriver v81.0 release notes)
-
Or you can override the default chromedriver v81.0 binary location with chromedriver v80.0 binary location as follows:
from selenium import webdriver driver = webdriver.Chrome(executable_path=r'C:\path\to\chromedriver.exe') driver.get('http://google.com/')
Reference
You can find a couple of relevant discussions in:
- How to work with a specific version of ChromeDriver while Chrome Browser gets updated automatically through Python selenium
- selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 80
- Ubuntu: selenium.common.exceptions: session not created: This version of ChromeDriver only supports Chrome version 79
Solution 5:
Chrome version is updating everyday so you need use exact chromedriver version according chrome version https://chromedriver.chromium.org/downloads in this website you can download chromedrivers