Here is the error:
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot determine loading status
from unknown error: unexpected command response
(Session info: chrome=103.0.5060.53)
I'm using proper webdriver and chrome version:
Here is the script, its job is to open a webpage from the normal user data directory and provide a response.
from seleniumwire import webdriver # Import from seleniumwire
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("user-data-dir=C:\\selenium")
driver = webdriver.Chrome(chrome_options=chrome_options)
driver.get('https://katalon.com/
')
for request in driver.requests:
if request.response:
print(
request.response.status_code,
)
You need to upgrade Google Chrome and your Chrome Driver to version 104:
Install Google Chrome Beta from here: https://www.google.com/chrome/beta/
Update ChromeDriver to 104 manually (it is not in brew yet) https://chromedriver.storage.googleapis.com/index.html?path=104.0.5112.20/
Set the chrome_options.binary_location:
Windows - "C:\Program Files\Google\Chrome Beta\Application\chrome.exe"
MacOS - "/Applications/Google Chrome Beta.app/Contents/MacOS/Google Chrome Beta"
There is a known issue with non-headless chromedriver browsers, you can read more about it here.
As of now there has not been a fix for chromedriver version 103 or less.
EDIT: This has been fixed for Chromedriver version 103 as well. Download chromedriver's latest 103 version from here.
What you can do:
Upgrade to chromedriver version 104 and use the Google 104 Beta version, following Dmytro Durach's instructions. The issue is definitely fixed as seen in the patch notes for chromedriver version 104.
Use a headless browser. Instructions on configuring chromedriver headless.
Use the incognito workaround found here. It seems to work for a few people.
Wait until the issue is fixed. From what I can tell they are actively working on it. Any updates will be posted here.
Use a try...except block to infinitely retry (not recommended).
There has been issue with chromeDriver 103 version and there is an issue raised for the same with Chromium community.
Please find below the bug ids for the same,
https://bugs.chromium.org/p/chromedriver/issues/detail?id=4121&q=label%3AMerge-Request-103
You can see all the conversations in the above bug thread.
For now, until this issue is fixed try to "Downgrade Chrome Browser To v102" and "Download Selenium Chrome Driver 102" and try to run your script, as this issue is happening in 103 version.
Because of this reason, Selenium community has closed the issue with regard to the same because the issue is related to Chrome team.
https://github.com/SeleniumHQ/selenium/issues/10799
I built in a static wait; it's not elegant, but it worked for my purpose:
import time
time.sleep(5)
I think this will work but as a temporary workaround.
while True:
try:
driver.get('https://katalon.com/')
break
except:
continue
On chrome version 103, If you open the chrome with incognito and disabled site isolation trials it would not give this error
options = webdriver.ChromeOptions()
options.add_argument("--incognito")
options.add_argument("--disable-site-isolation-trials")
driver = webdriver.Chrome(chrome_options=options)
I was getting the same reported error with Chrome ver=103: “Message: unknown error: cannot determine loading status from unknown error: unexpected command response”, although my error is generated from clicking an element.
I tried the following suggestions listed above which did not work: Incognito mode, headless browser (which would not work for my application), adding time.sleep(10).
(I am adverse to loading the Chrome beta version 104, at this time.)
What is peculiar about this error (at least in my application) is that while an exception is thrown, I can see that the code generating it (clicking an element) actually executes as expected - the element IS in fact clicked.
So I have had success with just ignoring the error with the following code:
try:
next_elm.click()
except:
pass
And then continuing with the rest of my code.
Not a very elegant work-around, but it works in my application.
Solution in Code:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
# 1
option = Options()
option.binary_location='/Applications/Google Chrome
Beta.app/Contents/MacOS/Google Chrome Beta'
# 2
driver = webdriver.Chrome(service=Service(ChromeDriverManager(version='104.0.5112.20').install()), options=option)
see: this thread
when i go to command prompt and type chromedriver -v:
ChromeDriver 79.0.3945.36 (3582db32b33893869b8c1339e8f4d9ed1816f143-refs/branch-heads/3945#{#614})
but when i try to run this code :
from selenium import webdriver
class InstaBot:
def __init__(self):
self.driver=webdriver.Chrome()
self.driver.get("www.instagram.com")
InstaBot()
it gives me error like this:
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 80
why this is happening i tried to remove selenium as well as chromedriver
and reinstall of version 79.0.3945 but when i run it ,it show this can only be run on version 80
my chrome version is 79.0.3945 which is lastest ,and version 80 chrome is chrome beta
This error message...
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 80
...implies that the ChromeDriver v80.0 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 mentioned about using chromedriver=79.0.3945.36 and the release notes of chromedriver=79.0 clearly mentions the following :
Supports Chrome v79
Presumably you are using chrome v79.0 browser.
So, it's quite evident your have chromedriver=80.0 present within your system which is also within the system PATH variable and is invoked while you:
self.driver=webdriver.Chrome()
Solution
There are two solutions:
Either you upgrade chrome to Chrome Version 80.0 level. (as per ChromeDriver v80.0 release notes)
Or you can override the default chromedriver v80.0 binary location with chromedriver v79.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/')
You can find a detailed discussion in Ubuntu: selenium.common.exceptions: session not created: This version of ChromeDriver only supports Chrome version 79
Additional Considerations
Ensure to:
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.
Reference
You can find a relevant detailed discussion in:
How to work with a specific version of ChromeDriver while Chrome Browser gets updated automatically through Python selenium
Use Bonigarcia plugin in project. After that it will manage all driver by itself.It reads chrome version and instantiate driver accordingly.
for help follow my post :
https://www.linkedin.com/pulse/webdrivermanager-bonigarcia-rohan-ravi-yadav/
or original git link/post
https://github.com/bonigarcia/webdrivermanager
If any help required , Let me know
This is a very strange issue I am facing. I have my selenium scripts which work completely fine on my locally system when executed. Also I am using selenium grid for remote execution. When I try to run the same on my Jenkins which is installed on a VM my test fails. I have set my implicit timeout to 20 secs and page load timeout to 100 secs. Still I have the issue.
My Error logs on Jenkins for one of my failed test is:
Element not found exception.
Yesterday I used Eclipse to run a Java program that used the Selenium API and Firefox as the browser. Today I made some modifications to the program and, when I try to run it, I get:
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
followed by many more lines of text.
This is thrown by the first line of code that is executed in the program. I have made no changes to versions of Eclipse or Firefox, and the Selenium build path for the program is the same. So why is the exception thrown?
I have used the following command in few of my test cases, because this command is most helpfull if your trying to click on a hidden element (which appears only when hovered on some context)..
((JavascriptExecutor)driver).executeScript("$('selector_for_element').click();");
it was working fine when tested on FF 15.0, now if i try the same on FF 24.0, getting the following error Exception in thread "main" org.openqa.selenium.WebDriverException: waiting for evaluate.js load failed
any help will be appreciated, thanks!
As per this issue, i am able to see that, upgrading to latest version solved their issue. you can download latest selenium jar from here