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

I have 3 browsers i want to give facebook url in 2 nd browser using qtp

3 Answers   Tech Mahindra,


what happen in object repository(shared)if we call an existing action from an external action ? and what happen in object repository(peraction)if we call an existing action from an external action ?

2 Answers  


hi i need to learn qtp its very urgent..pls tell me who is the best faculty for qtp in hyd..... and i plan to go foe mindq nageshwar rao? its good or not?

2 Answers  


how do you invoke the application through QTP?

1 Answers  


Object Repositories types, which & when to use?

3 Answers   Crea,


How to send the qtp results file by email (Lotus notes).

1 Answers   TCS,


How will you report the bug and explain the defect tracking sheet you handled?

0 Answers   TCS,


what is active screen,keyboard view?

2 Answers   BirlaSoft,


hou can we use vb script in qtp could u tell me breafly

0 Answers  


I want to open a Notepad window without recording a test and I do not want to use SystemUtil.Run command as well How do I do this?

12 Answers  


How can you capture(Read) the values from a Table?

1 Answers  


How to Import data from a ".xls" file to Data table during Runtime.

1 Answers   Crea,


Categories