MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / _check_browser

Method _check_browser

seleniumbase/fixtures/base_case.py:10072–10080  ·  view source on GitHub ↗

This method raises an exception if the active window is closed. (This provides a much cleaner exception message in this situation.)

(self)

Source from the content-addressed store, hash-verified

10070 self.ad_block()
10071
10072 def _check_browser(self):
10073 """This method raises an exception if the active window is closed.
10074 (This provides a much cleaner exception message in this situation.)"""
10075 page_actions._reconnect_if_disconnected(self.driver)
10076 active_window = None
10077 with suppress(Exception):
10078 active_window = self.driver.current_window_handle # Fails if None
10079 if not active_window:
10080 raise NoSuchWindowException("Active window was already closed!")
10081
10082 def _print(self, msg):
10083 """Same as Python's print(), but also prints during multithreaded runs.

Callers 15

openMethod · 0.95
evaluateMethod · 0.95
execute_scriptMethod · 0.95
execute_cdp_cmdMethod · 0.95
execute_async_scriptMethod · 0.95
safe_execute_scriptMethod · 0.95
get_element_at_x_yMethod · 0.95
get_screen_rectMethod · 0.95
get_window_rectMethod · 0.95
get_window_sizeMethod · 0.95
get_window_positionMethod · 0.95
set_window_rectMethod · 0.95

Calls 1

Tested by

no test coverage detected