assert_ui_node
Verifies if the current Android UI hierarchy contains a node matching specified text, resource-id, content-desc, or focus state. Set should_exist to false to assert that no such node exists.
Instructions
Assert that the current Android UI Automator hierarchy does or does not contain a matching node.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Exact node text to match | |
| focused | No | Whether the node must currently be focused | |
| resource_id | No | Exact UI Automator resource-id to match | |
| content_desc | No | Exact content-desc to match | |
| should_exist | No | Set false to assert that no matching node exists | |
| device_serial | No | ADB serial such as emulator-5554, a USB serial, or host:port. If omitted, the active device is used; a sole ready device is selected automatically. |