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
| Parameter | Description |
|---|---|
| Package Name | Target application package. |
| Element Text | Label or hint of the input field. |
| Input Text | Text 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.