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.
How to get _dragdrop working
Hi,
I have an application where one of the action users can do is drag and drop. I have used the following code but the drag&drop does not work - i.e. the element is not dragged. The log show everything was successful and there are no errors.
Are there any working examples of this function that I can refer.
Thanks in advance.
Nav
_include("VLincludes.sah");
login("demo", "demo");
gotoReportDesign();
_wait(3000);
_click(_image("New Report"));
_wait(3000);
_mouseOver(_cell("Data source[1]"));
_wait(1000);
_dragDropXY(_cell("Data source[1]"), 20, 20, false);
I have an application where one of the action users can do is drag and drop. I have used the following code but the drag&drop does not work - i.e. the element is not dragged. The log show everything was successful and there are no errors.
Are there any working examples of this function that I can refer.
Thanks in advance.
Nav
_include("VLincludes.sah");
login("demo", "demo");
gotoReportDesign();
_wait(3000);
_click(_image("New Report"));
_wait(3000);
_mouseOver(_cell("Data source[1]"));
_wait(1000);
_dragDropXY(_cell("Data source[1]"), 20, 20, false);
Tagged:
Comments
It is generally better to use _dragDrop(elementToDrag, elementToDropOn) if that works.
I tried with this statement as well - but no luck. I can click on the cell with the below element and that is the one that gets dragged.
_dragDrop(top.document.getElementsByTagName('table')[128].rows[0].cells[2], _div("baseLayer"));
I have asked the dev team (overseas) as well if they can point be to the appropiate element. The controller in record mode definitely shows it as a cell.
Thanks.
Nav
May be some overlaid element is visible on mousedown. If you can tell us what UI framework your application uses, we may be able to find an example online.
Regards,
Narayan