Skip to main content

Enter Text

The Enter Text action enters text into an editable field identified by its visible label, hint, or associated text. This action is commonly used to automate login forms, registration screens, search fields, and application configuration pages.

When to Use​

Use this action when entering:

  • Usernames
  • Passwords
  • Email addresses
  • Device names
  • Search keywords
  • Configuration values

Syntax​

var task = suremdmjs.automate().typeText(
"<Package Name>",
"<Element Text>",
"<Input Text>"
);

suremdmjs.automate().performAction(
task,
"onSuccess",
"onFailure"
);

Parameters​

ParameterDescription
Package NameTarget application package.
Element TextLabel or hint of the input field.
Input TextText to enter into the field.

Example​

var task = suremdmjs.automate().typeText(
"com.example.app",
"Username",
"admin@example.com"
);

suremdmjs.automate().performAction(
task,
"usernameEntered",
"failed"
);

Expected Result​

The specified username is entered into the Username field.

💬 Help us improve this documentation

Was this information useful?

Your feedback helps us keep our documentation accurate, up to date, and useful.