Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium stalls at "Launching Firefox...", no errors or exceptions

Trying to run Selenium on our RedHat box remotely just stays at "Launching Firefox..." without any error messages to go on.

I have a symlink from /usr/bin/firefox that goes to /usr/lib64/firefox/firefox. The RedHat machine has Firefox ESR 17.0.6 installed.

I'm using Xming and running Firefox by just typing "firefox" in the terminal works fine. I tried running Selenium through Xvfb, but it hangs at the same place (Xvfb verified working generally with "firefox &" and taking a screenshot).

The below is the terminal input and output (anonymized):

[user@redhat selenium-test]$ java -jar selenium-server-standalone.jar -trustAllSSLCertificates -htmlSuite "*firefox" https://BASEURL.com/ suite_FILE.html tmp_results-FILE.html -firefoxProfileTemplate "/home/user/.mozilla/firefox/wwjnyifu.Selenium"
Jun 25, 2013 2:51:41 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
14:51:41.817 INFO - Java: Sun Microsystems Inc. 20.12-b01
14:51:41.818 INFO - OS: Linux 2.6.32-279.el6.x86_64 amd64
14:51:41.836 INFO - v2.33.0, with Core v2.33.0. Built from revision 4e90c97
14:51:41.981 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
14:51:41.982 INFO - Version Jetty/5.1.x
14:51:41.983 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
14:51:41.983 INFO - Started HttpContext[/selenium-server,/selenium-server]
14:51:41.984 INFO - Started HttpContext[/,/]
14:51:52.538 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@c0b76fa
14:51:52.538 INFO - Started HttpContext[/wd,/wd]
14:51:52.546 INFO - Started SocketListener on 0.0.0.0:4444
14:51:52.546 INFO - Started org.openqa.jetty.jetty.Server@b34bed0
jar:file:/home/user/selenium-test/selenium-server-standalone.jar!/customProfileDirCUSTFFCHROME
14:51:52.791 INFO - Preparing Firefox profile...
14:51:53.343 INFO - Launching Firefox...
^C15:03:18.657 INFO - Shutting down...

I gave it almost 10 minutes before pressing CTRL+C.

With debugging, not much more to go on:

08:40:37.183 INFO [10] org.openqa.grid.selenium.GridLauncher - Launching a standalone server
08:40:37.243 INFO [10] org.openqa.selenium.server.SeleniumServer - Writing debug logs to selenium.log
08:40:37.243 INFO [10] org.openqa.selenium.server.SeleniumServer - Java: Sun Microsystems Inc. 20.12-b01
08:40:37.243 INFO [10] org.openqa.selenium.server.SeleniumServer - OS: Linux 2.6.32-279.el6.x86_64 amd64
08:40:37.259 INFO [10] org.openqa.selenium.server.SeleniumServer - v2.33.0, with Core v2.33.0. Built from revision 4e90c97
08:40:37.420 INFO [10] org.openqa.selenium.server.SeleniumServer - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
08:40:37.421 INFO [10] org.openqa.jetty.http.HttpServer - Version Jetty/5.1.x
08:40:37.422 INFO [10] org.openqa.jetty.util.Container - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
08:40:37.423 INFO [10] org.openqa.jetty.util.Container - Started HttpContext[/selenium-server,/selenium-server]
08:40:37.423 INFO [10] org.openqa.jetty.util.Container - Started HttpContext[/,/]
08:40:37.439 INFO [10] org.openqa.jetty.util.Container - Started org.openqa.jetty.jetty.servlet.ServletHandler@851052d
08:40:37.439 INFO [10] org.openqa.jetty.util.Container - Started HttpContext[/wd,/wd]
08:40:37.444 INFO [10] org.openqa.jetty.http.SocketListener - Started SocketListener on 0.0.0.0:4444
08:40:37.445 INFO [10] org.openqa.jetty.util.Container - Started org.openqa.jetty.jetty.Server@252f0999
08:40:37.737 INFO [10] org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher - Preparing Firefox profile...
08:40:38.289 INFO [10] org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher - Launching Firefox...
08:42:56.271 INFO [10] org.openqa.grid.selenium.GridLauncher - Launching a standalone server
08:42:56.335 INFO [10] org.openqa.selenium.server.SeleniumServer - Writing debug logs to selenium.log
08:42:56.336 INFO [10] org.openqa.selenium.server.SeleniumServer - Java: Sun Microsystems Inc. 20.12-b01
08:42:56.336 INFO [10] org.openqa.selenium.server.SeleniumServer - OS: Linux 2.6.32-279.el6.x86_64 amd64
08:42:56.356 INFO [10] org.openqa.selenium.server.SeleniumServer - v2.33.0, with Core v2.33.0. Built from revision 4e90c97
08:42:56.357 INFO [10] org.openqa.selenium.server.SeleniumServer - Selenium server running in debug mode.
08:42:56.376 DEBUG [10] org.openqa.jetty.util.Container - add component: [email protected]:4444
08:42:56.397 DEBUG [10] org.openqa.jetty.util.Container - add component: org.openqa.jetty.http.ResourceCache@39617189
08:42:56.401 DEBUG [10] org.openqa.jetty.util.Container - add component: org.openqa.selenium.server.ProxyHandler in HttpContext[/,/]
08:42:56.401 DEBUG [10] org.openqa.jetty.util.Container - add component: HttpContext[/,/]
08:42:56.402 DEBUG [10] org.openqa.jetty.http.HttpServer - Added HttpContext[/,/] for host *
08:42:56.403 DEBUG [10] org.openqa.jetty.util.Container - add component: org.openqa.jetty.http.ResourceCache@2d20cc56
08:42:56.404 DEBUG [10] org.openqa.jetty.http.HttpContext - added SC{BASIC,null,user,CONFIDENTIAL} at /org/openqa/selenium/tests/html/basicAuth/*
08:42:56.412 DEBUG [10] org.openqa.jetty.util.Container - add component: org.openqa.jetty.http.handler.SecurityHandler in HttpContext[/selenium-server,/selenium-server]
08:42:56.415 DEBUG [10] org.openqa.jetty.util.Container - add component: org.openqa.selenium.server.StaticContentHandler in HttpContext[/selenium-server,/selenium-server]
08:42:56.416 DEBUG [10] org.openqa.jetty.util.Container - add component: org.openqa.selenium.server.SessionExtensionJsHandler in HttpContext[/selenium-server,/selenium-server]
08:42:56.416 DEBUG [10] org.openqa.jetty.util.Container - add component: org.openqa.selenium.server.htmlrunner.SingleTestSuiteResourceHandler in HttpContext[/selenium-server,/selenium-server]
08:42:56.417 DEBUG [10] org.openqa.jetty.util.Container - add component: org.openqa.selenium.server.htmlrunner.SeleniumHTMLRunnerResultsHandler@56406199
08:42:56.417 DEBUG [10] org.openqa.jetty.util.Container - add component: HttpContext[/selenium-server,/selenium-server]
08:42:56.418 DEBUG [10] org.openqa.jetty.http.HttpServer - Added HttpContext[/selenium-server,/selenium-server] for host *
08:42:56.471 DEBUG [10] org.openqa.jetty.util.Container - add component: org.openqa.jetty.http.ResourceCache@1d10c424
08:42:56.487 DEBUG [10] org.openqa.jetty.util.Container - add component: org.openqa.selenium.server.SeleniumDriverResourceHandler in HttpContext[/selenium-server,/selenium-server]
08:42:56.488 DEBUG [10] org.openqa.jetty.util.Container - add component: HttpContext[/selenium-server/driver,/selenium-server/driver]
08:42:56.488 DEBUG [10] org.openqa.jetty.http.HttpServer - Added HttpContext[/selenium-server/driver,/selenium-server/driver] for host *
08:42:56.488 DEBUG [10] org.openqa.jetty.util.Container - add component: org.openqa.jetty.http.ResourceCache@5b40c281
08:42:56.501 DEBUG [10] org.openqa.jetty.util.Container - add component: WebDriver remote server
08:42:56.506 DEBUG [10] org.openqa.jetty.util.Container - add component: org.openqa.jetty.jetty.servlet.HashSessionManager@7df17e77
08:42:56.506 DEBUG [10] org.openqa.jetty.util.Container - add component: org.openqa.jetty.jetty.servlet.ServletHandler@79a5f739
08:42:56.507 INFO [10] org.openqa.selenium.server.SeleniumServer - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
08:42:56.507 DEBUG [10] org.openqa.jetty.util.Container - add component: HttpContext[/wd,/wd]
08:42:56.508 DEBUG [10] org.openqa.jetty.http.HttpServer - Added HttpContext[/wd,/wd] for host *
08:42:56.508 DEBUG [10] org.openqa.jetty.util.Container - Starting org.openqa.jetty.jetty.Server@252f0999
08:42:56.509 INFO [10] org.openqa.jetty.http.HttpServer - Version Jetty/5.1.x
08:42:56.509 DEBUG [10] org.openqa.jetty.http.HttpServer - LISTENERS: [[email protected]:4444]
08:42:56.509 DEBUG [10] org.openqa.jetty.http.HttpServer - HANDLER: {null={/selenium-server/driver/*=[HttpContext[/selenium-server/driver,/selenium-server/driver]], /selenium-server/*=[HttpContext[/selenium-server,/selenium-server]], /=[HttpContext[/,/]], /wd/*=[HttpContext[/wd,/wd]]}}
08:42:56.510 DEBUG [10] org.openqa.jetty.util.Container - Starting HttpContext[/selenium-server/driver,/selenium-server/driver]
08:42:56.510 DEBUG [10] org.openqa.jetty.http.HttpContext - Init classloader from null, sun.misc.Launcher$AppClassLoader@4aad3ba4 for HttpContext[/selenium-server/driver,/selenium-server/driver]
08:42:56.510 INFO [10] org.openqa.jetty.util.Container - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
08:42:56.510 DEBUG [10] org.openqa.jetty.util.Container - Starting HttpContext[/selenium-server,/selenium-server]
08:42:56.510 DEBUG [10] org.openqa.jetty.http.HttpContext - Init classloader from null, sun.misc.Launcher$AppClassLoader@4aad3ba4 for HttpContext[/selenium-server,/selenium-server]
08:42:56.511 DEBUG [10] org.openqa.jetty.http.handler.AbstractHttpHandler - Started org.openqa.jetty.http.handler.SecurityHandler in HttpContext[/selenium-server,/selenium-server]
08:42:56.511 DEBUG [10] org.openqa.jetty.http.handler.AbstractHttpHandler - Started org.openqa.selenium.server.StaticContentHandler in HttpContext[/selenium-server,/selenium-server]
08:42:56.511 DEBUG [10] org.openqa.jetty.http.handler.AbstractHttpHandler - Started org.openqa.selenium.server.SessionExtensionJsHandler in HttpContext[/selenium-server,/selenium-server]
08:42:56.511 DEBUG [10] org.openqa.jetty.http.handler.AbstractHttpHandler - Started org.openqa.selenium.server.htmlrunner.SingleTestSuiteResourceHandler in HttpContext[/selenium-server,/selenium-server]
08:42:56.512 DEBUG [10] org.openqa.jetty.http.handler.AbstractHttpHandler - Started org.openqa.selenium.server.SeleniumDriverResourceHandler in HttpContext[/selenium-server,/selenium-server]
08:42:56.512 INFO [10] org.openqa.jetty.util.Container - Started HttpContext[/selenium-server,/selenium-server]
08:42:56.520 DEBUG [10] org.openqa.jetty.util.Container - Starting HttpContext[/,/]
08:42:56.520 DEBUG [10] org.openqa.jetty.http.HttpContext - Init classloader from null, sun.misc.Launcher$AppClassLoader@4aad3ba4 for HttpContext[/,/]
08:42:56.520 DEBUG [10] org.openqa.jetty.http.handler.AbstractHttpHandler - Started org.openqa.selenium.server.ProxyHandler in HttpContext[/,/]
08:42:56.521 INFO [10] org.openqa.jetty.util.Container - Started HttpContext[/,/]
08:42:56.521 DEBUG [10] org.openqa.jetty.util.Container - Starting HttpContext[/wd,/wd]
08:42:56.521 DEBUG [10] org.openqa.jetty.http.HttpContext - Init classloader from null, sun.misc.Launcher$AppClassLoader@4aad3ba4 for HttpContext[/wd,/wd]
08:42:56.521 DEBUG [10] org.openqa.jetty.util.Container - Starting org.openqa.jetty.jetty.servlet.ServletHandler@79a5f739
08:42:56.521 DEBUG [10] org.openqa.jetty.jetty.servlet.AbstractSessionManager - New random session seed
08:43:07.962 DEBUG [10] org.openqa.jetty.jetty.servlet.Holder - Started holder of class org.openqa.selenium.remote.server.DriverServlet
08:43:07.962 DEBUG [11] org.openqa.jetty.jetty.servlet.AbstractSessionManager - Session scavenger period = 30s
08:43:07.962 INFO [10] org.openqa.jetty.util.Container - Started org.openqa.jetty.jetty.servlet.ServletHandler@79a5f739
08:43:07.962 INFO [10] org.openqa.jetty.util.Container - Started HttpContext[/wd,/wd]
08:43:07.970 INFO [10] org.openqa.jetty.http.SocketListener - Started SocketListener on 0.0.0.0:4444
08:43:07.970 INFO [10] org.openqa.jetty.util.Container - Started org.openqa.jetty.jetty.Server@252f0999
08:43:07.983 DEBUG [10] org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory - Requested browser string '*firefox' matches *firefox 
08:43:07.984 DEBUG [10] org.openqa.selenium.browserlaunchers.locators.CombinedFirefoxLocator - Discovering Firefox 2...
08:43:07.990 DEBUG [10] org.openqa.selenium.browserlaunchers.locators.BrowserLocator - Discovering Firefox 2...
08:43:07.990 DEBUG [10] org.openqa.selenium.browserlaunchers.locators.BrowserLocator - Checking whether Firefox 2 launcher at :'/Applications/Minefield.app/Contents/MacOS/firefox-bin' is valid...
08:43:07.990 DEBUG [10] org.openqa.selenium.browserlaunchers.locators.BrowserLocator - Checking whether Firefox 2 launcher at :'/Applications/Firefox-2.app/Contents/MacOS/firefox-bin' is valid...
08:43:07.990 DEBUG [10] org.openqa.selenium.browserlaunchers.locators.BrowserLocator - Checking whether Firefox 2 launcher at :'/Applications/Firefox.app/Contents/MacOS/firefox-bin' is valid...
08:43:07.990 DEBUG [10] org.openqa.selenium.browserlaunchers.locators.BrowserLocator - Checking whether Firefox 2 launcher at :'/usr/lib/firefox/firefox-bin' is valid...
08:43:08.008 DEBUG [10] org.openqa.selenium.browserlaunchers.locators.BrowserLocator - Checking whether Firefox 2 launcher at :'/usr/bin/firefox-bin' is valid...
08:43:08.010 DEBUG [10] org.openqa.selenium.browserlaunchers.locators.BrowserLocator - Discovered valid Firefox 2 launcher  : '/usr/bin/firefox-bin'
08:43:08.351 DEBUG [10] org.openqa.selenium.server.browserlaunchers.ResourceExtractor - Extracting /customProfileDirCUSTFFCHROME to /tmp/customProfileDir987977
08:43:08.432 INFO [10] org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher - Preparing Firefox profile...
08:43:08.984 INFO [10] org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher - Launching Firefox...
08:43:09.988 INFO [12] org.openqa.selenium.server.SeleniumServer - Shutting down...

Any ideas on where to start looking, or any fixes?

like image 309
Svedman Avatar asked Oct 04 '22 17:10

Svedman


2 Answers

Finally found out the problem.

Firefox started successfully when I expanded the "*firefox" argument to include the absolute path to Firefox (the symlink obviously didn't work).

like image 90
Svedman Avatar answered Oct 12 '22 07:10

Svedman


In selenium 2.0 the full path is not allowed. It says:

Supported browsers include:
*firefox
*mock
...
*custom
like image 32
Balazs Nemeth Avatar answered Oct 12 '22 09:10

Balazs Nemeth