You can also review our Telerik TV episode on the Do...While Statement for a video walk-through of this process.
- Create a Web Test and click Record.
- Navigate to www.random.org.
- Set the Min field to 1 and the Max field to 10.
- Click Generate.
- Enable hover over highlighting and hover over the Result box. Click the blue nub.
- Click Build Verification.
- Click the Content button under Available Verifications.
- Set the first drop-down to InnerText.
- Set the second drop-down to NotContain.
- Click OK.
- Test Studio recognizes you are verifying the number is not 4, when indeed it is 4. Click Yes to continue.
- Disable hover over highlighting and minimize the browser.
- Click the Logical button in the Add ribbon. Choose while...loop.
- Hover over the WHILE step and click the green plus icon.
- Click the green plus icon that appears next to the Verify step to associate it with the WHILE statement.
- Drag the Click Generate Button step into the WHILE step.
- Add an Execution Delay step from the More drop-down in the Add ribbon. Set it to 15 milliseconds.
- Drag the Execution Delay step into the WHILE step.
- Click Save and Execute. The test will continue to generate a random number between 1 and 10 until it generates the number referenced in the Verify step (4 in this example).