07-31-2018, 04:50 AM
This solution is working - worked it out myself.
Code:
'Wait for save to finish
WaitForSave(Browser("PDCS").Page("A").WebElement("Popup"))
Function WaitForSave(theObj)
timeSpent = 0
waitTimeOut = 20
Set tempObj = theObj 'example: (Browser("PDCS").Page("A").WebElement("Popup"))
Do While tempObj.Exist(0)
If timespent = waitTimeOut Then
Reporter.ReportEvent micFail, "Wait for Save", "Waiting for save to finalise and has not completed 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