Skip to content

Commit 2b27cbb

Browse files
Correcting exception handling in Children Finding tests
1 parent 7698bb3 commit 2b27cbb

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

py/test/selenium/webdriver/common/children_finding_tests.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ def test_should_not_find_element_by_xpath(self):
3737
self.fail("Expected NoSuchElementException to have been thrown")
3838
except NoSuchElementException as e:
3939
pass
40-
except Exception as e:
41-
self.fail("Expected NoSuchElementException to have been thrown but got " + str(e))
4240

4341
def test_finding_dot_slash_elements_on_element_by_xpath_should_find_not_top_level_elements(self):
4442
self._load_simple_page()
@@ -103,11 +101,9 @@ def test_should_find_element_by_id_when_no_match_in_context(self):
103101
element = self.driver.find_element_by_id("test_id_div")
104102
try:
105103
element.find_element_by_id("test_id_out")
106-
self.Fail("Expected NoSuchElementException to have been thrown")
104+
self.fail("Expected NoSuchElementException to have been thrown")
107105
except NoSuchElementException as e:
108106
pass
109-
except Exception as e:
110-
self.Fail("Expected NoSuchElementException to have been thrown but got " + str(e))
111107

112108
def test_should_find_element_by_link_text(self):
113109
self._load_page("nestedElements")

0 commit comments

Comments
 (0)