Home page

Tuesday, September 10, 2019

Types of exceptions in Selenium WebDriver

Types of exceptions in Selenium
  1. NoSuchElementException ---> When driver failed to locate element from DOM.
  2. NoSuchWindowException/NoSuchFrameException ---> While Switching between windows/frames failed to find mentioned window/frame
  3. NoAlertFoundException ---> Written alert Accept/Dismiss code at the wrong place
  4. TimeOutException ---> When given command failed to complete task in alloted time
  5. ElementNotVisibleException ---> Element is present in the DOM but not visible.
  6. InvalidSessionIDException ---> When session id gets expired
  7. JavaScriptException ---> When javascript executor contains incorrect JavaScript code
  8. StaleElementException ---> Once element stopped appearing in the DOM then StaleElementException.
  9. UnsupportedOperationException---> By mistake used method(deselectAll()) of Select class for single select dropdown. deselectAll() can only be used for multi-select dropdown
  10. SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 75 ---> It is due to browser version and chrome driver version compatibility mismatch. If your browser is updated with latest version than check compatible chrome driver version. Replace old chrome driver with compatible one.

org.openqa.selenium.nosuchelementexception



org.openqa.selenium.NoSuchWindowException

org.openqa.selenium.NoSuchFrameException

org.openqa.selenium.noalertpresentexception

org.openqa.selenium.TimeoutException

org.openqa.selenium.elementnotvisibleexception

selenium.common.exceptions.invalidsessionidexception

org.openqa.selenium.javascriptexception

org.openqa.selenium.staleelementreferenceexception

java.lang.UnsupportedOperationException

org.openqa.selenium.SessionNotCreatedException

If you are aware of any other types of exception in Selenium then write in the comment. 

No comments:

Post a Comment