-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[🐛 Bug]: Firefox and Edge Browser not launching on a Jenkins Linux Container #12495
Comments
@jay14687se, thank you for creating this issue. We will troubleshoot it as soon as we can. Info for maintainersTriage this issue by using labels.
If information is missing, add a helpful comment and then
If the issue is a question, add the
If the issue is valid but there is no time to troubleshoot it, consider adding the
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable
After troubleshooting the issue, please add the Thank you! |
Hmm, that output doesn't match what is in the most recent version, where is that binary coming from? Can you turn on logging? I'm not a JS dev, but I think this works: const logging = require('selenium-webdriver/lib/logging')
logging.installConsoleHandler()
logger = logging.getLogger('webdriver')
logger.setLevel(logging.Level.FINER) |
I have added Logging to my framework:
Are these the log details you are looking for?
Firefox:
|
I want to see what the Selenium manager is doing, looks like the browser location is coming back empty or null. @harsha509 do I have the logging code right? Should we be getting the Selenium manager logs from that? |
Selenium logs which I ran separately are provided in the "Relevant log output" section. If this not the same as what you are asking for please let me know what code do I need to add to get Selenium Manager logs. |
Maybe I need to stop replying to these by phone. Not sure why I thought this was JS (sorry @harsha509). Actually, yes I do, the location of Selenium Manager is wrong for Java. I'm expecting to see a line in the logs with browser location. Since it isn't there it makes me think you are somehow using an old version of the SM binary, except I don't know how that's possible, so I wanted to see the full logs thinking something in there might shed light on things. Are you doing something with the manager? |
I'm not invoking Selenium Manager anywhere inside my Java Selenium Testframework. I am just using the command |
Yes, so I want to see the logs from selenium manager when it is executing in your code, not from a separate download. |
Ok. So I don't know how to enable this in my code. Do you have some documentation on what I need to change in my Framework to get these logs? |
@titusfortner Is there a code/documentation that you can provide for me enable logs for Selenium Manager? |
@titusfortner I have already added this in my framework as mentioned in the above comment . But i don't see any Selenium Manager logs. |
Please read the link I provided for how to output logging for Selenium. |
@titusfortner Please find the logs for Edge and Firefox below. I have removed certificate logs and ip details since I'm running on company network, i hope that is ok. Firefox:
Edge:
|
If you have Edge installed, it isn't where Selenium knows to look for it, so you need to specify the location in the Edge Options class. Firefox is more confusing. It finds it, gets the version, but for some reason isn't including it in the return JSON. @bonigarcia any idea how this could use the location and then lose it before reporting it? |
Edge is not installed on the container. It only has Chrome and Firefox. |
Selenium does not yet automatically download Edge, you have to install it yourself to use it. Firefox situation is unusual though. |
Oh ok. So i will try to setup edge. But how is Edge picking the Chrome Browser - Chrome/114.0.5735.90? |
Selenium Manager is behaving correctly with Edge (since it is not installed). But I don't know where this version ( Regarding Firefox, I have confirmed it is a bug in Selenium Manager. I have just committed a patch to solve it: fb40ce3 @jay14687se This fix will be available in Selenium 4.12.0. As a temporary workaround in your test, you can try to set your Firefox binary path. It should do the trick:
|
@bonigarcia Thanks. Not sure what is happening with Edge. For firefox i will try the temporary workaround for now. |
@jay14687se are you able to run the FF in selenoid container . When I am running I am getting "org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 400. Message: Unrecognised option moz:debuggerAddress " I added options.setBinary("/usr/local/firefox/firefox"); but still I am getting same error . If you are able to lanuch FF then let me know |
@RaviNelluri This is a bug. Please refer to comment |
Today, I checked with 4.12.0 selenium-java version but still I am getting same error |
Still getting the error with 4.12.0 |
The following problem:
... is an open issue in Microsoft Edge Driver on Linux, see MicrosoftEdge/EdgeWebDriver#102 |
Still have a problem with FF browser also. |
In Firefox, I don't know the cause of this problem:
It seems beyond Selenium Manager. Maybe geckodriver? @diemol @titusfortner Any idea? |
@Argano-GQE that error comes from the remote end. You need to report that to the Selenoid project. |
@jay14687se Regarding your Firefox error, we would like the complete logs and a piece of code that shows how you are creating the session request. If it works in Windows but not Linux, I don't discard some conditionals in your code based on the platform. |
I found the regression to be in selenium-webdriver-4.12.0. With 4.11.0, firefox starts all right. Starting from selenium-webdriver-4.12.0 (up to and including 4.13.1), I get this log output (error "binary is not a Firefox executable"):
Whereas, with selenium-webdriver-4.11.0, I get this log output (no error):
|
It started failing because Selenium is now helpfully managing Firefox browser and driver for you, but snap makes the job difficult. @bonigarcia why is it using |
There are a couple of things I don't understand. It may be a bug in Selenium Manager, but I need to ensure it. First, Selenium Manager seems to fail to detect Firefox in a path in version 4.12+ but not in 4.11:
@fvue Can you please run the following commands in the shell and share the output here?
Then, when Firefox in the path is not detected, it is downloaded by Selenium Manager. But it seems the resulting binary is not correct for some reason. Can you please check the following:
|
|
Thanks a lot, @fvue. It seems the problem is that Selenium Manager is resolving the symbolic link from
So, I will change the Selenium Manager to avoid resolving the symbolic link for browsers found in the PATH. It will be available in the next Selenium version. Regarding the second part, Firefox has been correctly downloaded by Selenium Manager, and it is executable:
So the problem must be the relationship between the driver and browser, since the resolved driver is for snap, but the browser is the regular one. To solve it, you can try to remove geckodriver from your path ( |
So this is an issue of whether to use snap at all or not, right? For snap you need the snap browser + the snap driver. If you remove firefox & geckodriver from PATH, Selenium will just grab Firefox & geckodriver from the internet and use that. |
For selenium-java, I just follow the solution from issue 7788, where you create a custom File object that overrides getCanonicalPath(). This is hacky but works:
|
@fvue I created a new Selenium Manager version that avoids resolving symbolic links for found browsers. This should fix the problems related to snap Firefox. To check it, please download and uncompress the following binary: selenium-manager_linux-x64, run the following command, and share the results here, thanks:
|
The downloaded binary:
This is the output with selenium-webdriver-4.13.1, so the new version 0.4.14 gives better result indeed (/snap/bin/firefox instead of /usr/bin/snap):
But if I replace just selenium-manager (at ~/.rvm/gems/ruby-3.1.4@travelsim/gems/selenium-webdriver-4.13.1/bin/linux/selenium-manager) with v0.4.14 (was: 0.4.13), my ruby system test still fails:
|
The new version of Selenium Manager seems to work correctly:
So, I don't understand why your test fails with @titusfortner: Any idea about this? |
Don't try to replace it in the rvm, set the environment variable to the location of your selenium manager: ENV['SE_MANAGER_PATH'] = 'path/to/selenium-manager' |
It's weird that it's the snap geckodriver complaining about the snap firefox... the syntax looks correct |
Please create a service instance (use and set the log level to trace: |
Looks like this issue is now a collection of different variations, and we have not heard much from folks in the last weeks. I will close this for now, but if you are still having an issue inside the Jenkins Linux container, please comment and we will reopen. For something different, please open a new issue. |
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. |
What happened?
When trying to run my test scripts on a Jenkins using Linux container for Firefox and Edge browsers I get he errors ad shown in the logs. This seems run fine on Local Windows machine.
Note: Also the container does not have Edge and Firefox pre installed.
How can we reproduce the issue?
Relevant log output
Operating System
Docker Linux
Selenium version
4.11.0
What are the browser(s) and version(s) where you see this issue?
Firefox 113.0.2, MS EDGE 115
What are the browser driver(s) and version(s) where you see this issue?
msedgedriver 115.0.1901.188, geckodriver 0.33.0
Are you using Selenium Grid?
no
The text was updated successfully, but these errors were encountered: