Unified Functional Testing (formerly QTP) News and Support Forum
Showing results for 
Search instead for 
Do you mean 

QTP handling of a WebCombo box


QTP handling of a WebCombo box


I am writing scripts for a web application which has some combo boxes in it. The combo box is a combination of a editbox plus the select icon to its right which when clicked gives me a list of options in a drop down. I attached the screenshot of the combo box.  The problem is QTP recognizes this as a webedit and uses the set method on it. The set method does not work for me when my application stores the values in the combo boxes as enums (short form) in the DB. For ex: In the drop down it shows as Internet Explorer but in DB it is stored as IE. So when I use Browser("app").Page("app").WebEdit("A").Set "Internet Explorer", the app throws an exception. This is different when we do the selection in the combo manually. When we select an option manually in the combo box, a conversion to enum happens before it reaches the DB

It works if I directly use the enums like WebEdit("A").Set "IE". But I should know the enums of loads of combo boxes that exist in my app. 

Mine is an extjs application for which we developed a custom QTP add-in. Should I ask the developer to create another control called as extjscombobox and implement the select method on it so that QTP can do selections on the combo boxes? Please advise



Re: QTP handling of a WebCombo box

How the drop down items are getting recognized??

Occasional Advisor

Re: QTP handling of a WebCombo box

Hi srinivas,


These are ExtJs control i think, you can handle by WebElement as the parents and remaining inside this as the standard control.



Browser(),Page(),WebElement()Image().fireevent 'OnClick"


Browser(),Page(),WebElement().webcheckbox().set "ON"


Use DP to avoid runtime error if the object are Extjs.





Occasional Collector

Re: QTP handling of a WebCombo box

Hi Srini,

Can u post the html code of the combobox? If possible we can try to fix it with DOM.

Re: QTP handling of a WebCombo box

Each option in the dropdown is recognized as a ExtSelectionItem control by QTP. This is a custom control we put in the addin. Each item in the dropdown is ExtSelectionItem and operation on it is ExtSelectionItem("Option1").click. This will select the first option in the dropdown.