提问人:Shimix 提问时间:11/19/2010 最后编辑:Koen MeijerShimix 更新时间:12/19/2017 访问量:2699
Selenium + PHPUnit:sessionId 不应为 null;这个会话已经开始了吗?
Selenium + PHPUnit: sessionId should not be null; has this session been started yet?
问:
我正在用PHP运行Selenium RC。 我运行了一个简单的登录测试,该测试成功完成,但在关闭浏览器之前,我收到以下错误:
23:50:09.969 INFO - 命令请求:会话上的 testComplete[, ] d7a1effeabc24b0b9b46ad6fdb3eebec 23:50:09.969 INFO - 杀死谷歌 铬。。。23:50:10.286 信息 - 得到结果:会话正常 d7a1effeabc24b0b9b46ad6fdb3eebec 23:50:10.349 INFO - 命令请求: getLocation[, ] 在会话 null 23:50:10.351 上出错 - 运行异常 会话 null java.lang.NullPointerException 上的 'getLocation' 命令: sessionId 不应为 null;这个会话已经开始了吗? 在 org.openqa.selenium.server.FrameGroupCommandQueueSet.getQueueSet(FrameGroupCommandQueueSet.java:216) 在 org.openqa.selenium.server.commands.SeleniumCoreCommand.execute(SeleniumCoreCommand.java:34) 在 org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:562) 在 org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:370) 在 org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:129) 在org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1530) 在org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1482) 在org.openqa.jetty.http.HttpServer.service(HttpServer.java:909) 在org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820) 在org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986) 在org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837) 在 org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:245) 在 org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357) 在 org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534) 23:50:10.364 INFO - 得到的结果:错误服务器异常:sessionId 不应为 null;这个会话已经开始了吗?在会话上 null
我找不到解决方案... 请帮忙。
答:
问题出在 .删除它解决了问题。stop()
tearDown()
在帮助中添加以下行:setUp()
$this->start();
sleep(1);
评论