WebdriverIO: Retrieving browser logging

Viewed 1651

According to WebdriverIO-Dokumentation I can integrate the output of browser console logging into webdriverio-logging. My call is then browser.getLogs('browser'). However, only log messages issued with console.warn() are retrieved. All console.log() messages are ignored. How can I manage that and include all of console messages into my webriverio report?

1 Answers

If you are using a recent version of Chrome and find that you only get warning and error messages in your logs, but you want INFO as well, add the following into your wdio.conf.js:

exports.config = {
  capabilities: [{
    ...
    "goog:loggingPrefs": {   // <-- Add this
      browser: "ALL",
    },
  }],
};
Related