Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Could not connect to the Selenium RC server" after some time of executing script

I have got a test case in my test class and some problems with it. I run the script from console. The script is executed to a certain point and then the test fails with error:

Could not connect to the Selenium RC server.

Here is log from console:

PHPUnit 3.5.15 by Sebastian Bergmann.

E

Time: 01:56, Memory: 4.00Mb

There was 1 error:

1) someTest::testSomething
PHPUnit_Framework_Exception: Could not connect to the Selenium RC server.

/var/www/path.../someTest.php:105

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

Line 105 in my test script:

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

And here is Selenium log:

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

I tried with Selenium Server Standalone 2.19.0, then with 2.20.0 - the same result.

The server is still running, even after test interruption.

My question is: why this error occurs suddenly and unexpectedly interrupts the script?


PHPUnit 3.5.15
Selenium Server Standalone 2.19.0 & 2.20.0
Firefox 3.6.18
Ubuntu 10.04

like image 746
faramka Avatar asked Mar 07 '12 13:03

faramka


1 Answers

Try with $this->click("link=Next"); The reason behind this, When selenium try to find a text and the page is not fully loaded or there are ambiguous text then selenium throws it and shows like "Could not connect to the Selenium RC server". verification/assertion of text is making problem some times.

like image 86
Rajeev Roy Avatar answered Oct 24 '22 13:10

Rajeev Roy