Legacy | Swipe
-
Command: touch
-
Subcommand: swipe
-
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 swipe gesture, which is a three-part gesture:
- A touchdown at the start coordinates
- A move to the end coordinates
- A touch-up at the end coordinates
The relationship between the start and end coordinates defines the direction vector of the swipe. It is possible to also define the time frame of the swipe.
The start and end coordinate values can be in pixels or in percentage. Always use the same type for both coordinates.
The (0,0) point is in the upper left corner of the screen. The x-coordinate value increases to the right and the y-coordinate value increases to the bottom.
Parameters
Name | Value | Default | Description |
---|---|---|---|
deviceID* | The device for this command. | ||
start* |
The start, touch down, event coordinates. Format - x,y The 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 because it does not rely on the screen resolution. |
||
end* |
The end, touch up, event coordinates. Format - x,y The 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 because it does not rely on the screen resolution. |
||
duration | The duration, in seconds (0-10), for performing the swipe operation. |
* Mandatory
Request & Response
Request
https://mycloud.perfectomobile.com/services/executions/john@perfectomobile.com_controller_16-11-06_07_18_52_341?operation=command&securityToken=<your_token>&command=touch&subcommand=swipe¶m.deviceId=6370E775¶m.start=20,300¶m.end=540,320
JSON request
{
"executionId":"john@perfectomobile.com_controller_16-11-07_09_47_45_487",
"reason":"Success",
"timer.elapsed":"1328",
"testGridReportUrl":"https://mycloud.reporting-stg.perfectomobile.com?externalId[0]=john@perfectomobile.com_controller_16-11-07_09_47_45_487",
"timer.ux":"0",
"singleTestReportUrl":"https://mycloud.perfectomobile.com/nexperience/singletest/report/?reportRepositoryKey=PRIVATE:controller/161107/controller_16-11-07_09_47_45_487.xml&ownerId=john@perfectomobile.com&sharingCode=ef8a7281-7aec-46ef-a0ba-b1d08d4d9c64",
"description":"Success",
"timer.system":"1328",
"reportKey":"PRIVATE:controller/161107/controller_16-11-07_09_47_45_487.xml",
"completed":"true",
"flowEndCode":"SUCCEEDED",
"timer.device":"0"}