how can i count the number of links???

Answers were Sorted based on User's Feedback



how can i count the number of links???..

Answer / nalini

There are two ways to get the count of links on a page.

1) g=Browser("Google").Page("Google").GetROProperty("number
of links")
print g


2) set ld=description.Create()
ld("micclass").value="Link"
set lobj=Browser("Google").Page("Google").ChildObjects(ld)
c=lobj.count
print c

Is This Answer Correct ?    1 Yes 0 No

how can i count the number of links???..

Answer / raju

Using child objects we can count the links. script is as
given below

SystemUtil.Run "www.hdfcbank.com"
Set aa=description.Create
aa("html tag").value="TD"

set bb=Browser("name:=HDFC Bank.*").Page("title:=HDFC
Bank.*").childobjects(aa)
cc=bb.count

msgbox cc
For i=0 to cc-1
bb(i).highlight
Next

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More QTP Interview Questions

Does any one worked on JIL Emulator , Testing with QTP(automation). Trail Version of QTP is not identifying the child objects of JIL emulator, Can any one help me out ,

0 Answers  


What are the Application Functions available in QTP?

0 Answers  


How many tables r created during the recording in QTP?

2 Answers  


how can we handle errors other than using recovery scenerios in qtp

0 Answers  


How to handle the exceptions using recovery secnario manager in quicktest professional (qtp)?

0 Answers  






What is the difference between byref and byval in qtp?

0 Answers  


How to Parameterize Object repository in QTP?

1 Answers  


Function to convert lowercase to uppercase in QTP Pls anybody can give the answer.. Thanks in advance...

2 Answers   Navis,


Hi, i want download attached files in test plan area from QC to local drive in my system using QTP script. Please help me

3 Answers  


What is the concept of hooking in QTP?

1 Answers  


i want to learn testing tools what i have to know before.iam fresher i dnt know any this..which langagues i have to before testing.

2 Answers   Wipro,


Is QTP Supports SWT applications? If yes, can you write a sample script for opening a new package in eclipse.

0 Answers   IBM,


Categories