input

suspend fun input(tag: String, text: String)

Clears any existing text and inputs text into the UI element matching the string tag.

Primary method for entering text into form fields. Matches by explicit testTag first, then visible text substring.

Automatically waits for the field to become visible before typing.

Example Usage

input("Username", "john.doe")
input("Email Address", "alex.smith@example.com")

Parameters

tag

The testTag string or visible placeholder text of the input field.

text

The text value to input into the field.

See also

(Selector, String)

Throws

If no visible input element matching tag appears within the timeout.


suspend fun input(selector: Selector, text: String)

Clears any existing text and inputs text into the UI element matching the specified selector.

Advanced variant using explicit selectors for input field targeting.

Automatically waits for the field to become visible before typing.

Example Usage

input(tag("password_input"), "SecretPass123!")
input(text("Search").first(), "Kotlin Multiplatform")

Parameters

selector

The explicit Selector rule used to locate the input field.

text

The text value to input into the field.

See also

Throws

If no visible input element matches selector within the timeout.