wait_for_element
Waits for an iOS UI element to appear or disappear, optionally scrolling and matching by ID, text, type, or index. Use it to synchronize tests before tapping or asserting on the element.
Instructions
Wait until an element appears (or disappears with gone=true).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Exact accessibility identifier | |
| gone | No | ||
| text | No | Matches label, identifier, value or placeholder (exact first, then substring, case-insensitive) | |
| type | No | Element type, e.g. Button, TextField, Cell, Switch | |
| exact | No | Require an exact text match | |
| index | No | Pick the Nth best match (0-based) | |
| device | No | Device UDID or name substring. Defaults to the select_device choice, then IOS_DEVICE_MCP_DEVICE, else the single USB-connected device. | |
| timeout | No | Seconds to wait for the element (default 5) | |
| maxScrolls | No | Scroll attempts when scrollDirection is set (default 8) | |
| scrollDirection | No | If not found, scroll this way and look again (lists load lazily, so off-screen rows may not exist yet) |