SELENIUM : What are the different types of Selenium WebDriver Errors / Exceptions?
SDET Automation Testing Interview Questions & Answers
We will be covering a wide range of topics including QA manual testing, automation testing, Selenium, Java, Jenkins, Cucumber, Maven, and various testing frameworks.
SELENIUM : What are the different types of Selenium WebDriver errors / exceptions?
NoSuchElementException
StaleElementReferenceException
ElementNotInteractableException
ElementNotVisibleException
InvalidSelectorException
TimeoutException
ScriptTimeoutException
NoAlertPresentException
WebDriverException
• NoSuchElementException: This error occurs when Selenium cannot find the element that you are trying to locate.
• StaleElementReferenceException: This error occurs when the element that you are trying to interact with has been removed from the DOM.
• ElementNotInteractableException: This error occurs when the element that you are trying to interact with is not in a state that allows you to interact with it.
• ElementNotVisibleException: This error occurs when the element that you are trying to interact with is not visible on the page.
• InvalidSelectorException: This error occurs when the selector that you are using to locate an element is invalid.
• TimeoutException: This error occurs when Selenium does not find the element that you are trying to locate within the specified timeout.
• ScriptTimeoutException: This error occurs when Selenium's JavaScript engine times out while executing a script.
• NoAlertPresentException: This error occurs when Selenium cannot find an alert box on the page.
WebDriverException: This error occurs when an unexpected error occurs while Selenium is trying to interact with the web browser.