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