title: How to use watir-webdriver to find element by class and text
body: <p>I have the following HTML:</p>
  
  <pre><code>&lt;td class="test1 test3"&gt;1&lt;/td&gt;
  &lt;td class="test1 test2 test3"&gt;1&lt;/td&gt;
  &lt;td class="test1 test2 test3"&gt;2&lt;/td&gt;
  &lt;td class="test4 test3"&gt;2&lt;/td&gt;
  &lt;td class="test1 test3"&gt;2&lt;/td&gt;
  &lt;td class="test1 test3"&gt;3&lt;/td&gt;
  &lt;td class="test1 test2 test3"&gt;3&lt;/td&gt;
  </code></pre>
  
  <p>I am trying to find the following <code>&lt;td&gt;</code>:</p>
  
  <pre><code>&lt;td class="test1"&gt;2&lt;/td&gt;
  </code></pre>
  
  <p>Here is what I have tried so far:</p>
  
  <pre><code>b.td(:class =&gt; /(?!.*\btest2\b)/, :text =&gt; "2").click
  b.td(:class =&gt; /^(?!.*\btest2\b)/, :text =&gt; "2").click
  b.td(:class =&gt; /^(?!test2)/, :text =&gt; "2").click
  b.td(:class =&gt; "test1", :class =&gt; /(?!test2)/, :text =&gt; "2").click
  </code></pre>
  
  <p>All of them return the wrong cell.</p>
  
  <p>Edit:
  The number of elements could be different. The order could be different as well.
  Pretty much I need to find the element where class is <code>test1</code> and class is not <code>test2</code> and text is <code>2</code>.</p>
  
  <p>Edit2:
  I added more classes since it is not restricted to one or two classes. Could be more.</p>
  
  <p>Edit3:
  Order of classes could be different:</p>
  
  <pre><code>&lt;td class="test2 test1 test3"&gt;2&lt;/td&gt;
  </code></pre>
  
  <p>Edit4: TD must have test1, must not have test2 and must have text 2</p>