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.HtmlUnitDriverExtended version ofHtmlUnitDriverwhich 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 voidclose()WebElementfindElement(By by)java.util.List<WebElement>findElements(By by)voidget(java.lang.String url)java.lang.StringgetCurrentUrl()java.lang.StringgetPageSource()java.lang.StringgetTitle()WebClientgetWebClient()Returns the underlyingWebClientinstance to work with it directly.java.lang.StringgetWindowHandle()java.util.Set<java.lang.String>getWindowHandles()WebDriver.Optionsmanage()WebDriver.Navigationnavigate()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
-
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:
newWebClientin classcom.xceptance.xlt.engine.xltdriver.HtmlUnitDriver- Parameters:
version- which browser to emulate- Returns:
- the web client
-
getWebClient
public WebClient 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
public WebElement findElement(By by)
- Specified by:
findElementin interfaceSearchContext- Specified by:
findElementin interfaceWebDriver- Overrides:
findElementin classcom.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
-
findElements
public java.util.List<WebElement> findElements(By by)
- Specified by:
findElementsin interfaceSearchContext- Specified by:
findElementsin interfaceWebDriver- Overrides:
findElementsin 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:
getPageSourcein interfaceWebDriver- Overrides:
getPageSourcein classcom.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
-
getWindowHandle
public java.lang.String getWindowHandle()
- Specified by:
getWindowHandlein interfaceWebDriver- Overrides:
getWindowHandlein classcom.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
-
getWindowHandles
public java.util.Set<java.lang.String> getWindowHandles()
- Specified by:
getWindowHandlesin interfaceWebDriver- Overrides:
getWindowHandlesin classcom.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
-
getCurrentUrl
public java.lang.String getCurrentUrl()
- Specified by:
getCurrentUrlin interfaceWebDriver- Overrides:
getCurrentUrlin classcom.xceptance.xlt.engine.xltdriver.HtmlUnitDriver
-
get
public void get(java.lang.String url)
-
-