How do we count the links displayed on page using QTp,can we use getrop property,pls do me needful with dis coding part,suppose there ar some 10 links
we need to count the links and we need to validate.
Printable View
How do we count the links displayed on page using QTp,can we use getrop property,pls do me needful with dis coding part,suppose there ar some 10 links
we need to count the links and we need to validate.
You can count the links using the following code:
Set oLink = Description.Create()
oLink("micclass").value = "Link"
oLink("html tag").value = "A"
Set oLinkCount = Browser("").Page("").ChildObjects(oLink)
MsgBox oLinkCount
Set ObjectControl = Browser("Name").Page("Name")
Dim oDesc
Set oDesc = Description.Create()
oDesc("micclass").Value = "Link"'It is nothing but the class name of respective object.
Set Objects = ObjectControl.ChildObjects(oDesc)
environment("Objectscount") = Objects.Count'This environment variable holds the number/count of object of specified class in the destination page.
Cheers!!