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.
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:
- To start a set of gesture commands, we need to execute gestureStartBuilding() first.
- All gesture steps will be performed when executing gesturePerform().
- Each gesture command is given a finger index. Index is any integer.
- Events can be performed on elements, given by any identification method, or by coordinates.
- 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
Name | Value | Description |
---|---|---|
Zone | String * NATIVE * WEB * TEXT | Select Zone |
Element | Integer | Select Element |
Index | Integer | Element index |
FingerIndex | Integer | finger index - distinguishes between paths. |
MultiTouchDownCoordinate
Description
Adds a touch down event on the given coordinate, with the given finger index.
Parameters
Name | Value | Description |
---|---|---|
X-Coordinate | Integer | the x coordinate for the touch point |
Y-Coordinate | Integer | the y coordinate for the touch point |
FingerIndex | Integer | finger 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
Name | Value | Description |
Zone | String * NATIVE * WEB * TEXT | Select Zone |
Element | Integer | Select Element |
Index | Integer | Element index |
FingerIndex | Integer | finger 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
Name | Value | Description |
---|---|---|
X-Coordinate | Integer | the x coordinate for the touch point |
Y-Coordinate | Integer | the y coordinate for the touch point |
FingerIndex | Integer | finger index - distinguishes between paths. |
MultiTouchUp
Description
Touch up from the last point touched down or moved to.
Parameters
Name | Value | Description |
---|---|---|
FingerIndex | Integer | finger index - distinguishes between paths. |
MultiClick
Description
Adds a click on the given element, with the given finger index.
Parameters
Name | Value | Description |
---|---|---|
Zone | String * NATIVE * WEB * TEXT | Select Zone |
Element | Integer | Select Element |
Index | Integer | Element index |
FingerIndex | Integer | finger index - distinguishes between paths. |
MultiClickCoordinate
Description
Adds a click one the given coordinate, with the given finger index
Parameters
Name | Value | Description |
---|---|---|
X-Coordinate | Integer | the x coordinate for the touch point |
Y-Coordinate | Integer | the y coordinate for the touch point |
FingerIndex | Integer | finger index - distinguishes between paths. |
MultiSwipe
Description
Performs a swipe across the screen in the given direction, with the given finger.
Parameters
Name | Value | Description |
---|---|---|
Direction | String | Direction of the swipe motion. |
Offset | Integer | Swipe offset (in pixels). |
Time | Integer | Overall swipe time |
FingerIndex | Integer | finger index - distinguishes between paths. |
MultiWait
Description
Adds a wait, with the given finger.
Parameters
Name | Value | Description |
---|---|---|
Direction | String | Direction of the swipe motion. |
Offset | Integer | Swipe offset (in pixels). |
Time | Integer | Overall swipe time |
FingerIndex | Integer | finger index - distinguishes between paths. |
Usage
Replace <server> with the appropriate URL.
- Public Continuous Testing Cloud - https://cloud.seetest.io/wd/hub/.
- Dedicated Continuous Testing Cloud environment - Your own domain. For example: https://company.experitest.com/wd/hub/
- On-premises Continuous Testing Cloud environment - Your designated URL. For example: https://company.com/wd/hub
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();