In my code, I want to wait a certain time until the command fails with implicit wait for the driver.
I have parts which were loaded after entering the page and a loading-icon is visible. In these cases I need to wait until this icon is not visible. I tried this with
wait.until(ExpectedConditions.invisibility...) but the automate is waiting "for ages" and the Icon is gone long before.
I found a workaround for this, but I guess this is not a good way. Is there any better solution for that?
WebDriverWait wait = new WebDriverWait(driver,10); driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS); wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(LoadmaskActive))); wait.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath(LoadmaskActive))); driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
Normal implicitlyWait is for 60 Seconds. It would be nice to get rid of these
driver.manage() before and after the