org.unitils.selenium
Class WebDriverModule

java.lang.Object
  extended by org.unitils.selenium.WebDriverModule
All Implemented Interfaces:
org.unitils.core.Module

public class WebDriverModule
extends java.lang.Object
implements org.unitils.core.Module

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

Field Summary
protected static java.lang.String BASE_URL_KEY
           
protected static java.lang.String BROWSER_NAME_KEY
           
protected static java.lang.String DOWNLOADPATH
           
protected static java.lang.String FILETYPE
           
protected static java.lang.String LIST_AUTOMATICALLY_DOWNLOAD
           
protected static java.lang.String PACKAGENAME
           
protected static java.lang.String PROXY_HOST_KEY
           
 
Constructor Summary
WebDriverModule()
           
 
Method Summary
 void afterInit()
           
protected  java.lang.Object getElement(org.openqa.selenium.WebDriver webdriver, java.lang.Class<?> type)
          This is the actual method that creates an object of the correct type and initialises all the elements.
 org.unitils.core.TestListener getTestListener()
           
 void init(java.util.Properties configuration)
           
 void initBaseUrl(java.lang.Object testObject)
          All the elements with the @BaseUrlString will be initialised with the base url value of the unitils.properties.
 void initElements(java.lang.Object testObject)
          Searches all the fields with the WebPage annotation and sets the correct elements.
 void initWebDriver(java.lang.Object testObject)
          Initialises the webdriver.
protected  void killWebDriver(java.lang.Object testObject)
          All the webdrivers (all the fields with the TestWebDriver of the testObject will be killed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PACKAGENAME

protected static final java.lang.String PACKAGENAME
See Also:
Constant Field Values

BROWSER_NAME_KEY

protected static final java.lang.String BROWSER_NAME_KEY
See Also:
Constant Field Values

BASE_URL_KEY

protected static final java.lang.String BASE_URL_KEY
See Also:
Constant Field Values

PROXY_HOST_KEY

protected static final java.lang.String PROXY_HOST_KEY
See Also:
Constant Field Values

DOWNLOADPATH

protected static final java.lang.String DOWNLOADPATH
See Also:
Constant Field Values

FILETYPE

protected static final java.lang.String FILETYPE
See Also:
Constant Field Values

LIST_AUTOMATICALLY_DOWNLOAD

protected static final java.lang.String LIST_AUTOMATICALLY_DOWNLOAD
See Also:
Constant Field Values
Constructor Detail

WebDriverModule

public WebDriverModule()
Method Detail

init

public void init(java.util.Properties configuration)
Specified by:
init in interface org.unitils.core.Module

afterInit

public void afterInit()
Specified by:
afterInit in interface org.unitils.core.Module

initWebDriver

public void initWebDriver(java.lang.Object testObject)
Initialises the webdriver. The method searches if there are fields with the TestWebDriver and uses the browser choice (in unitils.properties) to create the driver.

Parameters:
testObject -

killWebDriver

protected void killWebDriver(java.lang.Object testObject)
All the webdrivers (all the fields with the TestWebDriver of the testObject will be killed.

Parameters:
testObject -

initBaseUrl

public void initBaseUrl(java.lang.Object testObject)
All the elements with the @BaseUrlString will be initialised with the base url value of the unitils.properties.

Parameters:
testObject -

initElements

public void initElements(java.lang.Object testObject)
Searches all the fields with the WebPage annotation and sets the correct elements.

Parameters:
testObject -

getElement

protected java.lang.Object getElement(org.openqa.selenium.WebDriver webdriver,
                                      java.lang.Class<?> type)
This is the actual method that creates an object of the correct type and initialises all the elements.

Parameters:
webdriver -
type -
Returns:
Object

getTestListener

public org.unitils.core.TestListener getTestListener()
Specified by:
getTestListener in interface org.unitils.core.Module


Copyright © 2013. All Rights Reserved.