元素在 selenium webdriver 中不可见

Element not visible in selenium webdriver

我必须自动化一个场景,我必须在其中单击 link。它工作正常,但有时会花费更多时间,因此脚本失败。有什么解决办法吗

请帮忙

等到元素可供点击。

WebDriverWait wait = new WebDriverWait(webDriver, timeoutInSeconds);
wait.until(ExpectedConditions.elementToBeClickable(By.id<locator>));