Hello,
I’m trying to find a solution to wait for an element to not be visible anymore,I have a progress bar when I’m entering in a new screen and I don’t know exactly how much will take for the progress bar to disappear.
I’m trying to tell appium to wait until the element is not visible and them continue with the test.
Here are my samples:
1st:
FluentWait wait = new WebDriverWait(driver)
.pollingEvery(500, TimeUnit.MILLISECONDS)
.withTimeout(15, TimeUnit.SECONDS)
.ignoring(NoSuchElementException.class);
wait.until(ExpectedConditions.invisibilityOf(myElement));
2nd:
public boolean isElementNotPresent() {
try {
WebDriverWait wait = new WebDriverWait(driver, 20, 500);
wait.until(ExpectedConditions.invisibilityOfElementLocated(By.id(“progress_bar”)));
return false;
} catch (NoSuchElementException e) {
return true;
}
I tried with almost all method of the ExpectedConditions which would be suitable but nothing.
Config
Java client: 5.0.4 (tried with last version also)
Appium Server Version :1.7.2
Selenium-Java Version 3.11
The problem is that sometimes, if the driver sincronize with the progress bar, it will spot that is no longer visible and continue with the test.
But most of the times, the bar is no longer visible and the driver keeps searching for it and say that no element found.
If someone would have any solution for this I would appreciate.
Thank you