2010-11-18 5 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

を助けた:あなたは右のgetLocation(前にGoogle Chromeを殺したよう

$this->start(); 
sleep(1); 
関連する問題