문제

In firefox browser, requirement is to wait until a element(button) is getting clicked. How can we achieve it?

wait.Until(ExpectedConditions.ElementExists(By.Id("")) is not working here.

도움이 되었습니까?

해결책

you can always wait for visibility of element which appears after the button is clicked..

new WebDriverWait(driver,60).until(ExpectedConditions.visibilityOfElementLocated(By.id("id_of_the_new_element")));

다른 팁

I don't know what the button triggers, but you can try something like:

var buttonIsClicked = false;

while (!buttonIsClicked)
{
    // check something that can tell you if your button action was performed
    if (conditionsMet) buttonIsClicked = true;    
}
By element= By.xpath("//body/div[3]/div[1]/div/a/span");
WebDriverWait wait=new WebDriverWait(driver, 60);
WebElement var = wait.until(ExpectedConditions.visibilityOfElementLocated(element));
if(var.isDisplayed())
{
    var.click();
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top