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:
HasCasting,HasCdp,HasLaunchApp,HasNetworkConditions,HasPermissions,HasDevTools,HasAuthentication,HasCapabilities,LocationContext,WebStorage,Interactive,JavascriptExecutor,HasLogEvents,NetworkConnection,PrintsPage,SearchContext,TakesScreenshot,HasVirtualAuthenticator,WebDriver
public class XltChromeDriver extends ChromeDriver
An extendedChromeDriverwhich 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
- DomLoading
- DomInteractive
- DomComplete
- DomContentLoadedEventStart
- DomContentLoadedEventEnd
- LoadEventStart
- LoadEventEnd
- FirstPaint
- FirstContentfulPaint
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, thexvfbbinary 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 classXltChromeDriver.BuilderBuilder class to createXltChromeDriverinstances.-
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.mobile.NetworkConnection
NetworkConnection.ConnectionType
-
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 newXltChromeDriverinstance with default settings.XltChromeDriver(ChromeDriverService service)Creates a newXltChromeDriverinstance with the given parameters and otherwise default settings.XltChromeDriver(ChromeDriverService service, ChromeOptions options)Creates a newXltChromeDriverinstance with the given parameters and otherwise default settings.XltChromeDriver(ChromeDriverService service, ChromeOptions options, boolean screenless)Creates a newXltChromeDriverinstance with the given parameters.XltChromeDriver(ChromeOptions options)Creates a newXltChromeDriverinstance with the given parameters and otherwise default settings.XltChromeDriver(ChromeOptions options, boolean screenless)Creates a newXltChromeDriverinstance with the given parameters and otherwise default settings.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidquit()static XltChromeDriver.BuilderxltBuilder()Returns aXltChromeDriver.Builderobject to create a newXltChromeDriverinstance.-
Methods inherited from class org.openqa.selenium.chrome.ChromeDriver
builder
-
Methods inherited from class org.openqa.selenium.chromium.ChromiumDriver
deleteNetworkConditions, executeCdpCommand, getCapabilities, getCastIssueMessage, getCastSinks, getLocalStorage, getNetworkConditions, getNetworkConnection, getSessionStorage, launchApp, location, maybeGetDevTools, onLogEvent, register, selectCastSink, setFileDetector, setLocation, setNetworkConditions, setNetworkConnection, setPermission, startDesktopMirroring, startTabMirroring, stopCasting
-
Methods inherited from class org.openqa.selenium.remote.RemoteWebDriver
addVirtualAuthenticator, execute, execute, execute, executeAsyncScript, executeScript, findElement, findElement, findElements, findElements, findElements, get, getCommandExecutor, getCurrentUrl, getElementConverter, getErrorHandler, getExecuteMethod, getFileDetector, getPageSource, getScreenshotAs, getSessionId, getTitle, getWindowHandle, getWindowHandles, log, manage, navigate, perform, print, removeVirtualAuthenticator, resetInputState, setCommandExecutor, 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.devtools.HasDevTools
getDevTools
-
Methods inherited from interface org.openqa.selenium.JavascriptExecutor
executeScript, getPinnedScripts, pin, unpin
-
-
-
-
Constructor Detail
-
XltChromeDriver
public XltChromeDriver()
Creates a newXltChromeDriverinstance with default settings.
-
XltChromeDriver
public XltChromeDriver(ChromeOptions options)
Creates a newXltChromeDriverinstance with the given parameters and otherwise default settings.- Parameters:
options- the options to use (may benull)
-
XltChromeDriver
public XltChromeDriver(ChromeOptions options, boolean screenless)
Creates a newXltChromeDriverinstance with the given parameters and otherwise default settings.- Parameters:
options- the options to use (may benull)screenless- whether to run in headless mode (using Xvfb)
-
XltChromeDriver
public XltChromeDriver(ChromeDriverService service)
Creates a newXltChromeDriverinstance with the given parameters and otherwise default settings.- Parameters:
service- the driver service (may benull)
-
XltChromeDriver
public XltChromeDriver(ChromeDriverService service, ChromeOptions options)
Creates a newXltChromeDriverinstance with the given parameters and otherwise default settings.- Parameters:
service- the driver service (may benull)options- the options to use (may benull)
-
XltChromeDriver
public XltChromeDriver(ChromeDriverService service, ChromeOptions options, boolean screenless)
Creates a newXltChromeDriverinstance with the given parameters.- Parameters:
service- the driver service (may benull)options- the options to use (may benull)screenless- whether to run in headless mode (using Xvfb)
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfaceWebDriver- Overrides:
closein classRemoteWebDriver
-
quit
public void quit()
- Specified by:
quitin interfaceWebDriver- Overrides:
quitin classChromiumDriver
-
xltBuilder
public static XltChromeDriver.Builder xltBuilder()
Returns aXltChromeDriver.Builderobject to create a newXltChromeDriverinstance.- Returns:
- the builder
-
-