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

type: 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.

ParamTypeDescription
delayoptionalnumberMaximum delay in ms. Actual wait is random between 40%-100% of this value. Default: 1000.
JSON
// Waits 400-1000ms (40%-100% of 1000)
{ "type": "wait" }

59
{ "type": "wait", "delay": 2000 }

133
{ "type": "wait", "delay": 500 }

wait_until

type: 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.

ParamTypeDescription
detectrequiredobjectDetection rules — at least one of: text, selector, url_contains, frame_url_contains.
detect.textoptionalstring | string[]Text(s) to find on the page.
detect.selectoroptionalstring | string[]CSS selector(s) to find on the page.
detect.url_containsoptionalstringSubstring the page URL must contain.
detect.frame_url_containsoptionalstringSubstring a frame URL must contain.
detect.include_framesoptionalbooleanSearch inside iframes too. Default: true.
timeoutoptionalnumberMax wait time in ms. Default: 60000.
JSON
// 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

type: 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.

ParamTypeDescription
selectoroptionalstring | string[]CSS selector(s) to wait for. If omitted, waits for page network idle.
stateoptionalstring"visible" (default) or "hidden".
timeoutoptionalnumberMax wait time in ms. Default: 15000.
poll_msoptionalnumberPolling interval in ms. Min: 100. Default: 300.
fail_on_timeoutoptionalbooleanIf true, throws a step-retry error on timeout instead of continuing. Default: false.
JSON
// 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

type: 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.

ParamTypeDescription
selectorrequiredstring | string[]CSS selector(s) for the field(s) to monitor.
timeoutoptionalnumberMax wait time in ms. Clamped to 1000-60000. Default: 15000.
poll_msoptionalnumberPolling interval in ms. Clamped to 100-2000. Default: 300.
settle_msoptionalnumberHow long indicators must stay clear before settling. Clamped to 200-5000. Default: 800.
persistent_loading_capoptionalnumberIf a loading indicator persists continuously for this long, treat it as a false positive and settle. Default: 3000.
JSON
// 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

type: 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.

ParamTypeDescription
expressionrequiredstringJavaScript expression that should return truthy. Also accepts fn as an alias.
timeout_msoptionalnumberMax wait time in ms. Clamped to 250-120000. Default: 15000. Also accepts timeout.
poll_msoptionalnumberPolling interval in ms. Clamped to 20-5000. Default: 250.
fail_on_timeoutoptionalbooleanIf true, throws a step-retry error on timeout. Default: false (logs warning and continues).
JSON
// 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

type: 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.

ParamTypeDescription
timeoutoptionalnumberMax wait time in ms. Default: 10000.
idleTimeoptionalnumberHow long network must be quiet before considered idle. Default: 500. Also accepts idle_time.
JSON
// 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 }