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

Description

This command allows you to drag an element or text from a specified zone and drop it on another element.


Parameters

Name

Value

Description

ZonestringSelect Zone - Native or Web
DragElementstringThe xpath identifier of the element to be dragged
DragIndexint

Specify index if the element appears more than once

DropElementstringThe xpath identifier of the element onto which the previous element will be dropped
DropIndex
Specify index if the element appears more than once

Usage

You can use this command to test drag drop scenarios if your app allows that (i.e. your app is a game that incorporates the dragging and dropping of elements).



Example

Set Experitest Url

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

Usage of DragDrop Command
driver = new AndroidDriver(new URL("<EXPERITEST_URL>"), dc);
seetest = new SeeTestClient(driver);


...
...

// specify how much time should pass before the drag action starts
// this ensures that the dragged elements is caught
seetest.setDragStartDelay(1000);
// locate the element at coordinates x: 250, y: 100 and clicks on it three times
seetest.dragDrop("NATIVE", "xpath=//*[@text='DemoUI']", 0, "xpath=//*[@text='EriBank']", 0);



In this example, dragging the DemoUi element on top of the EriBank element will create a folder that contains them both.






  • No labels