Error in running functional test

This is the first time I try running functional test case with Selenium RC. I’m getting the following error, have no idea what is means… I’m following SiteTest.php example on blog tutorial.

PHPUnit_Framework_Exception: Result is neither “true” nor “false”: ‘OR Server Exception: sessionId led to start new browser session: java.lang.RuntimeException: SystemRoot apparently not set! doesn’t exist; perhaps this session was already stopped?’

(note: I’ve tested Selenium RC settings by following simple example from PHPUnit site and it worked fine. I think my yii settings for the test is not correct but don’t know where to look.)

It is solved.

I added below line to WebTestCase setUp() and it runs without Exception now.


$this->setBrowser('*firefox');

When my testcase fails, now I get this error (instead of the line no of failed test.)


Argument 2 passed to PHPUnit_Framework_ExpectationFailedException::__construct() must be an instance of PHPUnit_Framework_ComparisonFailure, string given

Anyone has idea?

Are you using PHPUnit 3.6? Then it’s probably related to a bug that recently got fixed. (https://github.com/sebastianbergmann/phpunit-selenium/issues/79)

Thank you Tropi. That was exactly my problem.

Until the new release comes out, I just changed to remove the 2nd parm of this call:

PHPUnit_Framework_ExpectationFailedException($buffer, $message);

in SeleniumTestCase.php and it runs fine now.

I so careless that I edit

yii-1.1.13.e9e4a0/framework/cli/views/webapp/protected/tests/WebTestCase.php,but I actually should edit webTest/protected/tests/WebTestCase.php!