Package org.openqa.selenium.htmlunit
Class HtmlUnitElementFinder
java.lang.Object
org.openqa.selenium.htmlunit.HtmlUnitElementFinder
- Author:
- Martin Bartoš, Ronald Brill
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classLocator strategy for finding elements by their CSS class name.static classLocator strategy for finding elements using CSS selectors.static classLocator strategy for finding elements by theiridattribute.static classLocator strategy for finding anchor elements (<a>) by their exact visible text.static classLocator strategy for finding elements by theirnameattribute.static classLocator strategy for finding anchor elements (<a>) by partial visible text.static classLocator implementation that handlesRelativeLocator.RelativeByselectors for finding elements relative to other elements.static classLocator strategy for finding elements by their tag name.static classLocator strategy for finding elements using XPath expressions.static classBase class for element locators used byHtmlUnitElementFinder. -
Method Summary
Modifier and TypeMethodDescriptionorg.openqa.selenium.WebElementfindElement(HtmlUnitDriver driver, org.openqa.selenium.By locator) Finds a singleWebElementon the current page using the specified locator.org.openqa.selenium.WebElementfindElement(HtmlUnitWebElement element, org.openqa.selenium.By locator) Finds a singleWebElementwithin the context of the specified parent element.List<org.openqa.selenium.WebElement>findElements(HtmlUnitDriver driver, org.openqa.selenium.By locator) Finds allWebElementinstances on the current page matching the specified locator.List<org.openqa.selenium.WebElement>findElements(HtmlUnitWebElement element, org.openqa.selenium.By locator) Finds allWebElementinstances within the context of the specified parent element.
-
Method Details
-
findElement
public org.openqa.selenium.WebElement findElement(HtmlUnitDriver driver, org.openqa.selenium.By locator) Finds a singleWebElementon the current page using the specified locator.- Parameters:
driver- theHtmlUnitDriverto search withlocator- theBylocator to use- Returns:
- the first matching
WebElement - Throws:
org.openqa.selenium.NoSuchElementException- if no matching element is found
-
findElements
public List<org.openqa.selenium.WebElement> findElements(HtmlUnitDriver driver, org.openqa.selenium.By locator) Finds allWebElementinstances on the current page matching the specified locator.- Parameters:
driver- theHtmlUnitDriverto search withlocator- theBylocator to use- Returns:
- a
Listof matchingWebElementinstances; may be empty if none found
-
findElement
public org.openqa.selenium.WebElement findElement(HtmlUnitWebElement element, org.openqa.selenium.By locator) Finds a singleWebElementwithin the context of the specified parent element.- Parameters:
element- the parentHtmlUnitWebElementto search withinlocator- theBylocator to use- Returns:
- the first matching child
WebElement - Throws:
org.openqa.selenium.NoSuchElementException- if no matching element is found
-
findElements
public List<org.openqa.selenium.WebElement> findElements(HtmlUnitWebElement element, org.openqa.selenium.By locator) Finds allWebElementinstances within the context of the specified parent element.- Parameters:
element- the parentHtmlUnitWebElementto search withinlocator- theBylocator to use- Returns:
- a
Listof matching childWebElementinstances; may be empty if none found
-