Package com.xceptance.xlt.api.webdriver

# Class XltDriver

java.lang.Object
com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
com.xceptance.xlt.api.webdriver.XltDriver

All Implemented Interfaces:
  `HasCapabilities`, `Interactive`, `JavascriptExecutor`, `SearchContext`, `WebDriver`

public final class XltDriver extends com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
Extended version of `HtmlUnitDriver` which just uses the XLT web client. XltDriver can act as a full replacement for the HtmlUnitDriver and offers additional capabilities which are important for load testing.

This class is final to avoid changes to the web client which would render the XLT functionality obsolete.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver

  `com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver.ElementsMap, com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver.HtmlUnitWebDriverOptions, com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver.JavaScriptResultsCollection`

  ## Nested classes/interfaces inherited from interface org.openqa.selenium.WebDriver

  `WebDriver.Navigation, WebDriver.Options, WebDriver.TargetLocator, WebDriver.Timeouts, WebDriver.Window`

- ## Field Summary

  ### Fields inherited from class com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver

  `BROWSER_LANGUAGE_CAPABILITY, DOWNLOAD_IMAGES_CAPABILITY, JAVASCRIPT_ENABLED`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `XltDriver()`
  Constructs a new instance.
  `XltDriver(boolean enableJavaScript)`
  Constructs a new instance with the specified JavaScript support.
  `XltDriver(BrowserVersion version)`
  Constructs a new instance with the specified browser version.
  `XltDriver(BrowserVersion version, boolean enableJavaScript)`
  Constructs a new instance with the specified browser version and JavaScript support.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `WebElement`
  `findElement(By by)`
  `List<WebElement>`
  `findElements(By by)`
  `void`
  `get(String url)`
  `String`
  `getCurrentUrl()`
  `String`
  `getPageSource()`
  `String`
  `getTitle()`
  `WebClient`
  `getWebClient()`
  Returns the underlying `WebClient` instance to work with it directly.
  `String`
  `getWindowHandle()`
  `Set<String>`
  `getWindowHandles()`
  `WebDriver.Options`
  `manage()`
  `WebDriver.Navigation`
  `navigate()`
  `protected WebClient`
  `newWebClient(BrowserVersion version)`
  Returns a new web client instance to be used by this driver.
  `void`
  `quit()`

  ### Methods inherited from class com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver

  `assertElementNotStale, click, doubleClick, executeAsyncScript, executeScript, findElement, findElements, get, getAlert, getBrowserVersion, getCapabilities, getCurrentWindow, getElementsMap, getKeyboard, getMouse, implicitlyWaitFor, isAcceptInsecureCerts, isDownloadImages, isJavascriptEnabled, modifyWebClient, mouseDown, mouseMove, mouseUp, openNewWindow, perform, resetInputState, runAsync, sendKeys, setAcceptInsecureCerts, setAutoProxy, setCurrentWindow, setDownloadImages, setExecutor, setHTTPProxy, setJavascriptEnabled, setProxy, setProxySettings, setSocksProxy, setSocksProxy, submit, switchTo, switchToDefaultContentOfWindow, toWebElement, toWebElement`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface org.openqa.selenium.JavascriptExecutor

  `executeScript, getPinnedScripts, pin, unpin`

- ## Constructor Details

  - ### XltDriver

    public XltDriver()
    Constructs a new instance. What browser version will be used and whether JavaScript will be enabled is configured in the XLT settings.

  - ### XltDriver

    public XltDriver(boolean enableJavaScript)
    Constructs a new instance with the specified JavaScript support. What browser version will be used is configured in the XLT settings.
    Parameters:
      `enableJavaScript` - whether to enable JavaScript support or not

  - ### XltDriver

    public XltDriver(BrowserVersion version)
    Constructs a new instance with the specified browser version. Whether JavaScript will be enabled is configured in the XLT settings.
    Parameters:
      `version` - the browser version to use

  - ### XltDriver

    public XltDriver(BrowserVersion version, boolean enableJavaScript)
    Constructs a new instance with the specified browser version and JavaScript support.
    Parameters:
      `version` - the browser version to use
      `enableJavaScript` - whether to enable JavaScript support or not

- ## Method Details

  - ### newWebClient

    protected WebClient newWebClient(BrowserVersion version)
    Returns a new web client instance to be used by this driver. Overwritten to return an enhanced XLT web client instead of HtmlUnit's web client.
    Overrides:
      `newWebClient` in class `com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver`
    Parameters:
      `version` - which browser to emulate
    Returns:
      the web client

  - ### getWebClient

    public WebClient getWebClient()
    Returns the underlying `WebClient` instance to work with it directly. Mostly used for testing purposes of the framework itself.
    Overrides:
      `getWebClient` in class `com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver`
    Returns:
      the web client

  - ### quit

    public void quit()
    Specified by:
      `quit` in interface `WebDriver`
    Overrides:
      `quit` in class `com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver`

  - ### findElement

    public WebElement findElement(By by)
    Specified by:
      `findElement` in interface `SearchContext`
    Specified by:
      `findElement` in interface `WebDriver`
    Overrides:
      `findElement` in class `com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver`

  - ### findElements

    public List<WebElement> findElements(By by)
    Specified by:
      `findElements` in interface `SearchContext`
    Specified by:
      `findElements` in interface `WebDriver`
    Overrides:
      `findElements` in class `com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver`

  - ### navigate

    public WebDriver.Navigation navigate()
    Specified by:
      `navigate` in interface `WebDriver`
    Overrides:
      `navigate` in class `com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver`

  - ### manage

    public WebDriver.Options manage()
    Specified by:
      `manage` in interface `WebDriver`
    Overrides:
      `manage` in class `com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver`

  - ### close

    public void close()
    Specified by:
      `close` in interface `WebDriver`
    Overrides:
      `close` in class `com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver`

  - ### getPageSource

    public String getPageSource()
    Specified by:
      `getPageSource` in interface `WebDriver`
    Overrides:
      `getPageSource` in class `com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver`

  - ### getWindowHandle

    public String getWindowHandle()
    Specified by:
      `getWindowHandle` in interface `WebDriver`
    Overrides:
      `getWindowHandle` in class `com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver`

  - ### getWindowHandles

    public Set<String> getWindowHandles()
    Specified by:
      `getWindowHandles` in interface `WebDriver`
    Overrides:
      `getWindowHandles` in class `com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver`

  - ### getCurrentUrl

    public String getCurrentUrl()
    Specified by:
      `getCurrentUrl` in interface `WebDriver`
    Overrides:
      `getCurrentUrl` in class `com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver`

  - ### get

    public void get(String url)
    Specified by:
      `get` in interface `WebDriver`
    Overrides:
      `get` in class `com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver`

  - ### getTitle

    public String getTitle()
    Specified by:
      `getTitle` in interface `WebDriver`
    Overrides:
      `getTitle` in class `com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver`