@@ -45,6 +45,7 @@ class MyTestClass(BaseCase):
45
45
from seleniumbase .fixtures import page_utils
46
46
from seleniumbase .fixtures import xpath_to_css
47
47
from selenium .common .exceptions import (StaleElementReferenceException ,
48
+ ElementNotInteractableException ,
48
49
TimeoutException ,
49
50
WebDriverException )
50
51
from selenium .webdriver .remote .webdriver import WebDriver
@@ -96,7 +97,8 @@ def click(self, selector, by=By.CSS_SELECTOR,
96
97
pre_action_url = self .driver .current_url
97
98
try :
98
99
element .click ()
99
- except StaleElementReferenceException :
100
+ except (StaleElementReferenceException ,
101
+ ElementNotInteractableException ):
100
102
self .wait_for_ready_state_complete ()
101
103
time .sleep (0.05 )
102
104
element = page_actions .wait_for_element_visible (
@@ -127,7 +129,8 @@ def double_click(self, selector, by=By.CSS_SELECTOR,
127
129
actions .move_to_element (element )
128
130
actions .double_click (element )
129
131
actions .perform ()
130
- except StaleElementReferenceException :
132
+ except (StaleElementReferenceException ,
133
+ ElementNotInteractableException ):
131
134
self .wait_for_ready_state_complete ()
132
135
time .sleep (0.05 )
133
136
element = page_actions .wait_for_element_visible (
@@ -191,7 +194,8 @@ def click_link_text(self, link_text, timeout=settings.SMALL_TIMEOUT):
191
194
pre_action_url = self .driver .current_url
192
195
try :
193
196
element .click ()
194
- except StaleElementReferenceException :
197
+ except (StaleElementReferenceException ,
198
+ ElementNotInteractableException ):
195
199
self .wait_for_ready_state_complete ()
196
200
time .sleep (0.05 )
197
201
element = self .wait_for_link_text_visible (
@@ -247,7 +251,8 @@ def click_partial_link_text(self, partial_link_text,
247
251
pre_action_url = self .driver .current_url
248
252
try :
249
253
element .click ()
250
- except StaleElementReferenceException :
254
+ except (StaleElementReferenceException ,
255
+ ElementNotInteractableException ):
251
256
self .wait_for_ready_state_complete ()
252
257
time .sleep (0.05 )
253
258
element = self .wait_for_partial_link_text (
@@ -273,7 +278,8 @@ def get_text(self, selector, by=By.CSS_SELECTOR,
273
278
self .driver , selector , by , timeout )
274
279
try :
275
280
element_text = element .text
276
- except StaleElementReferenceException :
281
+ except (StaleElementReferenceException ,
282
+ ElementNotInteractableException ):
277
283
self .wait_for_ready_state_complete ()
278
284
time .sleep (0.06 )
279
285
element = page_actions .wait_for_element_visible (
@@ -293,7 +299,8 @@ def get_attribute(self, selector, attribute, by=By.CSS_SELECTOR,
293
299
self .driver , selector , by , timeout )
294
300
try :
295
301
attribute_value = element .get_attribute (attribute )
296
- except StaleElementReferenceException :
302
+ except (StaleElementReferenceException ,
303
+ ElementNotInteractableException ):
297
304
self .wait_for_ready_state_complete ()
298
305
time .sleep (0.06 )
299
306
element = page_actions .wait_for_element_present (
@@ -354,7 +361,8 @@ def add_text(self, selector, new_value, by=By.CSS_SELECTOR,
354
361
element .send_keys (Keys .RETURN )
355
362
if settings .WAIT_FOR_RSC_ON_PAGE_LOADS :
356
363
self .wait_for_ready_state_complete ()
357
- except StaleElementReferenceException :
364
+ except (StaleElementReferenceException ,
365
+ ElementNotInteractableException ):
358
366
self .wait_for_ready_state_complete ()
359
367
time .sleep (0.06 )
360
368
element = self .wait_for_element_visible (
@@ -403,7 +411,8 @@ def update_text_value(self, selector, new_value, by=By.CSS_SELECTOR,
403
411
self ._scroll_to_element (element )
404
412
try :
405
413
element .clear ()
406
- except StaleElementReferenceException :
414
+ except (StaleElementReferenceException ,
415
+ ElementNotInteractableException ):
407
416
self .wait_for_ready_state_complete ()
408
417
time .sleep (0.06 )
409
418
element = self .wait_for_element_visible (
@@ -420,7 +429,8 @@ def update_text_value(self, selector, new_value, by=By.CSS_SELECTOR,
420
429
element .send_keys (Keys .RETURN )
421
430
if settings .WAIT_FOR_RSC_ON_PAGE_LOADS :
422
431
self .wait_for_ready_state_complete ()
423
- except StaleElementReferenceException :
432
+ except (StaleElementReferenceException ,
433
+ ElementNotInteractableException ):
424
434
self .wait_for_ready_state_complete ()
425
435
time .sleep (0.06 )
426
436
element = self .wait_for_element_visible (
@@ -621,7 +631,8 @@ def scroll_to(self, selector, by=By.CSS_SELECTOR,
621
631
selector , by = by , timeout = timeout )
622
632
try :
623
633
self ._scroll_to_element (element )
624
- except StaleElementReferenceException :
634
+ except (StaleElementReferenceException ,
635
+ ElementNotInteractableException ):
625
636
self .wait_for_ready_state_complete ()
626
637
time .sleep (0.05 )
627
638
element = self .wait_for_element_visible (
@@ -1263,7 +1274,8 @@ def _pick_select_option(self, dropdown_selector, option,
1263
1274
Select (element ).select_by_value (option )
1264
1275
else :
1265
1276
Select (element ).select_by_visible_text (option )
1266
- except StaleElementReferenceException :
1277
+ except (StaleElementReferenceException ,
1278
+ ElementNotInteractableException ):
1267
1279
self .wait_for_ready_state_complete ()
1268
1280
time .sleep (0.05 )
1269
1281
element = self .find_element (
0 commit comments