drag and drop without mouse moves

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
steve20
Posts: 6
Joined: Wed Jun 04, 2014 9:13 am

drag and drop without mouse moves

Post by steve20 » Thu Jun 12, 2014 5:45 pm

hey,
is it possible to do "drag and drop" without using mouse moves (via pixels)?
Other software has special functions for that.
Are there any functions in ranorex (like the ranorex spy does) ?

regards

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: drag and drop without mouse moves

Post by krstcs » Thu Jun 12, 2014 6:26 pm

You can do drag-and-drop without having to use pixels at all.

You need to do a few things to set it up, but it works very well.

1. Create a repo object for the object(s) to be "dragged".
2. Create a repo object for the object that is in the location you want to drag TO.
3. In the action table of the recording module do the following:
3.1. Mouse -> Down -> Left -> Center -> <object from 1. above>
3.2. Mouse -> Move -> Center -> <object from 2. above> (this may be optional, you can try it and see)
3.3. Mouse -> Up -> Left -> Center -> <object from 2. above>

The Mouse -> Move action in 3.2 will move the mouse to the location of the object you select, and the Mouse -> Up in 3.3 will drop the dragged item.

No pixels or distances.



I've added a sample solution. Just look in Recording1.rxrec.

EDIT: I added delays in the script so you could see what was going on, but they don't have to be in the final project/recording.
Attachments
DragDropTest.zip
(35.78 KiB) Downloaded 173 times
Shortcuts usually aren't...

steve20
Posts: 6
Joined: Wed Jun 04, 2014 9:13 am

Re: drag and drop without mouse moves

Post by steve20 » Fri Jun 13, 2014 9:04 am

hey krstcs,

thanks for your quick answer. it works very well.
It is quite an easy solution but I'm a total beginner in ranorex.