Drag And Drop
Performs drag and drop operations by dragging an element from one location and dropping it onto another element.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing the node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If Continue On Error property is true, no error is caught when the project is executed, even if the Catch node is used.
Input
- Browser ID - The browser session identifier from the Open Browser node.
- Source Selector - The XPath or CSS selector for the element to drag.
- Target Selector - The XPath or CSS selector for the drop target element.
Options
-
Selector Type - Type of selector used for both source and target:
- XPath - Use XPath expressions (default)
- CSS - Use CSS selectors
-
Wait Timeout (sec) - Maximum time to wait for elements to appear. Default is 5 seconds.
Examples
Drag File to Upload Area
Browser ID: {{browser_id}}
Source Selector: //div[@class='file-item']
Target Selector: //div[@class='upload-zone']
Selector Type: XPath
Reorder List Items
Browser ID: {{browser_id}}
Source Selector: //ul[@id='sortable']/li[1]
Target Selector: //ul[@id='sortable']/li[5]
Move Elements Between Containers
Browser ID: {{browser_id}}
Source Selector: div.draggable-item
Target Selector: div.drop-container
Selector Type: CSS
Drag and Drop in Kanban Board
Browser ID: {{browser_id}}
Source Selector: //div[@data-card-id='123']
Target Selector: //div[@data-column='done']
Tips
- Both source and target elements must be visible and enabled
- Some drag and drop implementations use HTML5 drag API, which may require custom JavaScript
- Ensure elements are fully loaded before attempting drag and drop
- The operation moves the mouse smoothly from source to target
- Add delay after operation to allow animations to complete
Common Errors
- "Browser ID cannot be empty" - Connect to an Open Browser node
- "Source Selector cannot be empty" - Provide a selector for the element to drag
- "Target Selector cannot be empty" - Provide a selector for the drop target
- "Source element not found within X seconds" - The source element doesn't exist or is not visible
- "Target element not found within X seconds" - The target element doesn't exist or is not visible
- "Timeout cannot be empty" - Provide a timeout value
Related Nodes
- Click Element - Click elements
- Hover - Hover over elements
- Wait Element - Wait for elements