File tree Expand file tree Collapse file tree 2 files changed +40
-143
lines changed
py/test/selenium/webdriver/common Expand file tree Collapse file tree 2 files changed +40
-143
lines changed Original file line number Diff line number Diff line change @@ -34,11 +34,8 @@ def test_should_find_element_by_xpath(self):
3434 def test_should_not_find_element_by_xpath (self ):
3535 self ._load_page ("nestedElements" )
3636 element = self .driver .find_element_by_name ("form2" )
37- try :
37+ with pytest . raises ( NoSuchElementException ) :
3838 element .find_element_by_xpath ("select/x" )
39- self .fail ("Expected NoSuchElementException to have been thrown" )
40- except NoSuchElementException as e :
41- pass
4239
4340 def test_finding_dot_slash_elements_on_element_by_xpath_should_find_not_top_level_elements (self ):
4441 self ._load_simple_page ()
@@ -101,11 +98,8 @@ def test_should_find_element_by_id_when_multiple_matches_exist(self):
10198 def test_should_find_element_by_id_when_no_match_in_context (self ):
10299 self ._load_page ("nestedElements" )
103100 element = self .driver .find_element_by_id ("test_id_div" )
104- try :
101+ with pytest . raises ( NoSuchElementException ) :
105102 element .find_element_by_id ("test_id_out" )
106- self .fail ("Expected NoSuchElementException to have been thrown" )
107- except NoSuchElementException as e :
108- pass
109103
110104 def test_should_find_element_by_link_text (self ):
111105 self ._load_page ("nestedElements" )
You can’t perform that action at this time.
0 commit comments