Just in case anyone is looking - this also works
This is waiting for the object to appear and waits till it does, or drops out if it doesn't appear after a certain time
Function WaitForResult(theObj)
timeSpent = 0
waitTimeOut = 20
Set tempObj = theObj 'example: Browser("PD").Page("SearchPage").WebTable("Results Table")
Do While tempObj.Exist(0) = False
If timespent = waitTimeOut Then
Reporter.ReportEvent micFail, "Wait for Result", "Waiting for a result to occur and has not appeared in " & timeSpent & " seconds. Need to check why it has not saved. Test will stop"
ExitTest
Else
Wait 1
timeSpent = timeSpent + 1
End If
Loop
End Function
This is waiting for the object to appear and waits till it does, or drops out if it doesn't appear after a certain time
Function WaitForResult(theObj)
timeSpent = 0
waitTimeOut = 20
Set tempObj = theObj 'example: Browser("PD").Page("SearchPage").WebTable("Results Table")
Do While tempObj.Exist(0) = False
If timespent = waitTimeOut Then
Reporter.ReportEvent micFail, "Wait for Result", "Waiting for a result to occur and has not appeared in " & timeSpent & " seconds. Need to check why it has not saved. Test will stop"
ExitTest
Else
Wait 1
timeSpent = timeSpent + 1
End If
Loop
End Function