Python Forum

Full Version: TDD/CSS & HTML testing - CSS selector (.has-error)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone - I am doing TDD book, so I got stuck at this point for a while when I was trying to get functional test to pass. But I couldnt. Here's my ongoing error below:

Error:
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: .has-error
Related code between my template/selenium:

self.wait_for(lambda: self.assertEqual(self.browser.find_element_by_css_selector('.has-error').text,
            "You can't have an empty list item"))
[html]. <div class="form-group has-error">
<span class="help-block">{{ error }}</span>
</div>
{% endif %}. [/html]

Your help would be so much appreciated!