I've having some problems managing context sensitive menu items through windows forms. I can access them programmatically no problem like this:
...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.
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();
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!