Selenium seems to stop for about a minute between each step (I have not seen less than 60 seconds). Even steps that should be simple (like setSpeed) are performed at the same speed.
However, when I use the PHPUnit_Extensions_SeleniumTestCase class, I can run tests at normal speed. (In addition, slow steps are performed normally on the team computer.)
Does anyone know what I'm doing wrong? Thank!
Here is a slow test:
debug_time();
require_once 'Testing/Selenium.php';
debug_time();
$s = new Testing_Selenium('*firefox', "http://google.com/");
debug_time();
$s->setSpeed(0);
debug_time();
$s->start();
debug_time();
var_export($s->getSpeed());
echo "\n";
debug_time();
$s->open('/');
debug_time();
$s->stop();
debug_time();
echo "done";
Here is the result of a slow test:
0 => 18:01:54.44488 (+ 0.00000)
1 => 18:01:54.45478 (+ 0.00990)
2 => 18:01:54.45645 (+ 0.00167)
3 => 18:02:54.97334 (+ 60.51688)
4 => 18:04:03.59346 (+ 68.62013)
NULL
5 => 18:05:04.11214 (+ 60.51867)
6 => 18:06:05.83747 (+ 61.72534)
7 => 18:07:06.63492 (+ 60.79744)
done
Here is a quick test taken from the PHPUnit manual:
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
class WebTest extends PHPUnit_Extensions_SeleniumTestCase
{
protected function setUp()
{
$this->setBrowser('*firefox');
$this->setBrowserUrl('http://google.com/');
}
public function testTitle()
{
$this->open('/');
$this->assertTitleEquals('Example Web Page');
}
}
source
share