title: How to get id of an element when using Capybara for test (Rails)
body: <p>I am using Capybara to write test in my application, but now i have a situation in which i need to read id of an element within capybara like </p>
  
  <p><code>myid = page.find("#parentNode").first(".childClass").id</code></p>
  
  <p>Consider i have the below HTML structure</p>
  
  <pre><code>&lt;div id="parentNode"&gt;
   &lt;div id="childNode1" class="childClass"&gt;1&lt;/div&gt;
   &lt;div id="childNode2" class="childClass"&gt;2&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Please Note :</strong> I am not trying to read the content of the child node, but the id. The above shown is for example.</p>
  
  <p><strong>Expected Output :</strong> childNode1 (id of first element with class childClass</p>