Selenium在“启动Firefox ......”时失速,没有任何错误或例外

时间:2013-06-25 13:30:57

标签: firefox selenium redhat

尝试在我们的RedHat盒子上远程运行Selenium,只需停留在“启动Firefox ...”而不会出现任何错误消息。

我有/ usr / bin / firefox的符号链接到/ usr / lib64 / firefox / firefox。 RedHat机器安装了Firefox ESR 17.0.6。

我正在使用Xming并通过在终端中键入“firefox”来运行Firefox工作正常。我尝试通过Xvfb运行Selenium,但它挂在同一个地方(Xvfb验证通常使用“firefox&”并截取屏幕截图)。

以下是终端输入和输出(匿名):

[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...

我在按CTRL + C前差不多10分钟。

通过调试,还有更多工作要做:

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: SocketListener0@0.0.0.0: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: [SocketListener0@0.0.0.0: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...

有关从哪里开始查看或修改的任何想法?

2 个答案:

答案 0 :(得分:2)

终于找到了问题。

当我扩展“* firefox”参数以包含Firefox的绝对路径(符号链接显然不起作用)时,Firefox成功启动。

答案 1 :(得分:2)

在selenium 2.0中,不允许使用完整路径。 它说:

Supported browsers include:
*firefox
*mock
...
*custom