Selenium RC throws SessionId不应为空,assertTextPresent异常,仅phpunit 3.4错误?

Selenium RC throws SessionId不应为空,assertTextPresent异常,仅phpunit 3.4错误?,selenium,phpunit,selenium-rc,Selenium,Phpunit,Selenium Rc,我希望将selenium RC测试从PHPUnit 3.3.2迁移到使用PHPUnit 3.4.12 当我使用assertTextPresent()时,selenium测试将失败,但以下情况除外: 例如: public function testSending($browser) { ... $browser->click("send"); $browser->waitForPageToLoad("30000"); $browser->assertTex

我希望将selenium RC测试从PHPUnit 3.3.2迁移到使用PHPUnit 3.4.12

当我使用
assertTextPresent()
时,selenium测试将失败,但以下情况除外:

例如:

public function testSending($browser)
{
   ...
   $browser->click("send");
   $browser->waitForPageToLoad("30000");
   $browser->assertTextPresent("text");                
}
以下是selenium RC日志(在Windows上运行):

正如您所看到的,测试应该按照“Killing Firefox”位的指示完成,但是它继续执行其他操作,并触发了导致异常的getLocation[,]命令

我在PHPUnit 3.3.2上尝试了相同的测试,但没有产生这个问题-如果没有
getLocation()
,测试将很高兴地结束


有什么想法吗?

实际上问题在于
setAutoStop()
方法-默认情况下,它设置为TRUE,因此PHPUnit在
拆卸()之前向Selenium RC发送停止信号


添加
$this->setAutoStop(false)
到您的
setUp()
方法和
$this->stop()
拆卸()的末尾

在PHPUnit 3.3.2中是否通过了完全相同的测试?在Selenium会话停止后,您的眼泪中似乎有什么东西。有定制的听众吗?嗨,戴夫,谢谢你的评论。我的分解中有以下内容:受保护的函数tearDown(){if($this->autoStop){try{$this->stop();}catch(RuntimeException$e){}
public function testSending($browser)
{
   ...
   $browser->click("send");
   $browser->waitForPageToLoad("30000");
   $browser->assertTextPresent("text");                
}
15:40:19.676 INFO - Command request: isTextPresent[text, ] on session 153d03a123c42098711994f43c2db34
15:40:19.691 INFO - Got result: OK,false on session 153d023a123c42098711994f43cdb34
15:40:19.879 INFO - Command request: testComplete[, ] on session 153d023a123c4298711994f43c2db34
15:40:19.879 INFO - Killing Firefox...
15:40:20.269 INFO - Got result: OK on session 153d023a123c42098711994f43c2db34
15:40:20.472 INFO - Command request: getLocation[, ] on session null
15:40:20.472 ERROR - Exception running 'getLocation 'command on session null
java.lang.NullPointerException: sessionId should not be null; has this session been started yet?