18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
DragDrop on Jquery Draggable using Sahi not working
We implemented a drag and drop using Jquery UI component. I tried automating the drag and drop using the following code but it is not working
var $dragpos = _position($draggable);
var $dragposx = $dragpos[0];
var $dragposy = $dragpos[1];
var $pos = _position(_span("span_12"));
var $y = $pos[1];
var $postimespan = _position(_span("0925"));
var $x = $postimespan[0];
_call(_sahi.simulateMouseEventXY($draggable, "mousedown", $dragposx, $dragposy));
_dragDropXY($draggable,$x,$y);
Sahi says success but it doesnt do drag and drop.
A sample is present in this location.
jqueryui.com/demos/draggable/#snap-to
The reason that I think is wrong in the above code is mousedown. When I manually move the item , I have to hold the object with the left mouse button pressed while dragging which I believe the above code is not able to do. Any solution on this?
var $dragpos = _position($draggable);
var $dragposx = $dragpos[0];
var $dragposy = $dragpos[1];
var $pos = _position(_span("span_12"));
var $y = $pos[1];
var $postimespan = _position(_span("0925"));
var $x = $postimespan[0];
_call(_sahi.simulateMouseEventXY($draggable, "mousedown", $dragposx, $dragposy));
_dragDropXY($draggable,$x,$y);
Sahi says success but it doesnt do drag and drop.
A sample is present in this location.
jqueryui.com/demos/draggable/#snap-to
The reason that I think is wrong in the above code is mousedown. When I manually move the item , I have to hold the object with the left mouse button pressed while dragging which I believe the above code is not able to do. Any solution on this?
This discussion has been closed.
Comments
This issue has been fixed. (There was a bug in Sahi). The fix will be available in the next build (should be released in a day or two). We are emailing you a link to an intermediate build, so that you can verify.
Regards,
Narayan
Thanks for responding to this thread. Can you please send me the link for the build?
Thanks
Viju
Where is it? Can you also send me the link please? Thanks
For the record, the above mentioned code can be used for the JQuery UI components , drag and drop.