Forum Discussion

antonia_kresse's avatar
12 years ago

Test if Menu Item exist

Hello,



I want to test if the in my Menu exists an item. For exampein the Browser I will click "Help" and than "About". Then I will check if the about exists. How can I do this with TC?

Is there a method without scripting? If not, then I want to know the scripted method :)



I hope you can help me, I am thankful for every answer.

2 Replies


  • Hi Antonia,


     


    Actually, the code will be related to the menu control you are using. However, in most cases, the main app window has the MainMenu.wItems property that gives you access to the menu items. Refer to the "Items Property (Menu Controls)" article for details.


     

  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 1 rankChampion Level 1
    Hi Antonia,



    Another possible approach is to record a script (e.g. click on the menu item of interest) to get an idea of how TestComplete handles your menu control. Then you can improve recorded code to make it more reliable and independent of indexes (if TestComplete uses them in the recorded code).