Class AllBy


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

    Find elements which comply to ALL the specified By objects.
    This mechanism used to locate elements within a document using a series of lookups. This class will find all DOM elements that matches any of the locators in sequence. For example:

    List<WebElement> myList = driver.findElements(AllBy.all(By.xpath("path1"),By.xpath("path2"));

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

    Since:
    0.1
    Author:
    Nir Gallner
    See Also:
    ByAll, AnyBy, ElementBy, InputBy, NotBy, 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

      • all

        public static AllBy all​(org.openqa.selenium.By... bys)
        Parameters:
        bys - list of By objects to be used when findElements is called.}
        Returns:
        By object with all the locators in it
      • findElements

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