title: Selenium, xpath to match a table row containing multiple elements
body: <p>I'm trying to find a Selenium/PHP XPath for matching a table row that contains multiple elements (text, and form elements).</p>
  
  <p>Example:</p>
  
  <pre><code>&lt;table class="foo"&gt;
    &lt;tr&gt;
      &lt;td&gt;Car&lt;/td&gt;&lt;td&gt;123&lt;/td&gt;&lt;td&gt;&lt;input type="submit" name="s1" value="go"&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>This works for a single text element:</p>
  
  <pre><code>$this-&gt;isElementPresent( "//table/tbody/tr/td[contains(text(), 'Car')]" );
  </code></pre>
  
  <p>while this does NOT (omitting the /td locator):</p>
  
  <pre><code>$this-&gt;isElementPresent( "//table/tbody/tr[contains(text(), 'Car')]" );
  </code></pre>
  
  <p>and thus, this obviously won't work either for multiple elements:</p>
  
  <pre><code>$this-&gt;isElementPresent( "//table/tbody/tr[contains(text(), 'Car')][contains(text(), '123')]" );
  </code></pre>
  
  <p>Another way to do this would be with <code>getTable( "xpath=//table[@class='foo'].x.y")</code> for each and every row x, column y.  Cumbersome, but it worked... mostly.  It does NOT return the <code>&lt;input&gt;</code> tag!  It will return an empty string for that cell :(</p>
  
  <p>Any ideas? </p>