Micro Focus QTP (UFT) Forums
Combobox selections - 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: Combobox selections (/Thread-Combobox-selections)



Combobox selections - 1981.madhu@gmail.com - 12-15-2009

Hi,
I have a 2 wincombo boxes(Flight Reservation,window based).In that i want to select one by one and also in combox items also .

i dont want to Indivual selection , want to loop it .

My code is :

Code:
Window("Flight Reservation").WinEdit("Date of Flight:").Type "12/24/09"

Set a=Description.Create()
a("nativeclass").value="comboBox"

set b=Window("Flight Reservation").ChildObjects(a)

f=b.count

For i=1 to f

s=Window("Flight Reservation").WinComboBox("nativeclass:=comboBox", & i).GetItemsCount

Window("Flight Reservation").WinComboBox("nativeclass:=comboBox", & i).select randomnumber.Value(0,s)



Next


but iam getting syntax error pls help.

Thanks

Madhu.s
Hey solved.





Code:
set b=Window("Flight Reservation").ChildObjects(a)
f=b.count

For i=0 to f-1
s=b(i).GetItemsCount
b(i).select randomnumber.Value(0,s)
Next
Thanks
Closing thread