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

kindly please answer my question.

Answers were Sorted based on User's Feedback



write script for finding number of broken links in web page? kindly please answer my question...

Answer / pavani prasad

Thank u Lakshmi for responding my question.
But i asked about broken links,
u r script is for total links.
i want script for only broken links.

Is This Answer Correct ?    3 Yes 1 No

write script for finding number of broken links in web page? kindly please answer my question...

Answer / pramila

Using Automatic Page checkpoint:
Go to Tools > Options > Web > Advanced and check the two
boxes labeled “Create a checkpoint for each page while
recording” and “Broken Links”.
Now every time you record a new page, QTP will automatically
include a checkpoint for broken links.

OR

By manually creating a Page checkpoint:
QTP does not provide a direct menu option to incorporate a
page checkpoint. You need to take the help of standard
checkpoint. Start recording session > Insert > Checkpoint >
Standard Checkpoint (OR press F12). Place and click the hand
pointer anywhere on your web page from "Object selection-
CheckPoints Properties" window click OK it takes you to
"Page checkpoints Properties" where in click on 'Broken
Links" option.
Run the above script. Go To Test Results > Your Check Point.
Check the status of all links under “Broken Links Result”
If you want to verify links pointing only to the current
host check the box titled “Broken Links- check only links to
current host” under Tools > Options > Web. Similarly If you
want to verify links pointing to other hosts as well,
uncheck it.

Is This Answer Correct ?    0 Yes 2 No

write script for finding number of broken links in web page? kindly please answer my question...

Answer / 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

More QTP Interview Questions

hen do start automation testing after manual testing

1 Answers   Infosys,


Hi, Can anyone please tell me how to connect the QC with QTP using QTP script? Thanks in advance

0 Answers  


What are the features and benefits of quick test pro (qtp 8.0)?

0 Answers  


in a database table there are 3 columns (name , marks,grade) , in application after retrieving data from db to fields name, marks click ok button then grade should displayed ---for this how to write vb script prgm

3 Answers   IBM,


Please explain the role of Regular expression in QTP

0 Answers  






Explain the check points in QTP?

2 Answers  


Can anyone pls tell me how to do action parameterization (input and output parameters) with respect to login window and insert order of flight reservation window in detail( pls give a clear step by step explanation with example) anyone please. Will be very thankful to u

0 Answers   Avenger Software,


What is reusable action?

0 Answers  


What frame work ur using in QTP in ur current company?

7 Answers   Accenture,


In QTP I have a parameter in a datatable that is a sentence. I need to take the last word from the sentence and enter it into a field in a web application. How can I setup a parameter to enter in just a portion of the parameter (last word of the sentence) instead of the entire paramater (whole sentence).

2 Answers  


what is Action conversion tool? what the Action conversion tool will do?

1 Answers   Satyam,


What are some test assets and related extensions of qtp?

0 Answers  


Categories