Submenu - Can't find submenu if it moves from right to left

Ask general questions here.
rboivin
Posts: 11
Joined: Tue Apr 07, 2009 7:14 pm

Submenu - Can't find submenu if it moves from right to left

Post by rboivin » Tue May 05, 2009 7:46 pm

I have mutiple submenu and don't have a problem selecting them as long as the menus are to the right. If the application is to close to one edge of the screen the submenu will then open to the left. I would like to be able to select the submenu item no matter if it opens on the right or left and also no matter where is may appear within the submenu. I am not using mouse corrdinates since I was anticipating the location of the submenu may change.

menubar
MenuItem
MenuItem
MenuItem -> SubMenuItem
SubMenuItem
SubMenuItem


I've checkout out the example you have but they do not take in consideration if the location of the submenu changes from right to left.

I'm doing this in VB.NET

Thanks

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

Post by Support Team » Wed May 06, 2009 1:25 pm

I guess that the problem is the instance attribute of the context menu. If there is no better way in uniquely identifying two popups (context menu and sub menu in your case), the instance number is used for native windows. The instance number is an index for native windows with the same class name according to their X/Y screen position. That may cause problems if the sub menu does not pop up on the same side it did when you recorded that action.

A solution is usally to remove the instance attribute from the RxPath of the corresponding repository item, e.g.: change "/contextmenu[@instance='1']" to "/contextmenu".

Regards,
Alex
Ranorex Support Team