Hi David,
You may try the following code to wait for the page to be downloaded into the browser.
Note: The below code does not wait until the browser processes jscript code on the page and generates the objects that might be absent in the original html. (OnWebPageDownloaded event is also triggered before script code is processed.) So, you must wait additionally for the object you need if it is generated during runtime by page's script code on the client.
If ("iexplore" = Aliases.browser.ObjectIdentifier) Then
PageObject.Wait
While 4 <> PageObject.readyState
' w := PageObject.Parent.WaitWindow('#32770', '*', -1, 500);
' if (w.Exists) then
' w.Close;
Call aqUtils.Delay(500, "Waiting for the page to load from the web server...")
Wend
Else
Do Until aqObject.IsSupported(PageObject, "contentDocument")
Call aqUtils.Delay(500, "Waiting for the page to load from the web server...")
Loop
Do Until BuiltIn.varDispatch = aqObject.GetVarType(PageObject.contentDocument) 'PageObject.contentDocument Is Nothing
Call aqUtils.Delay(500, "Waiting for the page to load from the web server...")
Loop
Do Until aqObject.IsSupported(PageObject.contentDocument, "readyState")
Call aqUtils.Delay(500, "Waiting for the page to load from the web server...")
Loop
Do Until BuiltIn.varOleStr = aqObject.GetVarType(PageObject.contentDocument.readyState)
Call aqUtils.Delay(500, "Waiting for the page to load from the web server...")
Loop
Do Until "complete" = PageObject.contentDocument.readyState
' w := PageObject.Parent.WaitWindow('#32770', '*', -1, 500);
' if (w.Exists) then
' w.Close;
Call aqUtils.Delay(500, "Waiting for the page to load from the web server...")
Loop
End If