'create a Description Property
Set oDesc = Description.Create
oDesc("html tag").value = "A"
oDesc("micclass").value = "Link"
'get all childobjects matching the description
Set oColl = Browser("name:=").Page("title:=").ChildObjects(oDe sc)
'count the number of child objects
NumLinks = oColl.Count
'create a loop to cycle through all the child objects
For i = 0 to NumLinks-1
LinkName = oColl(i).GetROProperty("innerhtml")
'determine if the link is enabled or disabled
If NOT oColl(i).GetROProperty("disabled") Then
Reporter.ReportEvent micPass, LinkActive, "The link " & LinkName & " is active."
Reporter.ReportEvent micFail, LinkInactive, "The link " & LinkName & " is inactive."
And one more thing, it also says check if the link point to the correct page. Im not sure but what i did was capture the HREF and URL property and compared them, is this sufficient enough to say that the link point to the correct page? Or should I go with Prince's advice? Here is my code on this:
' if URL and HREF matches, the target is valid
If oURL = ohref Then
Reporter.ReportEvent micPass, CorrectTarget, "The " & LinkName & " link's target is correct."
Reporter.ReportEvent micFail, IncorrectTarget, "The " & LinkName & " link's target is incorrect."
Your help is greatly appreciated Tarun and Prince. Thanks!