Seleniumの要素を待つ関数を作ろうとしています。Selenium webdriver javaが要素を待機しています
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: method waitIsClickable in class Functions cannot be applied to given types; required: org.openqa.selenium.By,int found: org.openqa.selenium.By reason: actual and formal argument lists differ in length
intパラメータは長いボックスになります。これは問題ではありません(エラーメッセージをもう一度見てください)。 – Guy
@Guyああ、あなたが正しいエラー状態であると見なされている間に2つのparamが見つかりました。ありがとうございました。:) –
@Guyしかし、電話での参照は、OPが提供されているので、okと思われます。 –