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.
On Feb 28, 2:44 pm, Chris Habgood <[email protected]> wrote: > 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. > > Here is the page source: > > <fieldset class="inputs"><ol> > <li class="string required" id="user_first_name_input"><label > for="user_first_name">First name<abbr > title="required">*</abbr></label><input id="user_first_name" > maxlength="64" name="user[first_name]" size="50" type="text" /></li> > > <li class="string required" id="user_last_name_input"><label > for="user_last_name">Last name<abbr > title="required">*</abbr></label><input id="user_last_name" > maxlength="64" name="user[last_name]" size="50" type="text" /></li> > > <li class="string required" id="user_email_input"><label > for="user_email">Email<abbr title="required">*</abbr></label><input > id="user_email" maxlength="255" name="user[email]" size="50" > type="text" /></li> > > <li class="password required" id="user_password_input"><label > for="user_password">Password<abbr > title="required">*</abbr></label><input id="user_password" > name="user[password]" size="50" type="password" /></li> > > <li class="password required" > id="user_password_confirmation_input"><label > for="user_password_confirmation">Confirm password<abbr > title="required">*</abbr></label><input > id="user_password_confirmation" name="user[password_confirmation]" > size="50" type="password" /></li> > > </ol></fieldset> > > On Sun, Feb 28, 2010 at 12:55 PM, Curtis Cooley > <[email protected]>wrote: > > > > > 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. > > > On Sun, Feb 28, 2010 at 10:30 AM, Me <[email protected]> wrote: > > > 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? > > > > -- > > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Talk" group. > > > To post to this group, send email to [email protected]. > > > To unsubscribe from this group, send email to > > [email protected]<rubyonrails-talk%2Bunsubscrib > > [email protected]> > > . > > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en. > > > -- > > Curtis Cooley > > [email protected] > > home:http://curtiscooley.com > > blog:http://ponderingobjectorienteddesign.blogspot.com > > =============== > > Leadership is a potent combination of strategy and character. But if > > you must be without one, be without the strategy. > > -- H. Norman Schwarzkopf > > > -- > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Talk" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]<rubyonrails-talk%2Bunsubscrib > > [email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

