title: Selenium Webdriver click specific WebElement
body: <p>I have the following html and would like the <code>td</code> with <code>class</code> <code>tree-label-name ng-binding</code> and <code>text()</code> <code>Approver</code> to be selected (clicked)</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;treecontrol tree-model="vm.homeStats" expand-level="0" on-selection="vm.selectStatsNode(node)" on-node-toggle="vm.toggleTreeNode(node, expanded)" expanded-nodes="vm.expandedNodes" selected-node="vm.selectedNode" class="ng-isolate-scope"&gt;
     &lt;ul class="ng-scope"&gt;
        &lt;li ng-repeat="node in node.children | filter:filterExpression:filterComparator" ng-class="headClass(node)" class="ng-scope tree-collapsed tree-selected"&gt;
           &lt;i class="tree-branch-head" ng-class="iBranchClass()" ng-click="selectNodeHead(node)"&gt;&lt;/i&gt;&lt;i class="tree-leaf-head "&gt;&lt;/i&gt;
           &lt;div class="tree-label  tree-selected" ng-class="selectedClass()" ng-click="selectNodeLabel(node)" tree-transclude=""&gt;
              &lt;table class="ng-scope"&gt;
                 &lt;tbody&gt;
                    &lt;tr&gt;
                       &lt;td class="tree-label-icon"&gt;&lt;img bf-image-path="user" class="tree-icon" src="/Assets/img/icons/user.png"&gt;&lt;/td&gt;
                       &lt;td class="tree-label-name ng-binding"&gt;
                          Strydom, AJ (Rico)&lt;br&gt;
                          &lt;progress-bar ng-if="::!node.isFolder" value="6" max-value="230" class="ng-scope"&gt;
                             &lt;div class="progress-bar" ng-style="barStyles"&gt;
                                &lt;div class="progress-bar-value" ng-style="valueStyles" style="width: 2.6087%;"&gt;&lt;/div&gt;
                             &lt;/div&gt;
                          &lt;/progress-bar&gt;
                       &lt;/td&gt;
                       &lt;td width="30" class="text-right"&gt;
                        &lt;strong class="process-bar-total ng-binding ng-scope" ng-if="::!node.isFolder"&gt;6&lt;/strong&gt;&lt;!-- end ngIf: ::!node.isFolder --&gt;
                       &lt;/td&gt;
                    &lt;/tr&gt;
                 &lt;/tbody&gt;
              &lt;/table&gt;
           &lt;/div&gt;
        &lt;/li&gt;
        &lt;li ng-repeat="node in node.children | filter:filterExpression:filterComparator" ng-class="headClass(node)" class="ng-scope tree-collapsed"&gt;
           &lt;i class="tree-branch-head" ng-class="iBranchClass()" ng-click="selectNodeHead(node)"&gt;&lt;/i&gt;&lt;i class="tree-leaf-head "&gt;&lt;/i&gt;
           &lt;div class="tree-label " ng-class="selectedClass()" ng-click="selectNodeLabel(node)" tree-transclude=""&gt;
              &lt;table class="ng-scope"&gt;
                 &lt;tbody&gt;
                    &lt;tr&gt;
                       &lt;td class="tree-label-icon"&gt;&lt;img bf-image-path="team" class="tree-icon" src="/Assets/img/icons/team.png"&gt;&lt;/td&gt;
                       &lt;td class="tree-label-name ng-binding"&gt;
                          Approver&lt;br&gt;
                          &lt;progress-bar ng-if="::!node.isFolder" value="1" max-value="230" class="ng-scope"&gt;
                             &lt;div class="progress-bar" ng-style="barStyles"&gt;
                                &lt;div class="progress-bar-value" ng-style="valueStyles" style="width: 0.434783%;"&gt;&lt;/div&gt;
                             &lt;/div&gt;
                          &lt;/progress-bar&gt;
                       &lt;/td&gt;
                       &lt;td width="30" class="text-right"&gt;
                       &lt;strong class="process-bar-total ng-binding ng-scope" ng-if="::!node.isFolder"&gt;1&lt;/strong&gt;&lt;!-- end ngIf: ::!node.isFolder --&gt;
                       &lt;/td&gt;
                    &lt;/tr&gt;
                 &lt;/tbody&gt;
              &lt;/table&gt;
           &lt;/div&gt;
        &lt;/li&gt;
        &lt;li ng-repeat="node in node.children | filter:filterExpression:filterComparator" ng-class="headClass(node)" class="ng-scope tree-collapsed"&gt;
           &lt;i class="tree-branch-head" ng-class="iBranchClass()" ng-click="selectNodeHead(node)"&gt;&lt;/i&gt;&lt;i class="tree-leaf-head "&gt;&lt;/i&gt;
           &lt;div class="tree-label " ng-class="selectedClass()" ng-click="selectNodeLabel(node)" tree-transclude=""&gt;
              &lt;table class="ng-scope"&gt;
                 &lt;tbody&gt;
                    &lt;tr&gt;
                       &lt;td class="tree-label-icon"&gt;&lt;img bf-image-path="team" class="tree-icon" src="/Assets/img/icons/team.png"&gt;&lt;/td&gt;
                       &lt;td class="tree-label-name ng-binding"&gt;
                          Assigner&lt;br&gt;
                          &lt;progress-bar ng-if="::!node.isFolder" value="230" max-value="230" class="ng-scope"&gt;
                             &lt;div class="progress-bar" ng-style="barStyles"&gt;
                                &lt;div class="progress-bar-value" ng-style="valueStyles" style="width: 100%;"&gt;&lt;/div&gt;
                             &lt;/div&gt;
                          &lt;/progress-bar&gt;
                       &lt;/td&gt;
                       &lt;td width="30" class="text-right"&gt;
                        &lt;strong class="process-bar-total ng-binding ng-scope" ng-if="::!node.isFolder"&gt;230&lt;/strong&gt;&lt;!-- end ngIf: ::!node.isFolder --&gt;
                       &lt;/td&gt;
                    &lt;/tr&gt;
                 &lt;/tbody&gt;
              &lt;/table&gt;
           &lt;/div&gt;
        &lt;/li&gt;
     &lt;/ul&gt;
  &lt;/treecontrol&gt;
  </code></pre>
  
  <p>This is my code which does not seem to perform he click action.</p>
  
  <pre><code>WebElement inboxTypeToSelect =  webdriver.findElement(By.xpath("//treecontrol[@class='ng-isolate-scope']/ul/li/div/table/tbody/tr/td[@class='tree-label-name ng-binding' and normalize-space(text() = '" +  inboxType + "')]"));
  Actions action = new Actions(webdriver);
  action.click(inboxTypeToSelect);
  action.perform();
  </code></pre>
  
  <p>The value passed to <code>inboxType</code> is <code>Approver</code> so the xpath is:</p>
  
  <pre><code>//treecontrol[@class='ng-isolate-scope']/ul/li/div/table/tbody/tr/td[@class='tree-label-name ng-binding' and normalize-space(text() = 'Approver')]
  </code></pre>
  
  <p>Any idea why the action is not performed?</p>