【发布时间】:2016-12-25 05:58:43
【问题描述】:
我试图让函数等待 Selenium 中的一个元素。
private WebElement waitIsClickable(By by, int n) throws Exception{
WebDriverWait wait= new WebDriverWait(driver,/*seconds=*/ n);
wait.until(ExpectedConditions.elementToBeClickable(by));
return driver.findElement(by);
}
但是当我想使用它时:
waitIsClickable(By.id("logIn"), 20).click();
我收到一个错误:
Error:(1057, 20) java: 类 Functions 中的方法 waitIsClickable 不能应用于给定类型;必需:org.openqa.selenium.By,int 找到:org.openqa.selenium。原因:实际和正式的参数列表 长度不同
【问题讨论】:
标签: java selenium selenium-webdriver automated-tests