Legacy | Touch

  • Command: touch

  • Subcommand: tap

  • 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 touch operation on the specified coordinate location. A long press can be performed by using the durationparameter. A touchdown press is released with a touch- up release.

Parameters

Name

Value

Default

Description

deviceId*

   

The device for this command.

location*

   

The touch 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 - 20%, 25%

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

operation

single (Single)

double (Double)

up (Up)

down (Down)

force (Force)

Single

The touch operation mode.

Single - Perform a single tap on the specified coordinates

Double - Perform a double tap operation on the specified coordinates

Down - Perform a touch press on the specified coordinates

Up -Perform a touch release on the specified coordinates

Force - Perform a forceful tap on the specified coordinates

duration

   

The duration, in seconds, for performing the touch operation. Use this to perform a "long-press".

repeat

 

1

The number of times to repeat the operation. Relevant for tap and double tap actions only.

* Mandatory parameter

Request & Response

Copy

Request

https://mycloud.perfectomobile.com/services/executions/john@perfectomobile.com_controller_16-11-08_13_44_00_1095?operation=command&securityToken=<your_token>&command=touch&subcommand=tap&param.deviceId=6370E775&param.location=871,152
Copy

JSON response

{
    "executionId":"john@perfectomobile.com_controller_16-11-08_13_44_00_1095",
    "reason":"Success",
    "timer.elapsed":"47",
    "testGridReportUrl":"https://mycloud.reporting-stg.perfectomobile.com?externalId[0]=john@perfectomobile.com_controller_16-11-08_13_44_00_1095",
    "timer.ux":"0",
    "singleTestReportUrl":"https://mycloud.perfectomobile.com/nexperience/singletest/report/?reportRepositoryKey=PRIVATE:controller/161108/controller_16-11-08_13_44_00_1095.xml&ownerId=john@perfectomobile.com&sharingCode=71a76172-e4d8-4d48-a224-7c618f7f1c37",
    "description":"Success",
    "timer.system":"47",
    "reportKey":"PRIVATE:controller/161108/controller_16-11-08_13_44_00_1095.xml",
    "completed":"true",
    "flowEndCode":"SUCCEEDED",
    "timer.device":"0"}