Class ByChained

  • All Implemented Interfaces:
    java.io.Serializable

    public class ByChained
    extends By
    implements java.io.Serializable
    Mechanism used to locate elements within a document using a series of other lookups. This class will find all DOM elements that matches each of the locators in sequence, e.g.
     driver.findElements(new ByChained(by1, by2))
     
    will find all elements that match by2 and appear under an element that matches by1.
    See Also:
    Serialized Form
    • Constructor Detail

      • ByChained

        public ByChained​(By... bys)
    • Method Detail

      • findElement

        public WebElement findElement​(SearchContext context)
        Description copied from class: By
        Find a single element. Override this method if necessary.
        Overrides:
        findElement in class By
        Parameters:
        context - A context to use to find the element.
        Returns:
        The WebElement that matches the selector.
      • findElements

        public java.util.List<WebElement> findElements​(SearchContext context)
        Description copied from class: By
        Find many elements.
        Specified by:
        findElements in class By
        Parameters:
        context - A context to use to find the elements.
        Returns:
        A list of WebElements matching the selector.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class By