Get total number of rows from a HtmlTable – Webdriver


public static int getRowCount(WebElement element) throws Exception {
try {
WebElement table =element;
List rows = table.findElements(By.tagName(“tr”));
return rows.size();
} catch (Exception e) {
return -1;
}
No comments :

No comments :

Post a Comment