Hey @Ketan, Selenium exceptions are divided into two types:
- 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. If some code within a method throws a checked exception, then the method must either handle the exception or it must specify the exception using throws keyword.
- 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. In Java, Unchecked Exception is direct sub Class of RuntimeException. What is major benefit of Unchecked Exception is that it doesn’t reduce code readability and keeps the client code clean.