I'm still having issues with waiting for a page to load. I'm trying the page.wait method now, and I'm uncertain of precisely how to extract what it returns. For instance:
Sub BasicsFA_RegionSum
BasicsFA_RegionSum
Call iexplore.ToURL(Project.Variables.server & "gsa/webbas01.nsf/(vwWebPage)/Webbase.htm?OpenDocument&Set=1,Scope=RS______,App=Basics__________,Select=P-Active,")
str = iexplore.Page(Project.Variables.server & "gsa/webbas01.nsf/(vwWebPage)/Webbase.htm?OpenDocument&Set=1,Scope=RS______,App=Basics__________,Select=P-Active,").Wait
In the example above, the str variable is indeed getting populated, but with something very different than the URL of the page. There are frames involved on the pages in question. I'm uncertain how best to accomplish what I need here. I was hoping the str variable would return the URL, then I could easily run a compare of it vs. the string of the URL and log the results if they were different, but it seems when set str = iexplore.Page(URL).wait, the .wait bit isn't waiting. I'm at a loss here.
Any suggestions? I've tried the technique listed in the help file as follows:
Sub BasicsFA_RegionSum
Dim iexplore
Set iexplore = Aliases.iexplore
call iexplore.ToURL(Project.Variables.server & "gsa/webbas01.nsf/(vwWebPage)/webbase.htm?OpenDocument&Login&Set=1,Scope=PS______,App=Basics__________,Select=P-Active,")
Set pg = iexplore.ToURL(Project.Variables.server & "gsa/webbas01.nsf/(vwWebPage)/Webbase.htm?OpenDocument&Set=1,Scope=RSLU____,App=Basics__________,Select=P-Active,")
' Wait for frames
waitFrm = True
Set Frames = GetFrames(Pg) ' Obtain the frames collection
While waitFrm
For Each Frame In Frames
If Frame.Exists Then
waitFrm = waitFrm And (Frame.readyStateValue <> 4)
End If
Next
If waitFrm Then
aqUtils.Delay 100
End If
WEnd
msgbox ("page loaded")
End Sub
' Obtain the frames collection
Function GetFrames(APage)
GetFrames(APage)
Select Case Options.Web.TreeModel
Case "DOM" Set GetFrames = APage.document.frames ' DOM model
Case "Tag" Set GetFrames = APage.FRAME ' Tag model
Case Else Set GetFrames = APage ' Tree and Hybrid models
End Select
End Function
This only results in the script being caught in an infinite loop even after the page finishes loading (which takes something on the order of 30 seconds).
Thanks!