Class NotBy


  • public class NotBy
    extends org.openqa.selenium.By

    Find elements which do NOT has a specific By locator.
    This mechanism used to locate elements within a document using a single lookup. This class will find ALL DOM elements which does not contain the search specified. For example:

    List<WebElement> myList = driver.findElements(NotBy.not(By.xpath("path1"));

    will find all elements that does not match xpath "path1" and return a List of WebElement.

    Since:
    0.1
    Author:
    Nir Gallner
    See Also:
    ByAll, AnyBy, ElementBy, InputBy, AllBy, TdBy
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.openqa.selenium.By

        org.openqa.selenium.By.ByClassName, org.openqa.selenium.By.ByCssSelector, org.openqa.selenium.By.ById, org.openqa.selenium.By.ByLinkText, org.openqa.selenium.By.ByName, org.openqa.selenium.By.ByPartialLinkText, org.openqa.selenium.By.ByTagName, org.openqa.selenium.By.ByXPath, org.openqa.selenium.By.Remotable
    • Method Detail

      • not

        public static org.openqa.selenium.By not​(org.openqa.selenium.By by)
        Parameters:
        by - By object to be used when findElements is called.}
        Returns:
        By object with the locator to avoid
      • findElements

        public List<org.openqa.selenium.WebElement> findElements​(org.openqa.selenium.SearchContext context)
        Specified by:
        findElements in class org.openqa.selenium.By