Package net.thucydides.core.webdriver
Class WebDriverFactory
java.lang.Object
net.thucydides.core.webdriver.WebDriverFactory
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWebDriverFactory(EnvironmentVariables environmentVariables) WebDriverFactory(EnvironmentVariables environmentVariables, FixtureProviderService fixtureProviderService) WebDriverFactory(EnvironmentVariables environmentVariables, FixtureProviderService fixtureProviderService, TimeoutStack timeoutStack, CloseBrowser closeBrowser) -
Method Summary
Modifier and TypeMethodDescriptioncurrentTimeoutFor(org.openqa.selenium.WebDriver proxiedDriver) Class<? extends org.openqa.selenium.WebDriver>getClassFor(SupportedWebDriver driverType) static StringgetDriverFrom(EnvironmentVariables environmentVariables) static StringgetDriverFrom(EnvironmentVariables environmentVariables, String defaultDriver) static booleanisAlive(org.openqa.selenium.WebDriver driver) static booleanisNotAlive(org.openqa.selenium.WebDriver driver) org.openqa.selenium.WebDrivernewInstanceOf(SupportedWebDriver driverType) Create a new WebDriver instance of a given type.protected org.openqa.selenium.WebDrivernewWebdriverInstance(Class<? extends org.openqa.selenium.WebDriver> driverClass) This method is synchronized because multiple webdriver instances can be created in parallel.protected org.openqa.selenium.WebDrivernewWebdriverInstance(Class<? extends org.openqa.selenium.WebDriver> driverClass, String options, EnvironmentVariables environmentVariables) voidreleaseTimoutFor(org.openqa.selenium.WebDriver driverInstance) resetTimeouts(org.openqa.selenium.WebDriver proxiedDriver) voidsetTimeouts(org.openqa.selenium.WebDriver proxiedDriver, Duration implicitTimeout) voidvoidbooleanwithEnvironmentVariables(EnvironmentVariables environmentVariables)
-
Field Details
-
DEFAULT_DRIVER
- See Also:
-
REMOTE_DRIVER
- See Also:
-
-
Constructor Details
-
WebDriverFactory
public WebDriverFactory() -
WebDriverFactory
-
WebDriverFactory
public WebDriverFactory(EnvironmentVariables environmentVariables, FixtureProviderService fixtureProviderService) -
WebDriverFactory
public WebDriverFactory(EnvironmentVariables environmentVariables, FixtureProviderService fixtureProviderService, TimeoutStack timeoutStack, CloseBrowser closeBrowser)
-
-
Method Details
-
withEnvironmentVariables
-
newInstanceOf
Create a new WebDriver instance of a given type. -
getClassFor
-
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) -
getDriverFrom
-
getDriverFrom
-
setupFixtureServices
- Throws:
FixtureException
-
shutdownFixtureServices
public void shutdownFixtureServices() -
setTimeouts
-
currentTimeoutFor
-
resetTimeouts
-
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)
-