cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

OPA5 cannot locate controls inside ComponentContainer

MioYasutake
SAP Champion
SAP Champion
0 Kudos
460

Hi experts,

I'm trying to test an app with OPA5.

App view loads component from custom library, and the component simply displays a button (sap.m.Button).

Below is controller's code loading the component.

			this.getOwnerComponent().createComponent({
				usage: "myButton",
				settings: {},
				componentData: {},
				async: true
			}).then(function(oComp) {
				this.byId("box").addItem(new ComponentContainer({
					id: "myButtonComp",
					component: oComp
				}));                         
			}.bind(this)).catch(function(oError) {
				MessageBox.error(oError.message);
			});

The problem is, OPA5 doesn't recognize created component nor the button inside it.

				iShouldSeeMyButton: function () {
					return this.waitFor({
						viewName: sViewName,
						id: "myButtonComp",
						success: function () {
							Opa5.assert.ok(true, "The button is displayed");
						},
						errorMessage: "Did not find the button"
					});					
				}
Above code didn't work even if I changed 'id: "myButtonComp" to 'controlType: "sap.m.Button"'.With UI5 inspector tool, I could see both the ComponentContainer and button exited.

Actually, my intention was to test library components (Component.js and fragments) with OPA5. If you know how to achieve this, please help.Regards,Mio

Accepted Solutions (0)

Answers (0)