Skip to content

Commit b35623b

Browse files
committed
raise exception when the firefox binary isn't actually found, which usually implies the upgrade failed (on windows)
Fixes Issue #6092 Fixes Issue #6847
1 parent 1a59f58 commit b35623b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

py/selenium/webdriver/firefox/firefox_binary.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ def __init__(self, firefox_path=None, log_file=None):
4141
self.command_line = None
4242
if self._start_cmd is None:
4343
self._start_cmd = self._get_firefox_start_cmd()
44+
if not self._start_cmd.strip():
45+
raise Exception("Failed to find firefox binary. You can set it by specifying the path to 'firefox_binary':\n\nfrom selenium.webdriver.firefox.firefox_binary import FirefoxBinary\n\n" +
46+
"binary = FirefoxBinary('/path/to/binary')\ndriver = webdriver.Firefox(firefox_binary=binary)")
4447
# Rather than modifying the environment of the calling Python process
4548
# copy it and modify as needed.
4649
self._firefox_env = os.environ.copy()

0 commit comments

Comments
 (0)