private List<WebElement> getTableRows(By by) {
Validate.notNull(by, "Table element should not be null");
List<WebElement> rows = driver.findElement(by).findElements(By.tagName("tr")); // get table rows
return rows;
}
protected String getCellValue(WebElement row, int columnIndex) {
Validate.notNull(row, "Row element should not be null");
String cell = "";
cell = row.findElement(By.xpath("td[" + columnIndex + "]")).getText(); // get columns by index
return cell;
}
1条答案
按热度按时间8tntrjer1#
你需要这样的东西(如果我们谈论的是html表):