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

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.
ElementElement 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

IndexIntegerElement Order
XOffset IntegerHorizontal 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.

Set Experitest Url

Please make sure you replace <EXPERITEST_URL> with appropriate URL in the sample code below.

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("<EXPERITEST_URL>"), 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);
  • No labels