Selenium test timeout doesn't stop the test PHPUnit 3.6.10 Selenium RC 2.19.0 Selenium test timeout doesn't stop the test PHPUnit 3.6.10 Selenium RC 2.19.0 selenium selenium

Selenium test timeout doesn't stop the test PHPUnit 3.6.10 Selenium RC 2.19.0


I'm going to answer myself here in case anyone else has this problem. As a workaround, I override the waitForPageToLoad function. It calls the parent function and keeps track of the time it spends waiting for the page to load to determine if the page load actually timed out, and throws an exception if it did.

Here's the code for it:

protected function waitForPageToLoad( $timeout=null ) {    if ( is_null( $timeout ) ) {        $timeout = 30000;    }    $start = time();    parent::waitForPageToLoad( $timeout );    $end = time();    if ( ($end - $start) >= ($timeout / 1000) ) {        throw new Exception( 'Timed out after '.$timeout.'ms.' );    }}

This seems incredibly unnecessary, but at the moment, it works for me, but I would still like an answer that doesn't require such a hack.