How to select value from combo box ?
I am doing the automation of web application. I imported all data in the datapool.But I was not able to fetch data from datapool for the selection of value of combobox. When script runs it doesnot select proper value from combo box which must be same as in the datapool.
Please help to resolve this problem.
Thanks in advance.
Re: How to select value from combo box ?
You can use the simple click functions on combo box and combolist box, though it is not a good idea bcoz you will not be able to trap the errors.
Anyway, try the following function (you need to set the window context before calling this function)
Function SelectComboValue(sInternalName, sValue) as Integer ' Pass the internal name of the combo box and the value to be selected
Dim sName as String
sName = "Type=ComboBox;Name=" & sInternalName
sValue = "Text=" & sValue
ComboBox Click, sName, ""
sName = "Type=ComboListBox;Name=" & sInternalName
ComboListBox Click, sName, sValue
Hope this helps