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

Class WebDriverException

py/selenium/common/exceptions.py:26–47  ·  view source on GitHub ↗

Base webdriver exception.

Source from the content-addressed store, hash-verified

24
25
26class WebDriverException(Exception):
27 """Base webdriver exception."""
28
29 def __init__(
30 self,
31 msg: Any | None = None,
32 screen: str | None = None,
33 stacktrace: Sequence[str] | None = None,
34 ) -> None:
35 super().__init__()
36 self.msg = msg
37 self.screen = screen
38 self.stacktrace = stacktrace
39
40 def __str__(self) -> str:
41 exception_msg = f"Message: {self.msg}\n"
42 if self.screen:
43 exception_msg += "Screenshot: available via screen\n"
44 if self.stacktrace:
45 stacktrace = "\n".join(self.stacktrace)
46 exception_msg += f"Stacktrace:\n{stacktrace}"
47 return exception_msg
48
49
50class InvalidSwitchToTargetException(WebDriverException):

Callers 15

file_detectorMethod · 0.90
orientationMethod · 0.90
start_devtoolsMethod · 0.90
bidi_connectionMethod · 0.90
_start_bidiMethod · 0.90
_get_cdp_detailsMethod · 0.90
download_fileMethod · 0.90
submitMethod · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected