05-11-2008, 05:41 AM
Aparna, this is a simple function that will retrieve all values from a list object and enumerate them in QTP's print log:
Usage: Call TestWebListValue("name:=loc","")
You can test this exact code here: https://www.google.com/accounts/NewAccou...1cb&type=2
Code:
Public Function getListValues(strWebListDesc,creationT)
strBrowser = "creationtime:=" & creationT
strPage = "micclass:=Page"
Count = Browser(strBrowser).Page(strPage).WebList(strWebListDesc).GetROProperty ("items count")
iCount = 1
Do while iCount < Count
Browser(strBrowser).Page(strPage).WebList(strWebListDesc).Select "#" & iCount
sListVal = Browser(strBrowser).Page(strPage).WebList(strWebListDesc).GetROProperty ("selection")
Print sListVal 'Temporary placeholder
iCount = iCount + 1
Loop
End Function
Usage: Call TestWebListValue("name:=loc","")
You can test this exact code here: https://www.google.com/accounts/NewAccou...1cb&type=2