Delay/Wait - Examples                           How to use?

 

Example 1: To insert a delay of 5 seconds

  1. Open the Task Editor from Tools - Task Editor.
  2. Double click on the 'Delay/Wait' command.
  3. Select Delay option.
  4. Type '5' in the 'Delay' text box.
  5. Select option 'Delay in Seconds'.
  6. Click on 'Save' button.

Example 2: Generate random delays to simulate user behavior in your testing scenarios.

  1. Open the Task Editor from Tools -> Task Editor.
  2. Double click on the 'Delay/Wait' command.
  3. Select Delay option.
  4. Select the option 'Random Delay'.
  5. Type '5' in the 'From' textbox.
  6. Type '500' in the 'To' textbox.
  7. Select option 'Delay in Seconds'.
  8. Click on 'Save' button.

Tip: Every time you run the task and when Automation Anywhere comes across the random delay command, it generates a random number between the range you have specified.

Example 3: To wait for 'untitled - notepad' to open

  1. Open the Task Editor from Tools - Task Editor.
  2. Double click on the 'Delay/Wait' command.
  3. Select 'Wait For' option.
  4. Select 'Wait For Window To Open' option and specify the window title as 'Untitled - Notepad'.
  5. Specify how long would you like Automation Annywhere to wait for the condition to be true i.e. for notepad window to open.
  6. You can specify if you want to continue with the task or stop the task in case the notepad window did not open in your specified time.

Tip: Using Wildcards (*)

  1. For the options 'Wait For Window To Open' , 'Wait For Window To Close' and 'Wait for Screen Change' (relative to Window) you can also specify wild cards i.e. *.
  2. For e.g. if you want to perform any operation in any window with the word 'Untitled' anywhere in the Title. It can have any string before and after the word 'Untitled'.
  3. In that case you can specify Wait For Window To Open '*Untitled*'.
  4. Automation Anywhere will first search for the exact window i.e. '*Untitled*' and if it does not find it then it looks for windows that has the word 'Untitled' in the Title.
  5. You can put wild card character (*) at the beginning or end of the window title.

Example 4: To wait for the submit query to return successfully on web

  1. Open the Task Editor from Tools - Task Editor.
  2. Click on the 'Delay/Wait' command.
  3. Double-click 'Wait For Screen Change' option.
  4. Keep your web page open where the result of the submit button will be displayed. For e.g. your query has been submitted successfully.
  5. Select the relevant option based on whether you want to capture the image relative to the screen or a particular window. If you select 'Window' then you will be required to select a window from the list.
  6. Click on Capture button and capture the rectangular section around the area that will change when the query is submitted.
  7. Specify 1 seconds in the box that says 'How long you want to wait before comparing the screen'
  8. Specify the amount of seconds after which you do not want to wait and would like to either stop the task or go to next command.
  9. Save the command.