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.
Long click on the one matching node, using Android's default long-press timing.
Holds a physical finger for duration (1..30000 ms); short presses may not trigger a long-click handler. Must fit the remaining timeout, before any input. Requires the default display. Use the overload without duration for Android's default long press. The existing positional timeout argument keeps its meaning.
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.
Collect descendant observations from the current position, never claiming completeness. Explicit stable keys merge overlap; same-read collisions fail. Bad keys across reads can merge distinct rows. Does not rewind or wait for loading. Budgets are mandatory. Failures retain their type/code and expose scanPartial; cancellation stays cancellation.
One scroll gesture on the one matching node towards direction's content edge (UiAutomator semantics: DOWN reveals content below). Returns source-attributed movement/edge evidence where available. Unknown is neither unchanged nor at end.
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).
Click at the centre of the one matching node's visible bounds.
count taps (1..100) at the initially resolved visible centre, with interval between release and the next press (40..1000 ms; default 100 ms). The sequence, including each 50 ms press, must fit in 30 seconds and the remaining timeout. Resolves once, never retries; does not promise app-specific multi-click recognition. Single tap is unchanged.
Taps outside the panel this element is in: a dialog, popup, menu, drawer or bottom sheet, Views or Compose. Select any node inside the panel, such as its title; it need not be tappable itself. This is how a test checks "a touch outside closes it".
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. sensitive as for setText.