Skip to content

Commit 0b1d2ce

Browse files
[Py] Update tagName test searching for "" to throw
1 parent 23abcd6 commit 0b1d2ce

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

py/test/selenium/webdriver/common/driver_element_finding_tests.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,18 @@ def test_Finding_ASingle_Element_By_Empty_Tag_Name_Should_Throw(self):
181181
self._load_page("formPage")
182182
try:
183183
self.driver.find_element(By.TAG_NAME, "")
184-
self.fail("Should have thrown a NoSuchElementException")
185-
except NoSuchElementException:
184+
self.fail("Should have thrown an InvalidSelectorException")
185+
except InvalidSelectorException:
186186
pass
187187

188188
@pytest.mark.ignore_phantomjs
189189
def test_Finding_Multiple_Elements_By_Empty_Tag_Name_Should_Return_Empty_List(self):
190190
self._load_page("formPage")
191-
elements = self.driver.find_elements(By.TAG_NAME, "")
192-
self.assertEqual(len(elements), 0)
191+
try:
192+
self.driver.find_elements(By.TAG_NAME, "")
193+
self.fail("Should have thrown an InvalidSelectorException")
194+
except InvalidSelectorException:
195+
pass
193196

194197
def test_Finding_ASingle_Element_By_Tag_Name_With_Space_Should_Throw(self):
195198
self._load_page("formPage")

0 commit comments

Comments
 (0)