how to select the multi level sub menu object
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
how to select the multi level sub menu object
Hi all,
Can anybody please help me with the issue? Im stuck at a point selecting submenu within a submenu
Our desktop application has below Menu format:
Main Menu
SubMenu1
SubMenu2
SubMenuA
SubMenuB
SubMenu3
I able to select till SubMenu2. How do I select SubMenuA and SubMenuB?
Thanks in Advance
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The easiest way to find out how to select menu item, is to record your actions and then look at the code.
If you work with custom menu, it will be more difficult and require some skills to convert recorded actions into script code.
Gennadiy Alpaev
Software Testing Automation Tips - my new book
TestComplete Cookbook is published!
About Community Experts
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If the menu is normal and standard menu then you can click by using below lin.
MenubarObject.Click(MainMenu|SubMenu2|SubMenuA);
Thanks
Shankar R
LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com
“You must expect great things from you, before you can do them”- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am approaching a similar issue with web testing. I like the above answers, and may try them if mine does not work. However, my initial thought of how to handle my similar issue would be to use 'Conditional Mapping' within Name Mapping portion of TestComplete.
Hope you find solution that best works for you.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your approach is working fine when i hardcode the values but while looping Im facing a problem. Then second level has only 4 submenus but on using the Submenu.count() while using for loop, it shows 6 in the count list. Any ideas?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Menu
- Submenu1
- Submenu2
- item1
- item2
- subitem1
- subitem2
In the above scenario, when you get submenu count for Submenu2 it will return 4 as it's direct sub submenu has childs.
Thanks
Shankar R
LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com
“You must expect great things from you, before you can do them”- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Shankar,
Thanks for the quick reply. Your explanation makes sense if we are taking the count of child items of Submenu2. However in our application we have direct child items instead of child items for child items as in your example.
Below is the scenario in our application. The count for SubMenu5 shows 6 instead of 4. Count for Menu shows 5 though(excluding separators) It is similar to Windows Notepad application but with submenu for submenu.
Menu
Submenu1
Submenu2
Submenu3
Submenu4
Submenu5
Option1
Option2
Option3
Option4
I am able to select each of the options however "index out of bounds" error is thrown for index 5 and 6 which are not even present.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you have already excluded separators, than it is possible that you have hidden menu items. You can navigate the menu using Object Spy (the MainMenu property) and examine every single menu item.
Gennadiy Alpaev
Software Testing Automation Tips - my new book
TestComplete Cookbook is published!
About Community Experts
