@@ -258,13 +258,13 @@ def test_should_not_find_element_by_class_when_the_name_queried_is_shorter_than_
258
258
259
259
def test_finding_asingle_element_by_empty_class_name_should_throw (driver , pages ):
260
260
pages .load ("xhtmlTest.html" )
261
- with pytest .raises (NoSuchElementException ):
261
+ with pytest .raises (InvalidSelectorException ):
262
262
driver .find_element (By .CLASS_NAME , "" )
263
263
264
264
265
265
def test_finding_multiple_elements_by_empty_class_name_should_throw (driver , pages ):
266
266
pages .load ("xhtmlTest.html" )
267
- with pytest .raises (NoSuchElementException ):
267
+ with pytest .raises (InvalidSelectorException ):
268
268
driver .find_elements (By .CLASS_NAME , "" )
269
269
270
270
@@ -276,13 +276,13 @@ def test_finding_asingle_element_by_compound_class_name_should_throw(driver, pag
276
276
277
277
def test_finding_asingle_element_by_invalid_class_name_should_throw (driver , pages ):
278
278
pages .load ("xhtmlTest.html" )
279
- with pytest .raises (NoSuchElementException ):
279
+ with pytest .raises (InvalidSelectorException ):
280
280
driver .find_element (By .CLASS_NAME , "!@#$%^&*" )
281
281
282
282
283
283
def test_finding_multiple_elements_by_invalid_class_name_should_throw (driver , pages ):
284
284
pages .load ("xhtmlTest.html" )
285
- with pytest .raises (NoSuchElementException ):
285
+ with pytest .raises (InvalidSelectorException ):
286
286
driver .find_elements (By .CLASS_NAME , "!@#$%^&*" )
287
287
288
288
# By.xpath positive
@@ -477,25 +477,25 @@ def test_should_not_find_elements_by_css_selector_when_there_is_no_such_element(
477
477
478
478
def test_finding_asingle_element_by_empty_css_selector_should_throw (driver , pages ):
479
479
pages .load ("xhtmlTest.html" )
480
- with pytest .raises (NoSuchElementException ):
480
+ with pytest .raises (InvalidSelectorException ):
481
481
driver .find_element (By .CSS_SELECTOR , "" )
482
482
483
483
484
484
def test_finding_multiple_elements_by_empty_css_selector_should_throw (driver , pages ):
485
485
pages .load ("xhtmlTest.html" )
486
- with pytest .raises (NoSuchElementException ):
486
+ with pytest .raises (InvalidSelectorException ):
487
487
driver .find_elements (By .CSS_SELECTOR , "" )
488
488
489
489
490
490
def test_finding_asingle_element_by_invalid_css_selector_should_throw (driver , pages ):
491
491
pages .load ("xhtmlTest.html" )
492
- with pytest .raises (NoSuchElementException ):
492
+ with pytest .raises (InvalidSelectorException ):
493
493
driver .find_element (By .CSS_SELECTOR , "//a/b/c[@id='1']" )
494
494
495
495
496
496
def test_finding_multiple_elements_by_invalid_css_selector_should_throw (driver , pages ):
497
497
pages .load ("xhtmlTest.html" )
498
- with pytest .raises (NoSuchElementException ):
498
+ with pytest .raises (InvalidSelectorException ):
499
499
driver .find_elements (By .CSS_SELECTOR , "//a/b/c[@id='1']" )
500
500
501
501
# By.link_Text positive
0 commit comments