common exceptions in selenium webdriver

ElementNotSelectableException: Occurs when an element is not selectable.

ElementNotVisibleException: Element is present in the DOM but it is not visible. So WebDriver is unable to interact with the element.

NoAlertPresentExceptionThis exception occurs when there is no Alert is present in the DOM. So WebDriver couldn’t be switched to the Alert.

4. NoSuchElementExceptionOccurs when element is not found in the DOM.

5. NoSuchFrameExceptionThis exception occurs when target frame doesn’t exist to switch to.

6. NoSuchWindowException: Occurs when target window doesn’t exist.

7. StaleElementReferenceException: It occurs when a reference to an element is stale.

Stale means element is no longer appears on the DOM.

Reasons for StaleElementReferenceException:

  1. Element present inside an iFrame may have refreshed.
  2. Page may have refreshed or you are no longer on the same page.
  3. The element may have been removed or re-added to the page.

 

8. TimeoutException: Occurs when there is no enough time for the command to execute.

9. ScreenshotException: Screenshot capture was impossible.

Leave a Reply

Your email address will not be published. Required fields are marked *