Solved
Forum Discussion
ssv
7 years agoOccasional Contributor
I have the following syntax
If Sys.Process("msiexec", 2).Form("product*").Exists Then Set qvProcess = Sys.Process("msiexec", 2).Form("product*") Else If Sys.Process("msiexec").Form("product*").Exists Then Set qvProcess = Sys.Process("msiexec").Form("product*") End If End If
the above syntax solves the problem that i have, but with a minor setback. when entering the loop statement, the Test Complete tries to wait for the object, and as it will not be there, it throws an error
Unable to find the object Form("product*")
and then goes to the else statement and finds the object. Is it possible for me to supress the error somehow, or is there any other ways for me to solve this error?
Thanks in advance!
liquidphantom
7 years agoOccasional Contributor
You'll need to use an If Not for the first statement
i.e.
If Not Sys.Process("msiexec", 2).Form("product*").Exists Then Set qvProcess = Sys.Process("msiexec").Form("product*") ElseIf Sys.Process("msiexec", 2).Form("product*").Exists Then Set qvProcess = Sys.Process("msiexec", 2).Form("product*")
End If
Might have to tweak it a little but the If Not is important so it doesn't get caught in the error.