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
Name | Value | Description |
---|---|---|
Zone | String with following valid values * NATIVE * WEB * TEXT | Zones which define the way the element will be identified. |
Element | Element Identifier as String | Select Element from drop-down list OR (for OCR text identification) insert text into the empty box in the drop down list |
Index | Integer | Element Order |
XOffset | Integer | Horizontal Offset from the Element in screen pixels (negative values are possible, can use P2cx to convert screen percentage to pixels) |
YOffset | Integer | Vertical 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.
- Public Continuous Testing Cloud - https://cloud.seetest.io/wd/hub/.
- Dedicated Continuous Testing Cloud environment - Your own domain. For example: https://company.experitest.com/wd/hub/
- On-premises Continuous Testing Cloud environment - Your designated URL. For example: https://company.com/wd/hub
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);