Capybara-webkit 引发 Capybara::Driver::Webkit::WebkitInvalidResponseError

发布于 2024-12-27 13:22:42 字数 226 浏览 2 评论 0原文

我在 rspec 中从 webkit 驱动程序收到以下消息:

Capybara::Driver::Webkit::WebkitInvalidResponseError:
Unable to load URL: http://127.0.0.1:44923/posts

几天前它起作用了。问题出在 save_page 方法上。 可能出什么问题了?

I got following message from webkit driver in my rspec:

Capybara::Driver::Webkit::WebkitInvalidResponseError:
Unable to load URL: http://127.0.0.1:44923/posts

Few days ago it worked. The problem is with save_page method.
What could be wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

以为你会在 2025-01-03 13:22:42

当我的页面出现错误时,我也收到过类似的错误消息。您应该通过在测试模式 (rails s -e test) 下启动服务器并自行访问该页面来手动检查是否存在这种情况。

I've had similar error messages when my page was raising an error. You should check manually that this is not the case by starting a server in testing mode (rails s -e test) and accessing the page yourself.

命硬 2025-01-03 13:22:42

检查您的应用程序中是否存在任何其他可能阻止 Capybara 加载页面的错误。上次我得到它时,我意识到有一个 500 错误页面,这就是 Capybara 引发 Capybara::Driver::Webkit::WebkitInvalidResponseError 的原因。

Check if you don't have any other error in your application that could prevent Capybara from loading the page. Last time I got it, I realized that there was a 500 error page and that was why Capybara raised Capybara::Driver::Webkit::WebkitInvalidResponseError.

小嗲 2025-01-03 13:22:42

尝试从您的包中完全删除 gem thin

即使它仅位于 :development:product 组中!

Try removing gem thin from your bundle completely.

Even if it is in :development or :production group only!

小瓶盖 2025-01-03 13:22:42

在您的 test.rb 中:

设置 config.action_dispatch.show_exceptions = true

,您将看到导致 WebkitInvalidResponseError 的异常

In your test.rb:

set config.action_dispatch.show_exceptions = true

and you will see the exception that caused the WebkitInvalidResponseError

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文