Selenium doesn't work with Cucumber/Capybara (out of the box) - MacOSX Selenium doesn't work with Cucumber/Capybara (out of the box) - MacOSX selenium selenium

Selenium doesn't work with Cucumber/Capybara (out of the box) - MacOSX


Ok... I found out my problem. Somewhere in the bowls of cucumber is a dependency on DatabaseCleaner which is being triggered once when you use the selenium driver. The failure statement:

F______________F

Told me that the failure was occurring in the setup and teardown. Cucumber wasn't reporting the exception and even with the -b it didn't do anything.

How I found the problem:

  1. Add ruby-debug as a gem dependency

  2. Add require "ruby-debug" to env.rb

  3. I added the following statement to env.rb:

Before do    breakpoint; 0end
  1. Ran the feature using bundle exec. The debugger kicked in.

  2. Type in cat StandardError which will tell the debugger to breakpoint when "StandardError" is thrown. StandardError is the base class for all errors in Cucumber. What we want to do is find out where the error is being thrown and why.

  3. Type in cont to tell the debugger to resume

After adding database-cleaner as a gem dependency, everything went away. Firefox started firing up and things start to work as advertised.


Did you try

bundle exec cucumber feature/myfeature.feature

!!