【问题标题】:PHPUnit_Framework_Exception: Could not connect to the Selenium RC server when I run with HudsonPHPUnit_Framework_Exception:当我使用 Hudson 运行时,无法连接到 Selenium RC 服务器
【发布时间】:2010-10-02 17:03:28
【问题描述】:

我已经设置了 Hudson CI 服务器并使用 Selenium 运行 PHPUnit 测试(非常感谢 this post!)。 现在我在本地主机上运行 Hudson 服务器和 Selenium 服务器。 我将 Hudson 设置为端口 8080(默认)和 Selenium -port 1234,否则会发生冲突。

但是,每次我运行 Selenium 测试时,都会收到以下错误:

PHPUnit_Framework_Exception:无法连接到 Selenium RC 服务器。

/Users/***/.hudson/jobs/Selenium/workspace/sampleTest.php:28 /usr/lib/php/phing.php:37

第 28 行是一个断言: $this->assertElementContainsText($html, "this is sample test");

这是我的 Selenium 设置函数:

函数 setUp() {
$this->setBrowser("*firefox");
$this->setHost("localhost");
$this->setPort(1234);
$this->setBrowserUrl("example.com");
$this->setTimeout(100000); }

我怎样才能避免这个错误信息? 非常感谢您的建议。

谢谢大家,

【问题讨论】:

    标签: php selenium continuous-integration hudson phpunit


    【解决方案1】:

    你在测试 ajax 吗?如果是这样,您需要使用waitForElement() 删除您的waitForPageToload() 函数。我使用 selenium IDE 为我生成代码。

    【讨论】:

      猜你喜欢
      • 2012-01-24
      • 1970-01-01
      • 1970-01-01
      • 2012-03-25
      • 1970-01-01
      • 1970-01-01
      • 2016-12-16
      • 2014-08-10
      • 2023-04-09
      相关资源
      最近更新 更多