Delay
Type: delay · Package: Core Activities v1.0.8
Pauses the execution for the given time (in milliseconds) and then continues with the next activity. It is useful to give a system time to react: for a page to finish loading, for an application to open a window, for a file to finish being written.
How it works
Section titled “How it works”When the flow reaches the activity, it stops for the given milliseconds and then continues. Remember: 1000 ms = 1 second.
- The value is rounded to whole milliseconds.
0does not wait. - When it finishes, it writes an informational line to the log with the time waited: in milliseconds (
Waited 500 ms.) or, from one second on, in seconds. - If someone terminates the execution during the wait, the pause ends right there.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
milliseconds | int | — | Wait time in milliseconds (0 or greater). E.g. 1500 = 1.5 seconds. |
Optional parameters
Section titled “Optional parameters”None.
Output
Section titled “Output”This activity does not return a value.
Example
Section titled “Example”Wait half a second between two actions so as not to overload a slow system:
Page Click page = page selector = "#save"Delay milliseconds = 500Page Click page = page selector = "#confirm"| You want to wait… | milliseconds |
|---|---|
| Half a second | 500 |
| 1 second | 1000 |
| 5 seconds | 5000 |
| 1 minute | 60000 |
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
| Negative value | A value below -1 makes the activity fail, and -1 waits with no limit. If the time comes from a calculation, check with an If first that it is 0 or greater. |
| The value cannot be converted to a number | The expression returned a text that is not a number. Convert it with num(...). |