Re: QTP handling of a WebCombo box (381 Views)
Reply
Advisor
adityasrinivasb
Posts: 53
Registered: ‎01-19-2011
Message 1 of 5 (477 Views)

QTP handling of a WebCombo box

Hi 

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

Regards
Srinivas

Advisor
Murari9
Posts: 13
Registered: ‎02-11-2014
Message 2 of 5 (445 Views)

Re: QTP handling of a WebCombo box

How the drop down items are getting recognized??

Occasional Advisor
rameshtt
Posts: 9
Registered: ‎11-25-2008
Message 3 of 5 (432 Views)

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.

 

Eg 

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

wait(3)

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

 

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

 

 

Thanks,

Ramesh

Occasional Collector
Ruban_Chakk
Posts: 4
Registered: ‎01-18-2014
Message 4 of 5 (394 Views)

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.

Advisor
adityasrinivasb
Posts: 53
Registered: ‎01-19-2011
Message 5 of 5 (381 Views)

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.

 

Regards

Srinivas

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.