public class ByAll extends By implements Serializable
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.
By.ByClassName, By.ByCssSelector, By.ById, By.ByLinkText, By.ByName, By.ByPartialLinkText, By.ByTagName, By.ByXPath| 限定符和类型 | 方法和说明 |
|---|---|
WebElement |
findElement(SearchContext context)
Find a single element.
|
List<WebElement> |
findElements(SearchContext context)
Find many elements.
|
String |
toString() |
public ByAll(By... bys)
public WebElement findElement(SearchContext context)
ByfindElement 在类中 Bycontext - A context to use to find the elementpublic List<WebElement> findElements(SearchContext context)
ByfindElements 在类中 Bycontext - A context to use to find the element