public void toggleTab(int index) {
        final JSONObject cfg = getWidgetConfiguration();
        final boolean isDynamic = cfg.has("dynamic") && cfg.getBoolean("dynamic");

        if (isDynamic || ComponentUtils.hasAjaxBehavior(getRoot(), "tabChange")) {
            PrimeSelenium.guardAjax(headers.get(index)).click();
        }
        else {
            headers.get(index).click();
        }
    }
Toggle the tab denoted by the specified index.

@param index the index of the tab to expand
primefaces-selenium/primefaces-selenium-components/src/main/java/org/primefaces/selenium/component/TabView.java