Micro Focus QTP (UFT) Forums
Varying items in the dropdown - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Varying items in the dropdown (/Thread-Varying-items-in-the-dropdown)



Varying items in the dropdown - Meghana1 - 08-17-2012

I am new to QTP and i am working on weblist which contains multiple values.For the first iteration there will be 3 items in the dropdown and on subsequent iteration there will be only 2 items in the dropdown.I have used the below code to access the values from the dropdown.But i am not able to access the second value(item) from dropdown

Code:
Cnt=Browser("Browser").Page("page").WebList("weblist").GetROProperty("items count")
For i=1 to cnt step 1
Browser("Browser").Page("page").WebList("weblist").select (i)
Browser("Browser").Page("page").WebButton("button").Click
Next

Kindly Help

Thanks in advance


RE: Varying items in the dropdown - ksrikanth2k9 - 09-14-2012

try using for i=0 to cnt-1...


RE: Varying items in the dropdown - ssvali - 09-14-2012

Try this
Code:
Cnt=Browser("Browser").Page("page").WebList("weblist").GetROProperty("items count")
For i=0 to Cnt - 1
Browser("Browser").Page("page").WebList("weblist").select (i)
Browser("Browser").Page("page").WebButton("button").Click
Next