I am looking to port my RC selenium tests to using PHPUnit 3.4.12 from PHPUnit 3.3.2.
The selenium test will fail with the exception of the following when I use assertTextPresent() :
PHPUnit_Framework_Exception: Response from Selenium RC server for getLocation(). ERROR Server Exception: sessionId should not be null; has this session been started yet?.
For instance:
public function testSending($browser) { ... $browser->click("send"); $browser->waitForPageToLoad("30000"); $browser->assertTextPresent("text"); }
Below is the RC Selenium log (runs on Windows):
15:40:19.676 INFO - Command request: isTextPresent[text, ] on session 153d03a123c42098711994f43c2db34 15:40:19.691 INFO - Got result: OK,false on session 153d023a123c42098711994f43cdb34 15:40:19.879 INFO - Command request: testComplete[, ] on session 153d023a123c4298711994f43c2db34 15:40:19.879 INFO - Killing Firefox... 15:40:20.269 INFO - Got result: OK on session 153d023a123c42098711994f43c2db34 15:40:20.472 INFO - Command request: getLocation[, ] on session null 15:40:20.472 ERROR - Exception running 'getLocation 'command on session null java.lang.NullPointerException: sessionId should not be null; has this session been started yet?
As you can see, the test should be completed as indicated in the "Killing Firefox" cue ball, but instead continued to do something else and ran the getLocation [,] command, which caused an exception.
I tried the same test with PHPUnit 3.3.2, which did not cause this problem - the test will happily end without getLocation() .
Any ideas?
source share