Cucumber + radio button

Hello Friends While testing for the radio button getting the following error

ERB

<%= radio_button_tag “radio”, “primary_office_#{count}”, is_primary_office(office.id) %>

When I choose "radio_primary_office_2"       # features/step_definitions/webrat_steps.rb:110
  You have a nil object when you didn't expect it!
  The error occurred while evaluating nil.fields (NoMethodError)
  (eval):2:in `/^I choose "([^\"]*)"$/'

Please let me know where i am getting wrong.

Thanks Abhis

Can you post your step implementation?

Hey Leonardo. Thanks for your reply. Here is what my steps are my_file.erb <%= radio_button_tag “radio”, “primary_office_#{count}” %> something.feature Scenario: Radio button steps When I choose “radio_primary_office_2” webrat_steps.rb When /^I choose “([^"]*)”$/ do |field| choose(field) end Error: When I choose “radio_primary_office_2” # features/step_definitions/webrat_steps.rb:110 You have a nil object when you didn’t expect it! The error occurred while evaluating nil.fields (NoMethodError)

Thanks Abhis