How to print safari browser console log?
public void printSafaraConsoleLog(AppiumDriver driver)
{
if (driver != null)
{
for (LogEntry entry : driver.manage().logs().get("safariConsole"))
{
HashMap consoleEntry = new Json().toType(entry.getMessage(), Json.MAP_TYPE);
System.out.println(String.format("%s [%s] %s", entry.getTimestamp(), entry.getLevel(), consoleEntry.get("text")));
}
}
}