0% found this document useful (0 votes)
9 views9 pages

3 Common Selenium Exceptions

Uploaded by

pratikolte942
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views9 pages

3 Common Selenium Exceptions

Uploaded by

pratikolte942
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

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 WebDriver.findElement(By by)

 Thrown by WebElement.findElement(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 WebDriver.switchTo().frame(int frameIndex)

 Thrown by WebDriver.switchTo.frame(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 WebDriver.switchTo().window(String windowName)

Rex Jones II

You might also like