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
,LocationContext
,WebStorage
,Interactive
,JavascriptExecutor
,HasLogEvents
,PrintsPage
,SearchContext
,TakesScreenshot
,HasVirtualAuthenticator
,WebDriver
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
- 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 = trueNote 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 ClassesModifier and TypeClassDescriptionstatic final class
Builder class to createXltChromeDriver
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
ConstructorsConstructorDescriptionCreates a newXltChromeDriver
instance with default settings.XltChromeDriver
(ChromeDriverService service) Creates a newXltChromeDriver
instance with the given parameters and otherwise default settings.XltChromeDriver
(ChromeDriverService service, ChromeOptions options) Creates a newXltChromeDriver
instance with the given parameters and otherwise default settings.XltChromeDriver
(ChromeDriverService service, ChromeOptions options, boolean screenless) Creates a newXltChromeDriver
instance with the given parameters.XltChromeDriver
(ChromeOptions options) Creates a newXltChromeDriver
instance with the given parameters and otherwise default settings.XltChromeDriver
(ChromeOptions options, boolean screenless) Creates a newXltChromeDriver
instance with the given parameters and otherwise default settings. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
quit()
static XltChromeDriver.Builder
Returns aXltChromeDriver.Builder
object to create a newXltChromeDriver
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.devtools.HasDevTools
getDevTools
Methods inherited from interface org.openqa.selenium.HasDownloads
requireDownloadsEnabled
-
Constructor Details
-
XltChromeDriver
public XltChromeDriver()Creates a newXltChromeDriver
instance with default settings. -
XltChromeDriver
Creates a newXltChromeDriver
instance with the given parameters and otherwise default settings.- Parameters:
options
- the options to use (may benull
)
-
XltChromeDriver
Creates a newXltChromeDriver
instance 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
Creates a newXltChromeDriver
instance with the given parameters and otherwise default settings.- Parameters:
service
- the driver service (may benull
)
-
XltChromeDriver
Creates a newXltChromeDriver
instance with the given parameters and otherwise default settings.- Parameters:
service
- the driver service (may benull
)options
- the options to use (may benull
)
-
XltChromeDriver
Creates a newXltChromeDriver
instance 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 Details
-
close
public void close()- Specified by:
close
in interfaceWebDriver
- Overrides:
close
in classRemoteWebDriver
-
quit
public void quit()- Specified by:
quit
in interfaceWebDriver
- Overrides:
quit
in classChromiumDriver
-
xltBuilder
Returns aXltChromeDriver.Builder
object to create a newXltChromeDriver
instance.- Returns:
- the builder
-