Class ByAll
- java.lang.Object
-
- org.openqa.selenium.By
-
- org.openqa.selenium.support.pagefactory.ByAll
-
- All Implemented Interfaces:
java.io.Serializable
public class ByAll extends By implements java.io.Serializable
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, e.g.driver.findElements(new ByAll(by1, by2))
will find all elements that match by1 and then all elements that match by2. This means that the list of elements returned may not be in document order.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openqa.selenium.By
By.ByClassName, By.ByCssSelector, By.ById, By.ByLinkText, By.ByName, By.ByPartialLinkText, By.ByTagName, By.ByXPath, By.Remotable
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WebElement
findElement(SearchContext context)
Find a single element.java.util.List<WebElement>
findElements(SearchContext context)
Find many elements.java.lang.String
toString()
-
Methods inherited from class org.openqa.selenium.By
className, cssSelector, equals, getJavascriptExecutor, getWebDriver, hashCode, id, linkText, name, partialLinkText, tagName, xpath
-
-
-
-
Constructor Detail
-
ByAll
public ByAll(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 classBy
- 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 classBy
- Parameters:
context
- A context to use to find the elements.- Returns:
- A list of WebElements matching the selector.
-
-