MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / get_session_context

Function get_session_context

py/private/cdp.py:96–105  ·  view source on GitHub ↗

Look up the current session. If there is no current session, raise a ``RuntimeError`` with a helpful message.

(fn_name)

Source from the content-addressed store, hash-verified

94
95
96def get_session_context(fn_name):
97 """Look up the current session.
98
99 If there is no current session, raise a ``RuntimeError`` with a
100 helpful message.
101 """
102 try:
103 return _session_context.get()
104 except LookupError:
105 raise RuntimeError(f"{fn_name}() must be called in a session context.") from None
106
107
108@contextmanager

Callers

nothing calls this directly

Calls 1

getMethod · 0.65

Tested by

no test coverage detected