Page 1 of 1

Drag and Drop files

Posted: Tue Nov 29, 2016 10:20 am
by MB_wiko
Hello together,

I just want to record Drag and Drop files from windows Explorer into an web application. Until now I didn't have success. I didn't find a text for helping me in internet (I saw the articles for drag and drop in the application with mouse down, mouse move and mouse up, but I can not use this?!? I can not find the file in explorer in Spy). And the recorder didn't record any steps. Do you have some best practices for me?

Thanks a lot in advance.

Re: Drag and Drop files

Posted: Tue Nov 29, 2016 10:51 am
by odklizec
Hi,

I'm afraid, it's pretty hard to suggest something reliable without more details about your use case, your web app and location of the file on your PC. Please always post as much details about your problem as possible!

Why can't you find the file in Explorer? My guess is, that you will first have to set a correct working directory in explorer, in which can be found the file you want to D&D. Then if it's not in a visible area of Explorer (its list), you will have to make it visible (e.g. using EnsureVisible() method). Then you will have to select it and perform Mouse Down action on it, move the mouse to a desired element in your web application and finally, drop the file (Mouse Up). Most of the above actions should be doable just with Recording actions, but it may be necessary to add some actions manually, instead of recording them!

Re: Drag and Drop files

Posted: Wed Nov 30, 2016 1:31 pm
by MB_wiko
Sorry. I thought you same best practice. I just tried again:

The process is like following:

Click click left mouse on file in windows explorer, than move mouse on web application, than mouse left up => we have a webapplication: On the screen we can import files from windows explorer. We can insert the files with drag and drop into the browser. That is the case I would record.
DMS Drag and Drop.jpg
At this time I recorded it but the rxrec-files was empty, so I tried with spy and record following steps manually. I select the objects with spy and inserted them manually into the rxrec-file.
Unbenannt.JPG
Step 1 click in windows explorer
Step 2 and Step3 are operation in windows explorer

Step 5 is the drag and drop in webapplication.

Step 4 I inserted because the windows explorer frame is set into the background before the drag and drop is finished, but this has no success.

I hope my new information are helping you.

Re: Drag and Drop files

Posted: Wed Nov 30, 2016 3:07 pm
by odklizec
Hi,

Drag&Drop operations are always better to be added manually, instead of recording them. However, the D&D sequence, as you posted and described it, looks wrong to me. What you need to do is this:
- Mouse Down in Explorer (on element you want to drag, i.e. file).
- EnsureVisible of element in Web app.
- Mouse Move to destination element in web app.
- And finally, Mouse Up action to drop the file.

Notice that the EnsureVisible action should be performed "BEFORE" mouse move!

Check also this post about D&D operation:
http://www.ranorex.com/forum/drag-and-d ... t8565.html