Class WebDriverFactory

java.lang.Object
net.thucydides.core.webdriver.WebDriverFactory

public class WebDriverFactory
extends java.lang.Object
Provides an instance of a supported WebDriver. When you instantiate a WebDriver instance for Firefox or Chrome, it opens a new browser.
Author:
johnsmart
  • Field Details

  • Constructor Details

  • Method Details

    • withEnvironmentVariables

      public WebDriverFactory withEnvironmentVariables​(EnvironmentVariables environmentVariables)
    • newInstanceOf

      public org.openqa.selenium.WebDriver newInstanceOf​(SupportedWebDriver driverType)
      Create a new WebDriver instance of a given type.
    • getClassFor

      public java.lang.Class<? extends org.openqa.selenium.WebDriver> getClassFor​(SupportedWebDriver driverType)
    • usesSauceLabs

      public boolean usesSauceLabs()
    • newWebdriverInstance

      protected org.openqa.selenium.WebDriver newWebdriverInstance​(java.lang.Class<? extends org.openqa.selenium.WebDriver> driverClass)
      This method is synchronized because multiple webdriver instances can be created in parallel. However, they may use common system resources such as ports, so may potentially interfere with each other.
    • newWebdriverInstance

      protected org.openqa.selenium.WebDriver newWebdriverInstance​(java.lang.Class<? extends org.openqa.selenium.WebDriver> driverClass, java.lang.String options, EnvironmentVariables environmentVariables)
    • getDriverFrom

      public static java.lang.String getDriverFrom​(EnvironmentVariables environmentVariables, java.lang.String defaultDriver)
    • getDriverFrom

      public static java.lang.String getDriverFrom​(EnvironmentVariables environmentVariables)
    • getBrowserStackDriverFrom

      public static java.lang.String getBrowserStackDriverFrom​(EnvironmentVariables environmentVariables)
    • getSaucelabsDriverFrom

      public static java.lang.String getSaucelabsDriverFrom​(EnvironmentVariables environmentVariables)
    • setupFixtureServices

      public void setupFixtureServices() throws FixtureException
      Throws:
      FixtureException
    • shutdownFixtureServices

      public void shutdownFixtureServices()
    • setTimeouts

      public void setTimeouts​(org.openqa.selenium.WebDriver proxiedDriver, java.time.Duration implicitTimeout)
    • currentTimeoutFor

      public java.time.Duration currentTimeoutFor​(org.openqa.selenium.WebDriver proxiedDriver)
    • resetTimeouts

      public java.time.Duration resetTimeouts​(org.openqa.selenium.WebDriver proxiedDriver)
    • getDefaultImplicitTimeout

      public java.time.Duration getDefaultImplicitTimeout()
    • isAlive

      public static boolean isAlive​(org.openqa.selenium.WebDriver driver)
    • isNotAlive

      public static boolean isNotAlive​(org.openqa.selenium.WebDriver driver)
    • releaseTimoutFor

      public void releaseTimoutFor​(org.openqa.selenium.WebDriver driverInstance)