-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[🐛 Bug]: Selenium WebDriverException #10341
Comments
@fconil, thank you for creating this issue. We will troubleshoot it as soon as we can. Info for maintainersTriage this issue by using labels.
If information is missing, add a helpful comment and then
If the issue is a question, add the
If the issue is valid but there is no time to troubleshoot it, consider adding the
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, W3C),
add the applicable
After troubleshooting the issue, please add the Thank you! |
I can confirm this problem in a different setting: By using Capybara (on Ruby on Rails 5) with selenium-wevbdriver 4.1.0 (via the Webdrivers Gem), which returns two different errors
and
Please note:
|
I made some further tests but I won't have time to do much more. I user Chromium browser, not Chrome. Even if I did an The 2 binaries return the same version information, but have different hash: $ chromedriver --version
ChromeDriver 98.0.4758.80 (7f0488e8ba0d8e019187c6325a16c29d9b7f4989-refs/branch-heads/4758@{#972})
$ chromium.chromedriver --version
ChromeDriver 98.0.4758.80 (7f0488e8ba0d8e019187c6325a16c29d9b7f4989-refs/branch-heads/4758@{#972})
$ md5sum /snap/bin/chromium.chromedriver .venv/bin/chromedriver
0211d8cc2aa0d28eb2eb5394b4e29a5d /snap/bin/chromium.chromedriver
45b7ee2d481090eed757eb41f2ca5240 .venv/bin/chromedriver If I specify a path to the "snap chromedriver", it works without any weird option, and I get no import selenium.webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
service = ChromeService(executable_path="/snap/bin/chromium.chromedriver")
options = selenium.webdriver.ChromeOptions()
# Seems to work
options.headless = True
driver = selenium.webdriver.Chrome(service=service, options=options)
driver.get("https://www.selenium.dev/")
# Print page name
print(driver.title)
# Print information about the chromedriver
print(f"{driver.service.path=}")
driver.quit() I have been able to use the downloaded chromedriver that is in import selenium.webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
options = selenium.webdriver.ChromeOptions()
options.headless = True
# Solving problem : https://stackoverflow.com/a/56638103/481719
options.add_argument('--remote-debugging-port=9222')
driver = selenium.webdriver.Chrome(options=options)
driver.get("https://www.selenium.dev/")
# Print page name
print(driver.title)
# Print information about the chromedriver
print(f"{driver.service.path=}")
driver.quit() I found some better explanations about If I had more time, I could try to dig in the chromedriver source code documentation : https://chromium.googlesource.com/chromium/src/+/refs/heads/main/chrome/test/chromedriver# I saw some recent bug report on Hope it will help |
This means it is working for you? If a driver location is not specified, Selenium finds the first available driver in PATH. That driver finds the first available Chrome instance on the machine. If those don't match what you want to use, you will always need to specify the ones you need. |
Yes, it works but I have had the problem with a library that uses Selenium and where I can not specify an
# In /snap/bin
$ sudo ln -s chromium.chromedriver chromedriver Thus it works without specifying an executable_path. Though I have this solution, I would also like to understand why I had a |
As I said above, the libraries do their best to guess what you want, and if they guess incorrectly, you'll have to specify. Most likely DevToolsActivePort issue is with permissions between the executing user and the default located driver for some reason. |
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. |
What happened?
Hi,
I can not start a session on Ubuntu 20.04 with Chrome, I get an exception :
WebDriverException: Message: unknown error: DevToolsActivePort file doesn't exist
.I am using Python 3.8.10, I work inside a virtualenv :
.venv
The chrome driver is installed in
.venv/bin
which comes first in the$PATH
.I saw https://stackoverflow.com/a/50642913/481719, but I tried several options without success.
Chrome binaries are installed by apt / snap in
/snap/bin
and belong to root. This is not a problem for Firefox, I admit I am confused by this thread. I did not found how to "run Chrome as a regular user", I may be missing something.Any advice would be welcome.
Regards
How can we reproduce the issue?
Relevant log output
Operating System
Ubuntu 20.04.3
Selenium version
Python 4.1.0
What are the browser(s) and version(s) where you see this issue?
Chromium 98.0.4758.80 snap
What are the browser driver(s) and version(s) where you see this issue?
ChromeDriver 98.0.4758.80
Are you using Selenium Grid?
I do not think I am using Selenium Grid
The text was updated successfully, but these errors were encountered: