Package com.xceptance.xlt.api.tests
Class AbstractWebDriverTestCase
java.lang.Object
com.xceptance.xlt.api.tests.AbstractTestCase
com.xceptance.xlt.api.tests.AbstractWebDriverTestCase
- Direct Known Subclasses:
AbstractScriptTestCase,AbstractWebDriverScriptTestCase
A super class for
WebDriver-based test cases.
Current features:
- auto-manages
WebDriverinstance creation and disposal - the type of
WebDriverto be used for the test can be changed by configuration
For available configuration options, see the corresponding properties with key xlt.webDriver.* in the
XLT test suite settings.
For special purposes, the WebDriver instance can also be explicitly set programmatically, in which case any
automatic clean-up will be disabled.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidQuits theWebDriverinstance, but only if it was created implicitly.Returns theWebDriverinstance to use for the test.voidsetWebDriver(WebDriver webDriver) Sets theWebDriverinstance to use for the test.Methods inherited from class com.xceptance.xlt.api.tests.AbstractTestCase
__setup, __tearDown, getEffectiveKey, getProperty, getProperty, getProperty, getProperty, getSimpleName, getTestDataSet, getTestName, reconfigureStartUrl, setTestDataSet, setTestName, setTestName, setUp, tearDown
-
Constructor Details
-
AbstractWebDriverTestCase
public AbstractWebDriverTestCase()
-
-
Method Details
-
getWebDriver
Returns theWebDriverinstance to use for the test. If none was set so far viasetWebDriver(WebDriver), a new instance will be created, and this instance will also be returned for subsequent calls togetWebDriver(). What instance will be created depends on the configuration.- Returns:
- the web driver
-
setWebDriver
Sets theWebDriverinstance to use for the test. Note that when explicitly setting the driver instance via this method, you also have to close it by yourself. Furthermore, you can set a driver instance only once.- Parameters:
webDriver- the web driver to use
-
__quitWebDriver
public final void __quitWebDriver()Quits theWebDriverinstance, but only if it was created implicitly. If set explicitly, the caller is responsible to quit the driver instance properly.
-