![](/img/trans.png)
[英]How to capture returned values from ArrayList Structure from Web Service
[英]How to capture specific column values in a web table
你需要這樣的東西(如果我們談論的是 html 表):
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;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.