Page 1 of 1

drag and drop without mouse moves

Posted: Thu Jun 12, 2014 5:45 pm
by steve20
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

Re: drag and drop without mouse moves

Posted: Thu Jun 12, 2014 6:26 pm
by krstcs
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.

Re: drag and drop without mouse moves

Posted: Fri Jun 13, 2014 9:04 am
by steve20
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.