Sahi Documentation

Drag and drop issues

Drag and drop does not seem to work

symptom It seems like Sahi is not able to identify the drag source or drop target. The drag and drop fails.
resolution Sometimes you may need to specify a location "inside" the drag source or drop target for the drag/drop to work. We do this by using _xy().

In Sahi, _XY() API specifies the coordinates on element where the event is fired.

Eg. _click(_xy(_button("id"), 10, 20)) clicks inside the button, 10px from the left and 20 pixels from the top.

Negative values can be given to specify offset from right and bottom. Eg. _click(_xy(_button("id"), -5, -10)) clicks inside the button, 5px from the right and 10px from the bottom.

So the _dragDrop code can be written as