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

In a web page, one web table is present which is dynamic. In that table one of the column has links with the same inner text. write a script so that i need to click the third link.

3 Answers  


hi i want write code for "test engineer" in this i want write reverse how ca plz let me know through script

4 Answers  


Can anyone explain about Keyword driven framework in detail and how to use it in case of any project

4 Answers  


1--How many functions u develop 2--What is an array 3-- where is ur server 4--U involved in unit testing 5--how ur test the background colour using QTP

0 Answers  


How do we call Library Files(.vbs) in the Test Script Thanks in Advance...

6 Answers  






how many wayes we do the parameterization?

1 Answers  


hi everyone today is the first time i saw this website,and hi iam siraj,iam very impressed by seeing evryones response towards questions,iam a newcomer and i have got tryining in testing can anyone please send me some projects relaited to testing.i know it is very confidential but still if u send it will a great help. my mail id venku_krs@yahoo.co.in

1 Answers  


Suppose one object is changed in a project after delivering the project.Where we will update that object? it can be present in many scripts so can we update all the scripts?

1 Answers   IBM,


How can i parameterize the standard checkpoint using Excel sheet where my expected values are there?? suppose i want to test a application with diffent value and want to run 5 iteration?? for each iteration, values will be exported from excel sheet as input. Now i will store some expected values in the excel sheet, which i want to check in the application whether expected equals to actual value??? can any one help me

1 Answers   CSC,


In what occasion we can specify global sheet and action sheet?

0 Answers  


want to learn real time automation project(QTP)?

1 Answers  


Can we create test script with out Step Generator?

4 Answers  


Categories