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 |
In an Excel sheet take two fields as agentname and password and type some valid agentname and password.call that excel sheet in qtp so that qtp opens the flightreservation window taking into consideration how many records are entered in the excel sheet.For example if 3 records are entered today it will open 3 FR windows,if in near future the records are more than 3 then it will open that number of times.
hi all i have qtp 9.0, Active screen is not working means after recording script snap shots not displayed in Active screen window. i have all ready check all setting means Tool...>option...>Active screen...>Default Level button is disabled. Is there other setting is remain to set Pls help i m new for qtp
what is difference between analog and low level recording
What is the extension of 'Log file' in QTP
How we can merge the object repositories?say if we have two or three object repositories then how e can merge them? is there any option in Qtp to merge the object repositories
Hi, i run scripts in one machine those r passed.when i run the scripts in client side those r failed.Give me such a scenario when ever u faced?
Tell me the difference between QTP9.2, QTP9.5 and QTP10.0
If you giving priority as p0, as a developer if I give priority as p2, What happens In user defined function ?
Plz explain about MATCH/EXACT MATCH/IGNORE SPAGE in text check points?
how you have used object libraries? plzzzzz do answer
Where is the resultset of a sqlquery (which is fired by rsobj.open sqlquery,xxxx,xxxx) stored ?
how can i pass parameters into function?