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 |
how to write the descriptive programming in QTP for remove the object value and substitute, with a variable then call the validation from excel
What are the advantages of QTP over WinRunner?
how do you do database testing in qtp
hi, In A Table there are some columns and dynamic rows and in each row in first column there is a link with name. upon clicking on that link it will show some details. write the vbscript to check that link without descriptive programming?
WHO IS THE BEST FACULTY FOR QTP IN HYDERABAD? A) NAGESHWAR RAO- MINDQ B) SURESH REDDY -SMART SOLUTIONS C) SURESH BABU- Q EDGE D) VENKAT - LIVE TECH E) GC.REDDY - HI-TECH CITY F) NONE OR OTHERS
how to create user defined functions in QTP? can any one expalin me with example.. Thanks in Advance for help
How to create frame work for qtp?
1 Answers Bank Of America, Polaris,
How do client side image and server side image work?
How to Analyze the Checpoint results by Checking Bitmaps?
How can we open an Excel sheet through the script
Explain more about the Test Fusion Report of QTP?
How can we extract data like "Details","Result","Time" from the 'Run Error' result generated in QTP after run time errors are generated during a run & import the details etc...into excel sheet