dragAndDropToObject - Selenium IDE
dragAndDropToObject (drop from, drop to) - Selenium IDE command
dragAndDropToObject: Here you provide element locator of object to be dragged in target column and element locator of drag destination object in value column. Do not confuse this with the "dragAndDrop" command (not supported, does anyone need it?) where you need to provide source element locator in target column and x,y offset in pixel (Current location to destination location where you want to drop element) in value column with "dragAndDrop" command.
Drag and drop recording is tricky. The command works well for simple cases like https://html5demos.com/drag/, but the IDE can not yet record pages like https://jqueryui.com/draggable/ because there is no drop target and it depends on x,y coordinates. For widgets like https://fritz-c.github.io/react-sortable-tree/ it fails because it seems to depend on dragover/enter to show the final drop target. Of course, we would be more than happy to receive pull requests if you can improve drag and drop further.
Overall, visual web automation is better suited for drag & drop testing than the Selenium DOM based approach. The free Kantu visual automation tool controls the mouse inside the Chromium and generates all the right mouse events by design.
Related Demo Macros
The ready-to-import-and-run source code of all demo macros can be found in the Github repository testmacros folder.
Anything wrong or missing on this page? Suggestions?
...then please contact us.