Skip to content
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

Use which() to get Firefox path on Mac OS #10818

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion py/selenium/webdriver/firefox/firefox_binary.py
Expand Up @@ -150,7 +150,11 @@ def _get_firefox_start_cmd(self):
"""Return the command to start firefox."""
start_cmd = ""
if self.platform == "darwin": # small darwin due to lower() in self.platform
start_cmd = "/Applications/Firefox.app/Contents/MacOS/firefox-bin"
ffname = "firefox"
start_cmd = self.which(ffname)
symonk marked this conversation as resolved.
Show resolved Hide resolved
# use hardcoded path if nothing else was found by which()
if not start_cmd:
start_cmd = "/Applications/Firefox.app/Contents/MacOS/firefox-bin"
# fallback to homebrew installation for mac users
if not os.path.exists(start_cmd):
start_cmd = os.path.expanduser("~") + start_cmd
Expand Down