Forum Discussion

mfoster711's avatar
mfoster711
Regular Contributor
9 years ago
Solved

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.

 

CurrField.Click x,y
Call CurrField.PopupMenu.Click("Sort|Descending")

I tried adding a check for CurrField.PopupMenu.Exists or CurrField.PopupMenu = Null and both of these cause run time errors also.

  • SOAPUI with Hermes will always send a soap over jms. If you are intended to use just jms message you may use groovy script to call TIBCO EMS API to communicate jms message. Hope this helps.

13 Replies

  • There's no way of checking to see if a window exists unless you manually verify all the steps. The pop up windows are something that should be in the design documentation.

     

    You can also see if a window exists by going to a browser and clicking F12 for development mode. Then you would just have to dig through to see if there are any windows and find your matching window if it exists.

     

    This is how I find pop up windows and implement them using the xpath.

  • I'm late to the discussion, but I just had the case, around TestComplete/Execute 15.57.

    I wanted to test wnd.PopupMenu for null, before calling Click() on it.

    It seems that getting the PopupMenu property is not exactly a passive readonly code; I guess it's doing something to check the popup window. When calling PopupMenu twice, once to check whether it's null, and then again to call Click() on it, the second value was always null.

    What worked for me is this (JScript):

    var mnu = wnd.PopupMenu;
    if (mnu != null) { mnu.Click("xxx"); }
    else { Log.Error("null popup"); }