Page 1 of 1

Incorrrect mouse movements,cause Wrong elements being clickd

Posted: Wed Dec 29, 2010 8:48 pm
by slavikf
Incorrrect mouse movements,cause Wrong elements being clickd

Scenario:
- Start Notepad
- Type some text
- Click File
- Click New

To reproduce bug either:
- Modify CLICK events location to CENTER.
- or during recording click on right side of NEW menu entry

Can't replay it in Ranorex. See attached project.

Reason for that is that "Click" method called on FILE menu with Location.Center and than same method called on NEW menu with Location.Center. However, during mouse movement from FILE location to NEW location, it goes over EDIT menu, and activates it. So, wrong menu entry clicked.
Not sure, what proper solution is.

Obvious work-around is not to use Location.Center, but to use Location.CenterLeft...

I suggest, that MENU clicks recorded with Center.Left location by default (overriding user click position). That will guarantee, that it will correctly replayed. There is no reason to save real click position for MENU clicks.

Re: Incorrrect mouse movements,cause Wrong elements being clickd

Posted: Wed Dec 29, 2010 11:12 pm
by Ciege
I believe if you set Mouse.DefaultMoveTime = 0 that will alleviate your issue.
If your mouse actually moves from File to New it is taking the shortest path to get there, which is a straight line that happens to intersect with the corner of Edit.

Re: Incorrrect mouse movements,cause Wrong elements being clickd

Posted: Thu Dec 30, 2010 10:52 am
by Support Team
This is a known problem with menu item pop-ups if you - as slavikf explained - click on the far right side of a menu item. If replay is slow, another pop-up menu might be activated. That's why we will introduce a new mouse movement behavior for menu items with Ranorex 3.X where the mouse won't move diagonally any more, but first goes e.g. down and then to the right in order to stay inside the bounds of the parent menu item. Consequently, this problem should not exist any more with 3.X, no matter where you click or how quick the mouse is moved.

There are a few ways how you can avoid that problem with Ranorex 2.X:
  • Increase the recording playback speed or the decrease the "Move Time" property for the respective recording action. You can also decrease the default "Move Time" using the Recorder Configuration. That way Ranorex will move the mouse quickly enough to not let any other pop-up be activated.
  • When recording clicks on menu items, always click on the "left" side of the menu item (or the side that is inside the bounds of the parent menu item, respectively).
  • If you need to click the far side of the menu item (i.e. the side that can cause problems), record a mouse move to the correct side first. See following section in the Ranorex User Guide on how to record mouse movements: http://www.ranorex.com/support/user-gui ... -keys.html
Regards,
Alex
Ranorex Team