I am writing a selenium test and I need to assert that the page is redirected. How should I verify this? What would be the best way?
I am using PHPUnit
and the PHPUnit_Extensions_SeleniumTestCase
.
I am writing a selenium test and I need to assert that the page is redirected. How should I verify this? What would be the best way?
I am using PHPUnit
and the PHPUnit_Extensions_SeleniumTestCase
.
assertLocationEquals - Reports an error if the current location is not equal to the given $location.
$this->assertLocationEquals($someNewUrl);
I might also add a
$this->selenium->waitForPageToLoad("30000");
or if you're really paranoid, a
sleep(1);
In between the page's call to redirect and the check to see that the new URL loaded. That should help serve as a buffer in the event of a slightly slower web server response.