public static void getBrowserLog(WebDriver driver) {
Logs log = driver.manage().logs();
LogEntries logEntries = log.get(LogType.BROWSER);
APP_LOGS.info("======== Browser log - starts ========");
for (LogEntry logEntry : logEntries) {
APP_LOGS.info(logEntry.getMessage() + "\n");
}
APP_LOGS.info("======== Browser log - ends ========");
}
Note: Call the above method in onTestFailure method of TestNG listener.
No comments:
Post a Comment