【发布时间】: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