Delay / Sleep
A delay makes BugBug wait a fixed number of seconds before a step starts.
You usually don't need it: BugBug already waits for the page and the element with waiting conditions, only as long as necessary. A fixed delay makes tests slower and can still be too short on a slow day. But a delay can be a quick fix when you don't have time to find out what the step is waiting for.
How the delay works
The delay runs first. BugBug waits for the delay, then starts checking the step's waiting conditions.
It doesn't use up the timeout. The step's timeout starts when the delay ends.
It applies to one step. To wait between two steps, set the delay on the second one.
For example, with a delay of 3 and a timeout of 30, BugBug waits 3 seconds, then has up to 30 seconds to wait for the conditions and run the step.
Add a delay to a step
Open the step and enter a whole number of seconds, up to 300, in the Delay / Sleep field. Leave it empty to use the project's default delay.

In YAML the field is execution.sleep, and in the API and MCP sleep, both in seconds:
Default delay for the project
Project settings have a default delay that applies to every step without its own delay. It's 0 seconds by default. Keep it at 0: a delay on every step makes all tests slower.
Better options than a delay
The element appears after a while
Nothing: Element is visible already waits for it.
A loader or modal covers the element
Element is not covered waits for it to disappear.
The page keeps loading data
Page network requests are finished waits for the requests.
The button is disabled until the form is valid
Element must be active waits for it.
The element must reach a specific state
Add Element must have expected attribute, for example data-state="ready".
A step needs more time than usual
Raise the timeout of that step.
FAQ
Last updated
Was this helpful?
