Coffee Corner Discussions
Get to know other SAP Community members during your coffee break. Join discussions on a variety of topics in a casual environment.
cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Community Code Challenge - Testing UI5 Apps with wdi5

nicoschoenteich
Developer Advocate
Developer Advocate
We have a new code challenge for you as part of the Community Spotlight for the month of June. This time it's about testing UI5 apps with wdi5. Check out the corresponding blog post explaining all the details of the challenge, how to take part, and how to submit your entry.

This thread is the place to share your experience with the challenge and what kind of app you are building. Feel free to ask any questions (technical or non-technical) and leave your comments. Also feel free to post a link to your pull request as your challenge entry.

We are very much looking forward to your ideas and contributions! 😃
46 REPLIES 46

MioYasutake
Active Contributor
0 Kudos

Is there any way to locate MessageBox (or Message Toast)? I have tried the following code, but the both were unsuccessful.

 

//1. Using controlType
        const messageBox = await browser.asControl({
            controlType: "sap.m.MessageBox",
            viewName: Main._viewName
        })

//2. Using i18NText
        const messageBox = await browser.asControl({
            selector: {
                i18NText: {
                    propertyName: "text",
                    key: "message"
                },
                viewName: Main._viewName            
            }
        })

 

 

0 Kudos

I haven't tried both of those options, but you have two awaits in there, is that on purpose?

0 Kudos

Hi @nicoschoenteich ,

Sorry, it was a typo. There is only one await there.

0 Kudos

Did that fix the issue?

0 Kudos

Unfortunately, not. When debugging, the following message or object is set to messageBox.

        const messageBox = await browser.asControl({
            controlType: "sap.m.MessageBox",
            viewName: Main._viewName
        })

messageBox: 'ERROR: Specified selector is not valid -> abort'
        const messageBox = await browser.asControl({
            selector: {
                i18NText: {
                    propertyName: "text",
                    key: "message"
                },
                viewName: Main._viewName            
            

messageBox.getControlInfo()
{$: undefined, id: undefined, methods: undefined, className: undefined, key: undefined}

 

richard-bruenni
Explorer

A late one but maybe interesting for others because

  • did use xrpl javascript libray
  • the newest version of ui5 tooling extension did want to upgrade this project. Which I did without much of a problem
  • did use easy-ui5 generator for the new views, worked nicely

https://github.com/SAP-samples/sap-community-code-challenge-ui5/pull/49

 

Sweet!