-
-
Notifications
You must be signed in to change notification settings - Fork 428
Unable to load URL: http://127.0.0.1:52548/fredrik #109
Comments
The WebKit driver starts silently - it's headless. Can you check your application logs to see if there's anything interesting? That error is raised if capybara-webkit can't load the page for any reason, but sometimes it's hard to know why. |
Ok. Does capybara-webkit work in a threadsafe environment with Fibers in Ruby 1.9.2? |
I haven't ever tried fibers, so I'm not sure. If you can isolate your On Thu, Jul 14, 2011 at 11:01 AM, fbjork <
|
Unfortunately I don't see anything in the logs. I remember having these issues with Cucumber and Selenium in a Fiber app, so this is probably the issue. |
I've had a similar issue. All tests would use
This only happened with webkit, using
While my issue is probably different from yours, I suggest that you check where and how you redirect the visitor. After wasting a whole day on trying to solve this, we found that the problem was with a redirect inside of one of the controllers: before_filter :redirect_user, :only => :new
def redirect_user
unless current_user.profile
redirect_to new_canvas_profile_path
else
redirect_to canvas_quiz_path
end
end Without that filter all the tests pass again :) |
We added a :webkit_debug driver that prints more information that could be useful to us. Can you attach the output from the debug driver? |
I saw this error as well after I added Thin to my Gemfile. Upgrading to capybara-webkit 0.7.1 and capybara 1.1.1 fixed the issue. |
I'm running into a similar issue. It looks like it may be caused by a Browser#reset! call capybara is making at the end of each spec while a redirect or request is still being processed. Backtrace
Debug driver output
|
We can issue a user "Stop" request before resetting to see if that solves |
Actually, I was just able to reproduce this behavior with a "Find" command as well. I even inserted a ~60 sleep between the "Node.click" and "Find" calls, and still received the same failure. It seemed like that failure response was queued / held up, and then being sent after the next command, regardless of what it was:
After further investigation I realized our Our team was only seeing this issue on our CI machine:
We did not encounter the problem on our multicore OS X laptops with Qt 4.7.4 I can revert our fix to reproduce the issue if you think of anything you'd like me to try. |
Hi, I am getting the same "Unable to load URL" errors after posting a form to update a resource. Is there any update on this? Thanks |
Same for me. It started after upgrading my bundle to: rspec 2.8.0 This error does not shows up everytime I ran my specs, only sometimes. |
Hi tvdeyen, Weird, for me it happened each time. I am not sure of what "fixed" the issue for me in the end as it kinda disappeared with the combination of gems and perhaps some changes in the code that I had made. Sorry not to be of much help. I wish I knew for sure what caused that problem. Cheers |
Seeing this as well. Also intermittent, and nothing interesting to report in the logs. |
Same error :( capybara-webkit 0.10.0 I'm using Backbone, i'm clicking on link that changes location #hash and should trigger Backbone router. Here is my Teamcity log: https://gist.github.com/1910910 Also i dig a little bit to make more debug info, and also show info coming to |
We're working on ways to improve the feedback here, but in the meantime, here are a couple of suggestions:
|
I found one of cases when it failing: https://gist.github.com/1926473 It shows this error if one of the iframes on page is failed to load. Hope it helps! |
@buger thanks, that should help us fix at least one of the issues here. We'll look into that. |
@buger tried out your gist today, but it seems like it's failing because that's a bad domain. It fails because it can't load that page, which seems correct to me. If you change to load "www.something.com" it works. |
@jferris exactly, it fail all suite, because one of the iframes on the page is failed to load. I don't think it's normal situation. It should not fire error. If twitter or facebook widget and etc. will down, than all pages that include it will raise this error in test case. |
@buger if an iframe fails to load on the page, that means the page didn't load successfully. If you have iframes with unreliable or unimportant content, I recommend you fake out those services during tests. |
I just ran into this now.
Notice no port number. [Update] Forgot to mention, this is a Sinatra app. And what I neglected to do was set Capybara.app = MySinatraApp.new Now I don't see this issue anymore. |
I see this issue when I changed Rails' Here are some observations: If the only difference between webkit and webkit_debug is extra printouts, then I suspect some kind of timing-dependent error. Is that assumption correct? [Update] |
Same for me:
I can confirm that this might be a timing issue. |
I observe pretty much the same as pacovell. In my case, I was able to narrow down to one example running. The example passes when I use :webkit_debug instead of :webkit driver. It passes when I insert a single "nil" statement at the beginning of the example. There is an iframe on the page being tested, but it is not interacted with. test.log looks good. So, inserting nil made the bug disappear, so did insertion of any debugging trick I tried. Since a nil statement shouldn't change timings significantly, I suspect a bug somewhere in a C extension that is triggered by some byte positions being different at times. If true, this is pretty impossible to track down. |
Folks, I THINK I solved my problem (you never know that when it's a heisenbug), so I'd like to let you know because other people might hit upon here and read what their problem might be about. I used I solved that by using another Hope that helps! |
Any updates on this? I still have this issues and they are very annoying. |
I'm also getting what appears to be this issue. I am using remotipart, and although the iframe request returns a 200 response it appears red in the Chrome developer tab which I guess is also considered a failure by this driver (it is fine with Selenium however). Here is the response: Cache-Control:max-age=0, private, must-revalidate
Connection:close
Content-Type:text/html; charset=utf-8
Date:Fri, 22 Jun 2012 15:34:30 GMT
ETag:"52dd32d9108e1be54f6882c1b4efef34"
Set-Cookie:_hst_session=*snip*; domain=.hst.localhost; path=/; HttpOnly
Status:200 OK
X-Rack-Cache:invalidate, pass
X-Request-Id:e9b855eb554c24647e6af598e7fef9eb
X-Runtime:5.319091
X-UA-Compatible:IE=Edge
<textarea data-type="text/javascript" response-code="200">
*snip javascript*
</textarea> What is the textarea stuff about - that isn't mentioned anywhere in my views? Here is the development log:
Edit: The spec works fine if I don't use remotipart. |
I finally have the solution: https://github.com/jonleighton/poltergeist Uses phantomjs, is a easy dropin replacement, works out of the box. No more problems. And one can even run the specs on travis-ci!! Byebye capybara-webit. |
I'm also seeing the issue when an iframe on the page 500s. I can see your point @jferris that if an iframe fails to load, the page fails to load. I think the error message could be improved. The message I get is: It would be more helpful if it said something like "iframe #foo failed to load" :) |
@sarahmei can you try out the master branch? I've made some changes to the way it expects pages to load that may improve that specific scenario. |
@jferris Thanks! I am now getting: Capybara::Webkit::InvalidResponseError: Unable to load URL: [URL for main page 2 redirects ago] because of error loading [long iframe URL]: SSL handshake failed That is much easier to debug. Much appreciated. |
The same error occurs in our application. I think i narrowed it down a bit: We have a login-overlay-iframe which is inserted via JS when one clicks the 'sign in' link. def sign_in_via_form_as user
visit root_path
click_link "Anmelden"
within_frame("iframe") do
fill_in 'user_email', :with => user.email
fill_in 'user_password', :with => user.password
click_button 'Anmelden'
end
end
should '...' do
user = create(:user)
sign_in_via_form_as user
assert page...
end We then always received this error:
To make sure that the error is not caused by a 500 http status code or so, i started a test server:
And changed the Capybara.run_server = false But there were no errors shown in the log (only status 200 and 302). When logging in via the iframe, the server returns a redirect to the iframe which then displays the if(top != window) {
top.location.href = window.location.href;
$(top.document).find('#overlay').remove();
} It seems that this redirect process makes the def within_frame(frame_id_or_index)
browser.frame_focus(frame_id_or_index)
begin
yield
ensure
browser.frame_focus
end
end It seems to be caused by the def sign_in_via_form_as user
visit root_path
click_link "Anmelden"
#within_frame("iframe") do
page.driver.browser.frame_focus('iframe')
fill_in 'user_email', :with => user.email
fill_in 'user_password', :with => user.password
click_button 'Anmelden'
sleep 2
#end
end Basically leaving out the second call to I hope this might help people who struggle with a similar issue. |
forse_ssl can be the reason as well... |
Has any work been done on this? It seems numerous solutions have been proposed... but nothing definitive or resolved. Here is my sad story: We are using capybara-webkit to run our RSpec tests and everything passes on my own, relatively slow, 32-bit laptop - including the specs using javascript. However, the same specs consistently fail when running the javascript tests on a much faster 64-bit machine for the same reason mentioned at the beginning of this issue: My situation is the same as mentioned by "pacovell" and others in this thread:
The behavior is consistent, i.e. it does not come and go as others have mentioned. The fact that running all => "fail" and running one => "pass", coupled with the fact that all tests always pass on my slower laptop leads me to believe - as others have surmised in this thread - that this is a timing issue. I have been searching the web and trying different things for a couple of days:
And regarding #2, I didn't see any special output in either the console or the test.log file. Did I miss something? I'm at my wit's end on this - does anyone have any suggestions? Thanks, |
There are a number of fixes for loading issues in |
Okay, Joe. Thanks for taking the time to let me know what's going on - I appreciate it. (And all of the work you guys do on all of the gems you provide!) |
@pcreux I may do that. I've been meaning to look into the thin issues, because I've used thin and capybara-webkit together every project I work on, and it hasn't been an issue. The Qt 4.8 issues are the current priority, though. |
We're using unicorn instead of thin, so while removing thin might solve some problems I don't think you can say thin is the culprit. |
Have same issue. Spec failures are intermittent. |
Is this still an issue in the latest version of capybara-webkit? |
Don't think so; I haven't seen this problem in years. |
Great! I'll close this. If anyone is still having these issues, please re-open this issue. |
[Update] Still having this issue w/ filepicker. Error:
Manifestation: The URL we navigate to does result in a 302, so we may have some version of the redirect issue mentioned above. I'll confirm whether this manifests if we navigate directly to the resulting URL. Dependency Versions:
Gem Versions:
Debug Logs
|
I have the following in my Gemfile:
gem 'capybara', '1.0.0'
gem 'capybara-webkit', '1.0.0.beta4'
and this in my spec_helper.rb:
Capybara.javascript_driver = :webkit
running in a Ruby 1.9.2/Rails 3.0.9 app and get this when I run my JS RSpec acceptance tests:
Unable to load URL: http://127.0.0.1:52548/fredrik
I don't see the webkit driver starting. I've installed the non debug Cocoa OSX dmg. Any ideas?
The text was updated successfully, but these errors were encountered: