public static boolean isElementPresent(WebElement element) {
        try {
            element.isDisplayed(); // just any method to check if NoSuchElementException will be thrown
            return true;
        }
        catch (NoSuchElementException | StaleElementReferenceException e) {
            return false;
        }
    }
Is the Element present on the page?

@param element the WebElement to check
@return true if present
primefaces-selenium/primefaces-selenium-core/src/main/java/org/primefaces/selenium/PrimeSelenium.java