Demonstration: AddUsingTitle
As stated earlier, this method will store any browser with the provided title.
As stated earlier, this method will store any browser with the provided title.
Code:
SystemUtil.Run "iexplore.exe", "http://newtours.demoaut.com", "", "", 3 : Wait(4)
'Add the above open browser using its title
BrowserObject.AddUsingTitle "DemoAUT", ".*Mercury Tours.*"
SystemUtil.Run "iexplore.exe", "http://google.com", "", "", 3 : Wait(4)
'Add the above open browser using its title
BrowserObject.AddUsingTitle "Google", ".*Google.*"
'Use the names we gave the browser, and use the same name regardless of changes in its properties
With BrowserObject.Name("DemoAUT")
.WebEdit("name:=userName").Set "test"
.WebEdit("name:=password").Set "test"
.Image("name:=login").Click
.Sync
If .WebList("name:=fromPort").Exist(10) Then
.WebList("name:=fromPort").Select "Frankfurt"
.WebList("name:=fromMonth").Select "December"
.WebList("name:=toPort").Select "Paris"
.WebList("name:=toMonth").Select "December"
.WebRadioGroup("name:=servClass").Select "#1"
.WebList("name:=airline").Select "Unified Airlines"
.Image("name:=findFlights").Click
End If
End with
'Use the names we gave the browser, and use the same name regardless of changes in its properties
With BrowserObject.Name("Google")
.Link("text:=Gmail", "index:=0").Click
.Link("text:=+You", "index:=0").Click
.Link("text:=Images", "index:=0").Click
End with
With BrowserObject
.Name("DemoAUT").Close
.Name("Google").Close
End with
'Release
BrowserObject.Destroy