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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃悰 Bug]: Defaulting the Firefox binary to firefox-bin fails to start Firefox 121 and later #13350

Closed
whimboo opened this issue Dec 21, 2023 · 14 comments

Comments

@whimboo
Copy link
Contributor

whimboo commented Dec 21, 2023

What happened?

With the Firefox 121 release several Selenium bindings are not able to start Firefox via geckodriver because the default Firefox binary as found by Selenium will be used by specifying the firefox-bin binary instead of just firefox. We got this report earlier today via @soulgalore on mozilla/geckodriver#2144.

As it looks like several bindings use firefox-bin and need to be corrected to use firefox instead:
https://github.com/search?q=repo%3ASeleniumHQ%2Fselenium+firefox-bin&type=code

How can we reproduce the issue?

Install Firefox 121 and run a Selenium script that auto-detects the default installation of Firefox on the MacOS system.

Relevant log output

There is no output but the process gets immediately killed because of https://bugzilla.mozilla.org/show_bug.cgi?id=1871447.

Operating System

MacOS (all versions)

Selenium version

Most recent

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

Firefox 121 and later

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

geckodriver 0.33.0

Are you using Selenium Grid?

No

Copy link

@whimboo, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@whimboo
Copy link
Contributor Author

whimboo commented Dec 21, 2023

Note that on MacOS you should read the actual binary from the Info.plist file. Any hard-coded path should be avoided.

@whimboo
Copy link
Contributor Author

whimboo commented Dec 21, 2023

CC maintainers of Selenium to make them aware of the current breakage with Firefox 121.

@titusfortner @AutomatedTester @shs96c @jimevans @diemol

@titusfortner
Copy link
Member

Well, Selenium Manager does the right thing, so that's a good first step.

It looks like we support a user passing in the full path to the binary, which we can't fix, but some languages also support passing in the directory and adding the binary to it. How long has firefox been a valid alternative to firefox_bin?

@titusfortner
Copy link
Member

you should read the actual binary from the Info.plist file

I don't think Selenium should be reading from anything. I'm not even sure the code should be looking inside a provided directory.

Maybe this is a good excuse to deprecate the various FirefoxBinary classes. We needed them in Selenium 2, we do not need them in Selenium 4.

@whimboo
Copy link
Contributor Author

whimboo commented Dec 22, 2023

Maybe but I cannot talk about other drivers beside geckodriver. At least on our side you can specify an app bundle and we will resolve the binary automatically.

Which versions of Selenium are directly affected by this problem? I'm asking because you say that those classes are not needed for Selenium 4.

@whimboo
Copy link
Contributor Author

whimboo commented Dec 22, 2023

It looks like we support a user passing in the full path to the binary, which we can't fix, but some languages also support passing in the directory and adding the binary to it. How long has firefox been a valid alternative to firefox_bin?

Both binaries basically exist forever and firefox-bin is actually a duplicate that we may wanna remove. So using firefox will be the right thing to do.

@diemol
Copy link
Member

diemol commented Dec 22, 2023

I had a look at the code base, and we have a few places where firefox-bin is used.

  • In JavaScript, the Channel class inside Firefox, aims to help the user with some predefined locations for Nightly, etc.
  • In Java, the FirefoxBinary class tries to do the same thing and uses firefox-bin only when the system property webdriver.firefox.bin is used.
  • In Python, also a FirefoxBinary class, with the same intention as Java and JavaScript.

However, those are all helper classes, and they are not needed for recent versions of Selenium, more specifically because they were used when GeckoDriver was not around and Selenium was doing the heavy lifting.

Users can always:

  • Use Selenium Manager by not having any GeckoDriver on PATH
  • Avoid using those helper classes and, if needed pass the browser binary path through the browser options

What we can do in Selenium, is to update those mentions of firefox-bin and leave firefox, and then deprecate those helper classes because they are not needed.

@titusfortner
Copy link
Member

@diemol I know you deprecated these helpers, should we also change firefox-bin until we remove them?

@diemol
Copy link
Member

diemol commented Dec 29, 2023

I changed the firefox-bin string to firefox already. Did I miss something?

@titusfortner
Copy link
Member

There were still 2 references still the last time I searched. Not at the code right now.

@titusfortner
Copy link
Member

So, I think this is done. The helpers will be removed after 2 releases per our policy.

@diemol
Copy link
Member

diemol commented Jan 1, 2024

I did not change the ones in Python because I wanted to deprecate the FirefoxBinary class and I did not know how.

Copy link

github-actions bot commented Feb 1, 2024

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.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants