phpunit-selenium
phpunit-selenium copied to clipboard
Throw error on "The Selenium Server is not active on host localhost at port 4444."
I read through some of the old issues and found that people wanted it to NOT throw an error if selenium wasn't running.... however, this isn't great if there's something wrong with selenium (as sometimes happens) and it fails to connect during functional tests.
I would like an option to throw an error if selenium isn't running. Or if someone knows how to override the default (turning those tests into skipped tests), that'd be great!
Thanks!
+1
This could be a bootstrap configuration like the existing:
PHPUnit_Extensions_Selenium2TestCase::shareSession(true);
such as
PHPUnit_Extensions_Selenium2TestCase::errorOnServerUnavailable(true);
and should raise PHPUnit_Framework_Error
exceptions to fill the test results with E
.
I would accept a PR.
dont know if this error is related to this issue or not
fsockopen(): unable to connect to localhost:44444 (Connection refused) in /usr/share/php5/PEAR/PHPUnit/Extensions/SeleniumTestCase.php on line 738
please help !!
Where does the 44444
port number come from? Is it intentionally 44444
or confused with 4444
?
it is intentionally as per our own environment
Is there anything listening localhost:44444
? How did you check it?
netstat -a | egrep 44444
gives me following
tcp 0 0 server.company.co:44444 localhost:38278 ESTABLISHED
netstat -nlp | grep 44444
?
tcp 0 0 :::44444 :::* LISTEN
telnet localhost 44444
?
user@server:~> telnet localhost 44444
Trying ::1...
Connected to localhost.
And phpunit-selenium
connects to it from the same machine?
yes
pear list -a
PHPUnit 4.0.14 stable
PHPUnit_Selenium 1.2.7 stable
Did it ever work? I don't see how that error can be possible in your case
good question !!! i dont know it ever worked or not as i am the new guy doing this as last person left and i have no idea why it is not working have checked everything possibly could go wrong !!
Next my step to debug it would be to create a tiny php script that would connect to that port using fsockopen
as well and see if it succeeds.
ahh ok i didn't tried that thanks will check !!
hey now getting different error:
Invalid response while accessing the Selenium Server at 'http://localhost:44444/selenium-server/driver/': Timed out after 30000ms
What has changed in the setup?
Now it looks like there are no browsers configured in selenium (on first glance)
by changing PHPUnit/Extensions/SeleniumTestCase.php. The lines:
throw new PHPUnit_Framework_Error($buffer, $e->getCode(), $e->getFile(), $e->getLine(), $e->getTrace());
to
throw new PHPUnit_Framework_Error($buffer, $e->getCode(), $e->getFile(), $e->getLine(), $e);
I don't believe this would make such a change
yeah right but that is what i changed !!