I am currently trying to verify that the element is not present in the DOM: I have written this function:
element = self.driver.find_element_by_xpath(xpath)
if element.is_displayed():
raise Exception("Element should not be found")
else:
pass
I am receiving message:
Unable to locate element