title: Selenium RC: Selecting elements using the CSS :contains pseudo-class
body: <p>I would like to assert that a table row contains the data that I expect in two different tables.</p>
  <p>Using the following HTML as an example:</p>
  <pre><code>&lt;table&gt;
      &lt;tr&gt;
          &lt;th&gt;Table 1&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Row 1 Col 1&lt;/td&gt;
          &lt;td&gt;Row 1 Col 2&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  
  &lt;table&gt;
      &lt;tr&gt;
          &lt;th&gt;Table 2&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Row 1 Col 1&lt;/td&gt;
          &lt;td&gt;different data&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  <p>The following assertion passes:</p>
  <pre><code>$this-&gt;assertElementPresent('css=table:contains(Table 1)');
  </code></pre>
  <p>However, this one doesn't:</p>
  <pre><code>$this-&gt;assertElementPresent('css=table:contains(Table 1) tr:contains(Row 1 Col 1)');
  </code></pre>
  <p>And ultimately, I need to be able to test that both columns within the table row contain the data that I expect:</p>
  <pre><code>$this-&gt;assertElementPresent('css=table:contains(Table 1) tr:contains(Row 1 Col 1):contains(Row 1 Col 2)');
  $this-&gt;assertElementPresent('css=table:contains(Table 2) tr:contains(Row 1 Col 1):contains(different data)');
  </code></pre>
  <p>What am I doing wrong? How can I achieve this?</p>
  <h2>Update:</h2>
  <p>Sounds like the problem is a bug in Selenium when trying to select descendants.</p>
  <p>The only way I was able to get this to work was to add an extra identifier on the table so I could tell which one I was working with:</p>
  <pre><code>/* HTML */
  &lt;table id=&quot;table-1&quot;&gt;
  
  /* PHP */
  $this-&gt;assertElementPresent(&quot;css=#table-1 tr:contains(Row 1 Col 1):contains(Row 1 Col 2)&quot;);
  </code></pre>