How can i count the list box elements in QTP ?using script
plz explain me (Chandana)

Answers were Sorted based on User's Feedback



How can i count the list box elements in QTP ?using script plz explain me (Chandana)..

Answer / minni

u can use GETITEMCOUNT to count the items in a list
box.For an example see the below script.

msgbox Window("flightreservation").Wincombobox
("flyfrom:").getitemcount

Is This Answer Correct ?    25 Yes 2 No

How can i count the list box elements in QTP ?using script plz explain me (Chandana)..

Answer / sri satya

Hi
You can use this:
Count =Browser("title:abc").Page("title:abc").WebList
("name:=xyz").GetROProperty("items count")
msgbox Count

Is This Answer Correct ?    14 Yes 6 No

How can i count the list box elements in QTP ?using script plz explain me (Chandana)..

Answer / pbre

hi you can try this one

browser("SCP").Page("SCP").WebList("ctl00$WebPartManager1
$ResultSu").Click

a = browser("SCP").Page("SCP").WebList("ctl00
$WebPartManager1$ResultSu").GetROProperty("items count")
msgbox a
For i=1 to a
c =browser("SCP").Page("SCP").WebList("ctl00$WebPartManager1
$ResultSu").GetItem(i)
reporter.ReportEvent micPass,c,c

Next

Is This Answer Correct ?    4 Yes 4 No

How can i count the list box elements in QTP ?using script plz explain me (Chandana)..

Answer / rajaputra

url="http://corp.naukri.com/mynaukri/mn_newsmartsearch.php?xz=2_0_5&id="
Systemutil.Run "Iexplore.exe",url
set oDesc= Browser("name:=Mynaukri : naukri.com - India's
No.1 Job Site")
itemcount=oDesc.WebList("name:=qe").GetROProperty("items count")
msgbox "Number of Items in Experience List= "& itemcount
itemcount=oDesc.WebList("name:=qm").GetROProperty("items count")
msgbox "Number of Items in Minimum Salary List= "&itemcount

Is This Answer Correct ?    3 Yes 4 No

How can i count the list box elements in QTP ?using script plz explain me (Chandana)..

Answer / nani

The Following script displays the number of items in the
list box.

intFieldItemsCnt =CInt(GetProperty(Browser
("Browsername").Page("Pagename").Weblist
("weblistname"),"items count"))

msgbox intFieldItemsCnt

Any doughts feel free to make a mail to: nani4urs@gmail.com

Is This Answer Correct ?    3 Yes 8 No

How can i count the list box elements in QTP ?using script plz explain me (Chandana)..

Answer / karna

Thank you.. it works for me...

Is This Answer Correct ?    0 Yes 6 No

Post New Answer

More QTP Interview Questions

How vl i prioritize the actions when i have 10 actions A1, A2, A3......A10. I want to run action as follows A1,A5,A6 and A10. How i can do it. Thanks in Advance to u.

7 Answers   IBM, Wipro,


what is test scheduleling?

0 Answers   IBM,


How can you close the second opened browser?

0 Answers  


Is it possible to change the name of a test object. I mean when we are recording the script for an object (for Ex: Username is a text field which has value "Babu",i am recording that). Then the Name of the object will become "Babu" in object repository. If i want to change "babu" as "xxxxx" .. is it possible to do? Pls help me in this .. if you didn't understand the question, pls let me know.

4 Answers  


How to handle Java tree in QTP?

0 Answers  


what is framework? which frame work u follow for writting script?

5 Answers   IBM,


How many add-ins comes by default with qtp?

0 Answers  


what happen in object repository(shared)if we call an existing action from an external action ? and what happen in object repository(peraction)if we call an existing action from an external action ?

2 Answers   Covansys, Systel,


Explain the concept of how quicktest professional identifies object?

0 Answers  


What is the Command used to start the QTP

0 Answers   HCL,


How to do the scripting. Is there any inbuilt functions in QTP as in QTP-S. Whatz the difference between them? how to handle script issues?

2 Answers  


How can we use the "CreateObject("Wscript.Shell")" in QTP and what is the definition and purpose of it?

2 Answers  


Categories