Package org.openqa.selenium
Interface SearchContext
-
- All Known Subinterfaces:
WebDriver
,WebElement
- All Known Implementing Classes:
ChromeDriver
,ChromiumDriver
,EdgeDriver
,EventFiringWebDriver
,FirefoxDriver
,InternetExplorerDriver
,RemoteWebDriver
,RemoteWebElement
,SafariDriver
public interface SearchContext
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WebElement
findElement(By by)
Find the firstWebElement
using the given method.java.util.List<WebElement>
findElements(By by)
Find all elements within the current context using the given mechanism.
-
-
-
Method Detail
-
findElements
java.util.List<WebElement> findElements(By by)
Find all elements within the current context using the given mechanism.- Parameters:
by
- The locating mechanism to use- Returns:
- A list of all
WebElement
s, or an empty list if nothing matches - See Also:
By
-
findElement
WebElement findElement(By by)
Find the firstWebElement
using the given method.- Parameters:
by
- The locating mechanism- Returns:
- The first matching element on the current context
- Throws:
NoSuchElementException
- If no matching elements are found
-
-