Public Function CustomWait(waitLimit, expectedObj)
responseReceived = false
startTime = Now()
While Not responseReceived
wait(1)
If expectedObj.Exist(0) Then
responseReceived = true
CustomReporter micInfo, "Object found: " & expectedObj.ToString , "Waited for " & DateDiff ("s", startTime, Now()) & " seconds"
End If
If DateDiff ("s", startTime, Now()) > waitLimit Then
CustomReporter micFail, "Object not found: " & expectedObj.ToString , "The test failed due to missing object, waited for " & waitLimit & " seconds"
ExitTest(0)
Else
CustomReporter micInfo, "Waiting for Object: " & expectedObj.ToString , "Waited for " & DateDiff ("s", startTime, Now()) & " seconds"
End If
Wend
End Function
responseReceived = false
startTime = Now()
While Not responseReceived
wait(1)
If expectedObj.Exist(0) Then
responseReceived = true
CustomReporter micInfo, "Object found: " & expectedObj.ToString , "Waited for " & DateDiff ("s", startTime, Now()) & " seconds"
End If
If DateDiff ("s", startTime, Now()) > waitLimit Then
CustomReporter micFail, "Object not found: " & expectedObj.ToString , "The test failed due to missing object, waited for " & waitLimit & " seconds"
ExitTest(0)
Else
CustomReporter micInfo, "Waiting for Object: " & expectedObj.ToString , "Waited for " & DateDiff ("s", startTime, Now()) & " seconds"
End If
Wend
End Function
No comments:
Post a Comment