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

How u call functions in QTP

5 Answers   Lehman Brothers,


What are the different types of Database checkpoints in QTP? when they are used?

2 Answers  


Explain the checkpoint in qtp?

0 Answers  


what is the diff between manual test plan document and automation test plan doc.can u explain indetail.

0 Answers   Value Labs,


OR is full with objects but i want to add 5 more objects,but i tried merging files,shared mode and descriptive ,iwont work.is there any alternative for that

6 Answers   CTS,






What is the life cycle of QTP? Pls Give me Exact answer?

6 Answers   Google,


what are the challenges you have faced while testing web based application using the automation tools ?

0 Answers  


What is a quick test professional?

0 Answers  


Where can i get the QTP tutorials. I wanna move to automation testing. Is there any book or URL, where i can find the source to read...

1 Answers  


How to extract the data in the below scenario and dump it in the excel? Link1 Link2 Link3 Link4 numberlink1 text text text numberlink2 text text text numberlink3 text text text numberlink4 text text text So, Here is my question? -- It is a matrix but is not a web table(QTP does not recognize it as a web table) -- Link1, link2 and link3 are links under which text is available -- numberlink1 to numberlink4 are again LINKS -- All the others displayed are text only I want to extract the data in the above scenario and dump it into an excel in the same scenario as it is displayed above. Kindly help.. Thank you

0 Answers  


If u don't have any Knowledge on perticular application but they give that application to u for Testing ? Then How we wil move towards testing on that application?

16 Answers   Genpact, HP,


write a script to verify links on any web page by using descriptive method by creating a description object (give a filter condition only link) ... need to verify expected like name by reading

0 Answers  


Categories