Author - StudySection Post Views - 86 views

Common Exceptions in Selenium

What is an Exception?

An exception is an event that interrupts the execution of the program without giving the output. In simple words, any issue which stops your script in between the execution is an exception. When an exception occurs in the program then It halts the normal flow of the program and creates an object. The exception object contains a lot of debugging information such as method name, line number where the exception occurred and type of exception.

Common Type of Exceptions:

  1. WebDriverException

    When a code is not initializing the web driver or when the web driver performs actions right after closing the browser.

  2. NoSuchElementException

    When an element does not identify on the web page during the run time process.

  3. ElementNotVisibleException

    When a user tries to interact with an element that is hidden on the page. For Example, when a user tries to perform click action on the sub-heading in the drop-down list.

  4. ElementNotSelectableException

    When an element is present but disable and not clickable on the web page.

  5. InvalidSelectorException

    When a selected locator or selector does not return web element values. This exception occurs when a user does not select the web element and enters an invalid locator path.

  6. NoAlertPresentException

    When the web driver does not find any alert or switching to the invalid alert which is not present on the web page.

  7. NoSuchFrameException

    When the frame is not loaded on the web page or web driver switches to an invalid frame which is not present on the web page.

  8. NoSuchWindowException

    When the selected window is not loaded and the web driver is switching to the wrong window.

  9. SessionNotFoundException

    When session Id is not present and inactive in the given active session list.

  10. StaleElementReferenceException

    Stale means no longer. This exception occurs when a reference variable is no longer on the DOM page. This happens due to the following reasons:

    • The current page has refresh before locating to element on the page.
    • Element is removed from the page.
  11. TimeoutException

    When a selected command takes more time than the given time limit to return the value.

  12. NoSuchAttributeException

    When the attribute of an element is not finding on the web page.

  13. JavascriptException

    It usually happens when a command executed by a user fails. For Example, a user tries to execute the script with an unidentified variable.

  14. ScreenshotException

    When it is impossible or script fails to capture the selected screen.

A Windows 10 certification can help you prove your skills in the Microsoft Windows 10 operating system and it can improve your chances of getting hired. StudySection offers a Windows 10 certification exam for beginner level as well as professional level individuals in the Microsoft Windows 10 operating system.

Leave a Reply

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