If...Else

You can also review our Telerik TV episode on the If...Else Statement for a video walk-through of this process.

  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.  

     

  6. Enable hover over highlighting and hover over the Result box. Click the blue nub.
  7.  

     

  8. Click Quick Tasks and double click Verify - text contains '1'.
  9.  

     

  10. Disable hover over highlighting and minimize the browser.
  11. Click the Logical button in the Add ribbon. Choose if...else.
  12.  

    Standalone version

    VS plugin

     

  13. Hover over the IF step and click the green plus icon.
  14.  

     

  15. Click the green plus icon that appears next to the Verify step to associate it with the IF statement.
  16.  

     

  17. Bring up the IE recording window and navigate to www.google.com. Minimize the browser again.
  18. Drag the Navigate to Google step into the IF step.
  19.  

     

  20. Bring up the IE recording window and navigate to www.bing.com. Minimize the browser again.
  21. Drag the Navigate to Bing step into the ELSE step.
  22.  

     

  23. Save and Execute the test.
    • If 1 is generated it navigates to Google.
    • If 2 is generated it navigates to Bing.
  24. Test steps that are skipped due to the If...Else logic are denoted with different icons.
  25.