Targets
One selector syntax for every command and for Rust tests: #id, "name", role:, @n, >>, row n, [n].
Every command that takes a node takes a target. The same syntax works in Rust tests (TestApp::click, find, text…).
| Target | Names |
|---|---|
#send | the node with id = "send" |
"Send" | the node whose accessible name or text is exactly Send (a button, not the text inside it) |
role:button | by role, ARIA’s names: button, textbox, checkbox, option, listbox, article, heading, link, text… |
@12 | the node numbered 12 in tree (stable while it is mounted) |
role:button "Send" | parts together narrow |
#sidebar >> "Inbox" | >> looks inside what is before it |
#messages row 3 | a list’s third mounted row |
"Copy"[2] | the second of several matches |
A target matching several nodes is an error listing them (@n role "name" box), so you can name the one you meant with @n, a role, >> or [n]. Actions never pick one silently.