Description
Thewait
command pauses the execution of the script for a specified number of milliseconds before continuing. This is useful for adding delays between commands or waiting for certain conditions to stabilize.
Arguments
Argument | Type | Description |
---|---|---|
timeout | number | The duration in milliseconds to wait. |
Example usage
Protips
- Use the
wait
command to handle timing issues, such as waiting for animations to complete or elements to load. - Avoid using excessively long timeouts to keep tests efficient.
Gotchas
- Overusing the
wait
command can slow down test execution. Use it only when necessary. - Ensure the timeout value is appropriate for the scenario to avoid unnecessary delays.
Notes
- The
wait
command is ideal for introducing controlled pauses in your test scripts. - Whenever you are waiting for something to load, use the wait-for-text or wait-for-image commands instead to make the test more efficient.