How to access chromedriver logs for Protractor test

后端 未结 7 1101
一整个雨季
一整个雨季 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条回答
  •  -上瘾入骨i
    2021-02-15 17:29

    If you're using the seleniumServerJar, in protractor.conf.js set the logfile path to wherever you want it to write the file:

    seleniumArgs: [
        '-Dwebdriver.chrome.logfile=/home/myUsername/tmp/chromedriver.log',
    ]
    

    If you're using webdriver-manager start to run a local selenium server, you'll need to edit the webdriver-manager file:

    // insert this line
    args.push('-Dwebdriver.chrome.logfile=/home/myUsername/tmp/chromedriver.log');
    
    // this line already exists in webdriver-manager, add the push to args before this line
    var seleniumProcess = spawnCommand('java', args);
    

提交回复
热议问题