Micro Focus QTP (UFT) Forums
QTP Broken Link Testing - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: QTP Broken Link Testing (/Thread-QTP-Broken-Link-Testing)



QTP Broken Link Testing - shriqtp - 05-14-2009

I would like to Test all Web Links for that i try to create following code but stucks in between. Can anyone provide me the exact code?

Code:
Dim WindowObj, nameoflink
Set WindowObj = Description.Create
WindowObj("Class Name").Value = "Link"
Set nameoflink  = Browser("Browser").Page("Page").ChildObjects(WindowObj)
'This gives error to me. NOT GETTING WHY?

Code:
msgbox nameoflink.Count

For i = 1 to nameoflink.Count -1
       ' Then i want to get the Name for Each Link
       ' then want to Click the Link object
       ' then want to come back to original page
       ' This i want to continue till all LINKS clicked & Tested
Next


It would be gr8ly appreciated if anyone can reply with exact code.
Thanks


RE: QTP Broken Link Testing - manojith1984 - 05-15-2009

Hi,

Code:
Dim WindowObj, nameoflink
Set WindowObj = Description.Create
WindowObj("micClass").Value = "Link"
Set nameoflink = Browser("Browser").Page("Page").ChildObjects(WindowObj)
msgbox nameoflink.Count
I think this should solve the problem...


Rolleyes