SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
29.77k stars 8.02k forks source link

[πŸ› Bug]: raise WebDriverException( selenium.common.exceptions.WebDriverException) #14213

Closed skybird2022 closed 10 hours ago

skybird2022 commented 3 days ago

What happened?

Hi Support Team,

After I upgraded selenium version from 4.6.0 to 4.22.0 in Pycharm, it encountered following errors ( Please refer to attached screen captures with bugs) . I checked my local environment variable setting is no problem, and chromedriver version match with Google Chrome. I also open selenium-manager.exe, there is a error too. Can you help to check the root cause of these errors ? Thanks for support !

In order not to affect my daily work, I uninstall 4.22.0, and re-install temporarily 4.6.0 for workaround.

2 1 3

How can we reproduce the issue?

for example: 

from selenium import webdriver
driver = webdriver.Chrome()
driver.get('https://www.baidu.com/')

Relevant log output

Traceback (most recent call last):
  File "G:\Python\lib\site-packages\selenium\webdriver\common\driver_finder.py", line 67, in _binary_paths
    output = SeleniumManager().binary_paths(self._to_args())
  File "G:\Python\lib\site-packages\selenium\webdriver\common\selenium_manager.py", line 53, in binary_paths
    return self._run(args)
  File "G:\Python\lib\site-packages\selenium\webdriver\common\selenium_manager.py", line 118, in _run
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: Unsuccessful command executed: G:\Python\lib\site-packages\selenium\webdriver\common\windows\selenium-manager.exe --browser chrome --language-binding python --output json; code: 3221225477
{}

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "F:/Pycharm/Projects/aaa.py", line 8, in <module>
    driver = webdriver.Chrome()
  File "G:\Python\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 45, in __init__
    super().__init__(
  File "G:\Python\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 50, in __init__
    if finder.get_browser_path():
  File "G:\Python\lib\site-packages\selenium\webdriver\common\driver_finder.py", line 47, in get_browser_path
    return self._binary_paths()["browser_path"]
  File "G:\Python\lib\site-packages\selenium\webdriver\common\driver_finder.py", line 78, in _binary_paths
    raise NoSuchDriverException(msg) from err
selenium.common.exceptions.NoSuchDriverException: Message: Unable to obtain driver for chrome; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location

Operating System

Window 7

Selenium version

4.22.0

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

Chrome - 109.0.5414.120

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

ChromeDriver - 109.0.5414.25

Are you using Selenium Grid?

No

github-actions[bot] commented 3 days ago

@skybird2022, 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] commented 2 days ago

We need more information about this issue in order to troubleshoot.

Please turn on logging and re-run your code. Information on how to adjust logs for your language can be found in our Troubleshooting documentation.

skybird2022 commented 2 days ago

We need more information about this issue in order to troubleshoot.

Please turn on logging and re-run your code. Information on how to adjust logs for your language can be found in our Troubleshooting documentation.

Hi Support Team, please refer to above "Relevant log output" details.

diemol commented 1 day ago

Check the link; it has instructions on how to enable debug logging.

Troubleshooting documentation.

skybird2022 commented 23 hours ago

Check the link; it has instructions on how to enable debug logging.

Troubleshooting documentation.

Hi Diemol, I try to logging it according to your advise, it's not workable. I have find out the solution from official document. For higher version(4.6.0 or above ), I tested by using Service object to dedicate the path of chromedriver, it's workable. Therefore, seems there is no relationship between high-version and setting-driven environment variables.

Anyway, thanks for your support and prompt reply.

diemol commented 10 hours ago

Thanks for letting us know.