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 |
What is meant by Environmental variables?2 types r there know…can u pls explain clearly?
when qtp recognizes a web link like (hyper link)wich properties it is going to take to identify the objects unquely? what is Ini file in QTP?
How to map the test cases to requirements in QC?
What is smart identification?
Hi Guys, My Application in Microsoft Dynamic Navision, is it compitibale with QTP? if yes then let me know...
How can you close the second opened browser?
what is runmodes in QTP
At a time how many users can access QTP?
How to export quicktest professional results to an .xls file?
What are the types of data tables in qtp?
I AM NEW IN QTP,PLZ TELL ME ANY BOOKS FOR QTP, MY COMPANY IS QTP,SO I LEARN QTP,PLZ ANYBUDY HELP ME
When we use 'ERR' object to handle the exceptions in the script, do we need to include any statement in the beginning of the script..??
2 Answers DST Global Solutions,