Package org.openqa.selenium.htmlunit
Class HtmlUnitElementFinder
- java.lang.Object
-
- org.openqa.selenium.htmlunit.HtmlUnitElementFinder
-
public class HtmlUnitElementFinder extends Object
- Author:
- Martin Bartoš, Ronald Brill
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHtmlUnitElementFinder.FindByClassNameLocator strategy for finding elements by their CSS class name.static classHtmlUnitElementFinder.FindByCssSelectorLocator strategy for finding elements using CSS selectors.static classHtmlUnitElementFinder.FindByIDLocator strategy for finding elements by theiridattribute.static classHtmlUnitElementFinder.FindByLinkTextLocator strategy for finding anchor elements (<a>) by their exact visible text.static classHtmlUnitElementFinder.FindByNameLocator strategy for finding elements by theirnameattribute.static classHtmlUnitElementFinder.FindByPartialLinkTextLocator strategy for finding anchor elements (<a>) by partial visible text.static classHtmlUnitElementFinder.FindByRelativeLocatorLocator implementation that handlesRelativeLocator.RelativeByselectors for finding elements relative to other elements.static classHtmlUnitElementFinder.FindByTagNameLocator strategy for finding elements by their tag name.static classHtmlUnitElementFinder.FindByXPathLocator strategy for finding elements using XPath expressions.static classHtmlUnitElementFinder.HtmlUnitElementLocatorBase class for element locators used byHtmlUnitElementFinder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.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 Detail
-
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
-
-