Saturday, June 7, 2008

How to compare the list box items with another

Here i am giving the script to compare the list box items with another -
To run this script you have to add all the objects into the object repository
(Find the link in this blog "how to add 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

No comments:

About Me

My photo
Hi all,I am Arun Singh Rajaputra. I am working as a Project Lead in a reputed organization in Hyderabad, AP, India. I have little bit knowledge on Quick Test Professional and like to share my knowledge to all through this blog.

Subscribe to get updates on this blog

Enter your email address:

NOTE

Some of the posts posted in this blog are collected and most of them have been prepared by me. If any one have objections regarding any copied posts. Please mail me so that I can take a necessary action on that post.