Skip to content

[πŸ› Bug]: Unable to Chrome browser: webdriver.chrome() with error message " NoDriverException" Β #14760

@sonalmalage09

Description

@sonalmalage09

What happened?

NOTE: after providing chromedriver.exe file in project structure and define PATH it works

How can we reproduce the issue?

from selenium import webdriver

class BrowserConfig:

    @staticmethod
    def open_chrome_browser():
        driver = webdriver.Chrome()
        driver.get("https://google.com")
        driver.implicitly_wait(5)
        print("Current session is {}".format(driver.session_id))

if __name__ == '__main__':
    BrowserConfig.open_chrome_browser()

Relevant log output

Traceback (most recent call last):
  File ".venv\pythonProject\Lib\site-packages\selenium\webdriver\common\driver_finder.py", line 67, in _binary_paths
    output = SeleniumManager().binary_paths(self._to_args())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv\pythonProject\Lib\site-packages\selenium\webdriver\common\selenium_manager.py", line 55, in binary_paths
    return self._run(args)
           ^^^^^^^^^^^^^^^
  File ".venv\pythonProject\Lib\site-packages\selenium\webdriver\common\selenium_manager.py", line 129, in _run
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: Unsuccessful command executed: venv\pythonProject\Lib\site-packages\selenium\webdriver\common\windows\selenium-manager.exe --browser chrome --language-binding python --output json; code: 65
{'code': 65, 'message': 'error sending request for url (https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json)', 'driver_path': '', 'browser_path': ''}



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

Traceback (most recent call last):
  File "pythonProject\launch.py", line 13, in <module>
    BrowserConfig.open_chrome_browser()
  File "Dummy\pythonProject\launch.py", line 7, in open_chrome_browser
    driver = webdriver.Chrome()
             ^^^^^^^^^^^^^^^^^^
  File ".venv\pythonProject\Lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 45, in __init__
    super().__init__(
  File ".venv\pythonProject\Lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 50, in __init__
    if finder.get_browser_path():
       ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "venv\pythonProject\Lib\site-packages\selenium\webdriver\common\driver_finder.py", line 47, in get_browser_path
    return self._binary_paths()["browser_path"]
           ^^^^^^^^^^^^^^^^^^^^
  File ".venv\pythonProject\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

Windows11

Selenium version

4.26

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

Chrome 131

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

Chrome Driver

Are you using Selenium Grid?

NA

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!I-defectSomething is not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions