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?

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