How can you check all the URLS / Links are connected and working correctly throughout the application with the help of scripting in Quick Test Professional Automation tools

Questions by vishalsdg-325

Showing Answers 1 - 11 of 11 Answers


  • Apr 5th, 2006

you can use automated tools and websites available to test broken links.Just give the URL of the website and it will generate a report.

  Was this answer useful?  Yes

Vishal Asthana

  • Apr 5th, 2006

You can only thoes links which have been connected through that page, suppose one link is like, when you clik on that link a new uirl has been openedso how can you check

  Was this answer useful?  Yes

hi , This is srinivasulu. my answer is only system testing time you can check all the URL is perfectly working or not.

if one project u can connected one url , but sub-sequence url so many .

suppose u can take 10 sub url's in one project. Each sub Url is one application, once finished testing for all the applications. u test system testing , that time we combined all the applications and we did and we find its working or not.

if u want any clarification let me know.



  Was this answer useful?  Yes


  • Apr 25th, 2006

Simple task like this should be automated. write perl script and check if a link is valid or not.


1. You can even check dynamically created links

2. You can create an exe out of this script and run on any platform without perl installed on it ( please remember this is not portable meaning a windows created exe can be used on 95, 98, 2k, xp....only not on unix. but unix machnied always has perl these days )

  Was this answer useful?  Yes


  • Jun 3rd, 2006


Im Afraid what u people might not be correct ( Plz note : m not offending anyone)

Checking URL's is called as Link Testing.

Now we use Xenu or Link alarm to check for Broken Links

We use Infocus or A-prompt too for these resons.

thers is a bit of diff between link alarm and infous.


  Was this answer useful?  Yes


  • Jun 5th, 2006

but u cant check the java script page and applet pages.

  Was this answer useful?  Yes


  • Sep 12th, 2006

Cant we check links in Quick Test Pro,using Page checkpoint??

  Was this answer useful?  Yes


  • Oct 31st, 2007

We can check the number of images, links, load time using page checkpoint.
once a page checkpoint is created, after runing script, in test analysis pane gives detailed count of links, images,..

  Was this answer useful?  Yes


  • Jan 28th, 2008


I heard that various open tool web spiders exist in the market which can crawl the application and check for the broken links in the web application.

Currently I can not access any open source tool so I was thinking is there any way we can do the same job of web spiders or crawlers using QTP.

I have found out that using Page checkpoint in QTP we can know the number of links and there load time with expected urls in the QTP, this web page checkpoint also checks for the broken links in the web application..
But somehow when I tried this on the web page its not working fine .

Randomly its showing number of web links as checked and number of then as Not checked under broken link.

here I am not sure of following :-

A) Not checked URL by QTP is really a broken link or not?
B) Is it possible to navigate full web application for broken link and url using qtp or its page specific only.

While I am trying to find out the answers to my query by further analyzing the test results I have got …

it would be great if someone can help me with the correct way of doing it , If someone has tried this before of QTP

Many Thanks,

  Was this answer useful?  Yes

Function CheckLinks2 (BrowserObject, BrowserPage)
    CheckLinks2 = True

    sPage = "micclass:=Page"
    sBrowser = "creationtime:="
    Dim orgURL, orgCreationTime
    Dim i_Link, l_hWnd
    Dim b_newBrowser
    Dim s_LinkOuterText, s_LinkInnerText, s_Linkhref

    s_URL = BrowserPage.GetROProperty("url")
    l_hWnd = BrowserObject.GetROProperty("hwnd")

    i_CreationTime = 1

    i_LinkCount = BrowserPage.Object.links.Length - 1

    For i_Link = 0 To i_LinkCount

        If Trim(BrowserPage.Object.links(i_Link).target) = "" _
                And InStr(BrowserPage.Object.links(i_Link).href, "javascript:") = 0 Then
            b_newBrowser = False
            b_newBrowser = TRUE
        End If

        s_LinkOuterText = BrowserPage.Object.links(i_Link).outerText
        s_LinkInnerText = BrowserPage.Object.links(i_Link).innerText
        s_Linkhref = BrowserPage.Object.links(i_Link).href


        'Doing Browser.Exist with CreationTime:=1 when the browser does not
        'exist will give TRUE so i though of work around to compare the windows
        'handle for the old browser and the new browser with CreationTime:=1.
        'If they are same that mean no other window was opened.
        If b_newBrowser Then
            sBrowser = "CreationTime:=" & i_CreationTime
            l_newhWnd = CLng(Browser(sBrowser).GetROProperty("hwnd"))
            If CLng(l_hWnd) = l_newhWnd Then
                b_newBrowser = False
            End If
        End If

        On Error Resume Next
        If b_NewBrowser Then
            sBrowser = "CreationTime:=" & i_CreationTime
        End If
        On Error GoTo 0

        Dim s_LinkDetails

        If b_NewBrowser Then
            sBrowser = "CreationTime:=" & i_CreationTime
            IHTML = Browser(sBrowser).Page(sPage).Object.Body.innerHTML
            IHTML = BrowserPage.Object.Body.innerHTML
        End If

        'Check if page was not able to be displayed you can update this code any time
        If (InStr(IHTML, "HTTP 404") <> 0) Or (InStr(IHTML, "cannot be displayed") <> 0) Then
            s_LinkDetails = "Link Broken" + vbCrLf + "Link Details:" + vbCrLf
            s_LinkDetails = s_LinkDetails + "OuterText: " + s_LinkOuterText + vbCrLf
            s_LinkDetails = s_LinkDetails + "InnerText: " + s_LinkInnerText + vbCrLf
            s_LinkDetails = s_LinkDetails + "href: " + s_Linkhref + vbCrLf
            s_LinkDetails = s_LinkDetails + "Links Open in New Browse: " & bNewBrowser & vbCrLf
            Reporter.ReportEvent micWarning, "Check Link(" & i_Link & ") -> " & s_LinkOuterText , s_LinkDetails
            CheckLinks2 = FALSE
            s_LinkDetails = "Link Working" + vbCrLf + "Link Details:" + vbCrLf
            s_LinkDetails = s_LinkDetails + "OuterText: " + s_LinkOuterText + vbCrLf
            s_LinkDetails = s_LinkDetails + "InnerText: " + s_LinkInnerText + vbCrLf
            s_LinkDetails = s_LinkDetails + "href: " + s_Linkhref + vbCrLf
            s_LinkDetails = s_LinkDetails + "Links Open in New Browse: " & bNewBrowser & vbCrLf
            Reporter.ReportEvent micPass, "Check Link(" & i_Link & ") -> " & s_LinkOuterText , s_LinkDetails
        End If

        If b_NewBrowser Then
            sBrowser = "CreationTime:=" & i_CreationTime
            While CLng(Browser(sBrowser).GetROProperty("hwnd"))<>l_hwnd
                On Error Resume Next
                On Error GoTo 0
                'Tackle links that open a new browser and also opens a popup using that
                'i_CreationTime=i_CreationTime + 1

            i_CreationTime = 1

            On Error Resume Next
            BrowserObject.Navigate s_URL
            On Error GoTo 0
        End If
End Function

'*********************  In QTP **************
Set BrowserObject = Browser("micClass:=Browser", "CreationTime:=0")
Set BrowserPage = BrowserObject.Page("micClass:=Page")
CheckLinks2 BrowserObject, BrowserPage

Yes .. we can check all the URS/Links provided in the webpage are working or not.

1)Get the child objects (Links/URLs) from that web page.
2)Select the link/URL
3)Search for any object in the page which is opened after selecting that link/URL

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions