Element
A selector bound to a device. Every method resolves the selector again on the device, so nothing goes stale between calls; mutations require exactly one match.
All I/O methods are suspend and require an owning scope (tapScope/tapTest); derived selectors (descendant, child, first, at, await) only build values, so they stay non-suspend.
Properties
Functions
An ElementWait on this selector. Builds a value; no I/O, so not suspend.
The node matching other somewhere below this one. Builds a value; no I/O.
Presses the one matching node until it is a long press, moves the finger to the centre of the one node matching destination (resolved on the same screen, before any input), holds there briefly and lifts. Nothing is reported about what the app did with the drop.
Runs the one matching text field's keyboard action (Search, Go, Send, Done, … as the app configured it) exactly as the keyboard's action key does, through accessibility ACTION_IME_ENTER. API 30+: older devices fail with UNSUPPORTED / REQUIRES_API_30 before any input (pressing Enter is not equivalent). The field must have input focus (tap it first): Android offers the action only then, and a node that does not offer it fails with ACTION_REJECTED before any input.
Performs a standard accessibility action on the one matching node, as a screen reader does: no touch, so a covered node is no obstacle. The node must offer it (ElementSnapshot.actions); otherwise ACTION_REJECTED / ACTION_NOT_OFFERED before any input. A node that refuses an offered action is ACTION_REJECTED. Only Android's answer is reported: assert what the app did.
Performs the custom accessibility action labelled label (exactly) on the one matching node: the "Archive" or "Delete" a list item offers screen reader users instead of a swipe (ElementSnapshot.customActions). Not offered, or offered twice under that label: ACTION_REJECTED / ACTION_NOT_OFFERED before any input.
Two fingers moving together towards the one matching node's centre, across percent of its size.
One scroll gesture on the one matching node towards direction's content edge (UiAutomator semantics: DOWN reveals content below). Nothing is reported about whether content moved; observe that with a query or wait.
Client-side loop: checks whether target exists inside this container (descendant) and, while it does not, scrolls once, up to maxScrolls scrolls within timeout (default the device's wait timeout). Returns the target as a lazy element scoped to this container, so a later action cannot hit a duplicate elsewhere on screen; a container with first()/at() cannot be carried into a relation, and then the bare target is used.
Sets the one matching range node (SeekBar, Slider, RatingBar) to value in its own units (ElementSnapshot.range) through accessibility ACTION_SET_PROGRESS: exact, where a drag would land on whatever pixel maps to. A node without the action, or a value outside its min..max, is ACTION_REJECTED (ACTION_NOT_OFFERED / OUT_OF_RANGE) before any input; the view is not left to clamp it.
Accessibility text replacement (ACTION_SET_TEXT) on the one matching node. Fails with ACTION_REJECTED only when the node refuses the action; the field is not read back, so assert the effect yourself with a selector that survives the edit: app.await(res("email")).textEquals("new").
State of the one matching node at this instant (AMBIGUOUS/NOT_FOUND otherwise).
Taps the one matching node, waits until it reports focus (with awaitFocus; bounded by the wait timeout), then types value as real key events with Device.typeText. Three steps, so a failure says which one failed. Pass awaitFocus = false when focus goes elsewhere (a child or a separate input view), and wait for what that app needs yourself. The field is not read back: assert the effect yourself.