This may be a bit off topic but when running my cucumber tests for
clearance, webrat said it cannot find the password confirmation field.
Could not find field: "Confirm password" (Webrat::NotFoundError)
(eval):2:in `fill_in'
./features/step_definitions/web_steps.rb:34:in `/^(?:|I )fill in "([^
\"]*)" with "([^\"]*)"$/'
features/clearance_features/sign_up.feature:19:in `And I fill in
"Confirm password" with "password"'
It find all the other fields on the page but not sure why it cannot
find this one. it is there. Ideas?
Case issue: Confirm Password is what is actually on the page?
When I have problems with tools that parse web pages, my first attack
is to load the page in a browser and view the HTML source. It's
usually some silly typo.
It appears to be looking for the actual text on the page because it finds the other fields that is what text is on the page. It should work as this stuff is generated from the cucmber/generator with clearance.
You should read the docs a little more closely. Your label isn't
"Confirm password" because it includes the abbr tag ... so probably
you want to look for the id user_password_confirmation ...Webrat will
match on label, id, or name of the field, although I've found
sometimes its easier to write my own rules to match on what I want,
even if it means dropping down to nokogiri and pulling the element I
want directly.