protected LogEntries getLogsForType(String type) {
        if (!isConsoleSupported()) {
            return null;
        }

        Logs logs = getWebDriver().manage().logs();
        if (logs == null) {
            return null;
        }
        Set<String> types = logs.getAvailableLogTypes();
        if (!types.contains(LogType.BROWSER)) {
            return null;
        }
        return logs.get(type);
    }
Utility method for checking the browser console for a specific type of message.

@param type the {@link LogType} you are searching for
@return either NULL if not available or the {@link LogEntries}
primefaces-selenium/primefaces-selenium-core/src/main/java/org/primefaces/selenium/AbstractPrimePageTest.java