Package com.xceptance.xlt.api.webdriver

# Class XltFirefoxDriver

java.lang.Object
org.openqa.selenium.remote.RemoteWebDriver
org.openqa.selenium.firefox.FirefoxDriver
com.xceptance.xlt.api.webdriver.XltFirefoxDriver

All Implemented Interfaces:
  `HasBiDi`, `HasFederatedCredentialManagement`, `HasContext`, `HasExtensions`, `HasFullPageScreenshot`, `HasCapabilities`, `HasDownloads`, `org.openqa.selenium.html5.WebStorage`, `Interactive`, `JavascriptExecutor`, `PrintsPage`, `SearchContext`, `TakesScreenshot`, `HasVirtualAuthenticator`, `WebDriver`

public final class XltFirefoxDriver extends FirefoxDriver
An extended `FirefoxDriver` which allows to record data about requests and browser events or to run Firefox with a virtual display.

Collected Data

To collect data about requests and browser events, a special extension will be installed into the browser. This extension provides access to the following information:

- for requests:
  - start and total processing time
  - URL, status code, response content type
  - sent and received bytes
  - network timings (DNS time, connect time, send time, server busy time, receive time, time to first byte, time to last byte)
- for browser events:
  - the time after which the event occurred when loading a new page

The following browser events will be reported:

- DomLoading
- DomInteractive
- DomComplete
- DomContentLoadedEventStart
- DomContentLoadedEventEnd
- LoadEventStart
- LoadEventEnd

All this data will be available in the XLT load test report. Request data is shown in the Requests section and browser events can be found in the Page Load Timings section.

Headless Mode

On Unix machines, it is possible to run the browser in "headless" mode, i.e. with a virtual display. To put the browser in headless mode, simply set the following property in the configuration of your test project:

     xlt.webDriver.firefox_clientperformance.screenless = true

Note that for the headless mode to work, the `xvfb` binary must be installed on the target machine and must be located in one of the directories listed in the PATH environment variable. If this is not the case, the browser will be run with the default display.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final class`
  `XltFirefoxDriver.Builder`
  Builder class to create `XltFirefoxDriver` instances.

  ## Nested classes/interfaces inherited from class org.openqa.selenium.firefox.FirefoxDriver

  `FirefoxDriver.SystemProperty`

  ## Nested classes/interfaces inherited from class org.openqa.selenium.remote.RemoteWebDriver

  `RemoteWebDriver.RemoteTargetLocator, RemoteWebDriver.RemoteWebDriverOptions, RemoteWebDriver.When`

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

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

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `XltFirefoxDriver()`
  Creates a new `XltFirefoxDriver` instance with default settings.
  `XltFirefoxDriver(FirefoxOptions options)`
  Creates a new `XltFirefoxDriver` instance with the given parameters and otherwise default settings.
  `XltFirefoxDriver(FirefoxOptions options, boolean screenless)`
  Creates a new `XltFirefoxDriver` instance with the given parameters.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `void`
  `quit()`
  `protected void`
  `startSession(Capabilities desiredCapabilities)`
  `static XltFirefoxDriver.Builder`
  `xltBuilder()`
  Returns a `XltFirefoxDriver.Builder` object to create a new `XltFirefoxDriver` instance.

  ### Methods inherited from class org.openqa.selenium.firefox.FirefoxDriver

  `builder, getBiDi, getCapabilities, getContext, getFullPageScreenshotAs, getLocalStorage, getSessionStorage, installExtension, installExtension, maybeGetBiDi, setContext, setFileDetector, uninstallExtension`

  ### Methods inherited from class org.openqa.selenium.remote.RemoteWebDriver

  `addVirtualAuthenticator, deleteDownloadableFiles, downloadFile, execute, execute, execute, executeAsyncScript, executeScript, findElement, findElements, findElements, get, getCommandExecutor, getCurrentUrl, getDownloadableFiles, getElementConverter, getErrorHandler, getExecuteMethod, getFederatedCredentialManagementDialog, getFileDetector, getPageSource, getScreenshotAs, getSessionId, getTitle, getWindowHandle, getWindowHandles, log, manage, navigate, network, perform, print, removeVirtualAuthenticator, resetCooldown, resetInputState, script, setCommandExecutor, setDelayEnabled, setElementConverter, setErrorHandler, setFoundBy, setLogLevel, setSessionId, switchTo, toString`

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

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

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

  `requireDownloadsEnabled`

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

  `executeScript, getPinnedScripts, pin, unpin`

- ## Constructor Details

  - ### XltFirefoxDriver

    public XltFirefoxDriver()
    Creates a new `XltFirefoxDriver` instance with default settings.

  - ### XltFirefoxDriver

    public XltFirefoxDriver(FirefoxOptions options)
    Creates a new `XltFirefoxDriver` instance with the given parameters and otherwise default settings.
    Parameters:
      `options` - the driver options (may be `null`)

  - ### XltFirefoxDriver

    public XltFirefoxDriver(FirefoxOptions options, boolean screenless)
    Creates a new `XltFirefoxDriver` instance with the given parameters.
    Parameters:
      `options` - the driver options (may be `null`)
      `screenless` - whether to run the browser in screenless mode (overrides the "xlt.webDriver.firefox_clientperformance.screenless" setting in the configuration)

- ## Method Details

  - ### startSession

    protected void startSession(Capabilities desiredCapabilities)
    Overrides:
      `startSession` in class `RemoteWebDriver`

  - ### close

    public void close()
    Specified by:
      `close` in interface `WebDriver`
    Overrides:
      `close` in class `RemoteWebDriver`

  - ### quit

    public void quit()
    Specified by:
      `quit` in interface `WebDriver`
    Overrides:
      `quit` in class `FirefoxDriver`

  - ### xltBuilder

    public static XltFirefoxDriver.Builder xltBuilder()
    Returns a `XltFirefoxDriver.Builder` object to create a new `XltFirefoxDriver` instance.
    Returns:
      the builder