Skip to content

[🐛 Bug]: webdriver.Edge() fails on some machines with "Unsuccessful command executed", despite same environment #16089

@SherlockTN

Description

@SherlockTN

Description

What happened?

When running the following code:

from selenium import webdriver
driver = webdriver.Edge()

The browser starts correctly on some machines, but on others, the following error occurs:

selenium.common.exceptions.WebDriverException: Message: Unsuccessful command executed:

Additional information

  • All machines have the latest versions of Microsoft Edge and Selenium.
  • The issue happens regardless of proxy settings.
  • Changing Python and Selenium versions does not resolve the problem.
  • Even using a different PC results in the same error for affected users.
  • Manually specifying the path to a downloaded msedgedriver.exe makes the browser start successfully.

Steps to reproduce

The cause is unclear because the environment is reportedly identical.

Environment

  • OS: Windows 10 / 11
  • Browser: Microsoft Edge (latest version)
  • Selenium version: 4.x (tested with several versions)
  • Python version: 3.x (tested with several versions)

Expected behavior

Edge browser should launch without specifying the driver path manually.

Actual behavior

WebDriverException is thrown unless the driver path is specified explicitly.

Note

I have not yet confirmed if the exact same error occurs on all affected machines.
The provided error log is from a representative case where the issue was reproducible.

Reproducible Code

from selenium import webdriver

# 何も指定せずEdgeを起動しようとするだけの最小コード
driver = webdriver.Edge()

# 動作確認のために簡単なページを開く
driver.get("https://www.google.com")

Debugging Logs

Traceback (most recent call last):
  File ".../selenium/webdriver/common/driver_finder.py", line 67, in _binary_paths
    output = SeleniumManager().binary_paths(self._to_args())
  File ".../selenium/webdriver/common/selenium_manager.py", line 54, in binary_paths
    return self._run(args)
  File ".../selenium/webdriver/common/selenium_manager.py", line 128, in _run
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: Unsuccessful command executed: selenium-manager.exe --browser MicrosoftEdge --language-binding python --output json; code: 65
{'code': 65, 'message': 'error sending request for url (https://msedgedriver.azureedge.net/LATEST_RELEASE_138_WINDOWS)', 'driver_path': '', 'browser_path': ''}

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

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../selenium/webdriver/edge/webdriver.py", line 47, in __init__
    super().__init__(
  File ".../selenium/webdriver/chromium/webdriver.py", line 53, in __init__
    if finder.get_browser_path():
  File ".../selenium/webdriver/common/driver_finder.py", line 47, in get_browser_path
    return self._binary_paths()["browser_path"]
  File ".../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 MicrosoftEdge; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location

ℹ️ Last known working version: 4.34.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-pyPython BindingsD-edgeI-defectSomething is not working as intendedI-regressionSomething was working but we "fixed" it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions