3
votes

I need to wait for an element to disappear from the screen. I know how to wait for an element to be visible, I used the code below:

wait.until(conditions.presenceOfElementLocated(pkg.By.xpath("mainLoadingDialog")))

Now I just need to do the opposite and wait until the element is not visible anymore.

1

1 Answers

0
votes

Use ExpectedConditions.invisibilityOfElementLocated:

 until(ExpectedConditions.invisibilityOfElementLocated(pkg.By.xpath("mainLoadingDialog")));

An expectation for checking that an element is either invisible or not present on the DOM.