1.

What are some commonly encountered exceptions in selenium?

Answer»

Some of the COMMONLY seen exceptions in selenium are-

  1. NoSuchElementException -  You get this exception when the locator mentioned in the Selenium Program code is unable to find the web element on the web page.
  2. ElementNotVisibleException - You get this exception when a WebDriver is ABLE to locate web elements on the current webpage but it is not visible on the screen.
  3. NoAlertPresentException - You get this exception when we try to switch to an alert but the TARGETED alert is not present.
  4. InvalidElementStateException - You get this exception when the state of an element is not appropriate for the desired action.
  5. NoSuchAttributeException - You get this exception when you are trying to fetch an attribute's value but the attribute is not correct.
  6. WebDriverException - You get this exception when there is an issue with driver instance preventing it from GETTING launched.
  7. NoSuchFrameException - You get this exception when you try to switch to a frame but the targeted frame is not present.
  8. NoSuchWindowException - You get this exception when you try to switch to a window but the targeted window is not present.
  9. UnexpectedAlertPresentException - You get this exception when an unexpected alert blocks the normal interaction of the driver.
  10. TimeoutException - You get this exception when a COMMAND execution gets a timeout.


Discussion

No Comment Found