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
            GetAllValuesOfDropDown= False
        End If
        GetAllValuesOfDropDown= False
   End If
End Function

This will also help me revise my concepts. :)


Popular posts from this blog

How to install Android Emulator on Windows

Test Case Paths : Happy, Sad & Bad

Using Drag and Drop in Selenium / Webdriver