Skip to Content
avatar image
Former Member

OPA5 trigger IconTabFilter


I have an IconTabBar and in there there are 2 IconTabFilters in a fragment (see below).



    <IconTabFilter icon="sap-icon://line-chart" text="Chart">        


     <IconTabFilter "text="Table" key="tableIconTabFilter">           

 <core:Fragment fragmentName="js.view.device.fragment.Table" type="XML"/>        




using OPA5 tests, I am trying to switch to the second IconTabFilter.

I am following exactly the steps in this doc.

iPressTableIconTabFilter: function () {

    return this.waitFor({

        controlType: 'sap.m.IconTabFilter',

        viewName: viewName,

        matchers: new Properties({            

             key: 'tableIconTabFilter'

        //also tried: actions: new Press() instead of success function
        success: function () {           

                new Press();          

                 Opa5.assert.ok(true, 'Pressed Table tab');      


        errorMessage: 'Could not press Table tab'



I get the success message that the table was pressed, however in the view I see that it is still in the first tab and therefore the assertion also fails.

Anyone has any ideas what could be wrong?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 19, 2017 at 01:02 PM

    Hi Mahnaz,

    On step 13 you have 'function opaTest inside the script PostJourney.js'. There the action iPressOnTheTabWithTheKey is defined for post page. We send the IconTabFiler key as 'statistics'. On the page itself you will find an XML tag for the second IconTabFilter with key named 'statistics' as well. This way we know which filter tab we need to find and send the action press() so the framework can actually simulate the button being pressed.

    On your code you do not use parameters for the iPressOnTheTabWithKey. However I see you use a fixed key value - which should work just as well. I suspect that by not giving a key to the other IconTabFilter (the first one) that the framework isn't able to switch to the other tab. Maybe it is generating an exception in the background as there is no key for it. Since it is the first one being displayed, it never gets to another filter due to this exception. But it is certainly something to look into the console logs, etc.

    Would you mind sharing your project on a git repository so I can have a better look?


    Add comment
    10|10000 characters needed characters exceeded