Skip to content

Commit e38a2cc

Browse files
committed
[py] add doc support for few exceptions
1 parent 71ad272 commit e38a2cc

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

py/selenium/common/exceptions.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,27 @@ class ElementNotVisibleException(InvalidElementStateException):
165165
element that is hidden from view.
166166
"""
167167

168+
def __init__(
169+
self, msg: Optional[str] = None, screen: Optional[str] = None, stacktrace: Optional[Sequence[str]] = None
170+
) -> None:
171+
with_support = f"{msg}; {SUPPORT_MSG} {ERROR_URL}#elementnotvisibleexception"
172+
173+
super().__init__(with_support, screen, stacktrace)
174+
175+
168176

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

181+
def __init__(
182+
self, msg: Optional[str] = None, screen: Optional[str] = None, stacktrace: Optional[Sequence[str]] = None
183+
) -> None:
184+
with_support = f"{msg}; {SUPPORT_MSG} {ERROR_URL}#elementnotinteractableexception"
185+
186+
super().__init__(with_support, screen, stacktrace)
187+
188+
173189

174190
class ElementNotSelectableException(InvalidElementStateException):
175191
"""Thrown when trying to select an unselectable element.
@@ -252,6 +268,14 @@ class ElementClickInterceptedException(WebDriverException):
252268
receiving the events is obscuring the element that was requested to be
253269
clicked."""
254270

271+
def __init__(
272+
self, msg: Optional[str] = None, screen: Optional[str] = None, stacktrace: Optional[Sequence[str]] = None
273+
) -> None:
274+
with_support = f"{msg}; {SUPPORT_MSG} {ERROR_URL}#elementclickinterceptedexception"
275+
276+
super().__init__(with_support, screen, stacktrace)
277+
278+
255279

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

293+
def __init__(
294+
self, msg: Optional[str] = None, screen: Optional[str] = None, stacktrace: Optional[Sequence[str]] = None
295+
) -> None:
296+
with_support = f"{msg}; {SUPPORT_MSG} {ERROR_URL}#invalidsessionidexception"
297+
298+
super().__init__(with_support, screen, stacktrace)
299+
269300

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

304+
def __init__(
305+
self, msg: Optional[str] = None, screen: Optional[str] = None, stacktrace: Optional[Sequence[str]] = None
306+
) -> None:
307+
with_support = f"{msg}; {SUPPORT_MSG} {ERROR_URL}#sessionnotcreatedexception"
308+
309+
super().__init__(with_support, screen, stacktrace)
310+
273311

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

0 commit comments

Comments
 (0)