How to print safari browser console log? – pCloudy – Question and Answers
Home >> Appium Tricks and Tricks >> How to print safari browser console log? ...

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")));
  }
 }
}

Leave a Reply

Your email address will not be published. Required fields are marked *