Cucumbers, Webrat, and Selenium NoMethodError in Rails 3

I have a problem with selenium. When I have a script that uses the “I must see foo in bar” web step from a cucumber, I get the following error:

NoMethodError: undefined method `within' for #<Webrat::SeleniumSession:0x000000057ea608>

It works great using cucumber and webrat without selenium.

Here is the webrat configuration block from my env.rb:

Webrat.configure do |config|
  config.mode = :selenium
  config.application_framework = :rack
  config.open_error_files = false # Set to true if you want error pages to pop up in the browser
end

Here is the step that causes the problem (its implementation is in web_steps.rb)

Then I should not see "2" within "#node"
+5
source share
1 answer

Could you post your move? The definition for this is in web_steps.rb

Are you sure your step matches the regular expression in this file? AFAIK must be double quotes around "foo" and "bar"

-1

All Articles