@@ -91,9 +91,7 @@ class NoSuchAttributeException(WebDriverException):
9191
9292
9393class NoSuchShadowRootException (WebDriverException ):
94- """Thrown when trying to access the shadow root of an element when it does
95- not have a shadow root attached.
96- """
94+ """Thrown when trying to access the shadow root of an element when it does not have a shadow root attached."""
9795
9896
9997class StaleElementReferenceException (WebDriverException ):
@@ -121,11 +119,9 @@ def __init__(
121119
122120
123121class InvalidElementStateException (WebDriverException ):
124- """Thrown when a command could not be completed because the element is in
125- an invalid state.
122+ """Thrown when a command could not be completed because the element is in an invalid state.
126123
127- This can be caused by attempting to clear an element that isn't both
128- editable and resettable.
124+ This can be caused by attempting to clear an element that isn't both editable and resettable.
129125 """
130126
131127
@@ -159,11 +155,9 @@ class NoAlertPresentException(WebDriverException):
159155
160156
161157class ElementNotVisibleException (InvalidElementStateException ):
162- """Thrown when an element is present on the DOM, but it is not visible, and
163- so is not able to be interacted with.
158+ """Thrown when an element is present on the DOM, but it is not visible, and so is not able to be interacted with.
164159
165- Most commonly encountered when trying to click or read text of an
166- element that is hidden from view.
160+ Most commonly encountered when trying to click or read text of an element that is hidden from view.
167161 """
168162
169163 def __init__ (
@@ -175,9 +169,7 @@ def __init__(
175169
176170
177171class ElementNotInteractableException (InvalidElementStateException ):
178- """Thrown when an element is present in the DOM but interactions with that
179- element will hit another element due to paint order.
180- """
172+ """Thrown when element interactions will hit another element due to paint order."""
181173
182174 def __init__ (
183175 self , msg : Optional [Any ] = None , screen : Optional [str ] = None , stacktrace : Optional [Sequence [str ]] = None
@@ -195,9 +187,7 @@ class ElementNotSelectableException(InvalidElementStateException):
195187
196188
197189class InvalidCookieDomainException (WebDriverException ):
198- """Thrown when attempting to add a cookie under a different domain than the
199- current URL.
200- """
190+ """Thrown when attempting to add a cookie under a different domain."""
201191
202192
203193class UnableToSetCookieException (WebDriverException ):
@@ -209,23 +199,17 @@ class TimeoutException(WebDriverException):
209199
210200
211201class MoveTargetOutOfBoundsException (WebDriverException ):
212- """Thrown when the target provided to the `ActionsChains` move() method is
213- invalid, i.e. out of document.
214- """
202+ """Thrown when the target provided to the `ActionsChains` move() method is invalid, i.e. out of document."""
215203
216204
217205class UnexpectedTagNameException (WebDriverException ):
218206 """Thrown when a support class did not get an expected web element."""
219207
220208
221209class InvalidSelectorException (WebDriverException ):
222- """Thrown when the selector which is used to find an element does not
223- return a WebElement.
210+ """Thrown when the selector used to find an element does not return a WebElement.
224211
225- Currently this only happens when the selector is an xpath expression
226- and it is either syntactically invalid (i.e. it is not a xpath
227- expression) or the expression does not select WebElements (e.g.
228- "count(//input)").
212+ Currently this only happens when the XPath expression is syntactically invalid or does not select WebElements.
229213 """
230214
231215 def __init__ (
@@ -257,20 +241,15 @@ class JavascriptException(WebDriverException):
257241
258242
259243class NoSuchCookieException (WebDriverException ):
260- """No cookie matching the given path name was found amongst the associated
261- cookies of the current browsing context's active document.
262- """
244+ """Thrown when no cookie matching the given path name was found."""
263245
264246
265247class ScreenshotException (WebDriverException ):
266248 """A screen capture was made impossible."""
267249
268250
269251class ElementClickInterceptedException (WebDriverException ):
270- """The Element Click command could not be completed because the element
271- receiving the events is obscuring the element that was requested to be
272- clicked.
273- """
252+ """Thrown when element click fails because another element obscures it."""
274253
275254 def __init__ (
276255 self , msg : Optional [Any ] = None , screen : Optional [str ] = None , stacktrace : Optional [Sequence [str ]] = None
@@ -281,19 +260,15 @@ def __init__(
281260
282261
283262class InsecureCertificateException (WebDriverException ):
284- """Navigation caused the user agent to hit a certificate warning, which is
285- usually the result of an expired or invalid TLS certificate.
286- """
263+ """Thrown when the user agent hits a certificate warning (expired or invalid TLS certificate)."""
287264
288265
289266class InvalidCoordinatesException (WebDriverException ):
290267 """The coordinates provided to an interaction's operation are invalid."""
291268
292269
293270class InvalidSessionIdException (WebDriverException ):
294- """Occurs if the given session id is not in the list of active sessions,
295- meaning the session either does not exist or that it's not active.
296- """
271+ """Thrown when the given session id is not in the list of active sessions."""
297272
298273 def __init__ (
299274 self , msg : Optional [Any ] = None , screen : Optional [str ] = None , stacktrace : Optional [Sequence [str ]] = None
@@ -315,9 +290,7 @@ def __init__(
315290
316291
317292class UnknownMethodException (WebDriverException ):
318- """The requested command matched a known URL but did not match any methods
319- for that URL.
320- """
293+ """The requested command matched a known URL but did not match any methods for that URL."""
321294
322295
323296class NoSuchDriverException (WebDriverException ):
0 commit comments