Retrieving all Dropdown values in VBScript

I will be pushing some VBScript functions which will help QTP automation testers. I will be randomly selecting web controls and a problem statement with that. Today’s control is drop down box and I will be writing a function which will read all the values in the drop down.
Function GetAllValuesOfDropDown(BrowserName,PageName, DropDownName)
   If  Browser(BrowserName).Page(PageName).WebList(DropDownName).Exist  Then
        If  Browser(BrowserName).Page(PageName).WebList(DropDownName).GetROProperty("disabled") = False  Then 
       DropDownValues = Browser(BrowserName).Page(PageName).WebList(DropDownName).GetROProperty("all items")
            GetAllValuesOfDropDown= DropDownValues
        else
            GetAllValuesOfDropDown= False
        End If
   else
        GetAllValuesOfDropDown= False
   End If
End Function

This will also help me revise my concepts. :)

Comments

Popular posts from this blog

Defect Tracking System – Wastage of Money & Time ???

The 3 qualities that will always help you become better at almost anything…

Test Case Paths : Happy, Sad & Bad