1

I have a log which logs using formatting.

console.log('%c%s - %s', 'color:blue; font-weight:bold;', msg.type, msg.message);

I need to get these logs using selinium.

Using

LogEntries logEntries = driver.manage().logs().get(LogType.BROWSER);
for (LogEntry entry : logEntries) {
  System.out.println(entry.getLevel() + " " + entry.getMessage());
 }

prints

INFO xyz/abc/LogService.js 45:14 %c%s - %s

instead of printing the value of the object.

How do I get the value of %s or %c formats in the logs.

Uma Kanth
  • 5,659
  • 2
  • 20
  • 41
  • The question is already answered in other topics: [Capturing browser logs with Selenium](http://stackoverflow.com/questions/25431380/capturing-browser-logs-with-selenium) [Getting console.log output from Chrome with Selenium Python API bindings](http://stackoverflow.com/questions/20907180/getting-console-log-output-from-chrome-with-selenium-python-api-bindings) – Andrii Olieinik Jan 27 '16 at 09:13
  • 1
    @Adept, I used the same answer as reference. But this is not printing the value of `%s`. – Uma Kanth Jan 27 '16 at 09:14

0 Answers0