title: Capybara won't find a button by its "name" attribute
body: <p>A W3C-validated HTML 5 web page contains this working, simple button inside a login form.</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;input data-disable-with="Signing in, please wait&amp;amp;hellip;"
         name="commit" type="submit" value="Sign in" /&gt;
  </code></pre>
  
  <p>I'm writing a largely pointless test :-) in a Rails 3.2.17 application that's just to get the hang of Capybara and I've already got completely stuck Googling, reading documentation and reading source code to the test framework, with no joy - attempting to find this button by its <code>name</code> (i.e. <code>"commit"</code>) fails.</p>
  
  <pre class="lang-ruby prettyprint-override"><code>click_button("commit")
  find_button("commit")
  </code></pre>
  
  <p>Both result in <code>Capybara::ElementNotFound: Unable to find button "commit"</code>. If I use the visible button text of <code>Sign in</code> then the element <em>is</em> found, i.e. these:</p>
  
  <pre class="lang-ruby prettyprint-override"><code>click_button("Sign in")
  find_button("Sign in")
  </code></pre>
  
  <p>...both work fine, so it would appear that the XML parser isn't having any trouble finding the element.</p>
  
  <p>Documentation for <code>click_button</code> says that the locator works on "id, text or value", with "text" being meaningless for an <code>input</code> element like this (the visible text is taken from the <code>value</code> attribute), but relevant perhaps for <code>button</code> elements. So, we might expect that to fail, though if we view the code via the documentation, find that it calls down to <code>find</code> in the same way as <code>find_button</code>. Yet <code>find_button</code> is documented differently; it says it locates by "id, name or value". So sadly, <em>we know from this that the documentation is broken</em> because it says two different things for what turns out to be an identical call at the back end.</p>
  
  <p>Either way, the element isn't found by name, and that means the lower level <code>find</code> call isn't searching <code>name</code> attributes as far as I can see. This means Capybara (2.2.1, on Nokogiri 1.6.1) is rather broken in that respect. How come nobody has noticed? I've Googled for ages and it doesn't seem to come up. I seem to be rather missing the point :-)</p>
  
  <p>Why don't I just search for the English text in the button, you might ask? Because of internationalisation. This old, Rails 1 -> 2 -> 3 upgraded app has some I18n parts and other static text parts. I don't want to be forced to put I18n into any view that Capybara tests, just so I can have the test use <code>I18n.t()</code> to ensure a match despite different languages or locale file updates. Likewise, it would clearly be very stupid in 2014 to write hard-coded English strings into my tests.</p>
  
  <p>That's why we have names and IDs and such... The unique (in theory!) identifiers that are machine-read, not human-read.</p>
  
  <p>I could hack up something that CSS-selected by "type=submit" but seriously, why isn't Capybara searching the name attribute when its documentation says it does, and why does the documentation disagree on what attributes are searched on two methods that call down to exactly the same back-end implementation with exactly the same parameters?</p>
  
  <p>TIA :)</p>