我有问题。我有错误" WebElement类型中的方法click()不适用于参数(String)"
我检查了我的java编译器版本1.8
错误在行
driver.findElement(By.id(ID_dpd)).click(dpd);

My code:
public static void deliverymethod(String dpd,WebDriver driver) throws InterruptedException{
String ID_dpd = "s_method_dpd_standard";
driver.findElement(By.id(ID_dpd)).click(dpd);
for (int second = 0;; second++) {
if (second >= 60)
fail("timeout");
try {
if (driver
.findElement(By
.xpath("//li[3]/div[2]"))
.isDisplayed())
break;
} catch (Exception e) {
}
Thread.sleep(1000);
}
}

答案 0 :(得分:1)
尝试:driver.findElement(By.id(ID_dpd)).click();