SeeTestAutomation - DragDrop
Please note that this tool is classified as a Legacy tool. We recommend transitioning to our updated solutions to maintain optimal performance and security in your workflows. For more information on this matter, please reach out to technical support .
Drag(Zone, DragElement, DragIndex, DropElement, DropIndex)
Description
Drag an element or text in a specified zone (you can drag the second, third, etc appearance of the element by setting Index to 1, 2, etc), and drop it on another element.
Parameters
- Zone - Select Zone.
- DragElement - Select Element from drop-down list OR (for OCR text identification) insert text into the empty box in the drop down list.
- DragIndex - Element Order (the number of times the element appears more than once).
- DropElement - Select Element from drop-down list OR (for OCR text identification) insert text into the empty box in the drop down list.
- DropIndex - Element Order (the number of times the element appears more than once).
Usage
Scenario**:** In the following example, we will use the DragDrop command together with the SeeTestAutomation - SetDragStartDelay command in order to move the Hangouts icon across the device's springboard, and drop it on the YouTube icon, in order to add it to a folder.
Command usage: We will first use the SetDragStartDelay command in order to press the element for 1000 milliseconds before starting the drag. We will then use the DragDrop command with the following configurations:
Parameters:
-
Zone - will be set to NATIVE
-
DragElement - will be set to xpath=//*[@text='Hangouts'] in order to identify the Hangouts icon element.
-
DragIndex - will be set to 0
-
DropElement - will be set to xpath=//*[@text='YouTube'] in order to identify the YouTube icon element.
-
DropIndex - will be set to 0
This will be the result of the sequence:
Code Examples:
Java Example
client.setDragStartDelay(1000);
client.dragDrop("NATIVE", "xpath=//*[@text='Hangouts']", 0, "xpath=//*[@text='YouTube']", 0);
C# Example Expand source
client.SetDragStartDelay(1000);
client.DragDrop("NATIVE", "xpath=//*[@text='Hangouts']", 0, "xpath=//*[@text='YouTube']", 0);
VBScript Example Expand source
client.SetDragStartDelay(1000)
client.DragDrop("NATIVE", "xpath=//*[@text='Hangouts']", 0, "xpath=//*[@text='YouTube']", 0)
Python Example Expand source
self.client.setDragStartDelay(1000)
self.client.dragDrop("NATIVE", "xpath=//*[@text='Hangouts']", 0, "xpath=//*[@text='YouTube']", 0)
Perl Example Expand source
$client->setDragStartDelay(1000);
$client->dragDrop("NATIVE", "xpath=//*[\@text='Hangouts']", 0, "xpath=//*[\@text='YouTube']", 0);