| || |
Verification of a mainwindow\'s classes question
I am trying to verify all the menus are listed, are in the correct order and enabled on a main window.
I have been able to write the code to verify all menu items in a pulldown are correct (ie total number and the captions). I haven't been able to do this with the main page's menu items which happen to be 6. In the declarations I see the menu class listed. But how do I parse through a list of windows???
I have tried without much success to do a for each loop to go through each child of the mainwindow and just add up the number of for example the main menus listed on the top of the application. I am finding it has to be a list of string, not list of windows. I didn't find anything in the help to convert a list of window to a list of string.
Any pointers would be great.
Re: Verification of a mainwindow\'s classes question
If you are using the Open Agent you could use the following script to print out all menu entries:
<font class="small">Code:</font><hr /><pre>
[-] testcase PrintAllMenues() appstate none
[ ] LIST OF WINDOW allMainMenues = Desktop.FindAll("./MainWin/Menu")
[ ] WINDOW mainMenu
[-] for each mainMenu in allMainMenues
[ ] LIST OF WINDOW menuItems = mainMenu.FindAll(".//MenuItem")
[ ] Print(mainMenu.GetCaption())
[ ] WINDOW menuItem
[-] for each menuItem in menuItems
[ ] Print(menuItem.GetCaption())