我在测试类中有一个测试用例和一些问题.我从控制台运行脚本.脚本执行到某一点,然后测试失败,并显示错误:
Could not connect to the Selenium RC server.
这是从控制台的日志:
PHPUnit 3.5.15 by Sebastian Bergmann. E Time: 01:56,Memory: 4.00Mb There was 1 error: 1) someTest::testSomething PHPUnit_Framework_Exception: Could not connect to the Selenium RC server. /var/www/path.../someTest.PHP:105 FAILURES! Tests: 1,Assertions: 0,Errors: 1.
我的测试脚本中的第105行:
$this->clickAndWait("//a[text()='Next']");
这里是硒日志:
14:00:40.983 INFO - Command request: click[//a[text()='Next'],] on session 4222e17607254f41a6a52e13d0fd7cc5 14:00:41.205 INFO - Got result: OK on session 4222e17607254f41a6a52e13d0fd7cc5 14:00:41.207 INFO - Command request: waitForPageToLoad[600000000,] on session 4222e17607254f41a6a52e13d0fd7cc5 14:02:11.328 INFO - Command request: testComplete[,] on session 4222e17607254f41a6a52e13d0fd7cc5 14:02:11.328 INFO - Killing Firefox... 14:02:11.506 INFO - Got result: ERROR: Got a null result on session 4222e17607254f41a6a52e13d0fd7cc5 14:02:11.508 INFO - Got result: OK on session
我尝试使用Selenium Server Standalone 2.19.0,然后用2.20.0 – 相同的结果.
即使在测试中断后,服务器仍在运行.
我的问题是:
为什么这个错误突然发生并意外中断脚本?
PHPUnit 3.5.15
Selenium Server Standalone 2.19.0& 2.20.0
Firefox 3.6.18
Ubuntu 10.04