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
,HasDevTools
,HasFederatedCredentialManagement
,HasContext
,HasExtensions
,HasFullPageScreenshot
,HasCapabilities
,HasDownloads
,WebStorage
,Interactive
,JavascriptExecutor
,PrintsPage
,SearchContext
,TakesScreenshot
,HasVirtualAuthenticator
,WebDriver
public final class XltFirefoxDriver extends FirefoxDriver
An extendedFirefoxDriver
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
- DomLoading
- DomInteractive
- DomComplete
- DomContentLoadedEventStart
- DomContentLoadedEventEnd
- LoadEventStart
- LoadEventEnd
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, thexvfb
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 class
XltFirefoxDriver.Builder
Builder class to createXltFirefoxDriver
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 newXltFirefoxDriver
instance with default settings.XltFirefoxDriver(FirefoxOptions options)
Creates a newXltFirefoxDriver
instance with the given parameters and otherwise default settings.XltFirefoxDriver(FirefoxOptions options, boolean screenless)
Creates a newXltFirefoxDriver
instance with the given parameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
quit()
protected void
startSession(Capabilities desiredCapabilities)
static XltFirefoxDriver.Builder
xltBuilder()
Returns aXltFirefoxDriver.Builder
object to create a newXltFirefoxDriver
instance.-
Methods inherited from class org.openqa.selenium.firefox.FirefoxDriver
builder, getBiDi, getCapabilities, getContext, getDevTools, getFullPageScreenshotAs, getLocalStorage, getSessionStorage, installExtension, installExtension, maybeGetBiDi, maybeGetDevTools, 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, perform, print, removeVirtualAuthenticator, resetCooldown, resetInputState, 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 Detail
-
XltFirefoxDriver
public XltFirefoxDriver()
Creates a newXltFirefoxDriver
instance with default settings.
-
XltFirefoxDriver
public XltFirefoxDriver(FirefoxOptions options)
Creates a newXltFirefoxDriver
instance with the given parameters and otherwise default settings.- Parameters:
options
- the driver options (may benull
)
-
XltFirefoxDriver
public XltFirefoxDriver(FirefoxOptions options, boolean screenless)
Creates a newXltFirefoxDriver
instance with the given parameters.- Parameters:
options
- the driver options (may benull
)screenless
- whether to run the browser in screenless mode (overrides the "xlt.webDriver.firefox_clientperformance.screenless" setting in the configuration)
-
-
Method Detail
-
startSession
protected void startSession(Capabilities desiredCapabilities)
- Overrides:
startSession
in classRemoteWebDriver
-
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 classFirefoxDriver
-
xltBuilder
public static XltFirefoxDriver.Builder xltBuilder()
Returns aXltFirefoxDriver.Builder
object to create a newXltFirefoxDriver
instance.- Returns:
- the builder
-
-