查看未完成请求 [英] Viewing outstanding requests

查看:308
本文介绍了查看未完成请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请问有什么办法可以查看哪些请求量角器在等待?我试图调试片状国家检测,但很难讲一个按钮是否没有触发响应或者量角器没有刻意去等待。

Is there any way to view what requests Protractor are waiting on? I'm trying to debug flaky state testing, but it is hard to tell whether a button didn't trigger a response or if Protractor didn't bother to wait.

TL; DR:我如何才能查看到量角器控制流剩下的承诺

TL;DR: How can I view the remaining promises on the Protractor control flow?

推荐答案

通常的做法是在调试模式下启动量角器的放的 browser.debugger() 断点前问题块code的。

The usual approach is to start protractor in a debug mode and put browser.debugger() breakpoint before the problem block of code.

参见<获得更多的信息href=\"https://github.com/angular/protractor/blob/master/docs/debugging.md#debugging-protractor-tests\"相对=nofollow>调试量角器测试。

在另一方面,你可以赶上 chromedriver服务日志看起来像:

On the other hand, you can catch the chromedriver service logs that look like:

[2.389][INFO]: COMMAND FindElement {
   "sessionId": "b6707ee92a3261e1dc33a53514490663",
   "using": "css selector",
   "value": "input"
}
[2.389][INFO]: Waiting for pending navigations...
[2.389][INFO]: Done waiting for pending navigations
[2.398][INFO]: Waiting for pending navigations...
[2.398][INFO]: Done waiting for pending navigations
[2.398][INFO]: RESPONSE FindElement {
   "ELEMENT": "0.3367185448296368-1"
}

也可能会给你正在发生什么的线索。

Might also give you a clue of what is happening.

有关这一点,你需要使用启动铬 - 详细 - 日志路径参数:

For this, you need to start chrome with --verbose and --log-path arguments:

{
     browserName: "chrome",
     specs: [
         "*.spec.js"
     ],
     chromeOptions: {
         args: [
             "--verbose",
             "--log-path=/path/to/the/log/file"
         ]
     }
 }

(未测试)

对于Firefox,您可以通过设置查看日志 <开启和code> webdriver.log.driver 和 webdriver.log.file Firefox的配置设置

For firefox, you can turn on and view logs by setting webdriver.log.driver and webdriver.log.file firefox profile settings.

另请参阅:

  • Monitoring JSON wire protocol logs
  • How to change firefox profile

这篇关于查看未完成请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆