How can we get console logs from Safari browser using Selenium web driver?

Hi All, I am trying to get the console logs from Safari browser. I tried using below code with Safari 9 but getting empty errors even though errors exists in the browser console.   List<LogEntry> logs = driver.manage().logs().get(“browser”).getAll(); System.err.println(“Browser’s console:”); if (logs.isEmpty()) { System.err.println(“<EMPTY>”); } else { for (LogEntry log : logs) { System.err.println(” – ” + log.getMessage().replace(” (undefined:undefined)”, “”)); } } Can any one help us on this issue. Same issue is observed in IE as well.

Default Asked on January 25, 2018 in Selenium WebDriver.
Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.