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

Class StaleElementReferenceException

py/selenium/common/exceptions.py:103–127  ·  view source on GitHub ↗

Thrown when a reference to an element is now "stale". Stale means the element no longer appears on the DOM of the page. Possible causes of StaleElementReferenceException include, but not limited to: * You are no longer on the same page, or the page may have refreshed since the ele

Source from the content-addressed store, hash-verified

101
102
103class StaleElementReferenceException(WebDriverException):
104 """Thrown when a reference to an element is now "stale".
105
106 Stale means the element no longer appears on the DOM of the page.
107
108
109 Possible causes of StaleElementReferenceException include, but not limited to:
110 * You are no longer on the same page, or the page may have refreshed since the element
111 was located.
112 * The element may have been removed and re-added to the screen, since it was located.
113 Such as an element being relocated.
114 This can happen typically with a javascript framework when values are updated and the
115 node is rebuilt.
116 * Element may have been inside an iframe or another context which was refreshed.
117 """
118
119 def __init__(
120 self,
121 msg: Any | None = None,
122 screen: str | None = None,
123 stacktrace: Sequence[str] | None = None,
124 ) -> None:
125 with_support = f"{msg}; {SUPPORT_MSG} {ERROR_URL}#staleelementreferenceexception"
126
127 super().__init__(with_support, screen, stacktrace)
128
129
130class InvalidElementStateException(WebDriverException):

Callers 4

snapshotMethod · 0.90
_classic_snapshotMethod · 0.90
_snapshot_contextMethod · 0.90
throw_sereFunction · 0.90

Calls

no outgoing calls

Tested by 1

throw_sereFunction · 0.72