18 January 2026:


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.

issues with _dragDrop

bagsmodebagsmode Members
edited November -1 in Sahi - Open Source
Trying to simulate drag and drop using the _dragDrop api.
Have an id that I'd like to use.
I've tried a few different variations of using _byId with the _dragDrop api.. can someone please give me an example that I can work with so that I know that I'm using it correctly, please?

Thanks,
Glenn

Comments

  • narayannarayan Administrators
    Hi Glenn,

    Can you show how you are using it? It should be something like

    _dragDrop(_byId("dragMe"), _byId("dropArea"))


    Regards,
    Narayan
  • Sure, sorry, was just at lunch :p

    _dragDrop( _listItem(_byId("node-A0_AZ013_5_1_4fd9e1f5ad5c93406a00a328")), _listItem(_byId("28884832-0440-e19f-e948-16e770d3235b")));

    I tried adding the _listItem, since that's what they are that I'm dragging and dropping, but that didn't seem to work either (ie my initial attempt was without the _listItem, just using the _byId).

    One of the problems that I wonder about, is that a lot of the stuff we're doing is dynamic, and I wondered if there were any issues with that.
    For example, in my other post regarding the onclick for a table cell/td, I put some console.log's into the document ready section. I noticed that in looking at the console logs within Chrome, it takes a couple seconds for the properties of the values to be filled. The initial call, produces "[]", then a couple seconds later, they're filled with the td: "[<td...</td>]".
    With that in mind, I used _wait with 3000 for a 3 second delay. However, I _still_ am not finding the dynamic elements.

    Thank you for looking into this :)
  • Narayan,

    Haven't heard from you on this.. any additional thoughts?

    Also, if you see, the id names are rather unique and I'd prefer to be able to select them relatively, but unsure how I'd go about that..? Like just selecting the first listItem within the table..?

    Anyway, any additional thoughts would be great (like perhaps the _dragDrop doesn't work well on such and such browser?).

    Thanks
Sign In or Register to comment.