Long Press Element
The Long Press Element action performs a long press on a UI element identified by its visible text.
Typical Use Cases
- Opening context menus.
- Selecting applications.
- Entering edit mode.
- Displaying additional options.
Syntax
var task = suremdmjs.automate().longPress(
"<Package Name>",
"<Element Text>"
);
Example
var task = suremdmjs.automate().longPress(
"",
"Chrome"
);
suremdmjs.automate().performAction(
task,
"onSuccess",
"onFailure"
);
Expected Result
The Chrome application icon is long pressed and its context menu is displayed.