write script for finding number of broken links in web page?

kindly please answer my question.

Answer Posted / lakshmi

To find no:of links present in any open web page:-
************************************************

dim br,pg,objbr,objpg,linkcoll,lcount
br=Browser("micclass:=Browser").GetRoProperty("name")
pg=Browser("micclass:=Browser").Page("micclass:=Page").
GetRoProperty("title")
set objbr=description.create
set objpg=description.create
set odesc=description.create
odesc("micclass").value="Link"
objbr("name").value=br
objpg("title").value=pg
set linkcoll=Browser(objbr).Page(objpg).ChildObjects(odesc)
lcount=linkcoll.count
msgbox lcount

Try it...

Is This Answer Correct ?    3 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Problem with XML checkpoint in QTP ?

3497


How to export quicktest professional (qtp) results to an .xls file?

593


How to use descriptive programming?

605


what is the latest version of QTP? Main difference between 9.2 and 10 version

1544


I am trying to install QTP 9.5 but i am getting error message saying that ("Path is \QuickTest Professional\bin\vb_init.exe") vb_init.exe file is not find. can anybody give me the advise what to do ?

1763






wht type of User defined functions or Java Releated functions do we write in VB scripting

1823


What are the key elements available in test result window?

620


Will there be any standards or requirements for page appearance and/or graphics throughout a site or parts of a site?

600


How does quicktest professional (qtp) identifies the object in the application?

581


What is throw Object?

1554


When should I use smart identification?

600


What is object spy in quicktest professional?

615


There is an built in window application in qtp9.1,i.e.Flight4.0.i want to implement the recovery maneger on it.How can i do this?

1624


give me the code to save all messages of inbox of gmail into a folder and notepad

1615


What are the properties you would use for identifying a browser and page when using descriptive programming?

627