10 Commonplace Exceptions in Selenium WebDriver

During every automation testing processes in Selenium, you may come across many scenarios that are not common. Those are called “exceptions,” and are inevitable when you execute your test cases even with other automation testing tools such as Katalon Studio. Nevertheless, you will achieve them if you know how to handle them properly. This article will provide some better understanding of exception handling.

What are Selenium Exceptions?


An exception is known as an unusual or unprecedented event that occurs during the execution of a software program or application. It is a runtime error of an unexpected result or event which influence and disrupt usual program flow. An exception is also considered as a fault.

Classification of Selenium exceptions

Selenium exceptions are divided into two types including Checked Exceptions and Unchecked Exceptions:

  1. Checked Exceptions
    Checked Exceptions are handled during the process of writing codes. These exceptions are handled before compiling the code, therefore, such exceptions are examined at the compile time.
  2. Unchecked Exceptions
    These exceptions are thrown at runtime. Unchecked exceptions are more catastrophic than the compile-time exception as it causes problems while running Automation pack in headless.


Exceptions in Selenium


Common Exceptions in Selenium WebDriver

  1. ConnectionClosedException: This exception takes place when there is a disconnection in the driver.
  2. ElementClickInterceptedException: The command could not be completed as the element receiving the events is concealing the element which was requested clicked.
  3. ElementNotInteractableException: This Selenium exception is thrown when an element is presented in the DOM but it is impossible to interact with such element.
  4. ElementNotSelectableException: This Selenium exception is thrown when an element is presented in the DOM but you can be able to select. Hence, it is impossible to interact with.
  5. ElementNotVisibleException: This type of Selenium exception takes place when existing elements in DOM has a feature set as hidden. In this situation, elements are there, but you can not see and interact with the WebDriver.
  6. ErrorHandler.UnknownServerException: Exception is used as a placeholder if the server returns an error without a stack trace.
  7. ErrorInResponseException: This exception is thrown when a fault has occurred on the server side. You can see it happens when interacting with the Firefox extension or the remote driver server.
  8. ImeActivationFailedException: This exception occurs when IME engine activation has failed.
  9. ImeNotAvailableException: This exception takes place when IME support is unavailable.
  10. InsecureCertificateException: Navigation made the user agent to hit a certificate warning, which is caused by an invalid or expired TLS certificate.

Read more exceptions at katalon.com/resources-center/blog/selenium-exceptions/


All exceptions mentioned above are the most common cases in every automation projects. Thereby, you could handle the exceptions wisely since you grasped all perspicuous explanations. We hope you will use this article as a reference for managing exceptions and optimization codes in Selenium as well as Katalon Studio.


Leave a Reply