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 ofHtmlUnitDriver
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.JavaScriptResultsCollection
-
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 XltDriver()
Constructs 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
WebElement
findElement(By by)
java.util.List<WebElement>
findElements(By by)
void
get(java.lang.String url)
java.lang.String
getCurrentUrl()
java.lang.String
getPageSource()
java.lang.String
getTitle()
WebClient
getWebClient()
Returns the underlyingWebClient
instance to work with it directly.java.lang.String
getWindowHandle()
java.util.Set<java.lang.String>
getWindowHandles()
WebDriver.Options
manage()
WebDriver.Navigation
navigate()
protected WebClient
newWebClient(BrowserVersion version)
Returns a new web client instance to be used by this driver.void
quit()
-
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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openqa.selenium.JavascriptExecutor
executeScript, getPinnedScripts, pin, unpin
-
-
-
-
Constructor Detail
-
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
public XltDriver(BrowserVersion version)
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
public XltDriver(BrowserVersion version, boolean enableJavaScript)
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 Detail
-
newWebClient
protected WebClient newWebClient(BrowserVersion version)
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:
newWebClient
in classcom.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
- Parameters:
version
- which browser to emulate- Returns:
- the web client
-
getWebClient
public WebClient getWebClient()
Returns the underlyingWebClient
instance to work with it directly. Mostly used for testing purposes of the framework itself.- Overrides:
getWebClient
in classcom.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
- Returns:
- the web client
-
quit
public void quit()
-
findElement
public WebElement findElement(By by)
- Specified by:
findElement
in interfaceSearchContext
- Specified by:
findElement
in interfaceWebDriver
- Overrides:
findElement
in classcom.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
-
findElements
public java.util.List<WebElement> findElements(By by)
- Specified by:
findElements
in interfaceSearchContext
- Specified by:
findElements
in interfaceWebDriver
- Overrides:
findElements
in classcom.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
-
navigate
public WebDriver.Navigation navigate()
-
manage
public WebDriver.Options manage()
-
close
public void close()
-
getPageSource
public java.lang.String getPageSource()
- Specified by:
getPageSource
in interfaceWebDriver
- Overrides:
getPageSource
in classcom.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
-
getWindowHandle
public java.lang.String getWindowHandle()
- Specified by:
getWindowHandle
in interfaceWebDriver
- Overrides:
getWindowHandle
in classcom.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
-
getWindowHandles
public java.util.Set<java.lang.String> getWindowHandles()
- Specified by:
getWindowHandles
in interfaceWebDriver
- Overrides:
getWindowHandles
in classcom.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
-
getCurrentUrl
public java.lang.String getCurrentUrl()
- Specified by:
getCurrentUrl
in interfaceWebDriver
- Overrides:
getCurrentUrl
in classcom.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
-
get
public void get(java.lang.String url)
-
-