Forum Discussion

pashooo's avatar
pashooo
Contributor
14 years ago

how to verify that object doesnt exist

In my project I need to verify that project doesnt appear after some action.

I tried 2 methods:


aqObject.CheckProperty(ser_popup, "Exists", cmpEqual, false);

if(ser_popup.Exist==true)log.messag("popup form BA RClick")



... but both of them leads to error:

Unable to find the object Exist. See Additional Information for details.



So, how pro-testers, like Helen Kosova, verify such properties?



 

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Check out the following article.



    http://smartbear.com/support/viewarticle/14496/



    The key is this:  How do you check the "Exists" property of a non-existant object?



    So, you need to use things like FindChild or WaitNNN methods to return an "empty" object if the object doesn't exists.  The article outlines several ways of doing this.



    Hope this helps.
  • In addition to Robert's words: as far as I can see, you are working with a pop-up menu. The test objects for these menus exist only when the menu is visible. Once the menu closes, the object does not exist. Make sure to call ClickR to invoke the menu.


    >> if(ser_popup.Exist==true)log.messag("popup form BA RClick")

    >> Unable to find the object Exist.


    You misspelled the property name. It should be Exists, not Exist. Maybe this is the cause of the error?

  • !!! Alex, you are right) it's my carelessness...  

    "if(ser_popup.Exists==true)log.error("popup form fut RClick");" - works correctly