cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 OPA5 How can we write OPA script for MultiComboBox control

Former Member
0 Kudos

I have written OPA script successfully for sap.m.ComboBox control using below link ..https://openui5.hana.ondemand.com/#/topic/8615a0b9088645ae936dbb8bbce5d01d

But im facing an issue for sap.m.MultiComboBox, the OPA script what i have written is not working for MultiComboBox. Below is my Code..

XML:

<MultiComboBox items="{/macActivities}" id="typeSelction" selectionFinish="handleTypeSelected">
                        <items>
                            <core:Item text="{Description}" key="{TypeId}"></core:Item>
                        </items>
                    </MultiComboBox>

OPA Script::

opaTest("Enter Type", function (Given, When, Then) {
            Given.iStartMyApp();            
            When.onTheActivitySetpage.filltype();
        });

filltype: function () {
                        return this.waitFor({
                            id:"typeSel",
                            controlType: "sap.m.MultiComboBox",
                            actions: new Press(),
                        success: function(oSelect) {
                            this.waitFor({
                                controlType: "sap.ui.core.Item",
                                matchers: [
                                    new sap.ui.test.matchers.Ancestor(oSelect),
                                    new Properties({ text: "Offline"})
                                ],
                                actions: new Press(),
                                success: function() {
                                    Opa5.assert.ok(true, "Type Offline Selected");
                                },
                                errorMessage: "Cannot select Offline from methodSel"
                            });
                        },
                            errorMessage: "There was no Input"
                        });
                    };

Im getting an error by saying..

Cannot select Offline from methodSel
Opa timeout
This is what Opa logged:
The control Element sap.ui.core.Item#__item0-__xmlview1--actSetSel-0 is not visible -  sap.ui.test.matchers.Visible
The control Element sap.ui.core.Item#__item0-__xmlview1--actSetSel-1 is not visible -  sap.ui.test.matchers.Visible
The control Element sap.ui.core.Item#__item0-__xmlview1--actSetSel-2 is not visible -  sap.ui.test.matchers.Visible

Can some one please help me to resolve this issue with correct OPA Script?

Accepted Solutions (0)

Answers (0)