write script for finding number of broken links in web page?
kindly please answer my question.
Answer Posted / 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 View All Answers
What is the difference between run time object and test object in QTP?
can u explain relative path architecture framework in qtp?
What is the syntax to call one script from another? And what can be the syntax to call one “action” in another?
How does you pass optional arguments in qtp?
Can U Explain about QTP tool from older version to latest version also its differences?
How is recording done when a application is over lapping the QTP application it gives a message object not recorded
Without integrating QC/Testdirector with QTP, is it possible to keep track of the defects?If yes how? How to export QTP results to an excel sheet?
What does it mean when a check point is in red color? What do you do?
What is checkpoints for quicktest professional (qtp)?
How to define array in qtp?
What is checkpoints for quicktest professional?
how can i call function (which has link with excell sheet at a remote location) within another function
How to add object to object repository in qtp9.0 Suppose for brower yahoo home page
How do I generate Test Results window using descriptive method ( run time ) after my test execution process? Please have a look of my below code. ========================================================= Dim qtApp Dim qtTest Dim qtResultsOpt Set qtApp = CreateObject("QuickTest.Application") qtApp.Launch qtApp.Visible = True qtApp.Options.Run.CaptureForTestResults = "Always" qtApp.Options.Run.RunMode = "Fast" qtApp.Options.Run.ViewResults = True qtApp.Open "C:\Automation\Example", True Set qtTest = qtApp.Test qtTest.Settings.Run.OnError = "NextStep" Set qtResultsOpt = CreateObject ("QuickTest.RunResultsOptions") qtResultsOpt.ResultsLocation = "C:\Automation\Example\Res1" qtTest.Run qtResultsOpt MsgBox qtTest.LastRunResults.Status qtTest.Close Set qtResultsOpt = Nothing Set qtTest = Nothing Set qtApp = Nothing ========================================================== This code is working fine, but Test Result window is not displaying after execution. Anybody can please help me regading the same. Thanks Akshaya Madali Capgemini India Pvt Ltd 9823213538
Hoe can we do retesting using functions please give the code for it using login page