Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to select the drop down option by searching for partial text
#2
Not Solved
Please try the below code. Here the oObjectRef is the string reference of the object (dropdown object), sVerifyListItem is the partial string that you want to check

Code:
Dim sStringExist, i, j, iMin, iMax, sActItemList
    

    sItemArray = Split(sVerifyListItem," ")

    iMinArray = LBound(sItemArray)
    iMaxArray = UBound(sItemArray)

    sStringExist = "N"
    
    sItemCount = oObjectRef.GetROProperty("items count")
    
    For i = 1 to sItemCount

        sActItemList = oObjectRef.GetItem(i)

        For j = iMinArray to iMaxArray
            nPos = Instr(sActItemList,sItemArray(j))
            If nPos>=1 Then
                sStringExist = "Y"
            Else
                sStringExist = "N"
                Exit For
            End If
        Next

        If sStringExist = "Y" Then
            oObjectRef.Select sActItemList
            oObjectRef.FireEvent("onFocus")
            
            Exit For
        End If

    Next
Reply


Messages In This Thread
RE: How to select the drop down option by searching for partial text - by sporandla - 07-31-2015, 04:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Need to Validate Text filed is blank after clicking on the Text box balak89 3 4,833 09-13-2015, 12:06 AM
Last Post: ADITI1992
  Web Element: Not able to select value from drop down in Web Element. Rajeev 4 5,257 08-04-2015, 06:03 PM
Last Post: kbhargava505
  Click on drop down and select second option using HP UFT Tusharguru99 2 6,634 07-30-2015, 06:06 PM
Last Post: Neetha
  Drag and drop issue excellentpawan123 0 2,731 01-13-2015, 05:04 PM
Last Post: excellentpawan123
  Drop down list class is a link thotamurali 2 4,107 08-22-2014, 05:48 PM
Last Post: thotamurali

Forum Jump:


Users browsing this thread: 1 Guest(s)