Page tree
Skip to end of metadata
Go to start of metadata

Last updated: Mar 02, 2017 09:22

Perfecto Command

mobile:touch:swipe

Purpose

Performs the swipe gesture.

Parameters

NameTypePossible ValuesDescription
start (Mandatory)String 

The start, touch down, event coordinates.

Format - "x,y" or "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 (Mandatory)

String 

The end, touch up, event coordinates.

Format - "x,y" or "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.

durationInt1-10The duration, in seconds, for performing the operation.

Return Value

None

Exceptions

None

Examples

Java sample
Map<String, Object> params = new HashMap<>();
params.put("start", "20%,40%");
params.put("end", "15%,60%");
params.put("duration", "3");
Object res = driver.executeScript("mobile:touch:swipe", params);
C# sample
Dictionary<String, Object> pars = new Dictionary<String, Object>();
pars.Add("start", "20%,40%");
pars.Add("end", "15%,60%");
pars.Add("duration", "3");
Object res = driver.ExecuteScript("mobile:touch:swipe", pars);