title: How to search node by exact text match using Xpath in webdriver
body: <p>I need a little help regarding searching an exact text using xpath in webDriver.</p>
  
  <p>Suppose i have the html as follows..</p>
  
  <pre><code>&lt;html&gt;&lt;body&gt;
    &lt;table&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;button&gt;abcd&lt;/button&gt;&lt;/td&gt;
        &lt;td&gt;&lt;button&gt;abc&lt;/button&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>Now i want to click button "abc"</p>
  
  <p>I used xpath as <code>//button[contains(text(),'abc')]</code> but it is always performing on button "abcd" as it also contain the text "abc". In this regards I need a predicate or some other procedure which can search exact text instead of containing text.</p>
  
  <p>I also tried with <code>//button[matches(text(),'abc')]</code>,  <code>//button[matches($string,'abc')]</code>, <code>//button[Text='abc')]</code>, <code>//button[.='abc')]</code> and many more but none of these worked out to identify "abc" button. </p>
  
  <p>I do not know if there is any problem regarding my xpath version as I'm not aware of the version. But I'm using java 1.6 JDK.</p>
  
  <p>Though my exact scenario is not the example shown but similar logic needs to be applied.</p>
  
  <p>Hence any help or suggestion would be highly appreciated.</p>