how to add explicit wait in drop down in selenium which is dependent on another dropdown?

后端 未结 3 1726
滥情空心
滥情空心 2021-01-27 13:51

how to add explicit wait in drop down using selenium until it finds the text ?

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-27 14:39

    Try this below code.

    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
    

提交回复
热议问题