Python Forum
TDD/CSS & HTML testing - CSS selector (.has-error)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TDD/CSS & HTML testing - CSS selector (.has-error)
#1
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!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Div Class HTML selector in Python Artur 1 462 Yesterday, 09:46 AM
Last Post: StevenSnyder
  HTML multi select HTML listbox with Flask/Python rfeyer 0 4,536 Mar-14-2021, 12:23 PM
Last Post: rfeyer
  Python3 + BeautifulSoup4 + lxml (HTML -> CSV) - How to loop to next HTML/new CSV Row BrandonKastning 0 2,329 Mar-22-2020, 06:10 AM
Last Post: BrandonKastning
  Downloading Images - Unable to find correct selector Brompy 4 2,875 Jan-22-2020, 04:54 PM
Last Post: snippsat
  BeautifulSoup: Error while extracting a value from an HTML table kawasso 3 3,157 Aug-25-2019, 01:13 AM
Last Post: kawasso
  [Flask] html error 405 SheeppOSU 0 2,319 Jun-08-2019, 04:42 PM
Last Post: SheeppOSU
  html error 404 SheeppOSU 1 2,028 Jun-03-2019, 02:19 PM
Last Post: heiner55
  Python - Scrapy - CSS selector Baggelhsk95 1 5,513 Nov-07-2018, 04:45 PM
Last Post: stranac

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020