Wait Actions
Actions that pause execution until a condition is met or a timer expires. Prefer smart waits (auto_wait, wait_until) over fixed delays — they finish faster on fast pages and wait longer on slow ones.
wait
Random delay between 40% and 100% of the given maximum. The randomized range adds natural variation to timing for realistic interaction. Default maximum is 1000ms.
| Param | Type | Description |
|---|---|---|
| delayoptional | number | Maximum delay in ms. Actual wait is random between 40%-100% of this value. Default: 1000. |
// Waits 400-1000ms (40%-100% of 1000)
{ "type": "wait" }
59
{ "type": "wait", "delay": 2000 }
133
{ "type": "wait", "delay": 500 }wait_until
Waits until page detection conditions are met. Uses the same detection format as page-level detect blocks — checks for visible text, element selectors, URL patterns, or frame URLs. Ideal for waiting for page transitions.
| Param | Type | Description |
|---|---|---|
| detectrequired | object | Detection rules — at least one of: text, selector, url_contains, frame_url_contains. |
| detect.textoptional | string | string[] | Text(s) to find on the page. |
| detect.selectoroptional | string | string[] | CSS selector(s) to find on the page. |
| detect.url_containsoptional | string | Substring the page URL must contain. |
| detect.frame_url_containsoptional | string | Substring a frame URL must contain. |
| detect.include_framesoptional | boolean | Search inside iframes too. Default: true. |
| timeoutoptional | number | Max wait time in ms. Default: 60000. |
// Wait for a confirmation page
{ "type": "wait_until", "detect": { "text": ["Thank You", "Confirmation"] }, "timeout": 30000 }
129
{ "type": "wait_until", "detect": { "url_contains": "/confirmation" } }
243
{ "type": "wait_until", "detect": { "selector": ["#results-loaded"] }, "timeout": 15000 }
375
{ "type": "wait_until", "detect": { "text": ["Step 2 of 4"], "selector": ["#step-2-form"] } }auto_wait
Smart wait that polls for an element's visibility state. With a selector, it polls until the element is visible (or hidden). Without a selector, it waits for the page to reach network idle. Always bounded by a timeout.
| Param | Type | Description |
|---|---|---|
| selectoroptional | string | string[] | CSS selector(s) to wait for. If omitted, waits for page network idle. |
| stateoptional | string | "visible" (default) or "hidden". |
| timeoutoptional | number | Max wait time in ms. Default: 15000. |
| poll_msoptional | number | Polling interval in ms. Min: 100. Default: 300. |
| fail_on_timeoutoptional | boolean | If true, throws a step-retry error on timeout instead of continuing. Default: false. |
// Wait for page to settle (network idle)
{ "type": "auto_wait" }
67
{ "type": "auto_wait", "selector": "#loading-spinner", "state": "hidden", "timeout": 10000 }
204
{ "type": "auto_wait", "selector": "#main-form", "fail_on_timeout": true, "timeout": 20000 }
354
{ "type": "auto_wait", "selector": ["#step-2-form", ".error-message"], "timeout": 15000 }field_wait
Post-typing validation wait. After you type into a field, this action watches for async validation indicators (loading spinners, aria-busy,[data-loading], .validating classes) around the field and waits for them to clear. Falls back to network idle if no DOM indicators are detected.
| Param | Type | Description |
|---|---|---|
| selectorrequired | string | string[] | CSS selector(s) for the field(s) to monitor. |
| timeoutoptional | number | Max wait time in ms. Clamped to 1000-60000. Default: 15000. |
| poll_msoptional | number | Polling interval in ms. Clamped to 100-2000. Default: 300. |
| settle_msoptional | number | How long indicators must stay clear before settling. Clamped to 200-5000. Default: 800. |
| persistent_loading_capoptional | number | If a loading indicator persists continuously for this long, treat it as a false positive and settle. Default: 3000. |
// Wait for email validation to finish after typing
{ "type": "type", "selector": "#email", "value": "{{EMAIL}}" },
{ "type": "field_wait", "selector": "#email" }
164
{ "type": "field_wait", "selector": "#address", "timeout": 10000, "settle_ms": 1200 }
294
{ "type": "field_wait", "selector": ["#email", "#phone"], "timeout": 8000 }wait_for_function
Waits until a JavaScript expression returns a truthy value. The expression is read-only observation only — it may inspect DOM or JS state but must never click, submit, or mutate the page. Bounded by a hard timeout that guards against protocol wedges.
| Param | Type | Description |
|---|---|---|
| expressionrequired | string | JavaScript expression that should return truthy. Also accepts fn as an alias. |
| timeout_msoptional | number | Max wait time in ms. Clamped to 250-120000. Default: 15000. Also accepts timeout. |
| poll_msoptional | number | Polling interval in ms. Clamped to 20-5000. Default: 250. |
| fail_on_timeoutoptional | boolean | If true, throws a step-retry error on timeout. Default: false (logs warning and continues). |
// Wait for a JS variable to be set
{ "type": "wait_for_function", "expression": "window.__formReady === true", "timeout_ms": 10000 }
135
{ "type": "wait_for_function", "expression": "document.querySelector('#results').children.length > 0" }
276
{
"type": "wait_for_function",
"expression": "document.querySelector('#price').textContent !== '$0.00'",
"timeout_ms": 15000,
"fail_on_timeout": true
}wait_for_network_idle
Waits for all network requests to settle — no new requests for the specified idle period. Best after form submissions or navigations where you need AJAX calls to complete. Also accepts network_idle as an alias.
| Param | Type | Description |
|---|---|---|
| timeoutoptional | number | Max wait time in ms. Default: 10000. |
| idleTimeoptional | number | How long network must be quiet before considered idle. Default: 500. Also accepts idle_time. |
// Wait for network to settle with defaults
{ "type": "wait_for_network_idle" }
81
{ "type": "wait_for_network_idle", "timeout": 15000, "idleTime": 1000 }
200
{ "type": "network_idle", "timeout": 10000 }