Wednesday

Selenium - Assertion in Selenium

If you want to check string and pass then

assertTrue(selenium.isTextPresent("congrtulation ! you got the ticket"));

if you wanbt to find string and failt the test

assertTrue(!selenium.isTextPresent("Manage Applications is temporarily unavailable."));
***************************************

All Selenium Assertions can be used in three modes: "assert", "verify", and "waitFor".

For example, you can

* "assertText"
* "verifyText"
* "waitForText".

When an "assert" fails, the test is aborted.
When a "verify" fails, the test will continue execution, logging the failure.
"waitFor" commands wait for some condition to become true (which can be useful for testing Ajax applications). They will succeed immediately if the condition is already true. However, they will fail and halt the test if the condition does not become true within the current timeout setting (refer to the setTimeout action).

No comments:

Post a Comment