Class HtmlUnitTargetLocator

  • All Implemented Interfaces:
    org.openqa.selenium.WebDriver.TargetLocator

    public class HtmlUnitTargetLocator
    extends Object
    implements org.openqa.selenium.WebDriver.TargetLocator
    Provides target–location functionality for HtmlUnitDriver, allowing navigation to frames, windows, alerts, and other browser contexts.

    This implementation backs the WebDriver.TargetLocator interface for HtmlUnit-based drivers.

    Author:
    Martin Bartoš, Ronald Brill
    • Constructor Detail

      • HtmlUnitTargetLocator

        public HtmlUnitTargetLocator​(HtmlUnitDriver driver)
        Creates a new HtmlUnitTargetLocator bound to the specified HtmlUnitDriver.
        Parameters:
        driver - the driver instance for which this target locator will perform context switching; must not be null
    • Method Detail

      • newWindow

        public org.openqa.selenium.WebDriver newWindow​(org.openqa.selenium.WindowType typeHint)
        Specified by:
        newWindow in interface org.openqa.selenium.WebDriver.TargetLocator
      • frame

        public org.openqa.selenium.WebDriver frame​(int index)
        Specified by:
        frame in interface org.openqa.selenium.WebDriver.TargetLocator
      • frame

        public org.openqa.selenium.WebDriver frame​(String nameOrId)
        Specified by:
        frame in interface org.openqa.selenium.WebDriver.TargetLocator
      • frame

        public org.openqa.selenium.WebDriver frame​(org.openqa.selenium.WebElement frameElement)
        Specified by:
        frame in interface org.openqa.selenium.WebDriver.TargetLocator
      • parentFrame

        public org.openqa.selenium.WebDriver parentFrame()
        Specified by:
        parentFrame in interface org.openqa.selenium.WebDriver.TargetLocator
      • window

        public org.openqa.selenium.WebDriver window​(String windowId)
        Specified by:
        window in interface org.openqa.selenium.WebDriver.TargetLocator
      • defaultContent

        public org.openqa.selenium.WebDriver defaultContent()
        Specified by:
        defaultContent in interface org.openqa.selenium.WebDriver.TargetLocator
      • activeElement

        public org.openqa.selenium.WebElement activeElement()
        Specified by:
        activeElement in interface org.openqa.selenium.WebDriver.TargetLocator
      • alert

        public org.openqa.selenium.Alert alert()
        Specified by:
        alert in interface org.openqa.selenium.WebDriver.TargetLocator