title: Finding Xpath of element within angular table
body: <p>Hoping somebody is able to help me</p>
  
  <p>I am trying to find the Xpath within the table below</p>
  
  <p><a href="https://i.stack.imgur.com/3s17P.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3s17P.png" alt="enter image description here"></a></p>
  
  <p>I need to create an XPath query which will return the entitlements transferred box which contains the text 'entitlements @' but the row in the table must contain the Hide Externally checkbox</p>
  
  <p>Therefore I wish to ignore the first row in the table but return the entitlements transferred box for the 2nd and 3rd rows etc.</p>
  
  <p>Below is the HTML code for the table</p>
  
  <p></p>
  
  <pre><code>                &lt;thead&gt;
                      &lt;tr&gt;
                          &lt;th class="text-right col-md-1"&gt;&lt;a href="#" class="sortorder" ng-click="reverse=!reverse;order('transferorBusinessId',reverse)"&gt;Transferor Business ID&lt;/a&gt;&lt;/th&gt;
                          &lt;th class="text-right col-md-1"&gt;&lt;a href="#" class="sortorder" ng-click="reverse=!reverse;order('transfereeBusinessId',reverse)"&gt;Transferee Business ID&lt;/a&gt;&lt;/th&gt;
                          &lt;th class="text-right"&gt;Transfer Type&lt;/th&gt;
                          &lt;th class="text-right"&gt;Date of Transfer&lt;/th&gt;
                          &lt;th class="text-right"&gt;Effective Date&lt;/th&gt;
                          &lt;th class="text-right"&gt;Entitlements Transferred&lt;/th&gt;
                          &lt;th class="text-right col-md-1"&gt;Group ID&lt;/th&gt;
                          &lt;th class="text-right col-md-1"&gt;&lt;a href="#" class="sortorder" ng-click="reverse=!reverse;order('yearOfTransfer',reverse)"&gt;Year of Transfer&lt;/a&gt;&lt;/th&gt;
                          &lt;th class="text-right col-md-1"&gt;Leased Until&lt;/th&gt;
                          &lt;th class="text-right"&gt;Hide&lt;br&gt; Externally&lt;/th&gt;
                          &lt;th class="text-right"&gt;&lt;/th&gt;
                      &lt;/tr&gt;
                  &lt;/thead&gt;
                  &lt;tbody&gt;
                      &lt;!-- ngRepeat: transfer in completedTransfersSummary track by $id(transfer) --&gt;&lt;tr ng-repeat="transfer in completedTransfersSummary track by $id(transfer)"&gt;
                          &lt;td style="vertical-align: middle; color: rgb(166, 166, 166);" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}" ng-class="{'highlight' : transfer.transferorBusinessId == CisBusinessID }" class="highlight"&gt;622402&lt;/td&gt;
                          &lt;td style="vertical-align: middle; color: rgb(166, 166, 166);" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}" ng-class="{'highlight' : transfer.transfereeBusinessId == CisBusinessID }"&gt;661017&lt;/td&gt;
                          &lt;td style="vertical-align: middle; color: rgb(166, 166, 166);" nowrap="" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}"&gt;Lease&lt;/td&gt;
                          &lt;td style="vertical-align: middle; color: rgb(166, 166, 166);" nowrap="" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}"&gt;22/06/2016&lt;/td&gt;
                          &lt;td style="vertical-align: middle; color: rgb(166, 166, 166);" nowrap="" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}"&gt;13/04/2016&lt;/td&gt;
                          &lt;td style="vertical-align: middle; color: rgb(166, 166, 166);" nowrap="" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}"&gt;3.00 entitlements @ €242.55&lt;/td&gt;
                          &lt;td style="vertical-align: middle; color: rgb(166, 166, 166);" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}"&gt;513453&lt;/td&gt;
                          &lt;td style="vertical-align: middle; color: rgb(166, 166, 166);" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}"&gt;2016&lt;/td&gt;
                          &lt;td style="vertical-align: middle; color: rgb(166, 166, 166);" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}"&gt;2017&lt;/td&gt;
                          &lt;td style="vertical-align: middle; text-align: center;"&gt;
                              &lt;div&gt;
                                  &lt;input type="checkbox" ng-model="transfer.isTransferHiddenForExternal" ng-show="false" ng-click="changeVisisbilityOfTransferOnExternalScreen(transfer)" class="ng-pristine ng-untouched ng-valid ng-hide"&gt;                        
                              &lt;/div&gt;
                          &lt;/td&gt;
                          &lt;td style="vertical-align: middle;"&gt;
                              &lt;label style="vertical-align: middle; color: rgb(166, 166, 166);" ng-show="true" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}"&gt;Withdrawn&lt;/label&gt;
                              &lt;label style="vertical-align: middle; color: rgb(166, 166, 166);" ng-show="false" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}" class="ng-hide"&gt;&lt;/label&gt;
                              &lt;div&gt;
                                  &lt;a href="" style="vertical-align: middle" class="btn btn-primary btn-sm ng-hide" ng-show="false" ng-click="executeUndoCommand(transfer)"&gt;Undo&lt;/a&gt;
                                  &lt;a href="" style="vertical-align: middle" class="btn btn-primary btn-sm ng-hide" ng-show="false" ng-click="showUndoModal(transfer)"&gt;Undo&lt;/a&gt;
  
                                  &lt;a href="" style="vertical-align: middle" class="btn btn-default btn-sm ng-hide" ng-show="false" ng-click="executeWithdrawCommand(transfer)"&gt;Withdraw&lt;/a&gt;
                                  &lt;a href="" style="vertical-align: middle" class="btn btn-default btn-sm ng-hide" ng-show="false" ng-click="showWithdrawModal(transfer)"&gt;Withdraw&lt;/a&gt;
  
  
                              &lt;/div&gt;
                          &lt;/td&gt;
  
                      &lt;/tr&gt;&lt;!-- end ngRepeat: transfer in completedTransfersSummary track by $id(transfer) --&gt;&lt;tr ng-repeat="transfer in completedTransfersSummary track by $id(transfer)"&gt;
                          &lt;td style="vertical-align: middle" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}" ng-class="{'highlight' : transfer.transferorBusinessId == CisBusinessID }" class="highlight"&gt;622402&lt;/td&gt;
                          &lt;td style="vertical-align: middle" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}" ng-class="{'highlight' : transfer.transfereeBusinessId == CisBusinessID }"&gt;602024&lt;/td&gt;
                          &lt;td style="vertical-align: middle" nowrap="" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}"&gt;Lease&lt;/td&gt;
                          &lt;td style="vertical-align: middle" nowrap="" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}"&gt;18/04/2016&lt;/td&gt;
                          &lt;td style="vertical-align: middle" nowrap="" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}"&gt;18/04/2016&lt;/td&gt;
                          &lt;td style="vertical-align: middle" nowrap="" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}"&gt;11.00 entitlements @ €242.55&lt;/td&gt;
                          &lt;td style="vertical-align: middle" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}"&gt;513453&lt;/td&gt;
                          &lt;td style="vertical-align: middle" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}"&gt;2016&lt;/td&gt;
                          &lt;td style="vertical-align: middle" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}"&gt;2017&lt;/td&gt;
                          &lt;td style="vertical-align: middle; text-align: center;"&gt;
                              &lt;div&gt;
                                  &lt;input type="checkbox" ng-model="transfer.isTransferHiddenForExternal" ng-show="true" ng-click="changeVisisbilityOfTransferOnExternalScreen(transfer)" class="ng-pristine ng-untouched ng-valid"&gt;                        
                              &lt;/div&gt;
                          &lt;/td&gt;
                          &lt;td style="vertical-align: middle;"&gt;
                              &lt;label style="vertical-align: middle" ng-show="false" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}" class="ng-hide"&gt;&lt;/label&gt;
                              &lt;label style="vertical-align: middle" ng-show="false" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}" class="ng-hide"&gt;&lt;/label&gt;
                              &lt;div&gt;
                                  &lt;a href="" style="vertical-align: middle" class="btn btn-primary btn-sm" ng-show="true" ng-click="executeUndoCommand(transfer)"&gt;Undo&lt;/a&gt;
                                  &lt;a href="" style="vertical-align: middle" class="btn btn-primary btn-sm ng-hide" ng-show="false" ng-click="showUndoModal(transfer)"&gt;Undo&lt;/a&gt;
  
                                  &lt;a href="" style="vertical-align: middle" class="btn btn-default btn-sm" ng-show="true" ng-click="executeWithdrawCommand(transfer)"&gt;Withdraw&lt;/a&gt;
                                  &lt;a href="" style="vertical-align: middle" class="btn btn-default btn-sm ng-hide" ng-show="false" ng-click="showWithdrawModal(transfer)"&gt;Withdraw&lt;/a&gt;
  
  
                              &lt;/div&gt;
                          &lt;/td&gt;
  
                      &lt;/tr&gt;&lt;!-- end ngRepeat: transfer in completedTransfersSummary track by $id(transfer) --&gt;&lt;tr ng-repeat="transfer in completedTransfersSummary track by $id(transfer)"&gt;
                          &lt;td style="vertical-align: middle" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}" ng-class="{'highlight' : transfer.transferorBusinessId == CisBusinessID }" class="highlight"&gt;622402&lt;/td&gt;
                          &lt;td style="vertical-align: middle" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}" ng-class="{'highlight' : transfer.transfereeBusinessId == CisBusinessID }"&gt;611485&lt;/td&gt;
                          &lt;td style="vertical-align: middle" nowrap="" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}"&gt;Lease&lt;/td&gt;
                          &lt;td style="vertical-align: middle" nowrap="" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}"&gt;18/04/2016&lt;/td&gt;
                          &lt;td style="vertical-align: middle" nowrap="" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}"&gt;18/04/2016&lt;/td&gt;
                          &lt;td style="vertical-align: middle" nowrap="" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}"&gt;4.00 entitlements @ €242.55&lt;/td&gt;
                          &lt;td style="vertical-align: middle" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}"&gt;513453&lt;/td&gt;
                          &lt;td style="vertical-align: middle" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}"&gt;2016&lt;/td&gt;
                          &lt;td style="vertical-align: middle" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}"&gt;2017&lt;/td&gt;
                          &lt;td style="vertical-align: middle; text-align: center;"&gt;
                              &lt;div&gt;
                                  &lt;input type="checkbox" ng-model="transfer.isTransferHiddenForExternal" ng-show="true" ng-click="changeVisisbilityOfTransferOnExternalScreen(transfer)" class="ng-pristine ng-untouched ng-valid"&gt;                        
                              &lt;/div&gt;
                          &lt;/td&gt;
                          &lt;td style="vertical-align: middle;"&gt;
                              &lt;label style="vertical-align: middle" ng-show="false" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}" class="ng-hide"&gt;&lt;/label&gt;
                              &lt;label style="vertical-align: middle" ng-show="false" ng-style="transfer.isDisabled &amp;amp;&amp;amp; {color:'#A6A6A6'}" class="ng-hide"&gt;&lt;/label&gt;
                              &lt;div&gt;
                                  &lt;a href="" style="vertical-align: middle" class="btn btn-primary btn-sm" ng-show="true" ng-click="executeUndoCommand(transfer)"&gt;Undo&lt;/a&gt;
                                  &lt;a href="" style="vertical-align: middle" class="btn btn-primary btn-sm ng-hide" ng-show="false" ng-click="showUndoModal(transfer)"&gt;Undo&lt;/a&gt;
  
                                  &lt;a href="" style="vertical-align: middle" class="btn btn-default btn-sm" ng-show="true" ng-click="executeWithdrawCommand(transfer)"&gt;Withdraw&lt;/a&gt;
                                  &lt;a href="" style="vertical-align: middle" class="btn btn-default btn-sm ng-hide" ng-show="false" ng-click="showWithdrawModal(transfer)"&gt;Withdraw&lt;/a&gt;
  
  
                              &lt;/div&gt;
                          &lt;/td&gt;
  
  
  
                      &lt;/tr&gt;&lt;!-- end ngRepeat: transfer in completedTransfersSummary track by $id(transfer) --&gt;
                  &lt;/tbody&gt;
  
              &lt;/table&gt;
  </code></pre>
  
  <p>I have tried to create the following Xpath but it is returning every entitlements transferred box instead of only the ones which have the hide externally checkbox in the same row</p>
  
  <pre><code>("//td[contains(.,'entitlements @') and //tr[contains(.//@ng-class, 'transfer.transferorBusinessId == CisBusinessID')]//input[@type='checkbox' and @ng-show='true']]")
  </code></pre>