Micro Focus QTP (UFT) Forums
how to print link names in a for list - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: General (https://www.learnqtp.com/forums/Forum-General)
+--- Forum: Posting Guidelines/Disclaimer (https://www.learnqtp.com/forums/Forum-Posting-Guidelines-Disclaimer)
+--- Thread: how to print link names in a for list (/Thread-how-to-print-link-names-in-a-for-list)



how to print link names in a for list - sqadri - 12-20-2011

I am trying to print all link names on a page using following code
For inCount = LBound(myHomePageLinks) To UBound(myHomePageLinks)
'If Browser("Horizon Blue Cross Blue").Page("Horizon – Plan Configurator").Link(intCount).Exist Then
'Reporter.ReportEvent micPass, "Found", myHomePageLinks(intCount)
'else
' Reporter.ReportEvent micFail, "Failed", myHomePageLinks(intCount)
'Print(arrayElements)
'msgbox(arrayElements)

'end If
'Next

But I am getting error @ this place: Link(intCount).Exist Then

Could someone please help with this issue

Thanks,
Sqadri
Smile


RE: how to print link names in a for list - Sathiya - 12-20-2011

Hi Dude,
will you please confirm whether "intcount" and "incount" are same?



RE: how to print link names in a for list - sshukla12 - 12-20-2011

Hi,
myHomePageLinks---> I think this is an array where u had stored all the links present on the page.
In "'If Browser("Horizon Blue Cross Blue").Page("Horizon – Plan Configurator").Link(intCount).Exist Then "
u are checking if link exists or not but intcount doesn't specify the object here, it will give you the refrence for a particular object in the loop. If you want to access the link use Set obj=Browser("Horizon Blue Cross Blue").........
then go for obj(intcount).Exists
if true then print the name or what ever action u want to perform.

Regards,
Sankalp