session - Selenium + PHPUnit : sessionId should not be null; has this session been started yet?

标签 session selenium-webdriver null phpunit testcomplete

我正在使用 PHP 运行 Selenium RC。 我运行了一个简单的登录测试,成功完成,但在关闭浏览器之前,出现以下错误:

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

我找不到解决办法... 请帮忙。

最佳答案

问题出在 tearDown() 中的 stop() 调用。删除它解决了问题。

关于session - Selenium + PHPUnit : sessionId should not be null; has this session been started yet?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4220085/

相关文章:

javascript - 从 firefox 扩展范围访问 localStorage

apache-spark - Spark 数据帧空值计数

PHP 表单数据到 MYSQL 数据库 NOT NULL 规则

php - Safari 6 ajax 请求获取新的 session ID

PHP:根据上一页点击的链接动态加载内容?

PHP session 变量在表单操作中使用 PHP_SELF 进行 header 重定向时丢失

java - Selenium WebDriver 中的 URL Malformed 异常使用 Java 查找断开的链接

python - Selenium:从日历中选择日期

ios - iTunesConnect 返回 'nil' 作为 SKProduct 的本地化标题

node.js - NodeJS + ExpressJS + RedisStore session 未定义