Forum Discussion

mfoster711's avatar
mfoster711
Regular Contributor
9 years ago

Check PopupMenu exists

How do I check if a popup menu exists before I try to interact with it?    The following code works as long as the PopupMenu exists. If it doesn't, I get a run time error on the second line.   Cu...
  • AlexKaras's avatar
    AlexKaras
    9 years ago

    Hi,

     

    Ah, I see. Property will be of no use for you.

    What you should do in this case:

    1) Open Object Spy in TestComplete and switch it to Point-and-Fix mode;

    2) (Right-)click on the control so that the popup menu is opened;

    3) Hover popup menu with the mouse and wait until it is recognized by Object Spy;

    4) Fix the captured object in the Object Spy (Ctrl-Shift-A shortcut if I remember correctly);

    5) Copy the identification code from Object Spy into your test code, adjust and use accordingly.

     

    (It is a usual thing that popup menu is a separate standalone object that is a child of either tested application process or main window.)