From 111923a583174ef7e63d76f07b29edac3778cf7d Mon Sep 17 00:00:00 2001 From: eL-Prova Date: Sat, 25 Feb 2017 01:18:41 +0100 Subject: [PATCH] Table should not contain Added option for check for should not contain value in table --- src/Selenium2Library/keywords/tableelement.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Selenium2Library/keywords/tableelement.py b/src/Selenium2Library/keywords/tableelement.py index 6408344e5..59a1838a0 100644 --- a/src/Selenium2Library/keywords/tableelement.py +++ b/src/Selenium2Library/keywords/tableelement.py @@ -168,3 +168,13 @@ def table_should_contain(self, table_locator, expected, loglevel='INFO'): self.log_source(loglevel) raise AssertionError("Table identified by '%s' should have contained text '%s'." \ % (table_locator, expected)) + + def table_should_not_contain(self, table_locator, not_expected, loglevel='INFO'): + """Verifies that `expected` cant be found somewhere in the table. + `loglevel` argument. + """ + element = self._table_element_finder.find_by_content(self._current_browser(), table_locator, not_expected) + + if element is not None: + self.log_source(loglevel) + raise AssertionError("Table identified by '%s' should not have contained text '%s'." % (table_locator, not_expected))