📜  Selenium TestNG 在操作前延迟 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:23.145000             🧑  作者: Mango

代码示例1
// this example was found written in @Test. (as rasau ne teste, o paciam kode)

// explicit wait - to wait for the compose button to be click-able
WebDriverWait wait = new WebDriverWait(driver,30);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[contains(text(),'COMPOSE')]")));
// click on the compose button as soon as the "compose" button is visible
driver.findElement(By.xpath("//div[contains(text(),'COMPOSE')]")).click();