Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member197944
Active Participant
Opa5 is just like life, you could always wait for someting, but before that you'd better know if finally it will be there.

-- Me







If you have written Opa5 tests for your application, you will believe the waitFor function is one of the most important functions in Opa5. But there are not so many detailed documentations about it. About its functionality I found following statement in here.



So the waitFor function will always success if the control is visible? Maybe not. Recently a colleague came to me and said in her Opa5 tests a visible Column could not be found by waitFor. Then I checked the code. It turns out that the property "minScreenWidth" and "demandPopin" are setted to the column. So maybe during the Opa5 test the column popin, and the waitFor function does not work for a popin column. But why?

Then through the implementation of waitFor. During the whole process many conditions could lead to a failure in looking for the control.

  1. Firstly it tries to find the control.

    1. If a viewName and an id are given, it will look for the control with the given id in the given viel.

    2. If there's no viewName, it will consider the id as a global id and look for the control.

    3. If no id is given, it will try to find all the controls with the given controlType.

    4. If nothing is given, all controls will be return.



  2. After finding the control / controls, check if the control is available. If one of the following condition are not fulfilled, the whole process failed.

    1. Use getDomRef function to get the DOM element of the control, which means the control is rendered.

    2. The control should be visible.

    3. The control should be not in busy state.

    4. The control should be enabled.

    5. All the parents of the control should also be enabled and not busy.



  3. If all the above condition are fulfilled, the controll will be returned for further actions.


Then on which step failed the popin column? Let's have a small test. In the following table there are three columns ID, Name and Price. The last column popin. And we could see it cannot find a corresponding DOM element for the popin column. And that is the reason of the failure of waitFor.



And we could see in Column.js the function getDomRef is not rewritten. It only use the control id to find the DOM element, but nothing could be found since the structur of the table is changes.



About the table structur when there are popin columns you could find in my blog [UI5] Things that Demo Kit didn’t tell you. <Column> / [UI5] Dinge, die Demo-Kit Ihnen nicht mitgete....