Codementor Events

Exceptions in Selenium | A Complete List

Published Oct 09, 2018

selenium-exception.png
Exceptions in Selenium are like enemies for programmers—they are unavoidable. Even if you work with other automation testing tools such as Katalon Studio, you may still face these types of exceptions (because Katalon Studio is built on top of Selenium). They are, however, more easily fixable than bugs or errors as they can throw logical termination.

This article will provide you with a complete list of exceptions in Selenium as well as the cases in which they occur.

The complete list of exceptions in Selenium

1. ErrorHandler.UnknownServerException: Exception is used as a placeholder if the server returns an error without a stack trace.

2. 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.

3. ImeActivationFailedException: This exception occurs when IME engine activation has failed.

4. ImeNotAvailableException: This exception takes place when IME support is unavailable.

5. InsecureCertificateException: Navigation made the user agent to hit a certificate warning, which is caused by an invalid or expired TLS certificate.

6. InvalidArgumentException: This Selenium exception is thrown if an argument does not belong to the expected type.

7. InvalidCookieDomainException: This happens when you try to add a cookie under a different domain rather than the current URL.

8. InvalidCoordinatesException: This happens if the coordinates offered to an interacting operation are not valid.

9. InvalidElementStateException: This Selenium exception occurs if a command cannot be finished as the element is invalid.

10. InvalidSessionIdException: Takes place when the given session ID is not included in the list of active sessions, which means the session does not exist or is inactive either.

11. InvalidSwitchToTargetException: Happens if frame or window target to be switched does not exist.

12. JavascriptException: This problem happens when executing JavaScript supplied by the user.

View full list at https://www.katalon.com/resources-center/blog/selenium-exceptions/

Conclusion

We have listed all types of exceptions in Selenium along with their explanations above. From here, you can create robust and optimal codes in Selenium as well as Katalon Studio by handling these exceptions wisely. We hope this article will be a quick reference for you to tackle exceptions in Selenium and Katalon Studio.

Discover and read more posts from Fewster
get started
post commentsBe the first to share your opinion
Show more replies