Forum Discussion
Never try to execute actions on objects that may not exist yet.
so no
x = <function/command to find the object>
x.click
but
x = <function/command to find the object>
if (<check if x exists returns true>)
{ x.click }
else
{ Log.Error("Couldnt click x because the object was not found") }
Could be that the various TestComplete built-in checks like CheckProperty returns errors when they fail, but I try to refrain from using them unless they don't fill my log with green checks or red errors.
What marinb said... Unless you can pretty much guarentee the object will be there, don't attempt to do anything until it is.
If you're using NameMapping, there's a built-in auto-time out (defaults to 10 seconds) so you might be able to get away with standard functionality. But if you're performing some action and then checking to see if some other result happened, it's always a good idea to use WaitNNN methods or "FindChild" methods to look for the object and then check the result of that method to determine if it was successful.
Related Content
- 10 months agoIrinaManea
- 9 months agoAnabelle