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
.
The respective command that takes you forward by one page on the browser's history can be written as: driver. navigate(). forward();
A “waitFor” command waits for some condition to become true. They will fail and halt the test if the condition does not become true within the current timeout setting. Perhaps, they will succeed immediately if the condition is already true.
AssertFalse method asserts that a specified condition is false. It throws an AssertionError if the condition passed to assert false method is not satisfied. AssertEquals, AssertTrue, and AssertFalse methods are the most commonly used assertions in Selenium.
assertLocationEquals - Reports an error if the current location is not equal to the given $location.
$this->assertLocationEquals($someNewUrl);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With