Forum Discussion
JDR2500
5 days agoFrequent Contributor
For debugging this problem I would be tempted to try using FindChild in a loop to make sure TestComplete is really finding your form. Once it's found then you could use the property checkpoint to make sure it's visible on screen.
I would use a timer in the loop so that you aren't stuck forever if something goes wrong. You could use something like this to wait for the form:
Function WaitForChild(parentObj, childName, timeoutMS)
Dim startTime, elapsedTime, childObj
startTime = aqDateTime.Now()
Do
Set childObj = parentObj.FindChild("Name", childName, 5)
If Not childObj Is Nothing And childObj.Exists Then
Set WaitForChild = childObj
Exit Function
End If
Delay 100 ' Wait briefly before checking again
elapsedTime = aqDateTime.TimeSpan(aqDateTime.Now(), startTime) * 1000
Loop While elapsedTime < timeoutMS
Log.Warning "Child object '" & childName & "' did not appear within " & timeoutMS & " ms."
Set WaitForChild = Nothing
End Function