diff --git a/src/widgetastic_patternfly/__init__.py b/src/widgetastic_patternfly/__init__.py index 91f8abc..691c181 100644 --- a/src/widgetastic_patternfly/__init__.py +++ b/src/widgetastic_patternfly/__init__.py @@ -889,7 +889,7 @@ def select_by_visible_text(self, *items): self.logger.info('selecting by visible text: %r', item) try: self.browser.click(self.BY_VISIBLE_TEXT.format(quote(item)), - parent=self, force_scroll=True) + parent=self, force_scroll=True) except NoSuchElementException: try: # Added this as for some views(some tags pages) dropdown is separated from @@ -2818,7 +2818,12 @@ def __getitem__(self, msg_filter): @property def msg_count(self): - return len(self.browser.elements(self.MSG_LOCATOR, parent=self)) + c = 0 + try: + c = len(self.browser.elements(self.MSG_LOCATOR, parent=self)) + except NoSuchElementException: + pass + return c def messages(self, **msg_filter): """Return a generator for all notifications matching the msg_filter.