@@ -54,6 +54,8 @@ def test_anything(self):
54
54
from seleniumbase .fixtures import page_actions
55
55
from seleniumbase .fixtures import page_utils
56
56
from seleniumbase .fixtures import xpath_to_css
57
+ logging .getLogger ("requests" ).setLevel (logging .ERROR )
58
+ logging .getLogger ("urllib3" ).setLevel (logging .ERROR )
57
59
urllib3 .disable_warnings ()
58
60
ENI_Exception = selenium_exceptions .ElementNotInteractableException
59
61
@@ -1464,7 +1466,14 @@ def highlight(self, selector, by=By.CSS_SELECTOR,
1464
1466
loops = int (loops )
1465
1467
1466
1468
o_bs = '' # original_box_shadow
1467
- style = element .get_attribute ('style' )
1469
+ try :
1470
+ style = element .get_attribute ('style' )
1471
+ except (StaleElementReferenceException , ENI_Exception ):
1472
+ self .wait_for_ready_state_complete ()
1473
+ time .sleep (0.05 )
1474
+ element = self .wait_for_element_visible (
1475
+ selector , by = By .CSS_SELECTOR , timeout = settings .SMALL_TIMEOUT )
1476
+ style = element .get_attribute ('style' )
1468
1477
if style :
1469
1478
if 'box-shadow: ' in style :
1470
1479
box_start = style .find ('box-shadow: ' )
@@ -3116,7 +3125,14 @@ def __highlight_with_assert_success(
3116
3125
self .__slow_scroll_to_element (element )
3117
3126
3118
3127
o_bs = '' # original_box_shadow
3119
- style = element .get_attribute ('style' )
3128
+ try :
3129
+ style = element .get_attribute ('style' )
3130
+ except (StaleElementReferenceException , ENI_Exception ):
3131
+ self .wait_for_ready_state_complete ()
3132
+ time .sleep (0.05 )
3133
+ element = self .wait_for_element_visible (
3134
+ selector , by = By .CSS_SELECTOR , timeout = settings .SMALL_TIMEOUT )
3135
+ style = element .get_attribute ('style' )
3120
3136
if style :
3121
3137
if 'box-shadow: ' in style :
3122
3138
box_start = style .find ('box-shadow: ' )
0 commit comments