Class HtmlUnitElementFinder

java.lang.Object
org.openqa.selenium.htmlunit.HtmlUnitElementFinder

public class HtmlUnitElementFinder extends Object
Author:
Martin Bartoš, Ronald Brill
  • Method Details

    • findElement

      public org.openqa.selenium.WebElement findElement(HtmlUnitDriver driver, org.openqa.selenium.By locator)
      Finds a single WebElement on the current page using the specified locator.
      Parameters:
      driver - the HtmlUnitDriver to search with
      locator - the By locator 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 all WebElement instances on the current page matching the specified locator.
      Parameters:
      driver - the HtmlUnitDriver to search with
      locator - the By locator to use
      Returns:
      a List of matching WebElement instances; may be empty if none found
    • findElement

      public org.openqa.selenium.WebElement findElement(HtmlUnitWebElement element, org.openqa.selenium.By locator)
      Finds a single WebElement within the context of the specified parent element.
      Parameters:
      element - the parent HtmlUnitWebElement to search within
      locator - the By locator 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 all WebElement instances within the context of the specified parent element.
      Parameters:
      element - the parent HtmlUnitWebElement to search within
      locator - the By locator to use
      Returns:
      a List of matching child WebElement instances; may be empty if none found