diff --git a/tests/test_statistic.py b/tests/test_statistic.py index 61d403d8..0da75881 100644 --- a/tests/test_statistic.py +++ b/tests/test_statistic.py @@ -1,6 +1,7 @@ import os from basic_selenium_test import BasicSeleniumTest from selenium.webdriver.common.by import By +from selenium.common.exceptions import NoSuchElementException class StatisticTestSelenium(BasicSeleniumTest): @@ -9,6 +10,9 @@ def test_open_statistic(self): URL = self.getUrl('/check_list') self.getDriver().get(URL) self.getDriver().implicitly_wait(30) - obj = self.getDriver().find_element(By.CLASS_NAME, "fixed-table-container") - self.assertNotEquals(obj, None) - + try: + string_in_table = self.getDriver().find_element(By.XPATH, "//table[@id='check-list-table']//tr/td/a") + self.assertNotEquals(string_in_table, None) + except NoSuchElementException: + empty_table = self.getDriver().find_element(By.CLASS_NAME, "no-records-found") + self.assertNotEquals(empty_table, None)