Gesture

Command: touch

Subcommand: gesture

Supported Platforms: Native, UFT, Selenium, Appium

Supported OS: Android, iOS

Performs the multi-touch operation, pinch and zoom

Description

The start and end coordinates must be defined. It is also possible to define the duration of the gesture. The start and end coordinates specify the touch sequence path for a single finger, the other finger is symmetrical.

For example:

Zoom - if the start coordinate is (50%,50%) and the end coordinate is (60%,40%), then one finger will move from (50%,50%) to (60%,40%), and the other from (50%,50%) to (40%,60%).

Pinch - if the start coordinate is (60%,40%) and the end coordinate is (50%,50%), then one finger will move from (60%,40%) to (50%,50%) and the other from (40%,60%) to (50%,50%).

Macro recording can provide the start and end coordinates. See the Drag function for more information.

Note

API Change (effective as of release 19.10): Because the API used to implement the IDE gesture command or Perfecto mobile:touch:gesture extension for iOS is being deprecated, we are updating its implementation to be based on a newer API. While the new API performs more accurately and consistently, in some cases, parameter values in existing scripts may trigger different behavior and may need to be updated.

Parameters

Name Value Default Description
deviceId*     The device for this command.
start*    

The start, touch down, event coordinates.

Format - x,y

Coordinate value can be in pixels or in percentage of screen size (0-100). For percentage use the % sign.

Example - 50%, 50%

It is recommended to use the percentage value as it does not rely on the screen resolution.

end*    

The end, touch up, event coordinates.

Format - x,y

Coordinate value can be in pixels or in percentage of screen size (0-100). For percentage use the % sign.

Example - 60%, 40%

It is recommended to use the percentage value as it does not rely on the screen resolution.

operation

zoom (Zoom)

pinch (Pinch)

Zoom

The gesture operation type.

Zoom - performs pinch open operation from the start coordinates to the end coordinates.

Pinch - performs pinch close operation from the start coordinates to the end coordinates.

duration     The duration, in seconds (0-10), for performing the operation.

* Mandatory parameter

Request & Response

Copy

Request

 https://qatestlab.perfectomobile.com/services/executions/yaacovw@perfectomobile.com_controller_16-11-13_08_16_27_239?operation=command&securityToken=<your_token>&command=touch&subcommand=gesture&param.deviceId=04157DF47CA01828&param.start=525,1190&param.end=298,1188&param.operation=zoom
Copy

JSON response

{
    "executionId":"john@perfectomobile.com_controller_16-11-13_08_16_27_239",
    "reason":"Success",
    "timer.elapsed":"281",
    "testGridReportUrl":"https://mycloud.reporting-stg.perfectomobile.com?externalId[0]=john@perfectomobile.com_controller_16-11-13_08_16_27_239",
    "timer.ux":"0",
    "singleTestReportUrl":"https://mycloud.perfectomobile.com/nexperience/singletest/report/?reportRepositoryKey=PRIVATE:controller/161113/controller_16-11-13_08_16_27_239.xml&ownerId=john@perfectomobile.com&sharingCode=ace2abb5-1429-4de1-9769-67dd4c27db5a",
    "description":"Success",
    "timer.system":"281",
    "reportKey":"PRIVATE:controller/161113/controller_16-11-13_08_16_27_239.xml",
    "completed":"true",
    "flowEndCode":"SUCCEEDED",
    "timer.device":"0"}