Class AnyBy


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

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

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

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

    Since:
    0.1
    Author:
    Nir Gallner
    See Also:
    ByAll, AllBy, 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
    • Constructor Summary

      Constructors 
      Constructor Description
      AnyBy​(org.openqa.selenium.By... bys)  
    • Constructor Detail

      • AnyBy

        public AnyBy​(org.openqa.selenium.By... bys)
    • Method Detail

      • any

        public static org.openqa.selenium.By any​(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