question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[🐛 Bug]: Contained Firefox can't be used on MacOS

See original GitHub issue

What happened?

For the project https://github.com/robocorp/rpaframework/ we’re installing an isolated Firefox and adding that to the path. But because as seen here https://github.com/SeleniumHQ/selenium/blob/dab928e6ac2c270b03d0199f381950c998c3f8b0/py/selenium/webdriver/firefox/firefox_binary.py#L152 the path for MacOS is hardcoded and not searched for in $PATH, Selenium will never find and use that version.

How can we reproduce the issue?

Install Firefox on MacOS in a different path. Add it to the $PATH global variable and try to use Selenium against it. Selenium will fail, not being able to find Firefox.

Relevant log output

SessionNotCreatedException: Message: Expected browser binary location, but unable to find binary

Operating System

MacOS Monterey 12.3

Selenium version

3.141.0 (but based on the code seems like it should be on all versions)

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

Firefox 98, 99 and 100

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

GeckoDriver 0.30.0

Are you using Selenium Grid?

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
bogdancondurachecommented, Jun 8, 2022

Even if we rework the logic and follow your comments, or if we simply remove the path for macOS, GeckoDriver still will use this path as they know better the default locations.

I’m not sure the problem is in GeckoDriver. This works well on Windows and Linux because (I assume) Gecko calculates the paths properly.

Also, which are these ones?

by default it should be detected from the standard locations

Usually the convention is to take each folder from $PATH in order and try to use the binary from there, that’s why the order is important. From what I see, this is done by Selenium on Linux using the which method here: https://github.com/SeleniumHQ/selenium/blob/dab928e6ac2c270b03d0199f381950c998c3f8b0/py/selenium/webdriver/firefox/firefox_binary.py#L211

I think this should be the best approach for MacOS as well, if the binary couldn’t be found in the path currently hardcoded: https://github.com/SeleniumHQ/selenium/blob/dab928e6ac2c270b03d0199f381950c998c3f8b0/py/selenium/webdriver/firefox/firefox_binary.py#L153

0reactions
github-actions[bot]commented, Jul 30, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mac 11.4 Unable to connect to websites | Firefox Support Forum
I have been unable to use Firefox on a site that I have used for years. ... I cannot figure out how to...
Read more >
Firefox won't open on new Mac OS - profile cannot be found
I have a new Mac and have not been able to open FF. I just get this message: "your firefox profile cannot be...
Read more >
Firefox can't load websites but other browsers can
We'll explain errors such as "Server not found" or "Unable to connect" and how to fix problems where Firefox can't access websites but...
Read more >
I cannot install the new version of firefox in mi mac os x system ...
I cannot install the new version of firefox in mi mac os x system. It says that i do not have the permission...
Read more >
Problems loading pages (macOS Big Sur 11.1) - Mozilla Support
3 replies; 2 have this problem; 841 views; Last reply by FredMcD. 1 year ago ... Yesterday I got a new Mac, running...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found