net.thucydides.core.webdriver
Class WebDriverFactory

Package class diagram package WebDriverFactory
java.lang.Object
  extended by net.thucydides.core.webdriver.WebDriverFactory

public class WebDriverFactory
extends Object

Provides an instance of a supported WebDriver. When you instanciate a Webdriver instance for Firefox or Chrome, it opens a new browser.

Author:
johnsmart

Field Summary
static String DEFAULT_DRIVER
           
static String REMOTE_DRIVER
           
 
Constructor Summary
WebDriverFactory()
           
WebDriverFactory(EnvironmentVariables environmentVariables)
           
WebDriverFactory(WebdriverInstanceFactory webdriverInstanceFactory, EnvironmentVariables environmentVariables)
           
WebDriverFactory(WebdriverInstanceFactory webdriverInstanceFactory, EnvironmentVariables environmentVariables, FirefoxProfileEnhancer firefoxProfileEnhancer)
           
WebDriverFactory(WebdriverInstanceFactory webdriverInstanceFactory, EnvironmentVariables environmentVariables, FirefoxProfileEnhancer firefoxProfileEnhancer, FixtureProviderService fixtureProviderService)
           
WebDriverFactory(WebdriverInstanceFactory webdriverInstanceFactory, EnvironmentVariables environmentVariables, FirefoxProfileEnhancer firefoxProfileEnhancer, FixtureProviderService fixtureProviderService, ElementProxyCreator proxyCreator)
           
 
Method Summary
protected  org.openqa.selenium.firefox.FirefoxProfile buildFirefoxProfile()
           
protected  org.openqa.selenium.firefox.FirefoxProfile createNewFirefoxProfile()
           
protected  org.openqa.selenium.firefox.internal.ProfilesIni getAllProfiles()
           
 Class<? extends org.openqa.selenium.WebDriver> getClassFor(SupportedWebDriver driverType)
           
 void initElementsWithAjaxSupport(PageObject pageObject, org.openqa.selenium.WebDriver driver, int timeoutInSeconds)
          Initialize a page object's fields using the specified WebDriver instance.
 org.openqa.selenium.WebDriver newInstanceOf(SupportedWebDriver driverType)
          Create a new WebDriver instance of a given type.
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.
protected  void resizeBrowserTo(org.openqa.selenium.WebDriver driver, int height, int width)
           
 void setupFixtureServices()
           
 void shutdownFixtureServices()
           
protected  org.openqa.selenium.firefox.FirefoxProfile useExistingFirefoxProfile(File profileDirectory)
           
 boolean usesSauceLabs()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DRIVER

public static final String DEFAULT_DRIVER
See Also:
Constant Field Values

REMOTE_DRIVER

public static final String REMOTE_DRIVER
See Also:
Constant Field Values
Constructor Detail

WebDriverFactory

public WebDriverFactory()

WebDriverFactory

public WebDriverFactory(EnvironmentVariables environmentVariables)

WebDriverFactory

public WebDriverFactory(WebdriverInstanceFactory webdriverInstanceFactory,
                        EnvironmentVariables environmentVariables)

WebDriverFactory

public WebDriverFactory(WebdriverInstanceFactory webdriverInstanceFactory,
                        EnvironmentVariables environmentVariables,
                        FirefoxProfileEnhancer firefoxProfileEnhancer)

WebDriverFactory

public WebDriverFactory(WebdriverInstanceFactory webdriverInstanceFactory,
                        EnvironmentVariables environmentVariables,
                        FirefoxProfileEnhancer firefoxProfileEnhancer,
                        FixtureProviderService fixtureProviderService)

WebDriverFactory

public WebDriverFactory(WebdriverInstanceFactory webdriverInstanceFactory,
                        EnvironmentVariables environmentVariables,
                        FirefoxProfileEnhancer firefoxProfileEnhancer,
                        FixtureProviderService fixtureProviderService,
                        ElementProxyCreator proxyCreator)
Method Detail

getAllProfiles

protected org.openqa.selenium.firefox.internal.ProfilesIni getAllProfiles()

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.

Parameters:
driverClass -
Returns:

setupFixtureServices

public void setupFixtureServices()
                          throws FixtureException
Throws:
FixtureException

shutdownFixtureServices

public void shutdownFixtureServices()

resizeBrowserTo

protected void resizeBrowserTo(org.openqa.selenium.WebDriver driver,
                               int height,
                               int width)

createNewFirefoxProfile

protected org.openqa.selenium.firefox.FirefoxProfile createNewFirefoxProfile()

useExistingFirefoxProfile

protected org.openqa.selenium.firefox.FirefoxProfile useExistingFirefoxProfile(File profileDirectory)

buildFirefoxProfile

protected org.openqa.selenium.firefox.FirefoxProfile buildFirefoxProfile()

initElementsWithAjaxSupport

public void initElementsWithAjaxSupport(PageObject pageObject,
                                        org.openqa.selenium.WebDriver driver,
                                        int timeoutInSeconds)
Initialize a page object's fields using the specified WebDriver instance.



Copyright © 2011-2013 Wakaleo Consulting. All Rights Reserved.