Scroll Until Check
The Scroll Until Check action scrolls the screen until the specified UI element is found or confirmed to be absent. Unlike Scroll Until Click, this action performs verification only. It does not interact with the UI after locating the element. It is commonly used to validate whether a configuration option, menu item, or application setting exists before deciding the next automation step.
When to Use
Use this action when you want to:
- Verify that a settings option exists.
- Confirm that an application feature is available.
- Check whether an expected item appears in a list.
- Validate application configuration before continuing.
Syntax
var task = suremdmjs.automate().scrollUntilCheck(
"<Package Name>",
"<Direction>",
"<Element Text>",
<Checked>
);
suremdmjs.automate().performAction(
task,
"onSuccess",
"onFailure"
);
Parameters
| Parameter | Required | Description |
|---|---|---|
| Package Name | Yes | Package name of the target application. |
| Direction | Yes | Scroll direction. Supported values are up, down, left, and right. |
| Element Text | Yes | Visible text of the element to verify. |
| Checked | Yes | Pass true to verify that the element is present, or false to verify that the element is not present. |
Parameter Details
Checked
| Value | Description |
|---|---|
| true | Verifies that the specified element is present. |
| false | Verifies that the specified element is not present. |
Example
The following example verifies that the Suppress Notification Panel setting is available.
!#suremdmjs
verifySetting();
function verifySetting() {
var task = suremdmjs.automate().scrollUntilCheck(
"",
"up",
"Suppress Notification Panel",
true
);
suremdmjs.automate().performAction(
task,
"settingFound",
"settingMissing"
);
}
function settingFound() {
suremdmjs.log("Setting found.");
}
function settingMissing() {
suremdmjs.log("Setting could not be located.");
}
How This Example Works
- Scrolls upward through the current screen.
- Searches for the Suppress Notification Panel option.
- Verifies that the option is present.
- Executes the success callback if the verification succeeds.
- Executes the failure callback if the verification fails.
Expected Result
The automation confirms whether the specified setting is available without interacting with it.
Scroll Until Check is intended for verification only. It does not click or modify the target element.