Legacy | Gesture

Important: API Change (effective as of release 19.10): Because the API used to implement the IDE gesture command or the Perfecto extension mobile:touch:gesture for iOS has been deprecated, we have update 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.
  • Command: touch

  • Subcommand: gesture

  • Supported Platforms: Native (legacy), UFT (legacy), Selenium, Appium

    All commands must be executed using the same framework. Sharing the execution ID between different frameworks is not possible. This means that if you work with a Selenium/Appium driver, you need to call the commands using the Selenium/Appium driver (or, in the case of Reporting commands, through the Reporting SDK that works with the driver) and not as part of a UFT test or another framework.

  • Supported OS: Android, iOS

Description

Performs a multi-touch operation called pinch and zoom.

For this gesture, 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.

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"}