Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to select items from WebLists
#4
Not Solved
Can you just use the below function to see if this is working for you.


Code:
Function SelectWebListValue(strValue, strObjectName)

'Get the total no of items in that dropdown
intItemsCount=Browser("").Page("").Frame("").WebList(strObjectName).GetROProperty("items count")
'Browser("").Page("").Frame("").WebList(strObjectName).Highlight
For intIndex = 1 To intItemsCount
    strTextFrmAppl=Browser("").Page("").Frame("").WebList(strObjectName).GetItem(intIndex)
    
    If strTextFrmAppl= strValue Then
        Browser("").Page("").Frame("").WebList(strObjectName).Select strValue
        Reporter.ReportEvent micPass,"Weblist selection","Given value ("& strValue &") selected"
        SelectWebListValue= True
        Exit For
    ElseIf intIndex=intItemsCount Then
        Reporter.ReportEvent micFail,"Weblist selection","Given value ("& strValue &") is not present"
        SelectWebListValue= False

    End If
Next

End Function

To call the function use the below code

Call SelectWebListValue("Your Value","WeblistObject")

Regards,
Ankesh

Remove frame from the function if it is not there in your object hierarchy.
Reply


Messages In This Thread
RE: Unable to select items from WebLists - by Ankesh - 07-19-2012, 05:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unable to select value from Weblist using QTP neenumaria 4 13,064 08-07-2018, 04:43 PM
Last Post: NovGirl
Rolleyes To Get number of menu items of a winmenu object sasmitakumari 0 6,355 07-08-2010, 02:56 PM
Last Post: sasmitakumari
  Create List of all menu items LGold 1 2,496 04-29-2009, 03:37 PM
Last Post: Tarik Sheth

Forum Jump:


Users browsing this thread: 2 Guest(s)