开发者

Having trouble launching Google Chrome through Selenium RC server on Ubuntu

开发者 https://www.devze.com 2023-03-05 01:23 出处:网络
I\'m running Selenium RC server 2.0b3 on Ubuntu 11.04.I installed Google Chrome and am trying to run some tests against it.I\'m able to run tests against Firefox just fine.However, when I run my test

I'm running Selenium RC server 2.0b3 on Ubuntu 11.04. I installed Google Chrome and am trying to run some tests against it. I'm able to run tests against Firefox just fine. However, when I run my test against the Selenium server, it just hangs and then times out. This is all the server log reports (notice the null session):

16:14:16.810 INFO - Command request: getNewBrowserSession[*googlechrome, http://mydomain.com, ] on session null
16:14:16.810 INFO - creating new remote session
16:14:16.811 INFO - Allocated session 6913c9613c554db798e109eadefd43da for http://mydomain.com, launching...
16:14:16.811 INFO - Launching Google Chrome...
16:19:44.776 ERROR - Failed to start new browser session, shutdown browser and clear all session data
org.openqa.selenium.server.RemoteCommandException: timed out waiting for window 'null' to appear
    at org.openqa.selenium.server.FrameGroupCommandQueueSet.waitForLoad(FrameGroupCommandQueueSet.java:564)
    at org.openqa.selenium.server.FrameGroupCommandQueueSet.waitForLoad(FrameGroupCommandQueueSet.java:521)
    at org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession(BrowserSessionFactory.java:374)
    at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:125)
    at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:87)
    at org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(SeleniumDriverResourceHandler.java:785)
    at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:422)
    at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:393)
    at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:146)
    at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1530)
    at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1482)
    at org.openqa.jetty.http.HttpServer.service(HttpServer.java:909)
    at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
    at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
    at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
    at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
    at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)
    at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
16:19:44.777 INFO - Killing Google Chrome...
16:19:44.777 INFO - Got result: Failed to start new browser session: Error while launching browser on session null

I am starting Selenium as a service on system startup, like so ...

start() {
    log_daemon_msg "Starting selenium-server server: "
    /usr/bin/Xvfb :15 -ac -screen 0 1024x768x8 &
    export DISPLAY=localhost:15.0
    su selenium -c 'java -jar /opt/selenium/selenium-server-standalone-2.0b3.jar -userExtensions /opt/selenium/user-extensions.js > /var/log/se_rc_server.log 2>&1 &'
    PID=$!
    ### Create the lock file ###
    echo $PID > /var/run/selenium-server.pid
    echo

Any ideas how I can eliminate the Googl开发者_StackOverflowe Chrome null sessions and get my tests to run? Thanks, - Dave


You're running into Chrome's security restrictions. You need to set the "mode" value to "disableSecurity" in your BrowserConfigurationOptions to disable them.

0

精彩评论

暂无评论...
验证码 换一张
取 消