Drag Drop Activity
The Drag Drop activity simulates a drag-and-drop interaction between two elements on a web page, identified by their XPath locations. It allows automation to pick up a source element and release it onto a target element, replicating the behavior a user would perform with a mouse.
| Field | Description | Requirement |
|---|---|---|
| Application name | Specifies the reference name of the application previously opened or attached via the dropdown menu. | Required |
| Source field | The XPath identifying the element to be dragged. | Required |
| Source label | An alternative to Source field that identifies the drag source by label instead of XPath. | Optional |
| Source label match type | Defines how Source label is compared against candidate elements (e.g., Equals, Contains). | Optional |
| Target field | The XPath identifying the element the source will be dropped onto. | Required |
| Target label | An alternative to Target field that identifies the drop target by label instead of XPath. | Optional |
| Target label match type | Defines how Target label is compared against candidate elements (e.g., Equals, Contains). | Optional |
| Wait until load | Pauses execution until the page finishes loading before performing the drag-and-drop. | Optional |
| Wait until visible | Pauses execution until both the source and target elements are visible on the page. | Optional |
| X-coordinate offset | Adjusts the horizontal drop position relative to the target element by a specified pixel value. | Optional |
| Y-coordinate offset | Adjusts the vertical drop position relative to the target element by a specified pixel value. | Optional |
Action Types & Examples
Element-to-Element Drag
- Format: string (XPath)
- Example Result: Source
//div[@id="item-1"]dropped onto//div[@id="dropzone"].
Implementation Examples
Field Setup - Application name: ${robustaWebpage} - Source field: //div[@id="item-1"] - Target field: //div[@id="dropzone"] - Wait until load: true
Execution Parameters - X-coordinate offset: 10 - Y-coordinate offset: 0
Technical Notes
Source label/Target labelprovide a fallback way to identify elements when a stable XPath is not available, similar to the label support used by the Get, Set, and Mouse activities. Coordinate offsets are applied relative to the target element's position and are useful when the drop must land on a specific sub-area rather than the element's center.