Function Close_Browsers()
Dim oBrowser,Browsers,TotBrowsers,i
Set oBrowser = Description.Create
oBrowser("micclass").Value = "Browser"
Set Browsers = Desktop.ChildObjects(oBrowser)
TotBrowsers = Browsers.Count
Msgbox TotBrowsers
For i = 0 to TotBrowsers-1 Step 1
Browser(i).close
Next
End Function
—————————
ix) ‘Write Function to Count how many Buttons available in FR Window
Function Count_Buttons()
Set oButton=Description.Create
oButton(“Class Name”).Value=”WinButton”
Set Buttons=Window(“text:=Flight Reservation”).ChildObjects(oButton)
TotButtons=Buttons.Count
Msgbox TotButtons
End Function
Call Count_Buttons()
—————————–
x) ‘Write Function to Count how many Objects available in FR Window by specified Test Object class
Function Count_Objects(Object)
Set obj=Description.Create
obj(“Class Name”).Value=Object
Set Objects=Window(“text:=Flight Reservation”).ChildObjects(obj)
TotObjects=Objects.Count
Msgbox TotObjects
End Function
Call Count_Objects(“WinRadioButton”)
Call Count_Objects(“WinButton”)
Call Count_Objects(“WinEdit”)
Call Count_Objects(“WinComboBox”)
——————————–
xi) ‘Write function to capture all button names one by one from Login Dialog Box
Function Capture_Buttons()
Set oButton=Description.Create
oButton(“Class Name”).Value=”WinButton”
Set Buttons=Dialog(“text:=Login”).ChildObjects(oButton)
TotButtons=Buttons.Count
For i= 0 to TotButtons-1
myButton=Buttons(i).GetRoProperty(“text”)
Msgbox myButton
Next
End Function
Call Capture_Buttons()
'——————————————
xii) ‘Write function to Count Howmany Links available in Google Homepage
Function Count_Links()
Set oLink=Description.Create
oLink(“micclass”).Value=”Link”
Set Links=Browser(“title:=Google”).Page(“title:=Google”).ChildObjects(oLink)
TotLinks=Links.Count
Msgbox TotLinks
End Function
Call Count_Links()
'——————————————————————————-