I wanted to test both test and prod environment for same content.I have the below code to check all the links in a page.
But my question is how to write code so it checks all the inner links from main page.
Eg: Lets assume home page has 10 links and each of these links leads to another 2 links
Basically i should be testing 10(main page) + 20 (each sublinks from the home page)

Set category = Description.Create()
category("micclass").Value = "Link"
Set linksFound = Browser(browsername).Page(pagename).ChildObjects(c ategory)
NumberOfLinks = linksFound.Count
For i=0 to NumberOfLinks - 1
Set linksFound = Browser(browsername).Page(pagename).ChildObjects(c ategory)
title = linksFound(i).QueryValue("text")
HTML = Browser(browsername).Page(pagename).Object.Body.in nerText
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''Check if page was not able to be displayed (For broken links)'''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''
If (InStr(HTML,"HTTP 404") <> 0) Or (InStr(HTML,"cannot be displayed") <> 0) Or (Instr(HTML,"Error") <> 0) Or (Instr(HTML,"File Not Found") <> 0)Then
Reporter.ReportEvent 1,"Broken link with Title: "&Title," Link is Broken"
Reporter.ReportEvent 0,"Good link with Title: "&Title , " Link is OK"
End If