I have a few lines of code that occasionally causes Test Complete to error out. Here is the code:
<font class="small">Code:</font><hr /><pre>
while (!(Sys["Process"]("msiexec", 2)["Window"]("MsiDialogCloseClass", "My Application Window")["Window"]("Button", "&Finish")["Exists"]))
Basically, I don't want to attempt to use the window until it actually exists, so I have the script poll every half second to see if the window has been created yet.
The code works, but while the window does *not* exist, Test Complete reports an error in the log. That strikes me as odd, because I thought the whole reason to check for existence was to avoid errors!
I would like my script to end and report no errors, but unfortunately it doesn't (even though it works correctly), because every time that loop iterates it reports an error in the log. Am I checking for existence incorrectly, or is there some other approach I should use?