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
public abstract class AbstractWebDriverTestCase extends AbstractTestCase
A super class forWebDriver-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
WebDriverinstance can also be explicitly set programmatically, in which case any automatic clean-up will be disabled.
-
-
Constructor Summary
Constructors Constructor Description AbstractWebDriverTestCase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void__quitWebDriver()Quits theWebDriverinstance, but only if it was created implicitly.WebDrivergetWebDriver()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
-
-
-
-
Method Detail
-
getWebDriver
public WebDriver 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
public void setWebDriver(WebDriver webDriver)
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.
-
-