0 votes
Hello Team,

Please I need a help

to find menu count and sub menu count

to find menu count i have

cnt = Window("Menu").Menu("MainMenu1").GetNumItems()

this above println prints 9

but how to find sub menu count

for example you have one menu called country which has  sub menu states then how to get number of states

Any samples are great help thanks in davance
asked Mar 24, 2016 in QA Wizard Pro by Deepthi

2 Answers

0 votes
The example would depend on your application (looks like a windows application) as the menu controls do function differently based on the technology used.

Is this just a standard windows menu..? (Send a screenshot if possible)

Then we can look to send you an example.
answered Mar 27, 2016 by nico (8,200 points)
0 votes
Hi Deephi


You need to capture the sub menu control, the main menu and sub menu are two controls.

Just use the QA Wizard to click the main menu and then click the sub menu during recording, then you can find the sub menu control. after that you can get the itemCount.

if you are recording against a web app then


if it is window then

just change the Browser to window and then it will do, just  as you wrote in your original code


this is the general idea and easy one

If you want to capture a sub menu automatically based on a know main menu during playback.

I can offer two methods for that, but you need to know the strcuture of your target, like is the content of the sub menu  dynamic or not? changeable according to database data?  More details are reuqired.  but ifjust a simply one, I think the first general method would fit.

Good luck
answered Mar 30, 2016 by Leo (230 points)
248 questions
262 answers
2,047 users