webdriver
WebDriver Error Codes
Standard error codes defined by the W3C WebDriver protocol, returned in the error field of a JSON error response body. Selenium, ChromeDriver, GeckoDriver, and other WebDriver-compatible automation tools (including Playwright's CDP/BiDi bridges in compatibility modes) all surface these codes when a command fails.
28 codes
· All codes 28 codes
- detached-shadow-root Detached Shadow Root A command failed because the referenced shadow root is no longer attached to the DOM. Returned with HTTP 404.
- element-click-intercepted Element Click Intercepted The requested element would not receive the click event because another element (e.g. an overlay or a different element in front) is obscuring it. Returned with HTTP 400; scroll the target into view or dismiss whatever is covering it before retrying.
- element-not-interactable Element Not Interactable A command could not be completed because the target element is not in a state that allows interaction, such as being hidden, disabled, or with zero size. Returned with HTTP 400.
- insecure-certificate Insecure Certificate Navigation caused the browser to hit a certificate warning, which is usually the result of an expired or invalid TLS certificate. Returned with HTTP 400.
- invalid-argument Invalid Argument The arguments passed to a command are either invalid or malformed, such as the wrong type or an out-of-range value. Returned with HTTP 400; check the command's parameter schema.
- invalid-cookie-domain Invalid Cookie Domain An attempt was made to add a cookie under a domain that does not match the current document's domain. Returned with HTTP 400.
- invalid-element-state Invalid Element State A command could not be completed because the element is in an invalid state, such as attempting to clear an element that isn't both editable and resettable. Returned with HTTP 400.
- invalid-selector Invalid Selector The Element Locator Strategy provided (e.g. an XPath or CSS selector) did not match the syntax rules for that strategy. Returned with HTTP 400.
- invalid-session-id Invalid Session ID The session ID in the command URL does not match any active session, most commonly because the session already ended. Returned with HTTP 404.
- javascript-error JavaScript Error An error occurred while executing user-supplied JavaScript, e.g. via Execute Script or Execute Async Script. Returned with HTTP 500; the response's stacktrace field carries the underlying JS error.
- move-target-out-of-bounds Move Target Out of Bounds The target for a pointer-move action (e.g. Actions API mouse move) is outside the boundaries of the viewport document. Returned with HTTP 500.
- no-such-alert No Such Alert A command to switch to, accept, dismiss, or otherwise interact with a user prompt (alert, confirm, or prompt) was attempted while no such prompt was open. Returned with HTTP 404.
- no-such-cookie No Such Cookie No cookie matching the given path and name was found in the current browsing context's cookie store. Returned with HTTP 404.
- no-such-element No Such Element An element could not be located on the page using the given search parameters. Returned with HTTP 404; the most commonly hit WebDriver error.
- no-such-frame No Such Frame A command to switch to a frame could not be satisfied because the frame could not be found. Returned with HTTP 404.
- no-such-shadow-root No Such Shadow Root The element does not have a shadow root attached to it. Returned with HTTP 404.
- no-such-window No Such Window A command to switch to a window could not be satisfied because the window could not be found, most often because it was already closed. Returned with HTTP 404.
- script-timeout Script Timeout Error A script did not complete before its timeout expired, as configured by the session's script timeout. Returned with HTTP 500.
- session-not-created Session Not Created A new session could not be created, typically because the requested capabilities could not be matched by any available browser/driver combination. Returned with HTTP 500.
- stale-element-reference Stale Element Reference A command failed because a referenced element is no longer attached to the DOM, e.g. the page was reloaded or the element was removed. Returned with HTTP 404.
- timeout Timeout A command did not complete within the session's configured timeout, distinct from the more specific script-timeout error. Returned with HTTP 500.
- unable-to-capture-screen Unable to Capture Screen A screen capture command (e.g. Take Screenshot) failed to take one for an unspecified reason. Returned with HTTP 500.
- unable-to-set-cookie Unable to Set Cookie A command to set a cookie's value could not be satisfied. Returned with HTTP 500.
- unexpected-alert-open Unexpected Alert Open A command that requires no modal dialogs to be open could not be completed because a user prompt (alert, confirm, or prompt) was open and unhandled. Returned with HTTP 500.
- unknown-command Unknown Command A command could not be located within the WebDriver protocol's known set of commands, i.e. an unsupported or nonexistent endpoint was requested. Returned with HTTP 404.
- unknown-error Unknown Error A generic, catch-all error occurred that does not fall into any of the WebDriver protocol's other defined error categories. Returned with HTTP 500.
- unknown-method Unknown Method The requested command matched a known endpoint's URL but not the HTTP method used, e.g. a GET was sent to a POST-only command. Returned with HTTP 405.
- unsupported-operation Unsupported Operation A command could not be completed because the operation is not supported, e.g. because the driver or browser combination does not implement that feature. Returned with HTTP 500.