selenium icon indicating copy to clipboard operation
selenium copied to clipboard

Cannot launch ChromeDriver[🐛 Bug]:

Open gidigal opened this issue 3 years ago • 19 comments

What happened?

I got an error saying that my selenium version is 114 while chrome version is 116. I installed new version for selenium (4.11) and chrome driver 116 win64. I still got errors. According to an advice I read, I searched for chromedriver and deleted it from under C:\Users\Gidi.cache\selenium. Still got errors.

I see in the log attached below this line (log was produced using SeleniumLogger): 2023-08-26 22:16:58 FINE - chromedriver not found in PATH I don't see an executable named chromedriver in the files I downloaded. I will be grateful for help.

How can we reproduce the issue?

Have Chrome 114 installed with selenium 4.9. Now, update Chrome and see the erorr about version differences. Now, update selenium to 4.11 and download chrome driver 116, and delete chromedriver.exe from .cache folder. Try to launch again. I also tried to delete my project and start a new one.

Relevant log output

2023-08-26 22:16:35 FINE - Selenium Manager binary found at: C:\Users\Gidi\AppData\Local\Temp\selenium-manager148523699687006136012390874952462\selenium-manager.exe 
2023-08-26 22:16:35 FINE - Executing Process: [C:\Users\Gidi\AppData\Local\Temp\selenium-manager148523699687006136012390874952462\selenium-manager.exe, --browser, chrome, --output, json, --debug] 
2023-08-26 22:16:58 FINE - Checking chromedriver in PATH 
2023-08-26 22:16:58 FINE - Running command: chromedriver --version 
2023-08-26 22:16:58 FINE - Output: "" 
2023-08-26 22:16:58 FINE - chromedriver not found in PATH 
2023-08-26 22:16:58 FINE - chrome detected at C:\Program Files\Google\Chrome\Application\chrome.exe 
2023-08-26 22:16:58 FINE - Using shell command to find out chrome version 
2023-08-26 22:16:58 FINE - Running command: wmic datafile where name='C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe' get Version /value 
2023-08-26 22:16:58 FINE - Output: "\r\r\n\r\r\nVersion=116.0.5845.111\r\r\n\r\r\n\r\r\n\r" 
2023-08-26 22:16:58 FINE - Detected browser: chrome 116.0.5845.111 
2023-08-26 22:16:58 FINE - Required driver: chromedriver 116.0.5845.96 
2023-08-26 22:16:58 FINE - Reading metadata from https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json 
2023-08-26 22:16:58 FINE - Driver URL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/win64/chromedriver-win64.zip 
Exception in thread "main" org.openqa.selenium.remote.NoSuchDriverException: Unable to obtain: Capabilities {browserName: chrome, goog:chromeOptions: {args: [--remote-allow-origins=*], extensions: []}}, error Command failed with code: 65, executed: [C:\Users\Gidi\AppData\Local\Temp\selenium-manager148523699687006136012390874952462\selenium-manager.exe, --browser, chrome, --output, json, --debug]
error sending request for url (https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/win64/chromedriver-win64.zip): error trying to connect: tcp connect error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (os error 10060)
Build info: version: '4.11.0', revision: '040bc5406b'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.6'
Driver info: driver.version: ChromeDriver
	at org.openqa.selenium.remote.service.DriverFinder.getPath(DriverFinder.java:25)
	at org.openqa.selenium.remote.service.DriverFinder.getPath(DriverFinder.java:13)
	at org.openqa.selenium.chrome.ChromeDriver.generateExecutor(ChromeDriver.java:99)
	at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:88)
	at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:83)
	at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:51)
	at Main.main(Main.java:13)
Caused by: org.openqa.selenium.WebDriverException: Command failed with code: 65, executed: [C:\Users\Gidi\AppData\Local\Temp\selenium-manager148523699687006136012390874952462\selenium-manager.exe, --browser, chrome, --output, json, --debug]
error sending request for url (https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/win64/chromedriver-win64.zip): error trying to connect: tcp connect error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (os error 10060)
Build info: version: '4.11.0', revision: '040bc5406b'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.6'
Driver info: driver.version: ChromeDriver
	at org.openqa.selenium.manager.SeleniumManager.runCommand(SeleniumManager.java:151)
	at org.openqa.selenium.manager.SeleniumManager.getDriverPath(SeleniumManager.java:273)
	at org.openqa.selenium.remote.service.DriverFinder.getPath(DriverFinder.java:22)
	... 6 more

Process finished with exit code 1

Operating System

Windows 10 64 bit

Selenium version

Java Selenium 4.11

What are the browser(s) and version(s) where you see this issue?

Chrome

What are the browser driver(s) and version(s) where you see this issue?

ChromeDriver 116

Are you using Selenium Grid?

No response

gidigal avatar Aug 26 '23 19:08 gidigal

@gidigal, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

github-actions[bot] avatar Aug 26 '23 19:08 github-actions[bot]

I am also getting the same issue with - System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '13.4', java.version: '17.0.7'

kaurmanjot90 avatar Aug 26 '23 22:08 kaurmanjot90

This means there is a network issue get information from the internet:

error trying to connect: tcp connect error: A connection attempt failed because the connected party did not properly respond after a period of time,

Most likely the computer is behind a proxy that filters what is allowed to be accessed. Selenium supports setting proxy information for the driver by Options class, environment variable or configuration file.

titusfortner avatar Aug 26 '23 23:08 titusfortner

@kaurmanjot90 double check that you have Rosetta installed. It won't be necessary in 4.12, but is in 4.11

titusfortner avatar Aug 26 '23 23:08 titusfortner

double check your chrome driver version, or trying using the chrome driver manager for driver installation driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()))

domoncassiu avatar Aug 28 '23 01:08 domoncassiu

We do not recommend using webdriver manager (the project where ChromeDriverManager comes from) with the latest versions of Selenium.

titusfortner avatar Aug 28 '23 12:08 titusfortner

@titusfortner below is a screenshot of my LAN settings: image I understand that it means that I don't use proxy server. I did not need to set Options class in my previous work with 4.9. Is there a link to guide me what needs be set ? Thanks.

gidigal avatar Aug 28 '23 13:08 gidigal

@kaurmanjot90 double check that you have Rosetta installed. It won't be necessary in 4.12, but is in 4.11

Thank you plenty! This helped to resolve my issue, able to execute.

kaurmanjot90 avatar Aug 28 '23 13:08 kaurmanjot90

@gidigal yes, we've made a bunch of changes since 4.10.

Selenium is saying it can't access https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/win64/chromedriver-win64.zip

Can you access that link from your browser? Can you access it from command line using curl or wget?

Is this a work computer? Might your IT be limiting what can be downloaded?

titusfortner avatar Aug 28 '23 13:08 titusfortner

@titusfortner I am unable to access this path. When I needed to download this chrome driver version, I did it through my cell phone, because of this issue. I tried contacting my internet provider to understand if they are able to download it. I understood they are able to access it. I tried adding https://edgedl.me.gvt1.com to the approved list of sites in my antivirus program. It did not help. I don't understand why selenium tries to download it, while I have a local version and I added its path to PATH varible. This is my home computer.

gidigal avatar Aug 28 '23 17:08 gidigal

Huh, that's weird that you can't access it.

Selenium wants to make it so that you don't have to manually update drivers any more. That means Selenium figures out what you should be using and gets it for you.

If you want to avoid that, you need to manually download it and put it in a directory on PATH. Looking at the logs, Selenium doesn't detect anything on PATH. So, sounds like you'll need to update that.

2023-08-26 22:16:58 FINE - Running command: chromedriver --version 
2023-08-26 22:16:58 FINE - Output: "" 
2023-08-26 22:16:58 FINE - chromedriver not found in PATH 

titusfortner avatar Aug 28 '23 18:08 titusfortner

@titusfortner , I look on my download of chrome-win64.zip and I see there is no chromedriver.exe in it (I think it is 116.0.5845.96 version, according to the name of the manifest file). Below are the exe files in it: chrome.exe chrome_proxy.exe chrome_pwa_launcher.exe elevation_service.exe notification_helper.exe

So, the question is why would selenium search for chromedriver ? I did not set property "webdriver.chrome.driver". Is there something else I should delete in my temp files ? Thanks, Gidi

gidigal avatar Aug 31 '23 06:08 gidigal

You need a driver to use selenium. If selenium can't access the location online to get the driver automatically, you have to install it manually and put it in a directory on PATH.

titusfortner avatar Aug 31 '23 12:08 titusfortner

Exception in thread "main" org.openqa.selenium.remote.NoSuchDriverException: Unable to obtain: Capabilities {browserName: chrome, goog:chromeOptions: {args: [--remote-allow-origins=*], extensions: []}}, error Command failed with code: 65, executed: [--browser, chrome, --output, json] error sending request for url (https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json): error trying to connect: dns error: No such host is known. (os error 11001) Build info: version: '4.12.1', revision: '8e34639b11' System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '16.0.2' Driver info: driver.version: ChromeDriver at org.openqa.selenium.remote.service.DriverFinder.getPath(DriverFinder.java:25) at org.openqa.selenium.remote.service.DriverFinder.getPath(DriverFinder.java:13)

sakshi4219 avatar Sep 14 '23 04:09 sakshi4219

Driver info: driver.version: ChromeDriver at org.openqa.selenium.remote.service.DriverFinder.getPath(DriverFinder.java:25) at org.openqa.selenium.remote.service.DriverFinder.getPath(DriverFinder.java:13) at org.openqa.selenium.chrome.ChromeDriver.generateExecutor(ChromeDriver.java:99) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:88) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:83) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:51) at firstscript.main(firstscript.java:7)

sakshi4219 avatar Sep 14 '23 04:09 sakshi4219

I found the reason for my error. The the Chrome for Testing availability dashboard has both downloads for chrome and chromddriver. I mistakenly downloaded chrome. Once I downloaded chromedriver the issue was resolved. @titusfortner, thank you for your help :-)

gidigal avatar Sep 14 '23 05:09 gidigal

Any solution for this error - error sending request for url (https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json): error trying to connect: dns error: No such host is known. (os error 11001) ?

GitAmi55 avatar Nov 14 '23 12:11 GitAmi55

https://www.selenium.dev/documentation/selenium_manager/#connectivity-issues

titusfortner avatar Nov 14 '23 13:11 titusfortner

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Dec 15 '23 00:12 github-actions[bot]