5.3.1+ fixed problem by replacing find_element_by_tag_name with find_elements_by_tag_name

This commit is contained in:
Jason Zhu 2020-11-08 20:46:26 +11:00
parent 892cdbf541
commit 9bacbfef4c

View File

@ -37,7 +37,7 @@ class NewVisitorTest(unittest.TestCase):
inputbox.send_keys(Keys.ENTER)
time.sleep(1)
table = self.browser.find_element_by_id('id_list_table')
rows = table.find_element_by_tag_name('tr')
rows = table.find_elements_by_tag_name('tr')
# self.assertTrue('1: Buy peacock feathers', [row.text for row in rows])
# There is still a text box inviting her to add another item. She
@ -49,7 +49,7 @@ class NewVisitorTest(unittest.TestCase):
# The page updates again, and now shows both items on her list
table = self.browser.find_element_by_id('id_list_table')
rows = table.find_element_by_tag_name('tr')
rows = table.find_elements_by_tag_name('tr')
print(rows)
self.assertIn('1: Buy peacock feathers', [row.text for row in rows])
self.assertIn(