I want to get weblist items and compare it with some other list
Making sure that weblist populates correct data.
How this should done ?
This is a discussion on Verify the weblist (drop down) items within the QTP forums, part of the Software Testing category; I want to get weblist items and compare it with some other list Making sure that weblist populates correct data. How this should done ?...
I want to get weblist items and compare it with some other list
Making sure that weblist populates correct data.
How this should done ?
ArrayList1 = Split(Browser("").Page("").WebList1("").GetRoProperty("AllItems"), ";")
ArrayList2 = Split(Browser("").Page("").WebList2("").GetRoProperty("AllItems"), ";")
For i = 0 to UBound(ArrayList1)
If ArrayList1(i) = ArrayList2(i) Then
Msgbox "PASS"
Else
Msgbox "Fail"
End If
Next
Hi,
Here i am giving the script to compare the list box items with another in Flight application-
(To run this script you have to add all the objects into the object repository)
Window("Flight Reservation").activate
SeltItem = window("Flight Reservation").winComboBox("Fly From:").GerROProperty("text")
msgbox SelItem
'It displays the selected item in the list
ListItem = Window("Flight Reservation").WinComboBox("Fly To:").GetContent
msgbox ListItem
'It displays all the items in the list box
Itemcount = window("Flight Reservation").WinComboBox("Fly To:").GerItemsCount
msgbox Itemcount
'It displays no of items in the list box
For i=0 to Itemcount-1
a=window("Flight Reservation").wincombobox("Flt To:").GetItem(i)
If SelItem=a Then
msgbox "Items Are Matching"
else
msgbox "Items Are Not Matching"
End If
Next
__________________
Thanks & Regards!!
RAJAPUTRA
Hi sudhir,
I think this is the perfect answer based on your requirement.
ArrayList1 =Split (Browser("").Page("").WebList1("").GetRoProperty("AllItems"), ";")
ArrayList2 = split ((arrList("item1";"item2"; ; ; ....etc)),";",-1)
For i = 0 to UBound(ArrayList1)
For j=0 to UBound(ArrayList2)
If ArrayList1(i) = ArrayList2(j) Then
Msgbox "PASS"
Else
Msgbox "Fail"
End If
Next
Next
Thanks and regards
Bhaskar kumar