Drag and Drop files

Ranorex Spy, Recorder, and Studio.
MB_wiko
Posts: 85
Joined: Fri Sep 09, 2016 1:05 pm

Drag and Drop files

Post by MB_wiko » Tue Nov 29, 2016 10:20 am

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.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Drag and Drop files

Post by odklizec » Tue Nov 29, 2016 10:51 am

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!
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

MB_wiko
Posts: 85
Joined: Fri Sep 09, 2016 1:05 pm

Re: Drag and Drop files

Post by MB_wiko » Wed Nov 30, 2016 1:31 pm

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
This is the view drag and drop
DMS Drag and Drop.jpg (52.24 KiB) Viewed 826 times
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
Recorded Details
Unbenannt.JPG (31.1 KiB) Viewed 826 times
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.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Drag and Drop files

Post by odklizec » Wed Nov 30, 2016 3:07 pm

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
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration