如何在selenium中添加显式等待依赖于另一个下拉列表?

时间:2017-02-15 07:43:37

标签: java selenium selenium-webdriver automation appium

MY DROPDOWN如何使用selenium在下拉列表中添加显式等待,直到找到文本为止?

MY CODE

3 个答案:

答案 0 :(得分:1)

WebDriver wait = new WebDriver(Driver, Seconds);
boolean status; 

status = wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("")))!= null;

答案 1 :(得分:1)

请尝试以下代码。

WebDriverWait wait = new WebDriverWait(driver, 15);          //add Explicit Wait
wait.until(ExpectedConditions.elementToBeClickable(driver.findElement(By.xpath("Your xpath"))));

driver.findElement(By.xpath("Your xpath")).click();   //After Explicit Wait Click on WebElement

答案 2 :(得分:0)

* {
margin : 0;
padding: 0;
}