03-18-2014 08:53 PM
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
03-19-2014 03:19 AM
These are ExtJs control i think, you can handle by WebElement as the parents and remaining inside this as the standard control.
Use DP to avoid runtime error if the object are Extjs.
03-21-2014 09:44 AM
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.