Dave Sanders
Dave Sanders

Reputation: 3193

Can't get a basic Selenium + Capybara + Cucumber to work on Rails 3

Ok, I've been using selenium, etc for rails 2 projects, I've been working on for a while. Deciding to refactor AS I move the app to Rails 3, I've been trying to set up a very basic Rails 3 project with cucumber and capybara, and then run a test with selenium. (I'm using selenium because I know for a fact that some of my feature tests required me to use selenium to get the proper javascript interactions to work.)

I set things up plain jane, have all the gems installed, ran the cucumber installer with the --capybara - the whole nine yards. Yet when I include @selenium in a test I get:

When I go to the home page     # features/step_definitions/web_steps.rb:23
  Selenium is not a module (TypeError)
  ./features/step_definitions/web_steps.rb:24:in `/^(?:|I )go to (.+)$/'
  features/access.feature:10:in `When I go to the home page'

Why am I getting this Selenium is not a module error? I know it means it's not loaded, but I've gone back over my steps three times and can't figure out why this is coming up. Anyone have leads on what I should be checking?

Again, this is rails 3. I'm on ruby 1.9.2 with this project.

Thanks

Upvotes: 3

Views: 919

Answers (1)

Dave Sanders
Dave Sanders

Reputation: 3193

Welp, found the answer. I had neglected to install selenium-client gem and require selenium/client in the env.rb.

All better now. Just needed a day off to think it through.

Upvotes: 6

Related Questions