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 for WebDriver-based test cases.

Current features:

  • auto-manages WebDriver instance creation and disposal
  • the type of WebDriver to 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 Details

    • AbstractWebDriverTestCase

      public AbstractWebDriverTestCase()
  • Method Details

    • getWebDriver

      public WebDriver getWebDriver()
      Returns the WebDriver instance to use for the test. If none was set so far via setWebDriver(WebDriver), a new instance will be created, and this instance will also be returned for subsequent calls to getWebDriver(). What instance will be created depends on the configuration.
      Returns:
      the web driver
    • setWebDriver

      public void setWebDriver(WebDriver webDriver)
      Sets the WebDriver instance 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 the WebDriver instance, but only if it was created implicitly. If set explicitly, the caller is responsible to quit the driver instance properly.