This is a Browser Action API.
_dragDrop simulates a drag and drop action.
_dragDrop(draggable, droppable)
The parameters are:
_dragDrop(_image("item"), _byId("ShoppingCart"));
will drag the item and drop it in the shopping cart
Also look at _dragDropXY
Drag and Drop is not a native event till HTML4. So events are “synthesized” in Sahi for some generic cases which may not work for every framework.
(HTML5 has native drag drop capabilities ; support in Sahi coming soon for HTML5).
To fix this, you could write your own function using the various _mouseXXX APIs. For example, to dragDrop on a GWT grid, you may use:
function gwtDragDrop($dragEl, $dropEl){
_mouseDown($dragEl);
_mouseOver($dragEl);
_mouseOver($dropEl);
_mouseUp($dropEl);
}
gwtDragDrop(_span("drag me"), _span("drop on me"));
For multi-window drag drops, the code may look something like this:
function dragDropMultiwin($win1, $dragEl, $win2, $dropEl){
_selectWindow($win1).
_mouseDown($dragEl);
_mouseOver($dragEl);
_selectWindow($win2);
_mouseOver($dropEl);
_mouseUp($dropEl);
}
dragDropMultiwin("window1", _span("drag me"), "window2", _span("drop on me"));
Another useful API is _xy which lets one specify the co-ordinate from which to drag an element. Normally the drag event is triggered at coordinate (0,0) of an element. If your element needs to be clicked somewhere in between, say 10px from left and 5px from top, use this example:
_dragDrop(_xy(_image("item"), 10, 5), _byId("ShoppingCart"));