I'm using the Exists property to confirm that an object - a button - does not appear on the page (WinForms app). If the button does appear, I log an error message. The problem is that TC is logging an error since the object cannot be found. How can I get around this so that no error messages, other than ones I create, appear in the log.
I run into that problem alot when I have a long name...
What happens is any one of those items can be missing. So if you try to check if .window.exists() and the process doesn't exist, then you get a situation where you're calling a method on something that doesn't exist.
2 ways I know around it is. Use some sort of try/catch block or exception handling. Or try checking each level to make sure each object up the tree exists before trying to reference the next object up.
As Jared pointed out, even in using a long name, if you're going to call the Exists method, it you need to use a "Wait" method to determine your object. Again, consider that calling "Exists" on a non-existant object will always return an error because you can't call a method on an object that does not exist. The "Wait" methods in TestComplete create a stub object that, if the object you are "waiting" for does not exist, will still return an object but it will have an Exists of FALSE.
There's a help topic in TestComplete about waiting for processes or windows that does describe some of this stuff. Very helpful stuff in there.
Automated Testing Evangelists
Definition expert - noun - Unknown drip under pressure