Skip to Content
Former Member
Sep 11, 2017 at 10:44 AM

SAPUI5 OPA5 How can we write OPA script for MultiComboBox control


I have written OPA script successfully for sap.m.ComboBox control using below link ..

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..


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

OPA Script::

opaTest("Enter Type", function (Given, When, Then) {

filltype: function () {
                        return this.waitFor({
                            controlType: "sap.m.MultiComboBox",
                            actions: new Press(),
                        success: function(oSelect) {
                                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?