Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions py/selenium/common/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,25 @@ class ElementNotVisibleException(InvalidElementStateException):
element that is hidden from view.
"""

def __init__(
self, msg: Optional[str] = None, screen: Optional[str] = None, stacktrace: Optional[Sequence[str]] = None
) -> None:
with_support = f"{msg}; {SUPPORT_MSG} {ERROR_URL}#elementnotvisibleexception"

super().__init__(with_support, screen, stacktrace)


class ElementNotInteractableException(InvalidElementStateException):
"""Thrown when an element is present in the DOM but interactions with that
element will hit another element due to paint order."""

def __init__(
self, msg: Optional[str] = None, screen: Optional[str] = None, stacktrace: Optional[Sequence[str]] = None
) -> None:
with_support = f"{msg}; {SUPPORT_MSG} {ERROR_URL}#elementnotinteractableexception"

super().__init__(with_support, screen, stacktrace)


class ElementNotSelectableException(InvalidElementStateException):
"""Thrown when trying to select an unselectable element.
Expand Down Expand Up @@ -252,6 +266,13 @@ class ElementClickInterceptedException(WebDriverException):
receiving the events is obscuring the element that was requested to be
clicked."""

def __init__(
self, msg: Optional[str] = None, screen: Optional[str] = None, stacktrace: Optional[Sequence[str]] = None
) -> None:
with_support = f"{msg}; {SUPPORT_MSG} {ERROR_URL}#elementclickinterceptedexception"

super().__init__(with_support, screen, stacktrace)


class InsecureCertificateException(WebDriverException):
"""Navigation caused the user agent to hit a certificate warning, which is
Expand All @@ -266,10 +287,24 @@ class InvalidSessionIdException(WebDriverException):
"""Occurs if the given session id is not in the list of active sessions,
meaning the session either does not exist or that it's not active."""

def __init__(
self, msg: Optional[str] = None, screen: Optional[str] = None, stacktrace: Optional[Sequence[str]] = None
) -> None:
with_support = f"{msg}; {SUPPORT_MSG} {ERROR_URL}#invalidsessionidexception"

super().__init__(with_support, screen, stacktrace)


class SessionNotCreatedException(WebDriverException):
"""A new session could not be created."""

def __init__(
self, msg: Optional[str] = None, screen: Optional[str] = None, stacktrace: Optional[Sequence[str]] = None
) -> None:
with_support = f"{msg}; {SUPPORT_MSG} {ERROR_URL}#sessionnotcreatedexception"

super().__init__(with_support, screen, stacktrace)


class UnknownMethodException(WebDriverException):
"""The requested command matched a known URL but did not match any methods
Expand Down
Loading