Legacy | Drag

  • Command: touch

  • Subcommand: drag

  • 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 the drag gesture. You can define the touch sequence coordinates and time frame of the drag. The location parameter supplies the coordinates of the start and end points of the drag. There is a touchdown at the beginning of the drag and a touch-up at the end of the drag. A touchdown is performed with the first pair of coordinates. This is followed by a drag through all the coordinates until the last one, where a touch-up is performed.

The Auxiliary operation parameter is used by the system recorder when recording actions. Avoid entering this data manually.

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.

auxiliary

tap (Tap)

notap (No tap)

down (Down)

up (Up)

Tap

Tap - Touch down at the beginning and touch up at the end

No Tap - No auxiliary operation

Down - Touch down at the beginning

Up - Touch up at the end

duration

   

The duration, in seconds (1-30), for performing the drag operation.

* Mandatory parameter

Request & Response

Copy

Request

https://mycloud.perfectomobile.com/services/executions/john@perfectomobile.com_controller_16-11-13_07_54_36_233?operation=command&securityToken=<your_token>&command=touch&subcommand=drag&param.deviceId=04157DF47CA01828&param.location=298,1197,525,1195
Copy

JSON response

{
    "executionId":"john@perfectomobile.com_controller_16-11-13_07_54_36_233",
    "reason":"Success",
    "timer.elapsed":"5376",
    "testGridReportUrl":"https://mycloud.reporting-stg.perfectomobile.com?externalId[0]=john@perfectomobile.com_controller_16-11-13_07_54_36_233",
    "timer.ux":"0",
    "singleTestReportUrl":"https://mycloud.perfectomobile.com/nexperience/singletest/report/?reportRepositoryKey=PRIVATE:controller/161113/controller_16-11-13_07_54_36_233.xml&ownerId=john@perfectomobile.com&sharingCode=b3ba66ff-d54e-4ccb-a102-60793cd4545f",
    "description":"Success",
    "timer.system":"5376",
    "reportKey":"PRIVATE:controller/161113/controller_16-11-13_07_54_36_233.xml",
    "completed":"true",
    "flowEndCode":"SUCCEEDED",
    "timer.device":"0"}