QTP Provide the easiest way to select the Multiple values from the dropdownlist with the use of ExtendSelect Method. Will easily understand with the use of below example.
Keep all the values in an array and write the below code to select the values
Dim a
a =array("mushrooms","green peppers","olives")
lengthofarray = ubound(a)
msgbox lengthofarray
Browser("Browser").Page("Page").WebList("toppings").Select a(0)
For i =1 to lengthofarray
Browser("Browser").Page("Page").WebList("toppings").ExtendSelect a(i)
Next
Out put After executing the code
Application with the Weblist |
Keep all the values in an array and write the below code to select the values
Dim a
a =array("mushrooms","green peppers","olives")
lengthofarray = ubound(a)
msgbox lengthofarray
Browser("Browser").Page("Page").WebList("toppings").Select a(0)
For i =1 to lengthofarray
Browser("Browser").Page("Page").WebList("toppings").ExtendSelect a(i)
Next
Out put After executing the code
Output |
No comments:
Post a Comment