Search code examples
ruby-on-railsqtcucumbercapybara-webkit

Capybara-Webkit "Unable to load URL"


I've been struggling with this issue for a few days and can't figure out what's causing the problem. The test suite runs fine on TravisCI, and locally when I restart my computer. After doing something locally though, I keep getting the same error message:

Unable to load URL: http://localhost.dev:3001/en/users/sign_in because of error loading http://localhost.dev:3001/en/users/sign_in: Unknown error (Capybara::Webkit::InvalidResponseError)

Here is the full webkit-debug trace:

Using the default profile...
..........Finished "EnableLogging" with response "Success()"
Wrote response true ""
Received "Visit"
Started "Visit"
Load started
"Visit" started page load
Started request to "http://localhost.dev:3001/en/users/sign_in"
Finished "Visit" with response "Success()"
Received 0 from "http://localhost.dev:3001/en/users/sign_in"
Page finished with false
Load finished
Page load from command finished
Wrote response false "{"class":"InvalidResponseError","message":"Unable to load URL: http://localhost.dev:3001/en/users/sign_in because of error loading http://localhost.dev:3001/en/users/sign_in: Unknown error"}"
F-Received "Reset"
Started "Reset"
undefined|0|SECURITY_ERR: DOM Exception 18: An attempt was made to break through the security policy of the user agent.
Finished "Reset" with response "Success()"
Wrote response true ""
Received "FindXpath"
Started "FindXpath"
Finished "FindXpath" with response "Success()"
Wrote response true ""
..........F--------

(::) failed steps (::)

Unable to load URL: http://localhost.dev:3001/en/users/sign_in because of error loading http://localhost.dev:3001/en/users/sign_in: Unknown error (Capybara::Webkit::InvalidResponseError)

This comes up anywhere in the app that I try to visit a path. From what I understand, the "Unknown error" is from qt, not capybara-webkit, but I'm not quite sure who would be best to ask. I am using DNSmasq for subdomains and we have multiple languages so localhost:3000 is redirected to www.localhost.dev:3000/en.

Current versions of things:

  • capybara 2.4.1
  • capybara-webkit 1.1.0
  • cucumber 1.3.14
  • cucumber-rails 1.4.0
  • pg 0.7.1
  • rails 4.0.0
  • ruby 2.1.2
  • dnsmasq 2.71
  • postgresql 9.3.5
  • qt 4.8.6 OSX - Mavericks 10.9.4

Edit 1: Also posted on the capybara-webkit repo: https://github.com/thoughtbot/capybara-webkit/issues/667

Edit 2: Here is the test log file: https://gist.github.com/GolfyMcG/060053eba51a9ba69722


Solution

  • As I posted in the related Github issue, I found the solution here:

    https://apple.stackexchange.com/questions/26616/dns-not-resolving-on-mac-os

    Had nothing to do with Capybara-webkit and everything to do with how I had my ElasticSearch instance spinning up with testing.