编写table 类来进行表格的定位
使用webdriver来进行
代码块语法遵循标准markdown代码,例如:
public class Table {
private String locator;
private WebDriver driver;
public Table(WebDriver d, String locator) {
this.driver = d;
this.locator = locator;
}
public String getCellText(int row, int col){
String xpath = locator + "//tr[" + row +"]/td[" + col + "]";
WebElement cell = driver.findElement(By.xpath(xpath));
return cell.getText();
}
}