DragDrop
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 |
---|---|---|
Zone | string | Select Zone - Native or Web |
DragElement | string | The xpath identifier of the element to be dragged |
DragIndex | int | Specify index if the element appears more than once |
DropElement | string | The 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
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
Usage of DragDrop Command
driver = new AndroidDriver(new URL("<server>"), 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.