title: Webdriver how to find the parent fieldset element of a given element using Xpath
body: <p>I have a HTML like the one below</p>
  
  <pre><code>&lt;fieldset id='fs1'&gt;
    &lt;legend&gt;Basic Details&lt;/legend&gt;
    &lt;div&gt;
      &lt;input type='text' id='txt1'/&gt;
      &lt;input type='text' id='txt2'/&gt;
    &lt;/div&gt;
  &lt;/fieldset&gt;
  </code></pre>
  
  <p>I can get to the textboxes by saying</p>
  
  <pre><code>driver.findElement(By.id("txt1"));
  </code></pre>
  
  <p>Now, I want my webdriver to check if this textbox (or any other element at this stage) is the child of a fieldset. In other words, I want to find the parent "fieldset" tag of a given element.</p>
  
  <p>And I need to use xpath and nothing else.</p>
  
  <p>Now, I have tried using ("..") as my xpath query, which will return me the Div parent, and i have to keep doing it until I hit the fieldset. I just wonder if there is a straight forward solution.
  Can anyone suggest an xpath query which will help me do what I have explained?</p>
  
  <p>Thanks.</p>