Micro Focus QTP (UFT) Forums
How to count items in a weblist - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How to count items in a weblist (/Thread-How-to-count-items-in-a-weblist)



How to count items in a weblist - prachirao - 05-03-2010

Hi,
can you please tell me how can i count listbox items in a weblist using script.
QTP version:9.2
Please give a solution apart for "getitemcount" method .i dont know why but it is not available in my system.


RE: How to count items in a weblist - manabh - 05-03-2010

Hi,
Use "All Items" property. (See more of QTP help for more details).


RE: How to count items in a weblist - manishbhalshankar - 05-03-2010

Hi Prachirao,

use GetROProperty("items count")


RE: How to count items in a weblist - prachirao - 05-03-2010

hi Manish,

thanks for the reply.i already tried using it but am getting a general run error.

pasting the code please look into it
Code:
systemutil.run"http://in.news.yahoo.com/astrology/"
Count =Browser("name:=Astrology - Yahoo! India News").Page("title:=Astrology - Yahoo! India News").WebList("innertext:= All News Yahoo! News Only").GetROProperty("items count")
msgbox count

Thanks,
Prachi


RE: How to count items in a weblist - Saket - 05-03-2010

what exactly is the error that you receive?
It must be an object identification issue. add more description to the object like below
Code:
Count =Browser("name:=Astrology - Yahoo! India News").Page("title:=Astrology - Yahoo! India News").WebList("index:=0", "innertext:= All News Yahoo! News Only").GetROProperty("items count")



RE: How to count items in a weblist - basanth27 - 05-04-2010

Prachi -
Add the weblist object to the repository, use it and then see if you still get the error. If you dont then replicate the same property on your DP and see if that helps. If that does, then customize it according to your requirements.


RE: How to count items in a weblist - prachirao - 05-04-2010

Thanks u solved my problem