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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the steps involved in recovery scenario wizard?

732


How many types of recording modes in qtp? Which will be used when?

742


How to execute a winrunner script in quicktest professional?

758


If I change the object name in one action will it be updated in all the actions? Or not?

817


Explain quicktest professional (qtp) testing process?

745


tell me QTP standards ?plz

1689


what is the hierarchy to use properties in descriptive programming

1733


Dear All, How to generate Pass or Fail Report in QTP without using Reporter.Report Event Method ? Thanks Balaji

2487


How many types of status are there?

801


What are the key elements available in test result window?

869


What is optional step in qtp? How you can add optional step in qtp?

753


What are the things(properties, and other details) will be recorded while recording an object using normal recording?

1719


Hi frnds, does anybody know if there is anything called "thin point" or something in qtp? thanks in advance.

3181


How can you close the second opened browser?

1058


In Remote acess server how u run a test?

1457