07-30-2018, 05:37 AM
I need to pass an object to a function and wait until it no longer exists - as it is not saved until the popup has disappeared.
I need to set a time out for the popup displaying to stop looking after a certain time
This is required on many different panels / popup, so I want the same code to work just based on a same browser, different page, different heading on popup
I have tried the following but it does not reset the .exist line, so the value never changes to false
This works fine outside of the function
Do I need to Set the object??
I need to set a time out for the popup displaying to stop looking after a certain time
This is required on many different panels / popup, so I want the same code to work just based on a same browser, different page, different heading on popup
I have tried the following but it does not reset the .exist line, so the value never changes to false
Code:
Function waitToBeSaved(strObject) – being Browser(BrowserName).Page(PageName). object (popup header)
Dim strObject 'to hold page object description
Dim intCounter 'to store loop counter value
Dim strFinished 'to store page existence value
intCounter = 0
strFinished = strObject.Exist
Do While (intCounter <10) OR (strFinished = True)
strFinished = strObject.Exist(1)
intCounter = intCounter+1
Loop
If intCounter = 10 Then
Reporter.ReportEvent micFail........
Exit Test
End If
End Function
This works fine outside of the function
Do I need to Set the object??