title: Xpath for table - List having multiple tr and td - find first element and click on checkbox
body: <p>I'm struggling with xpath issues. The code is contained in an iframe which is being handled:</p>
  
  <pre><code>&lt;div _ngcontent-c10 class="panel panel-info"&gt;
    &lt;div _ngcontent-c10 class="panel-heading"&gt; ABC Output &lt;/div&gt;
  &lt;div _ngcontent-c10 class="panel-body"&gt;
  &lt;form _ngcontent-c10 novalidate class="ng-untouched ng-pristine ng-valid"&gt;
  &lt;div _ngcontent-c10 class="row"&gt;
  &lt;table _ngcontent-c10 class="table tb-striped"&gt;
  &lt;tbody _ngcontent-c10&gt;
  &lt;tr _ngcontent-c10=""&gt;
            &lt;td _ngcontent-c10="" class="td-fixed-width-35"&gt;
             &lt;label _ngcontent-c10=""&gt;
                 &lt;input _ngcontent-c10="" type="checkbox" value="" class="ng-untouched ng-pristine ng-valid"&gt;
             &lt;/label&gt;
         &lt;/td&gt;
         &lt;td _ngcontent-c10="" class="td-fixed-width-20 no-side-padding"&gt;
             &lt;img _ngcontent-c10="" class="outputLogo" src="https://qa-server/Services/content/logos/AAAA1.png" alt="AAA1"&gt;
         &lt;/td&gt;
         &lt;td _ngcontent-c10="" class="td-text-bold"&gt;
             AAA1 Output
             &lt;!----&gt;
         &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr _ngcontent-c10=""&gt;
            &lt;td _ngcontent-c10="" class="td-fixed-width-35"&gt;
             &lt;label _ngcontent-c10=""&gt;
                 &lt;input _ngcontent-c10="" type="checkbox" value="" class="ng-untouched ng-pristine ng-valid"&gt;
             &lt;/label&gt;
         &lt;/td&gt;
         &lt;td _ngcontent-c10="" class="td-fixed-width-20 no-side-padding"&gt;
             &lt;img _ngcontent-c10="" class="outputLogo" src="https://qa-server/Services/content/logos/BBB1.png" alt="BBB1"&gt;
         &lt;/td&gt;
         &lt;td _ngcontent-c10="" class="td-text-bold"&gt;
             BBB1 Output
             &lt;!----&gt;
         &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr _ngcontent-c10=""&gt;
            &lt;td _ngcontent-c10="" class="td-fixed-width-35"&gt;
             &lt;label _ngcontent-c10=""&gt;
                 &lt;input _ngcontent-c10="" type="checkbox" value="" class="ng-untouched ng-pristine ng-valid"&gt;
             &lt;/label&gt;
         &lt;/td&gt;
         &lt;td _ngcontent-c10="" class="td-fixed-width-20 no-side-padding"&gt;
             &lt;img _ngcontent-c10="" class="outputLogo" src="https://qa-server/Services/content/logos/CCC1.png" alt="CCC1"&gt;
         &lt;/td&gt;
         &lt;td _ngcontent-c10="" class="td-text-bold"&gt;
             CCC1 Output
             &lt;!----&gt;
         &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>I'm trying to find the first row in the list to click on Checkbox, these are the ones I tried already:</p>
  
  <pre><code>webElement = Driver.FindElement(By.XPath("//*[contains(text(),'AAA1 Output')]//preceding::label/input[@class='ng-untouched ng-pristine ng-valid'][@type='checkbox']"));
  
  webElement = Driver.FindElement(By.XPath("//*[.,'AAA1 Output')]//preceding::label/input[@class='ng-untouched ng-pristine ng-valid'][@type='checkbox']"));
  
  webElement = Driver.FindElement(By.XPath("//*[contains(text(),'AAA1 Output')]//preceding::input[@class='ng-untouched ng-pristine ng-valid'][@type='checkbox']"));
  
  webElement = Driver.FindElement(By.XPath("//*[.,'AAA1 Output')]//preceding::input[@class='ng-untouched ng-pristine ng-valid'][@type='checkbox']"));
  
  webElement = Driver.Instance.FindElement(By.XPath("//div[@class='panel panel-info']//following::tr[contains(., 'AAA1 Output')]/td[1]"));
  
  webElement = Driver.Instance.FindElement(By.XPath("//[contains(.,'ABC Output']//following::tr[contains(., 'AAA1 Output')]/td[1]"));
  </code></pre>
  
  <p>However, they can not click on checkbox for first element.</p>