5

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?

Sławosz
  • 11,187
  • 15
  • 73
  • 106

4 Answers4

7

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.

Marc-André Lafortune
  • 78,216
  • 16
  • 166
  • 166
  • 3
    I ran in to this issue for the same reason. To debug you can also change the call to 'visit foo_path' to 'get foo_path' and you should then see any exception raised by the page in the test output. – Jesse Clark Feb 10 '12 at 18:58
  • I've been taking this same approach myself recently, @Marc-André Lafortune. Good advice. I'd add that you'll want to fire up that server after you've run your spec so the database's most recent state will be available to you. – Tass Feb 16 '12 at 22:26
1

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.

Michał Czapko
  • 1,948
  • 1
  • 16
  • 25
1

Try removing gem thin from your bundle completely.

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

Stephan
  • 41,764
  • 65
  • 238
  • 329
0

In your test.rb:

set config.action_dispatch.show_exceptions = true

and you will see the exception that caused the WebkitInvalidResponseError

doesterr
  • 3,955
  • 19
  • 26