Test Studio provides built-in conditions for the test scenarios which cannot be covered by a simple sequence of actions. One of the available conditions is the if..else block to determine how to proceed the test based on a specific condition.
In this article you can find the following topics:
- Add the if..else condition and setup the test steps
- Explore the outcome of running the test
- An example how to verify if an element exists on the page
Check this step-by-step tutorial blog post on how to enhance your test scenarios with conditional steps.
1. Create a Web Test and click Record.
2. Navigate to www.random.org.
3. Set the Min field to 1 and the Max field to 2.
4. Click Generate.
5. Enable hover over highlighting by clicking Highlight Element in the Test Studio Recorder and hover over the Result box.
6. Click Quick Tasks and double click Verify - text contains '1'.
7. Disable hover over highlighting and minimize the browser.
8. Choose Conditions in the Step Builder and add if...else step.