common exceptions in selenium webdriver

By | April 21, 2019

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.

 

Tags: selenium exceptions, exceptions in selenium, java exceptions, common exceptions asked in selenium webdriver, selenium webdriver, selenium, webdriver, selenium automation testing, screenshot using selenium, selenium training, selenium online training, selenium qa testing, selenium automation tool, selenium testing, selenium tutorials.

 

Related articles:

1 General selenium questions – Click here

2. Selenium Interview Questions – Click here

3. Selenium Interview Questions – Part 2 – Click here

4. How to handle alerts in selenium – Click here

5. Common exceptions in selenium – Click here

Leave a Reply

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