问题
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:
回答1:
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
来源:https://stackoverflow.com/questions/60296873/sessionnotcreatedexception-message-session-not-created-this-version-of-chrome