TESTUS
12 years agoContributor
w.VisibleOnScreen does not exist
Hello SmartBear Support,
I am using the attached code snippet from your [support site].
About 2 out of 9 times an error occurs at line 7 and 9. It says:
At the "Additional Info" tab it says:
I ran the same script 9 times in a row and got the error at run 1 and 5. So the error seems to appear randomly.
Please help, thanks.
I am using the attached code snippet from your [support site].
Sub Test
i = 0
Set p = TestedApps.myApp.Run
Do
Set w = p.WaitWindow("ThunderRT6FormDC", "myApp(V?.*?.*?)", -1, 60000)
i = i + 1
Loop Until (w.Exists And w.VisibleOnScreen) Or (i > 10)
If Not (w.Exists And w.VisibleOnScreen) Then
Log.Warning "Window not found."
Else
Log.Message "Window was found."
End If
End Sub
About 2 out of 9 times an error occurs at line 7 and 9. It says:
"The object does not exist. See Additional Information for details."
At the "Additional Info" tab it says:
"You are trying to call the "VisibleOnScreen" method or property of the "myApp (V?.*?.*?)" object that does not exist."
I ran the same script 9 times in a row and got the error at run 1 and 5. So the error seems to appear randomly.
Please help, thanks.
- Hi Oliver,
From what you describe, I would not sure that p is well defined when the loop starts.
Just before the WaitWindow loop and after the Set p = TestApps.myApp.Run I would add
Set p = WaitProcess(processName,20000). The timeout value can be very hight as the function returns as soon as it gets a grip on the process.
It's worth a try ;-)
Sincerely
Simon Glet