How to access chromedriver logs for Protractor test

后端 未结 7 1126
一整个雨季
一整个雨季 2021-02-15 16:42

I have seen that chromedriver can output a logfile (https://sites.google.com/a/chromium.org/chromedriver/logging)

This page shows how to set this up when executing the e

相关标签:
7条回答
  • 2021-02-15 17:30

    I'm using this as a global afterEach hook (mocha):

    afterEach(() => {
        browser.manage().logs().get('browser').then(function(browserLog) {
            if(browserLog && browserLog.length) {
                console.log('\nlog: ' + util.inspect(browserLog) + '\n');
            }
        });
    });
    
    0 讨论(0)
提交回复
热议问题