title: Xpath to select button from table cell depending on text contained within specific cell
body: <p>On my web application I am attempting to select a button within a cell in a table.</p>
  
  <p>Not every cell will contain a show details button and the button is only displayed depending on the text within that cell</p>
  
  <p>Screenshot below</p>
  
  <p><a href="https://i.stack.imgur.com/TV0Dd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TV0Dd.png" alt="enter image description here"></a></p>
  
  <pre><code>&lt;td&gt;
      Allocated
      &lt;button ng-show="row.entitlementId" id="btnShowDetails" class="btn btn-primary btn-sm" style="width: 110px; float:right;" ng-click="showAllocationMonetaryDetails(row.entitlementId, CisBusinessID);" title="Show Details"&gt;
           &lt;span class="glyphicon glyphicon-search"&gt;&lt;/span&gt;Show Details
      &lt;/button&gt;
      &lt;br&gt;
      &lt;div style="font-size: small; color: darkgreen" ng-show="row.manualEstablishCommandType &gt;= 0"&gt;
           Adjustment
      &lt;/div&gt;
      &lt;div style="font-size: small; color: darkgreen" ng-show="row.manualReclaimCommandType &gt;= 0"&gt;
  
      &lt;/div&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>I attempted to use the following xpath to locate the show details button but it does not work.</p>
  
  <pre><code>("//td[contains(.,'Allocated') and (contains(@id,'btnShowDetails'))]")
  </code></pre>
  
  <p>Does anybody know how I can select the Show Details button?</p>
  
  <p>Thanks</p>