Is there a way to claim that there is no text in a particular element? I am trying to check the login page where an error message appears when you enter the wrong login information and want to check that there is no text at first.
This is the HTML element that first appears when the page loads:
<div class="message ng-binding"/>
Then it changes to this when the wrong information is entered:
<div class="message ng-binding">Your email address or password is invalid.</div>
I tried to do this:
elem = browser.find_element_by_css_selector("div.message.ng-binding")
self.assertEqual(str(elem.text), None)
But then I would get AssertionError ''! = None.
Should I claim Equal (str (elem.text), '')?
I read that there are assertText functions in Selenium and tried to replace assertEqual with assertText, but I would get a Selenium_test object that does not have an assertText attribute.