title: Find hidden element in capybara
body: <p>Learning 'capybara' and bumped into issue of finding the hidden elements through capybara.</p>
  
  <p>In HTML, we have an file field which is 'display: none' by default. HTML element is:</p>
  
  <pre><code>&lt;input class="some_class" id="some_id" name="some_name" type="file"&gt;
  </code></pre>
  
  <p>Now, while I was writing the test cases in capybara using cucumber, I could not find this element in my capybara script. My capybara script is finding the element just like this :</p>
  
  <pre><code>find(:xpath, "//input[@name='some_name']")
  </code></pre>
  
  <p>Read about the hidden elements and go to know that setting </p>
  
  <pre><code>Capybara.ignore_hidden_elements = false
  </code></pre>
  
  <p>should solve my problem. But I read somewhere else that above setting is by default. So, tried other option of passing it explicitly. Like:</p>
  
  <pre><code>find(:xpath, "//input[@name='some_name']", :visible =&gt; false)
  </code></pre>
  
  <p>That did not work too. Is there anything else I should try? Will be happy to share more details in case anyone is interested.</p>