Usage
Parameters
Milliseconds to pause. If provided, all other options are ignored.
Block until this element ref appears in the accessibility tree. Polls every 100ms.
Block until a window with this title (partial match) appears. Polls every 100ms.
Block until this text appears in the app’s accessibility tree (case-insensitive). Polls every 200ms.
Block until a context menu is open. Polls every 100ms.
Block until the context menu is dismissed. Polls every 100ms.
Block until a new notification arrives. Polls every 500ms.
Scope element, text, menu, or notification waits to this application.
Timeout in milliseconds for condition waits. Defaults to 30000ms (30 seconds).
Response
Fixed Duration Wait
The number of milliseconds waited
Element Wait
Always
true if element was found before timeoutThe element ref that was found
Time in milliseconds until element appeared
Window Wait
Always
true if window was found before timeoutThe window object that matched
Time in milliseconds until window appeared
Text Wait
Always
true if text was found before timeoutThe text that was searched for
Element ref where the text was found (if element has a ref)
Role of the element containing the text
Time in milliseconds until text appeared
Menu Wait
Always
true if menu condition was met before timeoutTime in milliseconds until menu opened/closed
Notification Wait
Always
"notification"Always
true if a new notification arrivedThe notification that arrived
Time in milliseconds until notification arrived
Examples
Fixed Duration
Wait for Element
Wait for Window
Wait for Text
Wait for Menu
Wait for Notification
Use Cases
Wait Between Actions
Wait Between Actions
Pause to let UI settle:
Wait for Dialog
Wait for Dialog
Wait for a Save dialog to appear:
Wait for Loading
Wait for Loading
Wait for a loading indicator to disappear:
Wait for Menu
Wait for Menu
Wait for Notification
Wait for Notification
Wait for a deployment notification:
Wait Conditions
| Condition | Poll Interval | Use Case |
|---|---|---|
ms | N/A | Fixed pause |
--element | 100ms | Element appears in tree |
--window | 100ms | Window opens |
--text | 200ms | Text appears anywhere |
--menu | 100ms | Context menu opens |
--menu-closed | 100ms | Context menu closes |
--notification | 500ms | New notification arrives |
Error Handling
Common error codes:TIMEOUT: Condition not met within timeout periodINVALID_ARGS: No valid wait condition providedSTALE_REF: Element ref in--elementis not in the current refmap
Notes
- Fixed duration waits (
wait <MS>) are precise and usestd::thread::sleep - Condition waits poll at fixed intervals and may overshoot slightly
- Text matching is case-insensitive and checks name, value, title, and description fields
- Window title matching is a partial substring match
- Notification waits detect new notifications only (compares against baseline)
- Menu waits check for any open context menu in the specified app (or focused app)
Related Commands
- snapshot - Capture UI state after waiting
- list-notifications - List notifications instead of waiting
- list-windows - List windows instead of waiting