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 delete unwanted results in qtp?

0 Answers  


In QTP how to interact tool and application build?

2 Answers  


how do you done Data-driven test using MS-Word Instead of DataTable

3 Answers   IBM,


How do u insert an object during runtime in qtp?

2 Answers  


How can we fill data in a text box without recording using object spy. Can you please provide the steps...

1 Answers   Hotel Jobs, TCS,






wht is the difference between action and functio?

3 Answers  


what is the difference between DP and keyword driven framework?

1 Answers  


How can I check if a environment variable exist or not?

0 Answers  


what is the extension of new local object repository?

5 Answers  


For ex we are doing automate testing in that can we do some part of application recording, some part descriptive programing and some part general VB scripting like that .............

3 Answers   Satyam,


What is Descriptive Programing? In which cases, we will go for descriptive programing?

2 Answers   CTS,


What is the syntax to use out of two characters. Pls anybody can give the answer.. Thanks in advance...

1 Answers   Navis,


Categories