Page tree
Skip to end of metadata
Go to start of metadata

Supported in iOS

Note

Gesture commands are supported on iOS only (version 9 and up) in full-control mode.


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.

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

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

General structure for gesture
  // 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

void (String MutliGesturesName)

 Description

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

PerfomMultiGestureStep

void ()

 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, e.g, an element identified with xpath in native zone.

MultiTouchDown

void (String Zone, String Element, int Index, int fingerIndex)

Parameters

  • Zone: Select Zone
  • Element: Select Element
  • Index: Element index
  • FingerIndex: finger index - distinguishes between paths.

 Description

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

MultiTouchDownCoordinate

void (int x, int y, int fingerIndex)

Parameters

  • xthe x coordinate for the touch point 
  • y: the y coordinate for the touch point 
  • FingerIndex: finger index - distinguishes between paths.

 Description

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

MultiTouchMove

void (String Zone, String Element, int Index, int fingerIndex)

Parameters

  • Zone: Select Zone
  • Element: Select Element
  • Index: Element index
  • FingerIndex: finger index - distinguishes between paths.

 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.

MultiTouchMoveCoordinate

void (int x, int y, int fingerIndex)

Parameters

  • x: the x coordinate for the touch point 
  • y: the y coordinate for the touch point 
  • FingerIndex: finger index - distinguishes between paths.

 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.

MultiTouchUp

void (int fingerIndex)

Parameters

  • FingerIndex: finger index - distinguishes between paths.

 Description

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

MultiClick

void (String Zone, String Element, int Index, int fingerIndex)

Parameters

  • Zone: Select Zone
  • Element: Select Element
  • Index: Element index
  • FingerIndex: finger index - distinguishes between paths.

 Description

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

MultiClickCoordinate

void (int x, int y, int fingerIndex)

Parameters

  • x: the x coordinate for the touch point 
  • y: the y coordinate for the touch point 
  • FingerIndex: finger index - distinguishes between paths.

 Description

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

MultiSwipe

void (String Direction, Int Offset, Int Time, Int fingerIndex)

Parameters

 Description

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

MultiWait

void (Int Time, int FingerIndex)

Parameters

 Description

Adds a wait, with the given finger.

Example

This example will perform pinch using 'Maps'

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

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

client.performMultiGesture();
  • No labels