Capybara-webkit raises Capybara::Driver::Webkit::WebkitInvalidResponseError
Asked Answered
E

4

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?

Ellenaellender answered 17/1, 2012 at 10:29 Comment(3)
Did you figure out what was wrong?Boisterous
Nope. It simply started working again.Metalinguistics
If it happens again, does this solution work? https://mcmap.net/q/2032226/-how-do-i-use-ruby-debug-in-capybara-w-seleniumSquab
B
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.

Binetta answered 17/1, 2012 at 15:7 Comment(2)
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.Pensioner
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.Albuminuria
M
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.

Mutineer answered 28/6, 2012 at 10:52 Comment(0)
T
1

Try removing gem thin from your bundle completely.

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

Teethe answered 16/10, 2012 at 13:8 Comment(0)
V
0

In your test.rb:

set config.action_dispatch.show_exceptions = true

and you will see the exception that caused the WebkitInvalidResponseError

Vertievertiginous answered 14/12, 2012 at 2:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.