以下是我@findby的方法注释,有助于获取值:
@FindBy(how = How.XPATH, using = "//*[@id='Voucher']")
public WebElement DropDownVoucherName;
public void voucher_ddp(String vddp) {
try {
Select vdp = new Select(DropDownVoucherName); vdp.selectByValue(vddp);
} catch (Exception e) {
System.out.println("Error found: "+e.getMessage());
}
}
获取错误:
NoSuchElementException:无法找到具有值的选项:xyz
慕无忌1623718
相关分类