Example 1: To insert a delay of 5 seconds
- Open the Task Editor from Tools - Task Editor.
- Double click on the 'Delay/Wait' command.
- Select Delay option.
- Type '5' in the 'Delay' text box.
- Select option 'Delay in Seconds'.
- Click on 'Save' button.
Example 2: Generate random delays to simulate user behavior in your testing scenarios.
- Open the Task Editor from Tools -> Task Editor.
- Double click on the 'Delay/Wait' command.
- Select Delay option.
- Select the option 'Random Delay'.
- Type '5' in the 'From' textbox.
- Type '500' in the 'To' textbox.
- Select option 'Delay in Seconds'.
- 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
- Open the Task Editor from Tools - Task Editor.
- Double click on the 'Delay/Wait' command.
- Select 'Wait For' option.
- Select 'Wait For Window To Open' option and specify the window title as 'Untitled - Notepad'.
- Specify how long would you like Automation Annywhere to wait for the
condition to be true i.e. for notepad window to open.
- 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 (*)
- 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. *.
- 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'.
- In that case you can specify Wait For Window To Open '*Untitled*'.
- 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.
- 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
- Open the Task Editor from Tools - Task Editor.
- Click on the 'Delay/Wait' command.
- Double-click 'Wait For Screen Change' option.
- Keep your web page open where the result of the
submit button will be displayed. For e.g. your query has been submitted
successfully.
- 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.
- Click on Capture button and capture the rectangular section around the
area that will change when the query is submitted.
- Specify 1 seconds in the box that says 'How long you want to wait before
comparing the screen'
- 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.
- Save the command.