IF Statements for Web Tests
Introduction
IF Statements are similar to assertions.
There are certain scenarios where we need to execute some steps only if a certain condition is met.
IF Statements can be nested in other IF Statements.
An IF Statement can cross the boundary of a test case and continue into the next test case.
Solution
IF Statements can be added by using the Start If Statement
action.
In order to close an IF Statement, we need to use the End If Statement
action.
You can choose from the following types of IF Statements:
- Element Is Present
- Element Is Not Present
- Element Is Visible
- Element Is Not Visible
- Element Matches Value
- Element Does Not Match Value
- Element Contains Value
- Element Does Not Contain Value
- Element Contains CSS Class
- Element Does Not Contain CSS Class
- Element Contains Attribute
- Element Does Not Contain Attribute
- Count Child Elements
- Variable Assertion
- Title Contains Value
- Title Does Not Contain Value
- URL Contains Value
- URL Does Not Contain Value
- Page Source Contains Value
- Page Source Does Not Contain Value
- Cookies Contain Value
- Cookies Do Not Contain Value
- Browser Logs Contain Value
- Browser Logs Do Not Contain Value
- Page Matches Screenshot
- Element Matches Screenshot