Ranorex can't see AUTs menu items

Ask general questions here.
User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Ranorex can't see AUTs menu items

Post by Ciege » Wed Apr 29, 2009 11:15 pm

Ranorex Spy displays the menus (I.e. the File menu) of my AUT as a "Form 'NativePopupMenu'". According to Spy it does not have any children associated. Therefore none of the menu items are available to me.

Currently I have to hard code all the shortcuts (i.e. Alt-F O for Open). But I would really like to be able to read the menu items at run time because the menus can contain different items depending on various states of the AUT.

Spy shows the information:
FlavorName: Win32
Class: WindowsForms10.Window.0.app.0.378734a
Role: Form [form]


Anything I can do here?

Thanks...

P.S. From my last inquiry with you guys, you should have a copy or at least access to get a copy of my AUT. Information was in emai to support.

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 » Thu Apr 30, 2009 3:13 pm

After playing around with your AUT a bit, I can definitely say that the menubar and the popupmenus are custom implementations and unfortunately do not expose their interior to Ranorex.

However, our upcoming version 2.1 might help because we have integrated a number of imaging functions into the API.

So if you have menu items which might change their location or might even not be there, you can do something like this:

Code: Select all

MyRepo.MyMenuBar.Click(new Location(MyResources.MenuItemTest));
where MyResources.MenuItemTest is a Bitmap (from a resource in this case)

or something like this:

Code: Select all

MyRepo.MyMenuPopup.Click(Imaging.Load("MenuItemProjectPlan.png"));
Ranorex then tries to find the correct location by looking for the provided image template in the element on the screen. You can of course tweak imaging settings for speed/robustness etc.

Hope that helps.
Version 2.1 will probably be released in about 2 weeks. If you are interested, we can provide you with a (non-public) beta version early next week.

Michael
Ranorex Team

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

Post by Ciege » Thu Apr 30, 2009 4:03 pm

Thanks for taking a look. I think I will wait on using a non public release for this issue. I have too many other pressing items that still need to be completed and I can handle using keystrokes for the time being. We have a new AUT that is being redesigned with newer components so I will make sure dev understands the need for automation-ability.

Thanks.