2010-11-18 20 views
7

저는 PHP로 Selenium RC를 실행하고 있습니다. 나는이 성공적으로 완료 간단한 로그인 테스트를 실행할 수 있지만 그냥 브라우저를 닫기 전에, 나는 다음과 같은 오류 얻을 :Selenium + PHPUnit : sessionId가 null이 아니어야합니다. 이 세션이 아직 시작되지 않았나요?

23:50:09.969 INFO - Command request: testComplete[, ] on session d7a1effeabc24b0b9b46ad6fdb3eebec 23:50:09.969 INFO - Killing Google Chrome... 23:50:10.286 INFO - Got result: OK on session d7a1effeabc24b0b9b46ad6fdb3eebec 23:50:10.349 INFO - Command request: getLocation[, ] on session null 23:50:10.351 ERROR - Exception running 'getLocation 'command on session null java.lang.NullPointerException: sessionId should not be null; has this session been started yet? at org.openqa.selenium.server.FrameGroupCommandQueueSet.getQueueSet(FrameGroupCommandQueueSet.java:216) at org.openqa.selenium.server.commands.SeleniumCoreCommand.execute(SeleniumCoreCommand.java:34) at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:562) at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:370) at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:129) 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:245) at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357) at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534) 23:50:10.364 INFO - Got result: ERROR Server Exception: sessionId should not be null; has this session been started yet? on session null

나는 해결책을 찾을 수 ... 이 도와주세요.

+0

보인다. 아마도 getLocation() 호출이 testComplete() 전에 있는지 확인해야합니다. – yonran

+1

감사. tearDown에 stop()을 추가하면 실패하게됩니다. – Shimix

+0

@yonran - 답으로 써야합니다. @ 시믹스, 당신은 그의 대답을 받아 들여야합니다. –

답변

0

tearDown() 내에서 stop() 호출 문제가 발생했습니다. 제거하면 문제가 해결되었습니다. setUp()에이 라인을 추가

0

는 도움 : Google 크롬 바로의 getLocation() 이전에 사망처럼

$this->start(); 
sleep(1);