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

How do you invoke any application and write a script to invoke QTP using VB Script.

2 Answers   HealthAsyst,


Why divide a test into three action calls?

1 Answers  


Could any one explain about the nested actions in QTP? This question is asked by Qualitree and CA

3 Answers   CA, Qualtree Solutions,


Does QTP10 supports Windows 7OS +IE 9 combination? Which is the preffered combination ,Plz let me know?

0 Answers  


What is text check point and text area check point?

0 Answers  






i need to learn the descriptive programming very well so for that what to do am reading the qtp user mannual but it is not so any materials or links with examples i want please help me

2 Answers  


What is recovery scenario manager? When you go for recovery scenario manager? Tell me one scenario were your used recovery scenario in your project?

0 Answers  


how to disable the pop ups through QTP using a script

0 Answers  


what difference between runtime object and text object and what property they have. whether they have same properties or different properties.

0 Answers   Intel, Satyam,


what function you write to do database testing with the help of qtp?

0 Answers  


What are the advantages of parameterization ?

0 Answers  


I have written some scripts in QTP by using older version, but I want to run them in latest version. Is there any process to do that.If so can anyone explain me?

1 Answers  


Categories