public void toggleTab(int index) {
        if (ComponentUtils.hasAjaxBehavior(getRoot(), "tabChange")) {
            PrimeSelenium.guardAjax(getHeaders().get(index)).click();
        }
        else {
            getHeaders().get(index).click();
        }
    }
Toggle the tab denoted by the specified index.

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