I'm able to retrieve the browser logs using
browser.manage().logs().get('browser').then(function(browserLog) {
logger.info('log: ' + require('util').inspect(browserLog));
});
referenced from https://github.com/angular/protractor/blob/master/docs/faq.md
Similarly is there a way to clear the browser console logs?
function clearLogs() {
browser.manage().logs().get('browser');
}
Retrieving the logs the way you do actually clears the collection so that trying to get them immediately after that returns an empty array.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With