4

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?

Ewgenij Sokolovski
  • 897
  • 1
  • 12
  • 31
  • Could you please check the `Level of logging verbosity` mentioned in the `wdio.conf.js` file ?. I guess by default it will be `logLevel: 'warn',`. Can you try changing it to `trace`, to get all the logs ? – Madhan May 01 '21 at 17:47
  • No, that didn't help. Any other ideas? – Ewgenij Sokolovski May 05 '21 at 06:25

1 Answers1

2

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",
    },
  }],
};
Ryan Shillington
  • 23,006
  • 14
  • 93
  • 108