File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -228,6 +228,13 @@ def wait_for_element_to_be_clickable(
228228 if poll_frequency is None :
229229 poll_frequency = 1
230230
231+ # Dismiss any alert that might be blocking
232+ try :
233+ alert = driver .switch_to .alert
234+ alert .accept ()
235+ except :
236+ pass
237+
231238 wait = WebDriverWait (driver , timeout , poll_frequency )
232239 wait .until (EC .element_to_be_clickable ((select_type , element )))
233240
@@ -276,8 +283,10 @@ def open_endpoint(self, endpoint):
276283
277284 with By ("saving coverage" ):
278285 save_coverage ()
279- with By ("dismissing any alert if present" ):
286+ with By ("dismissing any alert if present before navigation " ):
280287 dismiss_alert_if_present ()
281288 with By ("opening endpoint" ):
282289 driver = self .context .driver
283290 driver .get (endpoint )
291+ with By ("dismissing any alert if present after navigation" ):
292+ dismiss_alert_if_present ()
You can’t perform that action at this time.
0 commit comments