device_find
Find a UI element by visible text and optionally interact with it. Use action=“click” to tap, omit for find-only. Returns element ref for use with device_press/device_fill. Requires an open session. For overlapping labels (e.g. “Property damaged” vs “Property lost”), pass exact=true for strict match or index=N to pick the Nth candidate directly — both short-circuit AMBIGUOUS_MATCH. If AMBIGUOUS_MATCH still occurs, the result includes a candidates[] array with refs you can pass to device_press.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
text | string | Yes | Visible text, accessibility label, or identifier to find | ||
action | string | No | Action to perform: “click” to tap, omit for search-only | ||
exact | boolean | No | Require exact label match (case-sensitive). Skips fuzzy matching entirely. | ||
index | number | No | min: 0, integer | Pick the Nth candidate (0-based) when multiple elements match. Short-circuits AMBIGUOUS_MATCH. |
device_find(text: <string>)