Skip to main content

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

ParameterRequiredDescription
Package NameYesPackage name of the target application.
DirectionYesScroll direction. Supported values are up, down, left, and right.
Element TextYesVisible text of the element to verify.
CheckedYesPass true to verify that the element is present, or false to verify that the element is not present.

Parameter Details

Checked

ValueDescription
trueVerifies that the specified element is present.
falseVerifies 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

  1. Scrolls upward through the current screen.
  2. Searches for the Suppress Notification Panel option.
  3. Verifies that the option is present.
  4. Executes the success callback if the verification succeeds.
  5. Executes the failure callback if the verification fails.

Expected Result

The automation confirms whether the specified setting is available without interacting with it.

note

Scroll Until Check is intended for verification only. It does not click or modify the target element.

💬 Help us improve this documentation

Was this information useful?

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