Unable to get basic Selenium + Capybara + Cucumber to work with Rails 3

Ok i used seleniumetc for projects rails 2I've been working on for a while. Having decided to refactor AS, I move the application to Rails 3, I tried to create a very simple project Rails 3with cucumber and capybara, and then run the test with selenium. (I use selenium because I know that some of my performance tests required me to use selenium to get the appropriate javascript interactions to work.)

I set things up with a simple jane, set all the gems, ran cucumber installerwith help capybara- as many as nine yards. But when I include @seleniumin the 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 it not a module error? I know this means that it is not loaded, but I returned three times in my steps and cannot understand why this is happening. Does anyone lead to what I should check?

Again, these are rails 3. I'm on Ruby 1.9.2 with this project.

thank

+3
source share
1 answer

Welp, found the answer. I forgot to install selenium client stone and require selenium / client in env.rb.

Now everything is better. Just need a day off to think through.

+6
source

Source: https://habr.com/ru/post/1776750/


All Articles