title: WebDriver find a particular child element
body: <p>I have a HTML like this:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="classDiv"&gt;
    &lt;header&gt;
      &lt;button class="btn btn-icon-only btn-icon-only pull-right ng-scope" type="button"&gt;
     &lt;span class="btn-box"&gt;
       &lt;span class="sr-only"&gt;Edit&lt;/span&gt;
    &lt;span class="icon-btn icon-edit2" aria-hidden="true"&gt;&lt;/span&gt;
     &lt;/span&gt;
      &lt;/button&gt;
      &lt;h3 class="classH3"&gt;Text1&lt;/h3&gt;
    &lt;/header&gt;
  &lt;/div&gt;
  &lt;div class="classDiv"&gt;
    &lt;header&gt;
      &lt;button class="btn btn-icon-only btn-icon-only pull-right ng-scope" type="button"&gt;
     &lt;span class="btn-box"&gt;
       &lt;span class="sr-only"&gt;Edit&lt;/span&gt;
    &lt;span class="icon-btn icon-edit2" aria-hidden="true"&gt;&lt;/span&gt;
     &lt;/span&gt;
      &lt;/button&gt;
      &lt;h3 class="classH3"&gt;Text2&lt;/h3&gt;
    &lt;/header&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The problem is every tag is the same, only the text of H3 is different for each div. I want to click only one particular Edit button, for example the second Edit button. </p>
  
  <p>So I tried to find second H3 and from there I tried to find the second Edit button, like this:</p>
  
  <pre><code>WebElement hText = webDriver.findElement(By.xpath("//h3[contains(., 'Text2')]"));
  WebElement editBtn = hText.findElement(By.xpath("//button[contains(., 'Edit')]"));
  editBtn.click();
  </code></pre>
  
  <p>But it always clicks on the first Edit button. I want to find the parent element, and from parent to find its child. But in this case, every tag is the same, so I don't know how to look for a particular child. Any help much appreciated</p>