-
-
Notifications
You must be signed in to change notification settings - Fork 427
Random failure: Capybara::Webkit::InvalidResponseError: 'undefined' is not an object #550
Comments
+1, same problem for me |
Same here, I thought It was CircleCI, but It happens locally.... sometimes |
+1, we have seen this as well |
The same problem here: |
+1, happening on two different |
I spent some time looking into this today, and it looks like at least one source of the issue may be navigating away from a page between the time |
Yeah, I think the best thing we can do is divide
We can also add some more defensive code and logging/exceptions around node handling if we think there are race conditions there. |
+1, I'm getting this as well (although only on CircleCi, haven't seen it locally yet). Same config as OP. Anyone have a workaround yet? |
👍 seems to only occur on our CI server |
I was seeing this issue when I used the following line immediately after a click action which redirected the browser to another page. Even
After changing this to an xpath, it works 100% of the time:
I thought it might be a timing issue so before trying the xpath, I tried changing the capybara default timeout value; however, this had no effect. The issue was only resolved when I switched to the xpath selector. |
Interesting. We introduced native CSS selectors as part of capybara-webkit 1.0.0 (and upstream Capybara 2.1). It's possible that there's something with native CSS selectors that's causing an issue with our node interactions. Thanks for the additional details. |
My test failing was indeed using css selectors like @tmertens'. I just replaced them with xpath selectors. I'll update the ticket later on to let you know if the random failures disappeared or not. |
Alright, I replaced CSS selectors with xpath selectors and after a day I'm still getting the exact same error on my CI. Also some tests never fail randomly but they use css selectors... so I guess that's not the issue. |
You are still getting the same exact error? I started seeing a timeout
|
@tmertens Yes I'm getting the exact same error. It took ~20 runs to see one appear, but it's identical: |
+1 we're seeing this issue to. It happens much more frequently on our CI, too (we are using Tddium). But, I've seen the same failure running locally as well. In both cases they are intermittent and seem to be pretty random, though it occurs more often in some tests than others. |
I've found that every test I've applied tmertens genius solution to now passes consistently. All the failures occurred after a page navigation (generally triggered by an event within a modal dialog). Kinda sucks to have to modify the tests, but at least there's a way out. |
I'm also noticing this issue on Rails 4.0.0 w/ Ruby 2.0.0p247. The context in which it's failing involves clicking a "save" button, which invokes an ajax call, and then a Turbolinks.visit once the ajax request completes. I get the following error: Failure/Error: page.should have_content I18n.t('documents.create.success') |
I'm having the same problem, locally and in jenkins, with the following backtrace: Failures:
Finished in 13 minutes 11 seconds Failed examples: rspec ./spec/support/shared/landing_examples.rb:85 # Landing pages landing pages with different campaign layouts with a campaign layout CPL it should behave like invalid data for cpl campaigns when I visit the landing page and fill form with invalid data it should behave like error messages visit landing page with errors should show the flash error message |
We're getting this issue too. At first we thought it was only during our parallel features, but it turns out it just shows up more frequently then. |
In our case the problem was in our code. We were making calls to urls out of the testing environment (google analytics) and then the driver was lost. Check if this could be also your case. |
+1 We're seeing it intermittently when using |
+1 We're getting the same issue but very intermittent. |
I ended up here via a search after experiencing a somewhat related problem. For anyone who may have something similar, here's what was causing the failure for me. I have a test that does the following:
My app is doing the following during this test:
My
And updating the javascript to add the processing class to the form while it waits for the AJAX response. I hope this may be helpful to someone else who ends up on this issue. |
Using As already described in other comments it happens when a normal |
Seen a similar issue related to a I use this
|
Fyi, we get this a bit when triggering a page change in javascript. Most often, it's on an assertion similar to: page.should have_content "Success!" It is a little surprising to me that page could be the 'undefined' when capybara-webkit calls invoke, but I guess page is no different than any other node? |
Bit of an update here. After stripping out most |
Newer version of capybara-webkit fixes "Capybara::Webkit::InvalidResponseError: 'undefined' is not an object" error, which randomly occured because of a race condition. See also: * thoughtbot/capybara-webkit#550 * thoughtbot/capybara-webkit#595 This should fix intermittent test failure in https://www.apptrajectory.com/thoughtbot/learn/stories/15637153
Newer version of capybara-webkit fixes "Capybara::Webkit::InvalidResponseError: 'undefined' is not an object" error, which randomly occur because of a race condition. See also: * thoughtbot/capybara-webkit#550 * thoughtbot/capybara-webkit#595 This should fix intermittent test failure in https://www.apptrajectory.com/thoughtbot/learn/stories/15637153
Newer version of capybara-webkit fixes "Capybara::Webkit::InvalidResponseError: 'undefined' is not an object" error, which randomly occur because of a race condition. See also: * thoughtbot/capybara-webkit#550 * thoughtbot/capybara-webkit#595 This should fix intermittent test failure in https://www.apptrajectory.com/thoughtbot/learn/stories/15637153
If it is the same problem I was having, then it's an issue with the Webkit implementation that Qt 4 uses on OSX. The solution is to upgrade to Qt 5 which uses a newer version that doesn't throw these kinds of errors when trying to play MP4 videos, for instance. See this blog post for details about the problem and solution: http://magnemg.tumblr.com/post/113251336220/how-to-solve-a-capybara-webkit-and-video-js |
Thanks @redbar0n. I'll close this issue due to the long time of inactivity. Feel free to re-open it if you're still experiencing these issues. |
…-webkit#550 (comment)), trying selenium/firefox
Given weirdness in travis w/ webkit + qt 4.x (see thoughtbot/capybara-webkit#550 (comment)), trying selenium/firefox
Hello,
Running 1.0.0 with ruby 2.0.0-p247 & qt-4.8.5 I am getting random
Capybara::Webkit::InvalidResponseError
every once in a while. Let's say I run my tests 10 times in a row it might happen twice on 2 different tests.I tried on various machines and it seems to happen more frequently on the less powerful setups, but even very recent macbook pros run into the issue.
I've spent some time trying to figure out what could be wrong in my code, but there isn't anything out of the ordinary, so I am not sure anymore how to go about this so I figured I'd bring this up here.
This issue seemed to be linked to our recent upgrade to Ruby 2.0, but I could be wrong since - like I said - it's very random.
Thanks
The text was updated successfully, but these errors were encountered: