7

I'm running Selenium RC with PHP. I run a simple login test, that completes successfully, but just before closing the browser, I get the following error:

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

I can't find a solution... Please help.

Koen Meijer
  • 811
  • 11
  • 19
Shimix
  • 93
  • 2
  • 7
  • Looks like you killed Google Chrome right before getLocation(). Perhaps make sure the getLocation() call is before testComplete(). – yonran Nov 19 '10 at 07:30
  • 1
    Thanks. It seems that adding stop() in tearDown causes it to fail. – Shimix Nov 19 '10 at 08:39
  • @yonran - You should put that as an answer. @Shimix, you should accept his answer. – Austin Hyde Jun 15 '11 at 17:55
  • @casperOne For me the second comment here states that the issue is solved. At least I have no idea what do answer since op state that he could stop it from failing :/ – edorian Jan 03 '12 at 17:29

2 Answers2

0

The problem was the stop() call within tearDown(). Removing it fixed the problem.

cweiske
  • 30,033
  • 14
  • 133
  • 194
0

Adding these lines in the setUp() helped:

$this->start();
sleep(1);
Samson
  • 2,801
  • 7
  • 37
  • 55