Skip to main content

Scroll Until Check with Timeout

The Scroll Until Check with Timeout action scrolls the screen until the specified UI element is found or confirmed to be absent, within a configurable timeout. Unlike Scroll Until Check, this action allows you to define how long the automation should continue searching before the verification fails. This action performs verification only. It does not click or modify the target element.

When to Use​

Use this action when you want to:

  • Verify that a settings option exists within a specified time.
  • Confirm that an application feature is available.
  • Check whether an expected item appears in a dynamically loaded list.
  • Verify that an element is no longer present.
  • Limit the time spent searching for an element before continuing with failure handling.

Syntax​

var task = suremdmjs.automate().scrollUntilCheck(
"<Package Name>",
"<Direction>",
"<Element Text>",
<Checked>,
<Timeout in Milliseconds>
);

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

Parameters​

ParameterRequiredDescription
Package NameYesPackage name of the target application. Leave empty ("") to search all applications.
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.
TimeoutYesMaximum time, in milliseconds, to complete the verification before the action fails.

Parameter Details​

Checked

ValueDescription
trueVerifies that the specified element is present.
falseVerifies that the specified element is not present.

Timeout

Specifies the maximum time allowed for the verification operation.

ValueDescription
5000Waits for up to 5 seconds.
20000Waits for up to 20 seconds.
60000Waits for up to 60 seconds.

Example​

The following example verifies whether the Suppress Notification Panel setting is available within 20 seconds.

!#suremdmjs

verifySetting();

function verifySetting() {

var task = suremdmjs.automate().scrollUntilCheck(
"",
"up",
"Suppress Notification Panel",
true,
20000
);

suremdmjs.automate().performAction(
task,
"settingFound",
"settingMissing"
);
}

function settingFound() {
suremdmjs.log("Setting found.");
}

function settingMissing() {
suremdmjs.log("Setting could not be located within 20 seconds.");
}

How This Example Works​

  1. Starts scrolling upward through the current screen.
  2. Searches for the Suppress Notification Panel setting.
  3. Continues searching for up to 20 seconds.
  4. Verifies that the setting is present without interacting with it.
  5. Executes the success callback if the setting is found, or the failure callback if verification does not succeed within the timeout.

Expected Result​

The automation confirms whether the Suppress Notification Panel setting is available within 20 seconds, without clicking or modifying it.

note

Scroll Until Check with Timeout is intended for verification only. The Checked parameter determines whether the automation verifies the presence or absence of the specified element. It does not represent or modify the checked state of a checkbox.

💬 Help us improve this documentation

Was this information useful?

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