Selenium RC - VPS

Hi

I am new to Yii and Selenium. I am working through "Agile Web Application Development . . . Jeffrey Winesett. I am getting the following errors.

Time: 1 second, Memory: 8.75Mb

There were 3 errors:

  1. SiteTest::testIndex

Issues while capturing the screenshot:

Invalid response while accessing the Selenium Server at ‘localhost:4444/selenium-server/driver/’: ERROR Server Exception: sessionId should not be null; has this session been started yet?

Invalid response while accessing the Selenium Server at ‘localhost:4444/selenium-server/driver/’: Failed to start new browser session: java.lang.RuntimeException: Firefox 3 could not be found in the path!

Please add the directory containing ‘‘firefox-bin’ or ‘firefox’’ to your PATH environment

variable, or explicitly specify a path to Firefox 3 like this:

*firefox3 /blah/blah/firefox-bin

  1. SiteTest::testContact

Issues while capturing the screenshot:

Invalid response while accessing the Selenium Server at ‘localhost:4444/selenium-server/driver/’: ERROR Server Exception: sessionId should not be null; has this session been started yet?

Invalid response while accessing the Selenium Server at ‘localhost:4444/selenium-server/driver/’: Failed to start new browser session: java.lang.RuntimeException: Firefox 3 could not be found in the path!

Please add the directory containing ‘‘firefox-bin’ or ‘firefox’’ to your PATH environment

variable, or explicitly specify a path to Firefox 3 like this:

*firefox3 /blah/blah/firefox-bin

  1. SiteTest::testLoginLogout

Issues while capturing the screenshot:

Invalid response while accessing the Selenium Server at ‘localhost:4444/selenium-server/driver/’: ERROR Server Exception: sessionId should not be null; has this session been started yet?

Invalid response while accessing the Selenium Server at ‘localhost:4444/selenium-server/driver/’: Failed to start new browser session: java.lang.RuntimeException: Firefox 3 could not be found in the path!

Please add the directory containing ‘‘firefox-bin’ or ‘firefox’’ to your PATH environment

variable, or explicitly specify a path to Firefox 3 like this:

*firefox3 /blah/blah/firefox-bin

FAILURES!

Tests: 3, Assertions: 0, Errors: 3.


I am using Servint VPS hosting, and I am running a Mac laptop. I think I understand the issue (No Firefox on VPS), but can not figure out how to get around this.

Any help would be most appreciated.

Thank you

Hi mdcruns,

Did you fix your issue ? I have the same error messages, running windows 7 on localhost.

I’m mostly concern with the first error message, about sessionId, did you have any hint ?

For the other error regarding firefox, just remove the following line in protected/tests/phpunit.xml




<browser name="Firefox" browser="*firefox" />



Thanks,

you can run FF via Xming

I solved the same problem, i’ve spent all day finding whats wrong, and finally got it…

my error was, i was trying to run phpunit and selenium in the server (centos) … wrong!!!

when i tried to run selenium in my mac and phpunit in the server, finally worked…

just tell the phpunit in the server where is your selenium running…

<browser name="Firefox" browser="*firefox" host="your_ip_address" port="4444" timeout="30000" />

when run :

phpunit functional/SiteTest.php

PHPUnit 3.6.12 by Sebastian Bergmann.

Configuration read from /var/www/html/hello/protected/tests/phpunit.xml

Time: 19 seconds, Memory: 7.00Mb

OK (3 tests, 10 assertions)

I am having this exact same problem, although I’m working on localhost (with PHPUnit and Selenium both).

I have properly set the host, browser, test base URL (etc) in phpunit.xml and WebTestCase.php, am running 2.28.0 (Built from revision 18309) downloaded today from Selenium HQ. I have even tried running start() and initializing a browser session in the setUp (in addition to other solutions I’ve seen around the internet that don’t involve Yii but only PHPUnit and Selenium) and that results in a ton of redundant browser windows opening up (all going to a location at localhost:4444).

I really need to be able to automate web tests. I’m working on a redistributable web application, so it needs to be tested in a diverse range of hosting environments and browsers, and thus automated testing is a must. Can anyone please advise?

From the output of PHPUnit:


RuntimeException: Invalid response while accessing the Selenium Server at 'http://127.0.0.1:4444/selenium-server/driver/': ERROR Server Exception: sessionId should not be null; has this session been started yet?

From the output of Selenium Server:


14:35:58.285 ERROR - Exception running 'getExpression 'command on session null

java.lang.NullPointerException: sessionId should not be null; has this session been started yet?

Edit: For the record, I finally got it working once I:

  1. Overrode setUp in the test case child class

  2. Included a call to setBrowserUrl

  3. Made a call to prepareTestSession right after the call to parent::setUp().