setTextVerified

fun UiDevice.setTextVerified(selector: BySelector, text: String, timeout: Duration = DefaultDeviceTimeout)(source)

Replaces the text of the single field matching selector and verifies the result.

Password fields report masked text, so for them this only verifies that the text changed. The accessibility tree is read to detect a password field only when the text doesn't already match.

Parameters

selector

Selects one editable field.

text

The new contents.

timeout

The nonnegative wait budget for the field to appear.

Throws

when the field is ambiguous, missing, or holds different text afterward.