Hello Everybody,

Can anyone tell me that in QTP how to count the number of
webelements from the object repository.
Please provide the code.

Thanks in advance,
Gaytri

Answers were Sorted based on User's Feedback



Hello Everybody, Can anyone tell me that in QTP how to count the number of webelements from the..

Answer / seeths

hai gayatri,
we can count the no. of elements through Child
Objects.wich is advanced feature in Qtp..........

Is This Answer Correct ?    1 Yes 1 No

Hello Everybody, Can anyone tell me that in QTP how to count the number of webelements from the..

Answer / gaytri

Hi Seeths,

It is fine that we can use the child object property, I
also used the same, But the problem is that I want to count
the number of labels present in the specific page.

In addition to the above I also need that suppose:
1. I captured some of the labels of the web page.
2. Now in my script i used
Set oweb=Description.Create()
oweb("micclass").value="WebElement"
set lists=browser("Yahoo!").Page("Yahoo! Mail - The
best").ChildObjects(oweb)
numberoflists=lists.count()
msgbox(numberoflists)

this will display the number of webelement of the above
specified page.
3. I want if that webelement exists in the Object
Repository then it will add it to the list. and thus count
all those webelement that also exists in the Object
repository.

Thanks,
Gaytri

Is This Answer Correct ?    0 Yes 0 No

Hello Everybody, Can anyone tell me that in QTP how to count the number of webelements from the..

Answer / srinivasulu

Hi Seeths

Gayathri is asking to you count of webelement using object
repositary, but u had given aswer is using Descriptive
programing, I think that is ans is wrong

pls let me know if any issues
my mail id is : vasuth2008@gmail.com

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

What is the DIFF Between PROJECT AND PRODUCT?When Company will need Product?

5 Answers  


I am getting the "test object property" Description properties "toolkit class" value By using "gettoproperty" in run time But my problem is how to get Ordinal Identyfier's type and value Type is index, value is 0 How can i keep this values in to required place How can i get these values in runtime I have to insert these "index" and "value" into another area Is there any script for this like "gettoproperties","Getroproperties" If anybody knows,please help me .

0 Answers   Livetek,


Connect to QC using AOM.

0 Answers   Deloitte,


How can we change(increase or decrease)the size of a array variable with out loosing the previous values

1 Answers   DST Global Solutions,


How qtp recognizes the object?

0 Answers  






Is it possible to split an action? How?

0 Answers  


can QTP works on LINUX platfom

2 Answers  


Are Shared ORs read-only?

0 Answers  


I have thousands of links are there, i want check each and every funtionality of link by using descriptive programme, retrive link name from excelsheet then operate in application. Please anybody send me model script

1 Answers   Oracle,


how we implement share object repository in QTP 9.0 without using quality Centre , Explaine in brief

0 Answers   HCL,


What are the technics follow in writing VB script?

0 Answers   CTS,


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

4 Answers   iFlex, QA InfoTech,


Categories