How to access chromedriver logs for Protractor test

后端 未结 7 1113
一整个雨季
一整个雨季 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');
            }
        });
    });
    

提交回复
热议问题