public void setActiveLayout(Layout layout) {
        List<WebElement> layoutButtons = getLayoutOptionsWebElement().findElements(By.className("ui-button"));
        for (WebElement layoutButton: layoutButtons) {
            WebElement layoutButtonInputHidden = layoutButton.findElement(By.tagName("input"));
            if (layout == Layout.LIST && "list".equals(layoutButtonInputHidden.getDomProperty("value"))) {
                PrimeSelenium.guardAjax(layoutButton).click();
            }
            else if (layout == Layout.GRID && "grid".equals(layoutButtonInputHidden.getDomProperty("value"))) {
                PrimeSelenium.guardAjax(layoutButton).click();
            }
        }
    }
Component wrapper for the PrimeFaces {@code p:dataView}.
primefaces-selenium/primefaces-selenium-components/src/main/java/org/primefaces/selenium/component/DataView.java