Package com.xceptance.xlt.api.webdriver

# Class XltChromeDriver

java.lang.Object
org.openqa.selenium.remote.RemoteWebDriver
org.openqa.selenium.chromium.ChromiumDriver
org.openqa.selenium.chrome.ChromeDriver
com.xceptance.xlt.api.webdriver.XltChromeDriver

All Implemented Interfaces:
  `HasBiDi`, `HasCasting`, `HasCdp`, `HasLaunchApp`, `HasNetworkConditions`, `HasPermissions`, `HasDevTools`, `HasFederatedCredentialManagement`, `HasAuthentication`, `HasCapabilities`, `HasDownloads`, `org.openqa.selenium.html5.LocationContext`, `org.openqa.selenium.html5.WebStorage`, `Interactive`, `JavascriptExecutor`, `HasLogEvents`, `PrintsPage`, `SearchContext`, `TakesScreenshot`, `HasVirtualAuthenticator`, `WebDriver`

public class XltChromeDriver extends ChromeDriver
An extended `ChromeDriver` which allows to record data about requests and browser events or to run Chrome 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
- FirstPaint
- FirstContentfulPaint

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.chrome_clientperformance.screenless = true

Note that for the headless mode to work, the `xvfb` binary must be installed on the target machine and must be findable via the PATH 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`
  `XltChromeDriver.Builder`
  Builder class to create `XltChromeDriver` instances.

  ## 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`

- ## Field Summary

  ### Fields inherited from class org.openqa.selenium.chromium.ChromiumDriver

  `casting, cdp, IS_CHROMIUM_BROWSER`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `XltChromeDriver()`
  Creates a new `XltChromeDriver` instance with default settings.
  `XltChromeDriver(ChromeDriverService service)`
  Creates a new `XltChromeDriver` instance with the given parameters and otherwise default settings.
  `XltChromeDriver(ChromeDriverService service, ChromeOptions options)`
  Creates a new `XltChromeDriver` instance with the given parameters and otherwise default settings.
  `XltChromeDriver(ChromeDriverService service, ChromeOptions options, boolean screenless)`
  Creates a new `XltChromeDriver` instance with the given parameters.
  `XltChromeDriver(ChromeOptions options)`
  Creates a new `XltChromeDriver` instance with the given parameters and otherwise default settings.
  `XltChromeDriver(ChromeOptions options, boolean screenless)`
  Creates a new `XltChromeDriver` instance with the given parameters and otherwise default settings.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `void`
  `quit()`
  `static XltChromeDriver.Builder`
  `xltBuilder()`
  Returns a `XltChromeDriver.Builder` object to create a new `XltChromeDriver` instance.

  ### Methods inherited from class org.openqa.selenium.chrome.ChromeDriver

  `builder`

  ### Methods inherited from class org.openqa.selenium.chromium.ChromiumDriver

  `deleteNetworkConditions, executeCdpCommand, executeScript, getCapabilities, getCastIssueMessage, getCastSinks, getLocalStorage, getNetworkConditions, getPinnedScripts, getSessionStorage, launchApp, location, maybeGetBiDi, maybeGetDevTools, onLogEvent, pin, register, selectCastSink, setFileDetector, setLocation, setNetworkConditions, setPermission, startDesktopMirroring, startTabMirroring, stopCasting, unpin`

  ### 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, startSession, 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.HasAuthentication

  `register`

  ### Methods inherited from interface org.openqa.selenium.bidi.HasBiDi

  `getBiDi`

  ### Methods inherited from interface org.openqa.selenium.devtools.HasDevTools

  `getDevTools`

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

  `requireDownloadsEnabled`

- ## Constructor Details

  - ### XltChromeDriver

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

  - ### XltChromeDriver

    public XltChromeDriver(ChromeOptions options)
    Creates a new `XltChromeDriver` instance with the given parameters and otherwise default settings.
    Parameters:
      `options` - the options to use (may be `null`)

  - ### XltChromeDriver

    public XltChromeDriver(ChromeOptions options, boolean screenless)
    Creates a new `XltChromeDriver` instance with the given parameters and otherwise default settings.
    Parameters:
      `options` - the options to use (may be `null`)
      `screenless` - whether to run in headless mode (using Xvfb)

  - ### XltChromeDriver

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

  - ### XltChromeDriver

    public XltChromeDriver(ChromeDriverService service, ChromeOptions options)
    Creates a new `XltChromeDriver` instance with the given parameters and otherwise default settings.
    Parameters:
      `service` - the driver service (may be `null`)
      `options` - the options to use (may be `null`)

  - ### XltChromeDriver

    public XltChromeDriver(ChromeDriverService service, ChromeOptions options, boolean screenless)
    Creates a new `XltChromeDriver` instance with the given parameters.
    Parameters:
      `service` - the driver service (may be `null`)
      `options` - the options to use (may be `null`)
      `screenless` - whether to run in headless mode (using Xvfb)

- ## Method Details

  - ### 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 `ChromiumDriver`

  - ### xltBuilder

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