Skip to main content

Drag

Description

Drag an element or text into a specified zone (you can drag the second, third, etc appearance of the element by setting Index to 1, 2, etc)

Parameters

NameValueDescription
ZoneString with following valid values



* NATIVE

* WEB

* TEXT
Zones which define the way the element will be identified.
ElementElement Identifier as StringSelect Element from drop-down list OR (for OCR text identification) insert text into the empty box in the drop down list
IndexIntegerElement Order
XOffsetIntegerHorizontal Offset from the Element in screen pixels (negative values are possible, can use P2cx to convert screen percentage to pixels)
YOffsetIntegerVertical Offset from the Element in screen pixels (negative values are possible, can use P2cy to convert screen percentage to pixels)

Usage

Command can be used with SetDragStartDelay command in order to move and element such as icon to one location to other.

info

Replace <server> with the appropriate URL.

Example

In the following example, we will use the drag command together with the SetDragStartDelay command in order to move the Play Store icon across the device's springboard.

**

**

Drag

DesiredCapabilities dc = new DesiredCapabilities();
driver = new AndroidDriver(new URL("<server>"), dc);
seetest = new SeeTestClient(driver);
dc.setCapability(MobileCapabilityType.UDID, "deviceid");

...
...

//Command to delay in drag.
seetest.setDragStartDelay(5000);
seetest.drag("NATIVE", "xpath=//*[@text='Play Store']", 0, 0, -300);