How to access chromedriver logs for Protractor test

后端 未结 7 1130
一整个雨季
一整个雨季 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:21

    According to the protractor's source code, chromedriver service is started without any arguments and there is no direct way to configure the arguments. Even though the chromedriver's Service Builder that protractor uses actually has an ability to specify the verbosity and the log path:

    var service = new chrome.ServiceBuilder()
        .loggingTo('/my/log/file.txt')
        .enableVerboseLogging()
        .build();
    

    Old (incorrect) answer:

    You need to set the chrome arguments:

    capabilities: {
        browserName: "chrome",
        chromeOptions: {
            args: [
                "verbose", 
                "log-path=chromedriver.log"
            ]
        }
    },
    

    See also:

    • Viewing outstanding requests

提交回复
热议问题