PHPUnit_Framework_Exception: Could not connect to the Selenium RC server when I run with Hudson

自闭症网瘾萝莉.ら 提交于 2019-12-13 03:58:29

问题


I have set up Hudson CI Server and running PHPUnit test with Selenium (big thanks to this post!). Now I am running Hudson server and Selenium server on my localhost. I set up Hudson as port 8080 (default) and Selenium -port 1234 as it conflicts otherwise.

However, every time I run Selenium test, I get a following error:

PHPUnit_Framework_Exception: Could not connect to the Selenium RC server.

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

where line 28 is an assertion: $this->assertElementContainsText($html, "this is sample test");

and here is my Selenium setup function:

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

how can I avoid this error message? your suggestions are greatly appreciated.

thanks all,


回答1:


Are you testing ajax? If so, you need to remove your waitForPageToload() functions with a waitForElement(). I used selenium IDE to generate the code for me.



来源:https://stackoverflow.com/questions/3846691/phpunit-framework-exception-could-not-connect-to-the-selenium-rc-server-when-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!