View Source Improve this doc

touchPerform

Performs a specific touch action. The action object need to contain the action name (longPress, press, tap, wait, moveTo, release) and additional information about either the element, x/y coordinates or touch counts.

Usage

1
browser.touchPerform(actions);

Parameters

Param Type Details
actions Object touch action as object or object[] with attributes like touchCount, x, y, duration

Example

touchPerformPress.js
1
2
3
4
5
6
7
browser.touchPerform([{
action: 'press',
options: {
x: 100,
y: 250
}
}]);
touchPerformTap.js
1
2
3
4
5
6
7
8
9
browser.touchPerform([{
action: 'tap',
options: {
element: '1', // json web element was queried before
x: 10, // x offset
y: 20, // y offset
count: 1 // number of touches
}
}]);

Support

Support for android Support for ios