Class WebDriverFactory


  • public class WebDriverFactory
    extends 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
    • Method Detail

      • newInstanceOf

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

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

        public boolean usesSauceLabs()
      • newWebdriverInstance

        protected org.openqa.selenium.WebDriver newWebdriverInstance​(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​(Class<? extends org.openqa.selenium.WebDriver> driverClass,
                                                                     String options,
                                                                     EnvironmentVariables environmentVariables)
      • shutdownFixtureServices

        public void shutdownFixtureServices()
      • setTimeouts

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

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

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

        public 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)