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 review

0 Answers  


what r the drawbacks and limitations of QTP?

2 Answers   NIIT,


Can we put more than one action in a single script???? yes or no.....

2 Answers   BirlaSoft,


what is the smart identification techniqu?what r the different mechanisums used in it?

2 Answers   Accenture,


How to parameterize Object Repository?

2 Answers  


What does "Dynamic change on web pages" means.As per my knowledge, this comes in "Complete" level of Active screen capture levels, where it says, "Also dynamic changes on web changes are saved.so i want to know what type of dynamic changes are made and is this dyanmic changes efftes only on web application or any other?

0 Answers   EDS,


Will QTP Support Japanese Language?

3 Answers   Cap Gemini, Infosys,


What is an expert view and keyword view?

0 Answers  


Explain actions in qtp ?

0 Answers  


If there are some browsers opened and I don't how many browsers are open, Now I want to close all the browsers that I don't know how many are opened. What would be Descriptive programming for this in QTP using VB Script..??? Please send your answers.

6 Answers  


How many types of Parameters are available in QTP?

1 Answers  


How to send QTP test results to an email...(with out using Quality Center)?

11 Answers  


Categories