Search in sources :

Example 1 with Logs

use of org.openqa.selenium.logging.Logs in project cerberus-source by cerberustesting.

the class WebDriverService method getSeleniumLog.

@Override
public List<String> getSeleniumLog(Session session) {
    List<String> result = new ArrayList();
    Logs logs = session.getDriver().manage().logs();
    for (String logType : logs.getAvailableLogTypes()) {
        LogEntries logEntries = logs.get(logType);
        result.add("********************" + logType + "********************\n");
        for (LogEntry logEntry : logEntries) {
            result.add(new Date(logEntry.getTimestamp()) + " : " + logEntry.getLevel() + " : " + logEntry.getMessage() + "\n");
        }
    }
    return result;
}
Also used : LogEntries(org.openqa.selenium.logging.LogEntries) ArrayList(java.util.ArrayList) Logs(org.openqa.selenium.logging.Logs) LogEntry(org.openqa.selenium.logging.LogEntry) Date(java.util.Date)

Aggregations

ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 LogEntries (org.openqa.selenium.logging.LogEntries)1 LogEntry (org.openqa.selenium.logging.LogEntry)1 Logs (org.openqa.selenium.logging.Logs)1