top of page
Major WebDriwer Exceptions

This section refers exclusively to automated testing, which assumes knowledge of one of the high-level modern programming languages. And within the framework of our course it is given only in an introductory format. This list may be useful to you when passing the practical level assignment. Below is a list of the most common Webdriwer exceptions:

  • ElementNotVisibleException — throwing this exception means that although the element is present in the DOM, it is invisible and therefore impossible to interact with.

  • IllegalLocatorException — occurs when By cannot process the arguments passed to it. The most common occurrence is when using a distinguished class name in By.className ().

  • StaleElementReferenceException — occurs when a link to an item being referenced is no longer valid.

  • MoveTargetOutOfBoundsException — called if an element that is off-screen is passed to the moveToElement (WebElement toElement) method, as well as in some cases when the driver cannot hit the moving element (for example, when the page is in the process of scrolling (jquery) - it is worth waiting for it to complete and only after that refer to the elements)

  • SessionNotCreatedException — this exception means that the session cannot be created. Thrown when using ‘requiredCapabilities’ for remote launch if no browser with the “required” properties is found.

  • TimeoutException — called when a command does not complete in a sufficient amount of time. The gap is specified by the function parameter, or is set by default.

  • UnhandledAlertException — occurs when unexpected modal dialog boxes appear.

  • UnsupportedCommandException — an exception means that the command used by the remote web driver is not supported.

  • InvalidCookieDomainException — called when trying to add a cookie for a domain other than the current one.

  • UnableToSetCookieException — generated when the driver cannot set a cookie for some reason.

 

"Not Found" group exceptions

 

  • NoAlertPresentException — generated when an attempt is made to transfer control to a dialog box that does not exist at the moment.

  • NoSuchElementException — called by the findElement (By by) method if an element with the given selector is not found on the page.

  • InvalidSelectorException — an exception is thrown by the findElement (By by) method when the specified search selector does not return a WebElement. Currently, this exception only occurs when using xpath - when there are syntax errors in the xpath expression or the expression does not point to a WebElement (for example, "count (.// span)").

  • NoSuchFrameException — occurs when the WebDriver.switchTo (). frame (int frameIndex) and WebDriver.switchTo (). frame (String frameName) methods are running, if a frame with the specified parameter is not found. Read more about working with frames in this article.

  • NoSuchWindowException — occurs when there is no window with the specified name (WebDriver.switchTo (). window (String windowName)). Articles about working with windows:

  • Facebook Social Icon
  • Instagram
  • Vkontakte Social Icon
  • YouTube Social  Icon
  • mail_icon

© 2021 Galaxy QA Academy. All rights are protected.

bottom of page