我看到 chromedriver 可以输出一个日志文件(https://sites.google.com/a/chromium.org/chromedriver/logging)
I have seen that chromedriver can output a logfile (https://sites.google.com/a/chromium.org/chromedriver/logging)
此页面显示了如何在直接执行 exe 时进行设置:
This page shows how to set this up when executing the exe directly:
chromedriver.exe --verbose --log-path=chromedriver.log
我不知道如何在 Protractor 中进行设置
I cannot figure out how to set this up in Protractor however
我目前的protractor.conf.js
require('babel/register');
exports.config = {
framework: 'jasmine2',
seleniumServerJar: './node_modules/protractor/selenium/selenium-server-standalone-2.45.0.jar'
};
来自 @alecxe 的回答如下和 量角器的浏览器设置文档 我尝试添加以下内容(有和没有 --s)但没有明显效果:
From @alecxe's answer below and protractor's browser setup docs I tried adding the following (with and without --s) but with no apparent effect:
capabilities: {
browserName: "chrome",
chromeOptions: {
args: [
"--verbose",
"--log-path=chromedriver.log"
]
}
}
我还尝试指定一个绝对路径 (log-path=/chromedriver.log),但也没有用.
I also tried specifying an absolute path (log-path=/chromedriver.log) which also didn't work.
您始终可以在一个单独的进程中启动您自己的 chromedriver 实例,并告诉 Protractor 连接到该实例.例如,如果您使用以下命令启动 chromedriver:
You can always start up your own instance of chromedriver in a separate process and tell Protractor to connect to that. For example, if you start chromedriver with:
chromedriver --port=9515 --verbose --log-path=chromedriver.log
然后你可以像这样使用 Protractor 的配置文件:
Then you could use a configuration file for Protractor like so:
exports.config = {
seleniumAddress: 'http://localhost:9515',
capabilities: {
'browserName': 'chrome'
},
specs: ['example_spec.js'],
};
这篇关于如何访问量角器测试的 chromedriver 日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
即使在调用 abort (jQuery) 之后,浏览器也会等待Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在调用 abort (jQuery) 之后,浏览器也会等待 ajax 调用
JavaScript innerHTML 不适用于 IE?JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不适用于 IE?)
XMLHttpRequest 无法加载,请求的资源上不存在“AXMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 无法加载,请求的资
XHR HEAD 请求是否有可能不遵循重定向 (301 302)Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 请求是否有可能不遵循重定向 (301 302))
XMLHttpRequest 206 部分内容XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分内容)
XMLHttpRequest 的 getResponseHeader() 的限制?Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)