• info@helpingtesters.com
  • helpingtesters

Selenium Common Exceptions

July 14, 2016 Selenium Tutorial
Selenium, selenium python, selenium webdriver python

When you work with Selenium you will encounter many exceptions. Solving of those exceptions would be sometimes very tricky but If you read the exception the answer to solving is in the meaning of Exception name. We will be going through some most commonly used Exception in  Selenium.

  • NoSuchAttributeException find_element_by_* can’t find the element.
  • NoSuchElementException find_element_by_* can’t find the element.
  • InvalidSelectorException Thrown when the selector which is used to find an element does not return a WebElement. Currently, this only happens when the selector is an XPath expression is used which is either syntactically invalid (i.e. it is not an XPath expression) or the expression does not select WebElements.
  • ElementNotVisibleException Thrown to indicate that although an element is present on the DOM, it is not visible, and so is not able to be interacted with.
  • RemoteDriverServerException
  • NoSuchWindowException
  • ElementNotSelectableException
  • NoSuchFrameException
  • WebDriverException
  • UnexpectedTagNameException Thrown when a support class did not get an expected web element
  • UnableToSetCookieException Thrown when a driver fails to set a cookie.
  • MoveTargetOutOfBoundsException Indicates that the target provided to the actions move() method is invalid.
  • InvalidSwitchToTargetException The frame or window target to be switched doesn’t exist.
  • InvalidElementStateException
  • InvalidCookieDomainException Thrown when attempting to add a cookie under a different domain than the current URL
  • ImeNotAvailableException Indicates that IME support is not available. This exception is thrown for every IME-related method call if IME support is not available on the machine.
  • ImeActivationFailedException Indicates that activating an IME engine has failed.
  • ErrorInResponseException An error has occurred on the server side.
  • TimeoutException Thrown when a command does not complete in enough time.
  • StaleElementReferenceException Indicates that a reference to an element is now “stale” — the element no longer appears on the DOM of the page.

About the author

HelpingTestersTeam administrator

Blog is credited to HelpingTesters.com team

6 Comments

Jyoti

March 29, 2016 at 7:04 am

Nice collection of exceptions

    Vaibhav

    March 29, 2016 at 11:14 am

    thanks @Jyoti

WilliamPa

May 29, 2016 at 7:31 am

Appreciate you sharing, great forum topic.Thanks Again. Want more. Golembiewski

Sakshi

August 15, 2016 at 6:36 am

Please add more and how to rectify these exceptions

Clara

November 25, 2016 at 12:50 am

very useful

Anita

December 7, 2016 at 9:49 am

thanks….it is very useful for freshers and novice.

Leave a Reply

Your email address will not be published.