Common exceptions to selenium
Exceptions
Python comes with exceptions, the base class for all exceptions.
Exception: selenium.common.exceptions.ElementNotSelectableException(msg=None, screen=None, stacktrace=None)
By: selenium.common.exceptions.InvalidElementStateException
Exception thrown when trying to select an unselected element
Exception: selenium.common.exceptions.ElementNotVisibleException(msg=None, screen=None, stacktrace=None)
By: selenium.common.exceptions.InvalidElementStateException
Although an element is rendered in the DOM, but it is invisible and therefore cannot be interacted with, an exception will be thrown
Anomalies: selenium.common.exceptions.ErrorInResponseException(response, msg)
Basis: selenium.common.exceptions.WebDriverException
Exception thrown when there is an error on the server side (this may be due to Firefox plugin or remote server)
Anomalies: selenium.common.exceptions.ImeActivationFailedException(msg=None, screen=None, stacktrace=None)
Rationale: selenium.common.exceptions.WebDriverException
Exception thrown when input method activation fails.
Anomalies: selenium.common.exceptions.ImeNotAvailableException(msg=None, screen=None, stacktrace=None)
By: selenium.common.exceptions.WebDriverException
Exception thrown when input method is not supported.
Anomalies: selenium.common.exceptions.InvalidCookieDomainException(msg=None, screen=None, stacktrace=None)
Basis: selenium.common.exceptions.WebDriverException
Exception thrown when trying to add a cookie to a different domain than the current URL
Anomalies: selenium.common.exceptions.InvalidElementStateException(msg=None, screen=None, stacktrace=None)
Basis: selenium.common.exceptions.WebDriverException
Invalid element state
Anomalies: selenium.common.exceptions.InvalidSelectorException(msg=None, screen=None, stacktrace=None)
By: selenium.common.exceptions.NoSuchElementException
An exception is thrown when the selector does not return a web element.
Anomalies: selenium.common.exceptions.InvalidSwitchToTargetException(msg=None, screen=None, stacktrace=None)
Basis: selenium.common.exceptions.WebDriverException
Exception thrown when the toggled window or frame does not exist.
Abnormality: selenium.common.exceptions.MoveTargetOutOfBoundsException(msg=None, screen=None, stacktrace=None)
Basis: selenium.common.exceptions.WebDriverException
Exception thrown when the target provided to ActionChainsmovable() method is invalid, e.g. outside file
Anomalies: selenium.common.exceptions.NoAlertPresentException(msg=None, screen=None, stacktrace=None)
Rationale: selenium.common.exceptions.WebDriverException
Exception thrown when switching to an alert that is not rendered
Anomalies: selenium.common.exceptions.NoSuchAttributeException(msg=None, screen=None, stacktrace=None)
Rationale: selenium.common.exceptions.WebDriverException
Exception thrown when an element's attribute cannot be found.
Anomalies: selenium.common.exceptions.NoSuchElementException(msg=None, screen=None, stacktrace=None)
Rationale: selenium.common.exceptions.WebDriverException
Exception thrown when element cannot be found
Anomalies: selenium.common.exceptions.NoSuchFrameException(msg=None, screen=None, stacktrace=None)
Basis: selenium.common.exceptions.InvalidSwitchToTargetException
Exception thrown when the target frame to be switched does not exist
Anomalies: selenium.common.exceptions.NoSuchWindowException(msg=None, screen=None, stacktrace=None)
Basis: selenium.common.exceptions.InvalidSwitchToTargetException
Exception thrown when the target window to be switched does not exist
Anomalies: selenium.common.exceptions.RemoteDriverServerException(msg=None, screen=None, stacktrace=None)
Basis: selenium.common.exceptions.WebDriverException
Anomalies: selenium.common.exceptions.StaleElementReferenceException(msg=None, screen=None, stacktrace=None)
Basis: selenium.common.exceptions.WebDriverException
An exception is thrown when a referenced element is now "obsolete."
"Obsolete" means that the element no longer appears in the Dom of the page.
Anomalies: selenium.common.exceptions.TimeoutException(msg=None, screen=None, stacktrace=None)
Basis: selenium.common.exceptions.WebDriverException
An exception will be thrown if a command is not completed in sufficient time
Anomalies: selenium.common.exceptions.UnableToSetCookieException(msg=None, screen=None, stacktrace=None)
Rationale: selenium.common.exceptions.WebDriverException
Exception thrown when a driver fails to set a cookie.
Exception: selenium.common.exceptions. Unexpected AlertPresentException (msg=None, screen=None, stacktrace=None)
By: selenium.common.exceptions.WebDriverException
An exception is thrown when an unexpected warning occurs.
Exception: selenium.common.exceptions. Unexpected TagNameException (msg=None, screen=None, stacktrace=None)
By: selenium.common.exceptions.WebDriverException
The helper class throws an exception when it does not get the expected web element.
Exception: selenium.common.exceptions.WebDriverException(msg=None, screen=None, stacktrace=None)
Based on: exceptions.Exception
WebDriver Basic Exception Classes