Selenium RC: count rows in a table
While running Selenium tests, if some part of your logic requires you to count the number of rows in a table, we can do this in Java:
getXpathCount(“//xpath/to/the/particular/table/tbody/tr”)
eg:
int numRows = selenium.getXpathCount(“//table/tbody[2]/tr”).intValue();
Advertisement