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. We

Author:
johnsmart

Constructor Summary
WebDriverFactory()
           
WebDriverFactory(EnvironmentVariables environmentVariables)
           
WebDriverFactory(WebdriverInstanceFactory webdriverInstanceFactory, EnvironmentVariables environmentVariables)
           
WebDriverFactory(WebdriverInstanceFactory webdriverInstanceFactory, EnvironmentVariables environmentVariables, FirefoxProfileEnhancer firefoxProfileEnhancer)
           
 
Method Summary
protected  org.openqa.selenium.firefox.FirefoxProfile createNewFirefoxProfile()
           
protected  org.openqa.selenium.firefox.internal.ProfilesIni getAllProfiles()
           
 Class<? extends org.openqa.selenium.WebDriver> getClassFor(SupportedWebDriver driverType)
           
static void initElementsWithAjaxSupport(Object pageObject, org.openqa.selenium.WebDriver driver)
          Initialize a page object's fields using the specified WebDriver instance.
static void initElementsWithAjaxSupport(Object pageObject, org.openqa.selenium.WebDriver driver, int timeout)
           
 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)
           
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
 

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

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)

initElementsWithAjaxSupport

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


initElementsWithAjaxSupport

public static void initElementsWithAjaxSupport(Object pageObject,
                                               org.openqa.selenium.WebDriver driver,
                                               int timeout)


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