Overview
wait
Wait for time, element, window, text, or menu to appear
Wait Modes
Thewait command supports multiple modes:
- Time-based: Sleep for N milliseconds
- Element-based: Wait for element ref to appear
- Window-based: Wait for window with title to appear
- Text-based: Wait for text to appear in app
- Menu-based: Wait for menu to open
Common Patterns
Wait for Fixed Duration
Wait for Element to Appear
@e3 is present in the accessibility tree, or 5000ms elapses.
Returns:
Wait for Window to Appear
Wait for Text to Appear
Wait for Menu to Open
Examples
Use Cases
UI Synchronization
UI Synchronization
Wait for UI to settle after actions:
Async Operations
Async Operations
Wait for loading indicators to disappear:
Dialog Handling
Dialog Handling
Wait for dialogs or sheets to appear:
Menu Navigation
Menu Navigation
Polling Behavior
For condition-based waits (element, window, text, menu), the command polls every 100ms until:- Condition is met → returns
{"found": true} - Timeout expires → returns
TIMEOUTerror
--timeout for longer operations.
Timeout Values
Recommended timeouts:- UI settle: 200-500ms
- Dialog appearance: 1000-3000ms
- Loading indicator: 5000-10000ms
- App launch: 10000-15000ms (use
launchcommand instead)
Error Handling
Common error codes:TIMEOUT: Condition not met within timeout periodELEMENT_NOT_FOUND: Ref doesn’t exist (for--elementmode)INVALID_ARGS: Malformed timeout or missing required flag