Hi..
The above approach might NOT work as expected when you have only one link in the page. This is because, QTP uses index property only when multiple objects are found. When there is only one object, index property is simply ignored, so the above loop will repeat indefinitely. (even if you set index=10000, QTP's Exists property will return the value as True; but they all refer to same Link here)
So, Take the count first and proceed.
The above approach might NOT work as expected when you have only one link in the page. This is because, QTP uses index property only when multiple objects are found. When there is only one object, index property is simply ignored, so the above loop will repeat indefinitely. (even if you set index=10000, QTP's Exists property will return the value as True; but they all refer to same Link here)
So, Take the count first and proceed.
Code:
Set chObj = Description.Create
chObj("micclass").Value= "LINK"
chObj("html tag").Value ="A"
chObj("class").Value ="arrow_normal"
objCount = Browser("IDD Portal Login").Page("IDD Portal").ChildObjects(chObj).count