Difficulty managing context sensitive items in repository

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
carsonw
Posts: 178
Joined: Tue Nov 08, 2011 10:01 pm

Difficulty managing context sensitive items in repository

Post by carsonw » Tue Nov 08, 2011 10:13 pm

Hello there, we're just start to experiment with Ranorex. I've searched around the forums for an answer to this but haven't found anything that quite fits.

I've having some problems managing context sensitive menu items through windows forms. I can access them programmatically no problem like this:

Code: Select all


DoLogout.MainWindow.MenuBar.Trading_Program.Click();
Ranorex.MenuItem logoutContext = DoLogout.MainWindow.MenuBar.Trading_Program.FindSingle("./contextmenu/menuitem[@accessiblename='Log out and exit']");
logoutContext.Select();
...but what I really want to do is access them through the repository. This is not working, however. When I add the context menu to the repository, the menu items are added in a large "blob", each in their own subsection.

What I wanted to do was add them as subsections under their respective menu items, it's a more logical way to manage them.

Even so, I still cannot access them by using the repository, even though they are present there. I click the menu to open the context menu and then the context menu item is never found.

Essentially I click "Trading Program" then "Log out and exit". Similar examples might be "File -> Print" etc.

I know there are other ways to achieve this (short cut keys etc.), but there are some things we MUST be able to do through a menu and I am trying to prove that I can do this.

I've attached a screenshot to try and illustrate the problem in the repository that I'm having. Thanks!
Attachments
Repository.jpg
Repository.jpg (299.93 KiB) Viewed 1745 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Difficulty managing context sensitive items in repository

Post by Support Team » Wed Nov 09, 2011 3:33 pm

Hi there!

From the view of the host (your computer), a popup menu is like an own window - it doesn't belong to the applications which calls this menu. (The operating system provides this information this way...)
Therefore, it is direct under the root node.

You can define simple folders, which are just logic folders to which elements could be attached. With the help of this simple folders, you can organize these menus, for example you can do the following:
MyFirstApp
Menues
FileMenu
EditMenu
...
MySecondApp
Menues
....

For further information on working with the repository, simple folders ..... , go to http://www.ranorex.com/support/user-gui ... itory.html.


Within the code, try to avoid writing paths as string.
Use repository items instead, updating the path of a repository item will affect all references of this element.

For information using the repository in the code, go to http://www.ranorex.com/support/user-gui ... html#c3110.

Regards,
Martin
Ranorex Support Team
.
Image