Hi,
Preparation
1. Please, add in project item "TestedApps"
2. In this item add "iexplore" from your local. During add IE please set parameters,i.e. command line, = "-nohome"
3. Run once IE and in manually via IE go to some site, f.e.
www.google.com4. Educate you namemapping with IE process, page and IEFrame(0)>> in result in namemapping must be present
Sys -
iexplore -
IEFrameSys -
iexplore -
pageDuring add object "page" stay one property "objecttype" = "page"
In script
Public IE
Public IEApp
Public IEFrame
Public Page
Sub Main
' Set TestedApps "Internet Explorer" in var
Set IEApp = TestedApps.iexplore
' Set main process IE
Set IE = Aliases.Sys.iexplore
' Set IEFrame(0)
Set IEFrame = IE.IEFrame(0)
' Set IE page object
Set Page = IE.page
' Close IE
CloseIE ' Run IE
IEApp.Run
' Wait while IeFrame will be present during 30 sec
If Not WaitMainFrameIE(30000) Then
Log.Error("IeFrame not Exists")
End If
' Change position of IE with size on 1024*768
IEFrame.Position 1, 1, 1024, 768 ' Refresh IE process
IE.Refresh ' Check that Page of IE present during 20 sec
For i = 1 To 21
If Page.Exists Then Exit For
If i = 21 Then
Log.Error("Page not Exists")
Exit Sub
End If
Call aqUtils.Delay(1000, "Wait page during " & i & " to 20 sec")
Next
' Go to page by URL and check full page load
Set NewPage = Page.ToUrl("
www.google.ru") ' page not loaded - exit sub
If Not NewPage.Exists Then
Log.Error("page not loaded - exit sub")
Exit Sub
End If
' some code
End Sub
Sub CloseIE
Do
If IE.Exists Then
IE.Terminate
Else
Exit Do
End If
Loop
End Sub
Function WaitMainFrameIE(Timeout)
WaitMainFrameIE = False
' Check that IEFrame present during var "Timeout"
Set IEFrame = IE.WaitWindow("IEFrame", "*", -1, Timeout)
' IEFrame not Exists - exit function
If Not IEFrame.Exists Then Exit Function
WaitMainFrameIE = True
End Function ' WaitMainFrameIE