如何调试 websocket 连接?
在 testcafe 测试中运行时,在加载尝试连接到 websocket 的应用程序时,我在控制台中收到错误“在收到握手响应之前连接已关闭”,
这会阻止大多数应用程序工作。
如何获取有关 testcafe 在 url 重写后发出的最终请求的更多信息?我想看看到底是什么 url &它发送以尝试连接的标头。
简单的例子:
import { ClientFunction, Selector } from "testcafe";
fixture`Getting Started`.page("https://torus.qa.argos.education/session/new");
test("Example error", async (t) => {
await t.debug();
});
我尝试过使用非 ssl 和自签名证书模式的 chrome,还尝试禁用网络安全。 Firefox 也给出同样的错误。
When running within a testcafe test, upon loading an app that tries to connect to a websocket, I receive an error in the console of "Connection closed before receiving a handshake response"
This prevents most of the app from working.
How can I get additional information about what the final request that testcafe is making after url-rewriting? I'd like to see exactly what url & headers it's sending to try to connect.
Simple example:
import { ClientFunction, Selector } from "testcafe";
fixture`Getting Started`.page("https://torus.qa.argos.education/session/new");
test("Example error", async (t) => {
await t.debug();
});
I've tried chrome with both non ssl and self signed certificate mode, and also tried disabling web security. Firefox gives the same error.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们发布了新的 TestCafe 版本 (v2.3.0),其中包括 实验性无代理模式。此模式使用本机浏览器自动化。在无代理模式下,一些问题已经得到解决。此问题也应该在无代理模式下得到解决。
不幸的是,我无法测试您的网站,因为您共享的 URL 不再可用。请检查您的示例在启用实验性无代理模式的 v2.3.0 中是否正常工作?
此选项在所有界面中均可用:
请记住,此模式仍处于实验阶段,仅在 Google Chrome 中实现。如果您在非 Chrome 浏览器或其他浏览器的组合中运行测试,它将无法正常工作。
We released a new TestCafe version (v2.3.0), which includes experimental proxyless mode. This mode uses native browser automation. In Proxyless mode, a few issues are already fixed. This issue should also be fixed in Proxyless mode.
Unfortunately, I was not able to test your web site since the URL you shared is no longer available. Would you please check if your sample is working correctly in v2.3.0 with experimental proxyless mode enabled?
This option is available in all interfaces:
Please keep in mind that this mode is still experimental and is implemented only in Google Chrome. It will not work correctly if you run tests in a non-Chrome browser or in a combination of other browsers.