android_find_element
Locate Android UI elements by text, content description, or resource ID to verify existence and retrieve tap coordinates for automated testing workflows.
Instructions
Find a UI element on Android screen by text, content description, or resource ID. Returns element details including tap coordinates. Use this to check if an element exists without tapping it. Workflow: 1) wait_for_element, 2) find_element, 3) tap with returned coordinates. Prefer this over screenshots for button taps.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Exact text match for the element | |
| textContains | No | Partial text match (case-insensitive) | |
| contentDesc | No | Exact content-description match | |
| contentDescContains | No | Partial content-description match (case-insensitive) | |
| resourceId | No | Resource ID match (e.g., 'com.app:id/button' or just 'button') | |
| index | No | If multiple elements match, select the nth one (0-indexed, default: 0) | |
| deviceId | No | Optional device ID. Uses first available device if not specified. |