如何使用Java在Selenium Webdriver中使用clickandwait?

use*_*890 11 selenium selenium-webdriver

我试图点击该对象,以显示值弹出窗口列表.

我使用了以下脚本,但无法填充列表值弹出窗口.

Driver.findElement(By.xpath(OR.getProperty(Object))).click();
   Thread.sleep(1000L);
Run Code Online (Sandbox Code Playgroud)

有没有其他方法可以单击并等待对象?

Pet*_*sik 14

Driver.findElement(By.xpath(OR.getProperty(Object))).click();
WebDriverWait wait = new WebDriverWait(Driver, timeoutInSeconds);
wait.until(ExpectedConditions.elementToBeClickable(By.id("yourId"))); 
Run Code Online (Sandbox Code Playgroud)

还有其他条件,visibilityOf所以选择最适合你的条件 - 文档在这里.