Check Points @ Selenium IDE (ASSERTIONS)
· Assertions verifies that the state of the application confirms to what is expected
· Assertions can be added to the test case, irrespective of the IDE is in recording mode or not
· Assertions are classified into 3 types.
• Verify
•Assert
• WaitFor
•Assert
• WaitFor
Verify
Verify is used for validating the actual and expected values. If the actual and expected value matches. it resumes Execution , irrespective of pass or failure.
On Failure , It displyes the actual and expected behavior in the log and increase the error count by One
Example:-
Command
|
Target
|
Value
|
verifyTextPresent
|
Welcome to My Home Page
| |
verifyText
|
//h2
|
Downloads
|
Assert
Assert is used for validating the actual and expected values. If the actual and expected value matches, it is treated as pass. Otherwise it is treated as a failure. . it stops Execution , if it is failure.
On Failure , It displyes the actual and expected behavior in the log and increase the error count by One
Example:
Command
|
Target
|
Value
|
assertTitle
|
Downloads
| |
assertTable
|
1.2.1
|
Selenium IDE
|
WaitFor
WaitFor is used for validating the actual and expected values. If the actual and expected value matches, the controller will be transferred to the next statement immediately. Otherwise WaitFor command let the controller to wait till the actual and expected value matches or till the time out happens.
On failure, it displays time out error in the log and continues with next statement execution in the test case. For each failure error count increases by 1.
Example:
Command
|
Target
|
Value
|
waitForElementPresent
|
Welcome to My Home Page
| |
waitForPageToLoad
|
30000
|