Link Object

QTP Web Testing- Link Object
Methods & Properties that we can apply on Link Object
‘ChildObjects method on LinkĀ  Object
Dim oLink, Links
Set oLink = Description.Create
oLink(“micclass”).Value =”Link”
Set Links=Browser(“name:=Google”).Page(“url:=”).ChildObjects(oLink)
Msgbox Links.count
‘Exist Property for Google News Link
If Browser(“name:=Google”).Page(“url:=”).Link(“name:=News”).Exist(2) then

‘GetToProperty method on Link Object
x = Browser(“name:=Google”).Page(“url:=”).Link(“name:=News”).GetTOProperty(“name”)
Msgbox x
‘GetROProperty method on Link Object
y = Browser(“name:=Google”).Page(“url:=”).Link(“name:=News”).GetROProperty(“visible”)
Msgbox y

‘GetToProperties method on Google News Link
Set Gprops= Browser(“name:=Google”).Page(“url:=”).Link(“name:=News”).GetTOProperties()
Gpropscount = Gprops.count
Msgbox Gpropscount
For i=0 to Gpropscount-1
Gpropsname = Gprops(i).Name
Gpropsvalue = Gprops(i).value
Msgbox Gpropsname & “=” & Gpropsvalue
‘Click Method on Link Object
If Browser(“name:=Google News”).Page(“title:=Google News”).Exist(2) Then
Msgbox “Google News page opened successfully”
End If
End If

Browser(“name:=Google News”).Close




This site uses Akismet to reduce spam. Learn how your comment data is processed.