Overview
Waiting commands allow you to pause execution until specific conditions are met, ensuring reliable automation.wait
Wait for various conditions to be met.Wait for Element
Wait for an element to be visible.| Parameter | Description |
|---|---|
selector | Element selector to wait for |
Wait for Time
Wait for a specific duration.| Parameter | Description |
|---|---|
milliseconds | Time to wait in milliseconds |
Wait for Text
Wait for text to appear on the page.| Option | Description |
|---|---|
—text, -t | Text to wait for |
Wait for URL
Wait for URL to match a pattern.| Option | Description |
|---|---|
—url, -u | URL pattern to wait for (glob pattern) |
Wait for Load State
Wait for page to reach a specific load state.| Option | Description |
|---|---|
—load, -l | Load state: load, domcontentloaded, networkidle |
| State | Description |
|---|---|
load | Page load event fired |
domcontentloaded | DOM is fully loaded |
networkidle | No network activity for 500ms |
Wait for Function
Wait for JavaScript expression to return true.| Option | Description |
|---|---|
—fn, -f | JavaScript expression to evaluate |
Wait for Download
Wait for a file download to complete.| Option | Description |
|---|---|
—download, -d | Wait for download |
path | Optional: Save download to specific path |
—timeout | Optional: Download timeout in milliseconds |
Workflow Examples
Wait After Navigation
Wait for Dynamic Content
Wait for Form Submission
Wait for AJAX Request
Download File
Chained Waits
Timeout Handling
The default timeout for wait commands is 25 seconds. Override with theAGENT_BROWSER_DEFAULT_TIMEOUT environment variable: