I am trying to select an item in a Weblist based on the Parameter given (using regex)... Say I have a Weblist of Cities, and the parameter is "Mia", how do you select "Miami"?
Thanks for your help!
Then you have to write a function for partial Match. You have to loop through all the items in the WebList.
1. Get the Item in the WebList.
2. Use InStr function for Partial Match.
For i = i to NumberOfItemsInWebList
sCurrentItem = lcase(trim(WebList.GetItem(i)))
If (InStr (1, sCurrentItem ,sExpected,1)) > 0 Then
' Select the item.
Where sExpected = "Mia" and
sCurrentItem will be the ith item in WebList.
Search the QTP help using keyword "pattern" or "execute" and you will find one more interesting readymade function for your requirement.
Thanks and Regards,