Ask a Question

IfObject problem

tyrus
Contributor

IfObject problem

Hi, I have a question about "IfObject" method in keyword tests.

I'm trying to see if a an object exists at runtime specifically: Aliases.FirstWindowsApplication.dlg.Static

 

so I add "IfObject" per https://support.smartbear.com/viewarticle/69092/

 

but if the object is not visible TC throws and exception?? why is this happening? I would think i nthe event  IfObject returns false, it will simple continue to "else"... Is this not how it works? if not what is the point if  "IfObject...else?"

 

I inluded my .exe and the script

thanks

 

 

2 REPLIES 2
dmiscannon
Frequent Contributor

To get around the issue you are experiencing, I use IfObject with Exists and not Visible. If it doesn't exist, then it will move to the Else. For TestComplete to determine if the object is visible or not, the object must exist. Hence the error you are receiving.

thanks that seems to work

cancel
Showing results for 
Search instead for 
Did you mean: