Skip to main content

Gesture Commands

A gesture is a sequence of touch events, done with one or more fingers. To simulate a single or multi-touch gesture, a set of gesture commands are provided by SeeTest Extension.

A gesture consists of one or more event sequences (paths), where each path is executed with a different finger.

info

Supported by iOS devices only

The general structure for gesture is as follows (in pseudo-code):

General Stycture of Commands

// tells the client we want to perform a gesture
gestureStartBuilding(...);

// path 1 - add commands for the first simulated finger
gestureTouchDown...;
gestureTouchMove...;
gestureWait...;
gestureTouchUp...;

// path 2 - add commands for the second simulated finger
gestureTouchDown...;
gestureTouchUp...;

// identify elements and perform the gesture on the device
gesturePerform...;

A few points to note:

  1. To start a set of gesture commands, we need to execute gestureStartBuilding() first.
  2. All gesture steps will be performed when executing gesturePerform(). 
  3. Each gesture command is given a finger index. Index is any integer. 
  4. Events can be performed on elements, given by any identification method, or by coordinates.
  5. Paths start executing at the same time. i.e., path 1 and path 2 from the above example will start executing at the same time.

StartMultiGesture​

Description​

Indicate to SeeTest that the following commands sent from the client are grouped under the multi gesture step.

PerfomMultiGestureStep​

Description​

Takes the steps added since the last StartMultiGesture command till this command and sends them to the device.

At this step, the elements used in different commands will be identified, for example an element identified with xpath in native zone.

MultiTouchDown​

Description​

Adds a touch down event on the given element, with the given finger index.

Parameters​

NameValueDescription
ZoneString



* NATIVE

* WEB

* TEXT
Select Zone
ElementIntegerSelect Element
IndexIntegerElement index
FingerIndexIntegerfinger index - distinguishes between paths.

MultiTouchDownCoordinate​

Description​

Adds a touch down event on the given coordinate, with the given finger index.

Parameters​

NameValueDescription
X-CoordinateIntegerthe x coordinate for the touch point
Y-CoordinateIntegerthe y coordinate for the touch point
FingerIndexIntegerfinger index - distinguishes between paths.

MultiTouchMove​

Description​

Adds a move event to the given element, with the given finger index.

The move will start from the last point touched down or moved to.

Parameters​

NameValueDescription
ZoneString



* NATIVE

* WEB

* TEXT
Select Zone
ElementIntegerSelect Element
IndexIntegerElement index
FingerIndexIntegerfinger index - distinguishes between paths.

MultiTouchMoveCoordinate​

Description​

Adds a move event to the given coordinate, with the given finger index.

The move will start from the last point touched down or moved to.

Parameters​

NameValueDescription
X-CoordinateIntegerthe x coordinate for the touch point
Y-CoordinateIntegerthe y coordinate for the touch point
FingerIndexIntegerfinger index - distinguishes between paths.

MultiTouchUp​

Description​

Touch up from the last point touched down or moved to.

Parameters​

NameValueDescription
FingerIndexIntegerfinger index - distinguishes between paths.

MultiClick​

Description​

Adds a click on the given element, with the given finger index.

Parameters​

NameValueDescription
ZoneString



* NATIVE

* WEB

* TEXT
Select Zone
ElementIntegerSelect Element
IndexIntegerElement index
FingerIndexIntegerfinger index - distinguishes between paths.

MultiClickCoordinate​

Description​

Adds a click one the given coordinate, with the given finger index

Parameters​

NameValueDescription
X-CoordinateIntegerthe x coordinate for the touch point
Y-CoordinateIntegerthe y coordinate for the touch point
FingerIndexIntegerfinger index - distinguishes between paths.

MultiSwipe​

Description​

Performs a swipe across the screen in the given direction, with the given finger.

Parameters​

NameValueDescription
DirectionStringDirection of the swipe motion.
OffsetIntegerSwipe offset (in pixels).
TimeIntegerOverall swipe time
FingerIndexIntegerfinger index - distinguishes between paths.

MultiWait​

Description​

Adds a wait, with the given finger.

Parameters​

NameValueDescription
DirectionStringDirection of the swipe motion.
OffsetIntegerSwipe offset (in pixels).
TimeIntegerOverall swipe time
FingerIndexIntegerfinger index - distinguishes between paths.

Usage​

info

Replace <server> with the appropriate URL.

Gesture Commands

DesiredCapabilities dc = new DesiredCapabilities();
driver = new IOSDriver(new URL("<server>"), dc);
seetest = new SeeTestClient(driver);
dc.setCapability(MobileCapabilityType.UDID, "<deviceid>");

...
seetest.launch("com.apple.Maps", false, false);
// finger 0
seetest.startMultiGesture("test");
seetest.multiTouchDownCoordinate(200,600, 0);
seetest.multiTouchMoveCoordinate(250, 600, 0);
seetest.multiTouchUp(0);

// finger 1
seetest.multiTouchDownCoordinate(170,600, 1);
seetest.multiTouchMoveCoordinate(140, 600, 1);
seetest.multiTouchUp(1);

seetest.performMultiGesture();