Interface ConfigurationProperties

All Known Subinterfaces:
Configuration, FluentControl, FluentPageControl, IFluentAdapter
All Known Implementing Classes:
AnnotationConfiguration, BaseFluentHook, BaseHook, ComposedConfiguration, ConfigurationDefaults, ContainerFluentControl, DefaultFluentContainer, FluentAdapter, FluentControlImpl, FluentCucumberTest, FluentDriver, FluentPage, FluentStandalone, FluentStandaloneRunnable, FluentTest, FluentTest, FluentTestNg, FluentTestNgSpringTest, FluentTestRunnerAdapter, IsolatedTest, ProgrammaticConfiguration, PropertiesBackendConfiguration, WaitHook

public interface ConfigurationProperties
FluentLenium can be configured in many ways through configuration properties.

It's possible to define those properties using:

  • Overrides of JavaBean property getters of the test class. (ie. override getWebDriver())
  • JavaBean property setters of the test class. (ie. call ConfigurationMutator.setWebDriver(String))
  • System properties of the Java Environment, passed using -D on the command line. Property names must be prefixed with fluentlenium.. (ie. Launch test with
    -Dfluentlenium.webDriver=chrome
    )
  • Environment Variable of the Operating System. Property names must be prefixed with fluentlenium.. (ie: EXPORT fluentlenium.webDriver=chrome)
  • FluentConfiguration annotation on test class to configure.
     
    
     {@literal @FluentConfiguration(webDriver="chrome")} public class SomeFluentTest extends FluentTest {
     ....
     }
     
     
  • Java Properties file located at
    /fluentlenium.properties
    in the classpath
     
     webDriver=chrome
     ...
     
     
  • ConfigurationProperties custom implementation specified by
    configurationDefaults
    property.
     
     public class CustomConfigurationDefaults extends ConfigurationDefaults {
     {@literal @Override} public String getWebDriver() {
     return "chrome";
     }
     }
    
     $ cat fluentlenium.properties
     configurationDefaults=org.your.package.CustomConfigurationDefaults
     
     
This list of way to configure fluentlenium is ordered by priority. If a value is defined in an element, lower ways to define it will be ignored.

You may implement additionnal ways to read configuration property by implementing another ConfigurationFactory and set your configuration factory class in the

configurationFactory
property.
See Also:
  • Method Details

    • getWebDriver

      String getWebDriver()
      webDriver
      property.

      Sets the WebDriver type to use.

      When FluentLenium needs to create a new WebDriver instance, it calls IFluentAdapter.newWebDriver() which delegates to WebDriversRegistryImpl.newWebDriver(String, Capabilities, ConfigurationProperties) registry using the value stored in webDriver and capabilities property.

      Possible values are "firefox", "chrome", "ie", "edge", "htmlunit", "safari", "opera", "remote" or any class name implementing WebDriver or any name that is defined in the `@FactoryName` annotation of a `WebDriverFactory` implementation.

      Default value is "firefox".

      Returns:
      webDriver property value
      See Also:
    • getRemoteUrl

      String getRemoteUrl()
      remoteUrl
      property. Sets the remoteUrl for "remote" webDriver.
      Returns:
      remoteUrl property value
      See Also:
      • RemoteWebDriver
    • getCapabilities

      org.openqa.selenium.Capabilities getCapabilities()
      capabilities
      property. Sets the Capabilities to use, as a JSON Object or a URL pointing to a JSON Object. Default value is "null".
      Returns:
      Capabilities property value
      See Also:
    • getBaseUrl

      String getBaseUrl()
      baseUrl
      property. Sets the base URL used to build absolute URL when relative URL is given to FluentControl.goTo(String). Default value is null.
      Returns:
      baseUrl property value
    • getDriverLifecycle

      driverLifecycle
      property. Sets the lifecycle of the WebDriver. WebDriver is fully managed by FluentLenium, so you should never create or quit a WebDriver by yourself. Please keep in mind that this configures when drivers are created and exited at runtime, but it does not deal with concurrency of your tests. Default value is METHOD.
      Returns:
      driverLifecycle property value
    • getBrowserTimeout

      Long getBrowserTimeout()
      browserTimeout
      property. Sets the maximum amount of time when the browser should start responding to the WebDriver. Default value is 60 seconds.
      Returns:
      long
    • getBrowserTimeoutRetries

      Integer getBrowserTimeoutRetries()
      browserTimeoutRetries
      property. Sets the maximum number of retries for failed WebDriver because of browserTimeout issues. Default value is 2 times.
      Returns:
      Integer
    • getDeleteCookies

      Boolean getDeleteCookies()
      deleteCookies
      property. When using CLASS or JVM
      driverLifecycle
      configuration property, allow to delete cookies between each test. Default value is false.
      Returns:
      deleteCookies property value.
    • getPageLoadTimeout

      Long getPageLoadTimeout()
      pageLoadTimeout
      property. Sets the amount of time in millisecond to wait for a page load to complete before throwing an error. If the timeout is negative, page loads can be indefinite. Default value is null.
      Returns:
      pageLoadTimeout property value
      See Also:
      • WebDriver.Timeouts.pageLoadTimeout(long, java.util.concurrent.TimeUnit)
    • getImplicitlyWait

      Long getImplicitlyWait()
      implicitlyWait
      property. Specifies the amount of time in millisecond the driver should wait when searching for an element if it is not immediately present. Default value is null.
      Returns:
      implicitlyWait property value
      See Also:
      • WebDriver.Timeouts.implicitlyWait(long, java.util.concurrent.TimeUnit)
    • getScriptTimeout

      Long getScriptTimeout()
      scriptTimeout
      property. Sets the amount of time in millisecond to wait for an asynchronous script to finish execution before throwing an error. If the timeout is negative, then the script will be allowed to run indefinitely. Default value is null.
      Returns:
      scriptTimeout property value
      See Also:
      • WebDriver.Timeouts.setScriptTimeout(long, java.util.concurrent.TimeUnit)
    • getAwaitAtMost

      Long getAwaitAtMost()
      awaitAtMost
      property. Sets the default timeout in millisecond when using FluentControl.await() or Wait hook.
      Returns:
      awaitTimeout property value
      See Also:
    • getAwaitPollingEvery

      Long getAwaitPollingEvery()
      awaitPollingEvery
      property. Sets the default polling frequency in millisecond when using FluentControl.await() or Wait hook.
      Returns:
      awaitPollingEvery property value
      See Also:
    • getEventsEnabled

      Boolean getEventsEnabled()
      eventsEnabled
      property. Enables FluentControl.events() by wrapping the WebDriver in EventFiringWebDriver. Default value is true.
      Returns:
      eventsEnabled property value.
    • getScreenshotPath

      String getScreenshotPath()
      screenshotPath
      property. Sets the filesystem path where screenshot will be saved when calling FluentControl.takeScreenshot() or FluentControl.takeScreenshot(String). Default value is null.
      Returns:
      screenshotPath property value
    • getScreenshotMode

      screenshotMode
      property. Sets the trigger mode of screenshots. Can be {AUTOMATIC_ON_FAIL} to take screenshot when the test fail or {MANUAL}. Default value is null.
      Returns:
      screenshotMode property value.
      See Also:
    • getHtmlDumpPath

      String getHtmlDumpPath()
      htmlDumpPath
      property. Sets the filesystem path where screenshot will be saved when calling FluentControl.takeHtmlDump() or FluentControl.takeHtmlDump(String). Default value is null.
      Returns:
      htmlDumpPath property value
    • getHtmlDumpMode

      htmlDumpMode
      property. Sets the trigger mode of htmlDump. Can be {AUTOMATIC_ON_FAIL} to take html dump when the test fail or {MANUAL}. Default value is null.
      Returns:
      htmlDumpMode property value.
      See Also:
    • getConfigurationDefaults

      Class<? extends ConfigurationProperties> getConfigurationDefaults()
      configurationDefaults
      property. Set this to a class implementing ConfigurationProperties to provide the default values of the configuration properties. Default value is ConfigurationDefaults
      Returns:
      Custom ConfigurationProperties instance with default values.
    • getConfigurationFactory

      Class<? extends ConfigurationFactory> getConfigurationFactory()
      configurationFactory
      property. Set this to a class implementing ConfigurationFactory to customize the ways properties are read. This allow to configure properties from sources that are not supported by default FluentLenium. Default value is DefaultConfigurationFactory class.
      Returns:
      Custom ConfigurationFactory class.
    • getCustomProperty

      String getCustomProperty (String propertyName)
      Get custom property value.
      Parameters:
      propertyName - name of the property
      Returns:
      property value