write script for finding number of broken links in web page?
kindly please answer my question.
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
can u give one scenario for for PopWindow Exception & write Code for that?
How to Get the Run-time value of an object under that web app under Test to the local data table sheet of that Action?
Hi What are re-usable actions in QTP? -Thank You
how to retrieve the xml file data through qtp. can anybody send script for this..
What are the Test design techniques you uses in ur project?
suppose i can done the project in automation tool with QTP in that time what i can say?
what is the main use of reviews
What is meant by Step generator?what is the use of this? we have 3 steps know there what r all those.? can u all pls give me clear idea of this
what is reusable action and how the same can be implemented (process)?
explian qtp frame work and what is the use of it? what is the neceecity of this? explian detail?
How many add-ins comes by default with qtp?
Consider a scenario where there are two action sheets say action 1 and action 2. Can Action 1 take values from action 2 data sheet or vice versa. If so, how?