【问题标题】:PHPUnit_Framework_Exception: Could not connect to the Selenium RC serverPHPUnit_Framework_Exception:无法连接到 Selenium RC 服务器
【发布时间】:2012-01-24 05:24:49
【问题描述】:

我使用 PHPUnit 和 Selenium Server 来测试 Yii 应用程序,但是每当我尝试它时总是给我这个错误。

这是我终端上的代码

GusDeCooL:tests budiarsana$ phpunit functional/SiteTest.php
PHPUnit 3.5.15 by Sebastian Bergmann.

EEE

Time: 04:31, Memory: 8.50Mb

There were 3 errors:

1) SiteTest::testIndex
PHPUnit_Framework_Exception: Could not connect to the Selenium RC server.

/Users/budiarsana/host/yii/1.1.8/test/CWebTestCase.php:61

2) SiteTest::testContact
PHPUnit_Framework_Exception: Could not connect to the Selenium RC server.

/Users/budiarsana/host/yii/1.1.8/test/CWebTestCase.php:61

3) SiteTest::testLoginLogout
PHPUnit_Framework_Exception: Could not connect to the Selenium RC server.

/Users/budiarsana/host/yii/1.1.8/test/CWebTestCase.php:61

FAILURES!
Tests: 3, Assertions: 0, Errors: 3.

怎么会这样?
硒打开了我的Firefox,但在我的Firefox上没有发生,我得到了那个错误。 我尝试使用 PHPUnit 仅使用 NetBeans IDE 测试一些代码,它工作正常(测试不使用 Selenium)

如果需要任何信息来说明我的问题,请告知。

工作站:
MAC OSX LION 10.7.2
PHP 版本 5.2.17
塞巴斯蒂安伯格曼的 PHPUnit 3.5.15。

【问题讨论】:

  • 你是否从命令行启动了 selenium 服务器?
  • 是的,我确实使用此代码 java -jar selenium-server.jar 从一开始就启动了 selenium 服务器。还是我需要添加sudo 命令?
  • 您使用的是什么版本的 selenium 服务器。尝试使用最新版本。
  • @GirishB 在我第一次使用 2.8 时,现在我将它更新到 GirishB 并且它的所有工作都可以@_@

标签: selenium terminal phpunit yii command-line-interface


【解决方案1】:

问题已解决,我更新了我的 Selenium 服务器并使其正常工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-16
    • 2012-03-25
    • 2010-11-13
    • 1970-01-01
    • 2014-08-20
    • 1970-01-01
    相关资源
    最近更新 更多