Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to count items in a weblist
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
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.
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,
Use "All Items" property. (See more of QTP help for more details).
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Prachirao,

use GetROProperty("items count")
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
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
Reply
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
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")

Reply
#6
Solved: 11 Years, 3 Months, 3 Weeks ago
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.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#7
Solved: 11 Years, 3 Months, 3 Weeks ago
Thanks u solved my problem
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Webtable objects recognise as weblist in UFT 12.5 Sharad Kumar 0 1,163 12-06-2018, 04:57 PM
Last Post: Sharad Kumar
  Unable to fetch items from WpfList in UFT saurabhkumar_gupta 0 2,441 03-08-2015, 09:17 PM
Last Post: saurabhkumar_gupta
  Can't locate items on Win7 Desktop RandomGrin 0 2,070 01-30-2015, 10:55 PM
Last Post: RandomGrin
  QTP identifying WebList as WebEdit and an Element passion77 3 8,431 01-27-2014, 10:21 PM
Last Post: supputuri
  How to populate data in weblist using excel vijifun 1 3,298 12-05-2013, 12:06 PM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 3 Guest(s)