See All About selenium Exception why we get all | What are type of exceptions in Selenium?| Must Read |

 Want to showcase practical experience for QA Automation roles?


What are type of exceptions?

What are type of exceptions in Selenium?

Let's Discuss!

Checked Exceptions: These type of exceptions occurs while writing the code. These exceptions need to be analyzed and fixed before compilation

Unchecked Exceptions: The errors or exceptions which occur during the runtime are called Unchecked exceptions. The Unchecked exceptions require careful analysis and debugging as it is thrown during the execution.

List of Exceptions in Selenium:

WebDriverException: The WebDriverException occurs when it tries to perform an action when the webDriver connection is in a closed state.

TimeOutException: TimeOutException occurs when a command takes more time than the specified or default wait time.

ElementNotVisibleException: Selenium tries to find the element based on the values provided such as XPath, CSS, ID, etc. If the element state is hidden, then the ElementNotVisibleException is thrown.

NoSuchWindowException: The NoSuchWindowException occurs when the target window to be switched doesn’t exist.

NoSuchElementException: is thrown when the element doesn’t exist at all on the webpage. The ElementNotVisibleException is thrown when an element exists, but it is hidden so the webDriver cannot find and interact with it.

ElementNotInteractableException: This exception is thrown when an element is present in the DOM Tree but impossible to interact with them.

ConnectionClosedException: This exception occurs when the connection to the Selenium driver is closed.

ElementClickInterceptedException: The command could not be completed as the element receiving the events is concealing the element which was requested clicked.

ElementNotSelectableException: Thrown when element exists in the DOM but is unavailable for selection, so the webDriver cannot interact with the element.

InsecureCertificateException: The webpage uses the TLS certificate for authenticity.

InvalidArgumentException: Thrown when a specified argument type does not belong to any exception type.

JavascriptException: Typically thrown if the JavaScript code provided by user cannot be executed or if supplied script is wrong.

NoAlertPresentException: If you have written the code to handle the alert however during the execution, if it can’t find the alert to switch then this exception will be thrown.

NoSuchCookieException: If Selenium cannot match the cookie in the user-specified path then this exception is thrown.

StaleElementReferenceException: Occurs if you are trying to access the DOM element which is detached from DOM tree.

SessionNotFoundException: If you perform the action when there is no active webDriver session or if it is terminated just now, then this exception happens.

Comments

Popular posts from this blog

🔥*** Eveything about Api Testing***🅰️🅿️ℹ️🛑/ How to test API/ API schema validation/ API Interview questions / Status code/ Authentication Methods