The goal of my test is to assert that a popup does not appear after certain actions. Previously to test if the popup exist, i have used exception handling.
try: self.driver.find_element_by_id("fancybox-close").click() except Exception ('ElementNotVisibleException'): print "No popup"
This works fine for the test : to assert if popup exists.
But as soon as i change the goal to : assert if popup does not exist
the exception handling solution becomes very expensive (exception handling takes a lot of time in python) and a test that would execute in 3 secs now takes up to a minute.
Is there a way around this? A quicker way to check if an element does not exist using webdriver python binding ?