#35 ✓resolved
James B. Byrne

selects does not find input by field or label

Reported by James B. Byrne | November 13th, 2008 @ 03:28 PM

When calling webrat using:

When /^I select "(.*)" from "(.*)"$/ do |value, field|
selects(value, :from => field) end

If one specifies a label value then this error results:

And I select "CORP" from "'Legal Form'" 
   # features/step_definitions/webrat_steps.rb:16
  Could not find field labeled "'Legal Form'" (RuntimeError)
  /usr/lib/ruby/gems/1.8/gems/webrat-0.3.2/lib/webrat/core/flunk.rb:4:in

flunk' /usr/lib/ruby/gems/1.8/gems/webrat-0.3.2/lib/webrat/core/locators.rb:16:infield_labeled' /usr/lib/ruby/gems/1.8/gems/webrat-0.3.2/lib/webrat/core/locators.rb:10:in field' /usr/lib/ruby/gems/1.8/gems/webrat-0.3.2/lib/webrat/core/locators.rb:49:infind_select_option' /usr/lib/ruby/gems/1.8/gems/webrat-0.3.2/lib/webrat/core/scope.rb:91:in `selects'

If one specifies the input field name instead then one gets this error:

And I select "CORP" from "entity_entity_legal_form" # features/step_definitions/webrat_steps.rb:16
You have a nil object when you didn't expect it! The error occurred while evaluating nil.choose (NoMethodError) /usr/lib/ruby/gems/1.8/gems/webrat-0.3.2/lib/webrat/core/scope.rb:91:in selects' /usr/lib/ruby/gems/1.8/gems/webrat-0.3.2/lib/webrat/rails.rb:88:insend' /usr/lib/ruby/gems/1.8/gems/webrat-0.3.2/lib/webrat/rails.rb:88:in `method_missing'

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Ruby Acceptance Testing for Web applications.

Shared Ticket Bins

People watching this ticket

Pages