5

I'm having a problem using selenium. When I have a scenario which uses the "I should see foo within bar" web step from cucumber, I get the following error:

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

It works fine just using cucumber and webrat without selenium.

Here is the webrat configure 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 trouble (it's implementation is in web_steps.rb)

Then I should not see "2" within "#node"
Magnus
  • 1,222
  • 1
  • 12
  • 25
  • May I nominate 'Then I should not see "2" within "#node"' for DailyWTF as a prime example of Cucumber abuse? Cucumber is for clients to review, and should only say high level things like "this feature is profitable". And Cucumber should NOT be used as a confusion layer over tests that drive a website through its user interface! – Phlip Jun 18 '12 at 23:21

1 Answers1

-1

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

Are you sure your step matches the regexp in this file? AFAIK there should be double quotes around the "foo" and "bar"

AlistairH
  • 3,139
  • 2
  • 21
  • 19