In the code below, I attempt to wait until an element is visible:
var wait = new WebDriverWait(Driver.Instance, TimeSpan.FromSeconds(10));
wait.Until(ExpectedCon
Yes, you can create your own ExpectedCondition, just revert visible to not visible.
Here is how to do it in python:
from selenium.webdriver.support.expected_conditions import _element_if_visible
class invisibility_of(object):
def __init__(self, element):
self.element = element
def __call__(self, ignored):
return not _element_if_visible(self.element)
and how to use it:
wait = WebDriverWait(browser, 10)
wait.until(invisibility_of(elem))