3 Common
Selenium Exceptions
Rex Jones II
NoSuchElementException 1
extends NotFoundException
The exception is returned when Selenium WebDriver cannot locate the specified
element.
Thrown by [Link](By by)
Thrown by [Link](By by)
Rex Jones II
2
StaleElementReferenceException
extends WebDriverException
Indicates that a reference to an element is now “stale”.
The element no longer appears on the DOM of the page
Rex Jones II
3
TimeoutException
extends WebDriverException
Thrown when a command does not complete in enough time
Rex Jones II
Honorable Mention
Selenium Exceptions
Rex Jones II
ElementNotInteractableException
extends InvalidElementStateException
Thrown to indicate that although a WebElement is present on the DOM, the
WebElement is not in a state for interaction.
This includes an element that is not displayed or whose center point cannot be
scrolled into the viewport.
Rex Jones II
NoSuchFrameException
extends NotFoundException
The exception is returned when Selenium WebDriver cannot locate the specified
frame/iframe.
Thrown by [Link]().frame(int frameIndex)
Thrown by [Link](String frameName)
Rex Jones II
NoAlertPresentException
extends NotFoundException
Indicates that a user has tried to access an alert when one is not present
Rex Jones II
NoSuchWindowException
extends NotFoundException
The exception is returned when Selenium WebDriver cannot find the specified
window or tab.
Thrown by [Link]().window(String windowName)
Rex Jones II