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

Hi Friends, I have an application that is having some options to choose. While doing business transaction I need to select one option among from available options. But here the thing is, we won't get one option which we've chosen already and the available options will get automatically from the system with time basis, moreover each and every option having with various label names respective to that option. So obviously if I run my recorded script will automatically gets fail, even though it got pass at first time. Could anyone please give me appropriate solution for this. I would be greatly obliged with you if you give the solution as soon as possible.

1 Answers   Zensar,


How to remove the associated function library?

0 Answers  


Explain in brief about the quicktest professional (qtp) automation object model?

0 Answers  


What are the Features & Benefits of Quick Test Pro (QTP)..?

5 Answers  


Hi All,I am in wierd situation that my laptop is installed with QTP11 and os is xp sp3.The problem is the descriptive programming which i have written is working in other laptops and it is not working in my laptop.it is clicking the link which is above the testbox instead of typing it in textbox below it.It is same with the other working scripts written by another person.

1 Answers  






How to capture data from images in QTP and produce them in Excel sheet ? please ans...

3 Answers   Sapient,


What is an Regular expression doing in VBScript?Tell the pattern for the email verification.

0 Answers   Accenture,


Explain how Selenium is different from UFT?

0 Answers  


I have a library function , with that function 100 scripts are being called. The library function is changed(something is added) . how do i update all the scripts.

1 Answers   IBM,


Have you done batch testing in qtp? If yes how you are doing?

0 Answers  


how to generate numbers in between to numbers suppose numbers in between 500 to 1000 in sequencies using vbscript

1 Answers  


How to import the Test Results in QTP to an Excel sheet

4 Answers   Sonata,


Categories