# Cucumber/webrat field issue

**URL:** <https://www.ruby-forum.com/t/cucumber-webrat-field-issue/184313>\
**Category:** Rails\
**Created:** [February 28, 2010, 7:31pm UTC](https://www.ruby-forum.com/t/cucumber-webrat-field-issue/184313 "2010-02-28T19:31:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [February 28, 2010, 7:31pm UTC](https://www.ruby-forum.com/t/cucumber-webrat-field-issue/184313/1 "2010-02-28T19:31:24Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [February 28, 2010, 7:56pm UTC](https://www.ruby-forum.com/t/cucumber-webrat-field-issue/184313/2 "2010-02-28T19:56:34Z")

</div>

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 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 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 G. “Ruby on Rails: Talk” group.  
> To post to this group, send email to removed\_email\_address@domain.invalid.  
> To unsubscribe from this group, send email to removed\_email\_address@domain.invalid.  
> For more options, visit this group at [http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

# – Curtis C. removed\_email\_address@domain.invalid home:[http://curtiscooley.com](http://curtiscooley.com) blog:[http://ponderingobjectorienteddesign.blogspot.com](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

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [February 28, 2010, 8:46pm UTC](https://www.ruby-forum.com/t/cucumber-webrat-field-issue/184313/3 "2010-02-28T20:46:18Z")

</div>

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:

1. First name\*
2. Last name\*
3. Email\*
4. Password\*
5. Confirm password\*

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [February 28, 2010, 9:17pm UTC](https://www.ruby-forum.com/t/cucumber-webrat-field-issue/184313/4 "2010-02-28T21:17:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [February 28, 2010, 9:55pm UTC](https://www.ruby-forum.com/t/cucumber-webrat-field-issue/184313/5 "2010-02-28T21:55:22Z")

</div>

Not my label. Clearance put the all of the cucumber stuff in not me.
