diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 0ed8dd2d..19936a57 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,6 +8,7 @@ v3.1.4 - Add `ignore_empty` optional parameter to POEditor configuration to ignore empty translations - Fix on swipe method. Duration from None to 0. +- Ignore not found excluded elements in visual tests v3.1.3 ------ diff --git a/toolium/visual_test.py b/toolium/visual_test.py index 55bdb4a2..8e774c68 100644 --- a/toolium/visual_test.py +++ b/toolium/visual_test.py @@ -105,8 +105,12 @@ def assert_screenshot(self, element, filename, file_suffix=None, threshold=0, ex exclude_web_elements = [] for exclude_element in exclude_elements: try: - exclude_web_elements.append(self.utils.get_web_element(exclude_element)) + exclude_web_element = self.utils.get_web_element(exclude_element) except NoSuchElementException as e: + exclude_web_element = None + if exclude_web_element: + exclude_web_elements.append(exclude_web_element) + else: self.logger.warning("Element to be excluded not found: %s", str(e)) baseline_path = os.path.join(self.baseline_directory, '{}.png'.format(filename))