2010-11-18 14 views
7

Sto eseguendo Selenium RC con PHP. ho eseguito un semplice test di accesso, che completa con successo, ma poco prima di chiudere il browser, ricevo il seguente errore:Selenium + PHPUnit: sessionId non dovrebbe essere nullo; questa sessione è già stata avviata?

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

non riesco a trovare una soluzione ... prega di aiuto.

+0

Sembra che tu abbia ucciso Google Chrome a destra prima getLocation(). Forse assicurati che la chiamata a getLocation() sia prima di testComplete(). – yonran

+1

Grazie. Sembra che l'aggiunta di stop() in tearDown faccia fallire. – Shimix

+0

@yonran - Dovresti metterlo come risposta. @Shimix, dovresti accettare la sua risposta. –

risposta

0

Il problema era la chiamata stop() all'interno di tearDown(). Rimuovendo risolto il problema.

0

L'aggiunta di queste righe nel setUp() aiutato:

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