Incorrrect mouse movements,cause Wrong elements being clickd

Bug reports.
User avatar
slavikf
Posts: 104
Joined: Mon Sep 13, 2010 9:07 pm
Location: Toronto, Canada
Contact:

Incorrrect mouse movements,cause Wrong elements being clickd

Post by slavikf » Wed Dec 29, 2010 8:48 pm

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.
You do not have the required permissions to view the files attached to this post.

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Incorrrect mouse movements,cause Wrong elements being clickd

Post by Ciege » Wed Dec 29, 2010 11:12 pm

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.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Incorrrect mouse movements,cause Wrong elements being clickd

Post by Support Team » Thu Dec 30, 2010 10:52 am

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