Capybara-webkit raises Capybara::Driver::Webkit::WebkitInvalidResponseError

醉酒当歌 提交于 2020-01-03 15:18:06

问题


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?


回答1:


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.




回答2:


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.




回答3:


Try removing gem thin from your bundle completely.

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




回答4:


In your test.rb:

set config.action_dispatch.show_exceptions = true

and you will see the exception that caused the WebkitInvalidResponseError



来源:https://stackoverflow.com/questions/8893038/capybara-webkit-raises-capybaradriverwebkitwebkitinvalidresponseerror

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!