org.unitils.selenium
Class WebDriverFactory

java.lang.Object
  extended by org.unitils.selenium.WebDriverFactory

public class WebDriverFactory
extends Object

This class creates all the WebDrivers.

Since:
1.0.0
Author:
Jeroen Horemans, Thomas De Rycke, Willemijn Wouters

Constructor Summary
WebDriverFactory()
           
 
Method Summary
protected static org.openqa.selenium.WebDriver createChromeDriver()
          This method creates a new ChromeDriver.
static org.openqa.selenium.WebDriver createDriver(BrowserChoice browserChoice, String downloadPath, String fileType)
          The webdriver will be created in this method.
static org.openqa.selenium.WebDriver createDriver(BrowserChoice browserChoice, String proxyUrl, String downloadPath, String fileType)
          checks which browser is chosen by the BrowserChoice and creates the WebDriver.
protected static org.openqa.selenium.WebDriver createFireFoxDriver(String downloadPath, String fileType)
          Creates a FirefoxDriver.
protected static org.openqa.selenium.WebDriver createFireFoxDriver(String proxyUrl, String downloadPath, String fileType)
          This method creates a new FirefoxDriver.
protected static org.openqa.selenium.firefox.FirefoxProfile createFirefoxProfile(String fileType, String downloadPath)
           
protected static org.openqa.selenium.WebDriver createInternetExplorerDriver(String proxyUrl)
          This method creates a new InternetExplorerDriver.
protected static org.openqa.selenium.WebDriver createRemoteWebdriver(String proxyUrl, String fileType, String downloadPath)
           
protected static CapabilitiesChoice getChosenCapabilities()
           
protected static File getFileFromProperty(String property)
          Checks if the value of the property is an already existing file, otherwise it tries to create a new file.
protected static Properties getUnitilsProperties()
          get the unitils.properties.
static void setLogPropertiesIE()
          This method sets the log levels for IE.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebDriverFactory

public WebDriverFactory()
Method Detail

createDriver

public static org.openqa.selenium.WebDriver createDriver(BrowserChoice browserChoice,
                                                         String downloadPath,
                                                         String fileType)
The webdriver will be created in this method.

Parameters:
browserChoice - : the chosen browser (see: WebDriverModule.BROWSER_NAME_KEY).
downloadPath - : the location where all the files should be downloaded.
fileType - : all the types that can be downloaded automatically.
Returns:
WebDriver

createChromeDriver

protected static org.openqa.selenium.WebDriver createChromeDriver()
This method creates a new ChromeDriver.

Returns:
WebDriver

setLogPropertiesIE

public static void setLogPropertiesIE()
This method sets the log levels for IE.


createInternetExplorerDriver

protected static org.openqa.selenium.WebDriver createInternetExplorerDriver(String proxyUrl)
This method creates a new InternetExplorerDriver.

Parameters:
proxyUrl - : the proxy url
Returns:
WebDriver

createDriver

public static org.openqa.selenium.WebDriver createDriver(BrowserChoice browserChoice,
                                                         String proxyUrl,
                                                         String downloadPath,
                                                         String fileType)
checks which browser is chosen by the BrowserChoice and creates the WebDriver.

Parameters:
browserChoice - : the chosen browser (see: WebDriverModule.BROWSER_NAME_KEY).
proxyUrl - : the proxy url
downloadPath - : the location where all the files should be downloaded.
fileType - : all the types that can be downloaded automatically.
Returns:
WebDriver

createFireFoxDriver

protected static org.openqa.selenium.WebDriver createFireFoxDriver(String downloadPath,
                                                                   String fileType)
Creates a FirefoxDriver.

Parameters:
downloadPath - : the location where all the files should be downloaded.
fileType - : all the types that can be downloaded automatically.
Returns:
WebDriver

createFireFoxDriver

protected static org.openqa.selenium.WebDriver createFireFoxDriver(String proxyUrl,
                                                                   String downloadPath,
                                                                   String fileType)
This method creates a new FirefoxDriver.

Parameters:
proxyUrl - : the proxy url
downloadPath - : the location where all the files should be downloaded.
fileType - : all the types that can be downloaded automatically.
Returns:
WebDriver

createFirefoxProfile

protected static org.openqa.selenium.firefox.FirefoxProfile createFirefoxProfile(String fileType,
                                                                                 String downloadPath)

createRemoteWebdriver

protected static org.openqa.selenium.WebDriver createRemoteWebdriver(String proxyUrl,
                                                                     String fileType,
                                                                     String downloadPath)

getChosenCapabilities

protected static CapabilitiesChoice getChosenCapabilities()

getFileFromProperty

protected static File getFileFromProperty(String property)
Checks if the value of the property is an already existing file, otherwise it tries to create a new file.

Parameters:
property - : the name of the property in the untils.property.
Returns:
File

getUnitilsProperties

protected static Properties getUnitilsProperties()
get the unitils.properties.

Returns:
Properties : all the properties defined in the unitils.properties, unitils-local.properties.


Copyright © 2015. All Rights Reserved.