Package com.xceptance.xlt.api.webdriver
Class XltDriver
java.lang.Object
com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
com.xceptance.xlt.api.webdriver.XltDriver
- All Implemented Interfaces:
HasCapabilities,Interactive,JavascriptExecutor,SearchContext,WebDriver
public final class XltDriver
extends com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
Extended version of
HtmlUnitDriver which just uses the XLT web client. XltDriver can act as a full
replacement for the HtmlUnitDriver and offers additional capabilities which are important for load testing.
This class is final to avoid changes to the web client which would render the XLT functionality obsolete.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver.ElementsMap, com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver.HtmlUnitWebDriverOptions, com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver.JavaScriptResultsCollectionNested 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 com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
BROWSER_LANGUAGE_CAPABILITY, DOWNLOAD_IMAGES_CAPABILITY, JAVASCRIPT_ENABLED -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new instance.XltDriver(boolean enableJavaScript) Constructs a new instance with the specified JavaScript support.XltDriver(BrowserVersion version) Constructs a new instance with the specified browser version.XltDriver(BrowserVersion version, boolean enableJavaScript) Constructs a new instance with the specified browser version and JavaScript support. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()findElement(By by) findElements(By by) voidgetTitle()Returns the underlyingWebClientinstance to work with it directly.manage()navigate()protected WebClientnewWebClient(BrowserVersion version) Returns a new web client instance to be used by this driver.voidquit()Methods inherited from class com.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
assertElementNotStale, click, doubleClick, executeAsyncScript, executeScript, findElement, findElements, get, getAlert, getBrowserVersion, getCapabilities, getCurrentWindow, getElementsMap, getKeyboard, getMouse, implicitlyWaitFor, isAcceptInsecureCerts, isDownloadImages, isJavascriptEnabled, modifyWebClient, mouseDown, mouseMove, mouseUp, openNewWindow, perform, resetInputState, runAsync, sendKeys, setAcceptInsecureCerts, setAutoProxy, setCurrentWindow, setDownloadImages, setExecutor, setHTTPProxy, setJavascriptEnabled, setProxy, setProxySettings, setSocksProxy, setSocksProxy, submit, switchTo, switchToDefaultContentOfWindow, toWebElement, toWebElementMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openqa.selenium.JavascriptExecutor
executeScript, getPinnedScripts, pin, unpin
-
Constructor Details
-
XltDriver
public XltDriver()Constructs a new instance. What browser version will be used and whether JavaScript will be enabled is configured in the XLT settings. -
XltDriver
public XltDriver(boolean enableJavaScript) Constructs a new instance with the specified JavaScript support. What browser version will be used is configured in the XLT settings.- Parameters:
enableJavaScript- whether to enable JavaScript support or not
-
XltDriver
Constructs a new instance with the specified browser version. Whether JavaScript will be enabled is configured in the XLT settings.- Parameters:
version- the browser version to use
-
XltDriver
Constructs a new instance with the specified browser version and JavaScript support.- Parameters:
version- the browser version to useenableJavaScript- whether to enable JavaScript support or not
-
-
Method Details
-
newWebClient
Returns a new web client instance to be used by this driver. Overwritten to return an enhanced XLT web client instead of HtmlUnit's web client.- Overrides:
newWebClientin classcom.xceptance.xlt.engine.xltdriver.HtmlUnitDriver- Parameters:
version- which browser to emulate- Returns:
- the web client
-
getWebClient
Returns the underlyingWebClientinstance to work with it directly. Mostly used for testing purposes of the framework itself.- Overrides:
getWebClientin classcom.xceptance.xlt.engine.xltdriver.HtmlUnitDriver- Returns:
- the web client
-
quit
public void quit() -
findElement
- Specified by:
findElementin interfaceSearchContext- Specified by:
findElementin interfaceWebDriver- Overrides:
findElementin classcom.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
-
findElements
- Specified by:
findElementsin interfaceSearchContext- Specified by:
findElementsin interfaceWebDriver- Overrides:
findElementsin classcom.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
-
manage
-
close
public void close() -
getPageSource
- Specified by:
getPageSourcein interfaceWebDriver- Overrides:
getPageSourcein classcom.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
-
getWindowHandle
- Specified by:
getWindowHandlein interfaceWebDriver- Overrides:
getWindowHandlein classcom.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
-
getWindowHandles
- Specified by:
getWindowHandlesin interfaceWebDriver- Overrides:
getWindowHandlesin classcom.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
-
getCurrentUrl
- Specified by:
getCurrentUrlin interfaceWebDriver- Overrides:
getCurrentUrlin classcom.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
-
get
-
getTitle
-