2011-05-11 7 views
1

저는 우분투 11.04에서 Selenium RC 서버 2.0b3을 실행하고 있습니다. Google 크롬을 설치하고 이에 대한 몇 가지 테스트를 실행하려고합니다. 파이어 폭스에 대한 테스트를 잘 진행할 수 있습니다. 그러나 Selenium 서버에 대한 테스트를 실행하면 중단되고 시간이 초과됩니다. 나는 시스템 시작시 서비스로 셀레늄을 시작하고우분투에서 Selenium RC 서버를 통해 Chrome을 시작하는 데 문제가 있습니다.

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 

, ...과 같이하는

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 

어떤 아이디어를 내가 제거 할 수있는 방법을이 모든 서버 로그 보고서 (널 세션을 확인할 수)입니다 Google 크롬 세션을 종료하고 테스트를 실행 하시겠습니까? 감사합니다. - Dave

+0

테스트 코드를 공유 할 수 있습니까? 셀레늄 서버에 연결되는 것? –

+1

'/ usr/bin/google-chrome' 또는 다른 곳에서'google-chrome'을 사용합니까? –

답변

0

Chrome 보안 제한 사항을 실행하고 있습니다. BrowserConfigurationOptions에서 "mode"값을 "disableSecurity"로 설정하여 사용하지 않도록 설정해야합니다.

+0

어떻게 할 수 있습니까? "chromium-browser --disable-web-security"라는 내용으로 "/ usr/bin/google-chrome"파일을 만들려고했으나 작동하지 않습니다. – Dave

+0

어떤 언어를 사용하고 있는지 모르겠지만 Java에서는'set()'메서드를 호출합니다. 다음은 JavaDocs입니다 (사용하는 언어에 맞게 수정해야 함) : http://selenium.googlecode.com/svn/trunk/docs/api/java/com/thoughtworks/selenium/BrowserConfigurationOptions.html – nirvdrum

+0

당신은 무엇입니까? Google 크롬/Chromium을 '--disable-web-security'옵션과 함께 시작하는 것과 동등한가? HttpCommandProcessor 클래스를 사용하여 명령 (http://release.seleniumhq.org/selenium-remote-control/0.9.0/doc/java/com/thoughtworks/selenium/HttpCommandProcessor.html)을 보내고 있습니다. BrowserConfiguration에 대한 옵션이 포함되어 있으므로 동일한 작업을 수행 할 다른 방법을 찾고 있습니다. – Dave

관련 문제