org.openqa.selenium.support.pagefactory
Class ByChained

java.lang.Object
  extended by org.openqa.selenium.By
      extended by org.openqa.selenium.support.pagefactory.ByChained

public class ByChained
extends By

Mechanism used to locate elements within a document using a series of other lookups. This class will find all DOM elements that much each of the locators in sequence, eg.

 driver.findElements(new ByChained(by1, by2))
 
will find all elements that match by2 and appear under an element that matches by1.


Constructor Summary
ByChained(By... bys)
           
 
Method Summary
 WebElement findElement(SearchContext context)
          Find a single element.
 List<WebElement> findElements(SearchContext context)
          Find many elements.
 String toString()
           
 
Methods inherited from class org.openqa.selenium.By
className, cssSelector, equals, hashCode, id, linkText, name, partialLinkText, tagName, xpath
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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 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 element
Returns:
A list of WebElements matching the selector

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.