gpt4 book ai didi

php - 执行脚本一段时间后出现 "Could not connect to the Selenium RC server"

转载 作者:行者123 更新时间:2023-12-03 01:52:42 25 4
gpt4 key购买 nike

我的测试类中有一个测试用例,并且存在一些问题。我从控制台运行脚本。 脚本执行到某个点,然后测试失败并出现错误:

Could not connect to the Selenium RC server.

这是来自控制台的日志:

PHPUnit 3.5.15 by Sebastian Bergmann.ETime: 01:56, Memory: 4.00MbThere was 1 error:1) someTest::testSomethingPHPUnit_Framework_Exception: Could not connect to the Selenium RC server./var/www/path.../someTest.php:105FAILURES!Tests: 1, Assertions: 0, Errors: 1.

我的测试脚本中的第 105 行:

$this->clickAndWait("//a[text()='Next']");

这是 Selenium 日志:

14:00:40.983 INFO - Command request: click[//a[text()='Next'], ] on session 4222e17607254f41a6a52e13d0fd7cc514:00:41.205 INFO - Got result: OK on session 4222e17607254f41a6a52e13d0fd7cc514:00:41.207 INFO - Command request: waitForPageToLoad[600000000, ] on session 4222e17607254f41a6a52e13d0fd7cc514:02:11.328 INFO - Command request: testComplete[, ] on session 4222e17607254f41a6a52e13d0fd7cc514:02:11.328 INFO - Killing Firefox...14:02:11.506 INFO - Got result: ERROR: Got a null result on session 4222e17607254f41a6a52e13d0fd7cc514:02:11.508 INFO - Got result: OK on session

我尝试使用 Selenium Server Standalone 2.19.0,然后使用 2.20.0 - 相同的结果。

即使在测试中断后,服务器仍在运行。

我的问题是:为什么这个错误突然发生并意外中断了脚本?


PHPUnit 3.5.15
Selenium 服务器独立版 2.19.0 和 2.20.0
火狐浏览器 3.6.18
Ubuntu 10.04

最佳答案

尝试使用 $this->click("link=Next");这背后的原因是,当 selenium 尝试查找文本并且页面未完全加载或存在不明确的文本时,selenium 会抛出它并显示“无法连接到 Selenium RC 服务器”。文本的验证/断言有时会产生问题。

关于php - 执行脚本一段时间后出现 "Could not connect to the Selenium RC server",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9602826/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com