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. :)
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
Post a Comment
Your comments will be reviewed and then published !