A Capybara driver for headless WebKit so you can test Javascript web apps.
Questions tagged [capybara-webkit]
470 questions
118
votes
7 answers
ERROR: Error installing capybara-webkit:
Any suggestions on how to fix?
gem install capybara-webkit -v '0.11.0'
Building native extensions. This could take a while...
ERROR: Error installing capybara-webkit:
ERROR: Failed to build gem native extension.
…

Michael Durrant
- 93,410
- 97
- 333
- 497
61
votes
4 answers
How do poltergeist/PhantomJS and capybara-webkit differ?
What are the differences between PhantomJS and capybara-webkit?
What are the advantages of capybara-webkit over PhantomJS?
Which of the two is the most efficient tool?
Others ...

Prashanth Sams
- 19,677
- 20
- 102
- 125
38
votes
6 answers
Capybara: Unable to find css
I am using capybara to click a checkbox, however it can't seem to find it no matter what I do. I am able to correctly find both the span and the label inside the span, but not the input I actually need.
Here is the checkbox

user2158382
- 4,430
- 12
- 55
- 97
31
votes
2 answers
Click overlay marker in Google Maps with capybara-webkit
Is there a way to click a Google Maps overlay with capybara-webkit? What about Capybara using Selenium? I want to test the content of the info window once the marker is selected. I also want to test that there are n markers on the page.

trev9065
- 3,371
- 4
- 30
- 45
27
votes
4 answers
Cucumber / Capybara Error: arguments[0] is undefined (Selenium::WebDriver::Error::JavascriptError)
I've been running my tests via the terminal for a while now without any problems.:
cucumber Create\ New\ Game.feature
Which contains the following:
Feature: Create New Game
Background:
Given I am logged in
Scenario: Cleanup & New Game 01
…

James
- 303
- 3
- 10
25
votes
2 answers
Find elements by data attributes
I'm improving my tests with RSpec and capybara-webkit, trying to delete all the css and xpath selectors like
find('#edit_user > div:nth-child(7) > div > div > button').click
and I'm looking for the best option to replace them.
I was going to use…

fabdurso
- 2,366
- 5
- 29
- 55
23
votes
6 answers
Capybara can't find database records during feature specs
I have a JS feature spec I'm trying to run with Capybara Webkit. It doesn't seem to be able to find my database records however.
The spec in question looks like this
it "should allow pledging to a Hardback level", js: true do
book =…

David Tuite
- 22,258
- 25
- 106
- 176
21
votes
18 answers
How to test a Select2 element with capybara DSL?
I have a Select2 element on a page that loads results via ajax. Would like to test this with capybara/rspec (using the poltergeist driver), but since the Select2 element actually starts out as a hidden field, and then populates a
- once results…

sbeam
- 4,622
- 6
- 33
- 43
19
votes
4 answers
Can I use homebrew's qt5 with capybara-webkit?
I want to use qt5's QtWebKit with capybara-webkit.
brew uninstall qt
Uninstalling /usr/local/Cellar/qt/4.8.4...
brew install qt5
This formula is keg-only: so it was not symlinked into /usr/local.
/usr/local/Cellar/qt5/5.0.2: 3103 files, 140M,…

Jared Beck
- 16,796
- 9
- 72
- 97
18
votes
4 answers
Headless gem: webkit_server: cannot connect to X server
I've got some problems running capybara-webkit with the Headless gem, Xvfb and our ci server. We use this setup for automatic integration testing and javascript testing of our Ruby on Rails 3.2 app. During the tests it complains that
webkit_server:…

23tux
- 14,104
- 15
- 88
- 187
17
votes
6 answers
Not able to install capybara-webkit using bundle install command in Rails 4
I am getting following error while executing command bundle install in my Rails 4 application.
> ruby -v
ruby 2.1.8p440 (2015-12-16 revision 53160) [i386-mingw32]
> rails --version
Could not find gem 'capybara-webkit x86-mingw32' in any of the gem…

Nital
- 5,784
- 26
- 103
- 195
17
votes
7 answers
Stripe checkout fill in form in Capybara-webkit
I'm using capybara-webkit driver for my JS enabled tests. However when I try to fill in the form fields for the stripe checkout iframe, I'm not able to do it using the capybara fill_in helper in both the drivers. Selenium driver provides methods…

Ananth
- 837
- 1
- 10
- 20
15
votes
5 answers
Capybara, capybara-webkit and custom file upload form
I have created custom upload form using the following html stack:
The file field is hidden via css with display: none property. So the file attach dialogue is being called by user when she…

Ruslan
- 1,208
- 3
- 17
- 28
15
votes
4 answers
Trouble interacting with Bootstrap modals via Capybara (v2)
In a Rails application I'm trying to test a Bootstrap modal with a jQuery TokenInput field in Rspec using Capybara with the capybara-webkit driver. The portion in question is as follows:
click_link 'Create Team Modal'
sleep…

user701847
- 337
- 3
- 15
14
votes
1 answer
Rails3 form_for hidden_field undefined method 'merge'
My attempt to place a hidden_field within a form_for is crashing within cucumber on an ActionView helper error. Something also about FixNum which escapes me since I haven't dug through the source code. My prices_controller shows this:
@price =…

sam452
- 1,281
- 3
- 20
- 33