I am trying to build a component query so that I can click on a tab in my test. The title of the tab isn't known until certain events happen, so I am building the component query dynamically.

My code isn't working so I was wondering if anyone has any clue how to go about this problem?

Code:
                    tabTitle = "Country (1)";
                    if(parentId == "root-Asset"){
                        grid.rowWith('id', record.id)
                        .click()
                        .wait(2000);
                        var query = "'content tab[title*=" + '"' + tabTitle +'"' + "]" + "'";
                        var tab = ST.button(query); //This line of code doesn't work as it is an invalid query.
                        tab.click();
                        ST.wait(3000);
                    }