com.ibm.team.fvt.tests.web
Class WebWindowFactory

java.lang.Object
  extended by com.ibm.team.fvt.tests.web.WebWindowFactory

public class WebWindowFactory
extends java.lang.Object

Factory to create instances of WebWindow.


Constructor Summary
WebWindowFactory()
           
 
Method Summary
static
<W extends WebWindow>
W
createInstance(WebPage page, org.openqa.selenium.By locator, java.lang.Class<W> windowClass)
          Create an instance of the given web window class located in the given page.
static
<W extends WebWindow>
W
createInstance(WebPage page, org.openqa.selenium.By locator, java.lang.Class<W> windowClass, java.lang.String... data)
          Create an instance of the given web window class located in the given page.
static
<W extends WebWindow>
W
createInstance(WebPage page, java.lang.Class<W> windowClass)
          Create an instance of the given web window class located in the given page.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebWindowFactory

public WebWindowFactory()
Method Detail

createInstance

public static <W extends WebWindow> W createInstance(WebPage page,
                                                     java.lang.Class<W> windowClass)
                                          throws java.lang.Exception
Create an instance of the given web window class located in the given page.

When using this factory method, the framework assumes that the given class has a constructor with a single WebPage or one of its direct subclass parameter.

Parameters:
page - The page from which the window will belong to
windowClass - The framework class of the window
Returns:
The instance of the given window class
Throws:
java.lang.Exception - Thrown if typically the expected class constructor does not exist.

createInstance

public static <W extends WebWindow> W createInstance(WebPage page,
                                                     org.openqa.selenium.By locator,
                                                     java.lang.Class<W> windowClass)
                                          throws java.lang.Exception
Create an instance of the given web window class located in the given page.

When using this factory method, the framework assumes that the given class has a constructor with following parameters:

Parameters:
page - The page from which the window will belong to
locator - The mechanism to find the web window element when opened
windowClass - The framework class of the window
Returns:
The instance of the given window class
Throws:
java.lang.Exception - Thrown if typically the expected class constructor does not exist.

createInstance

public static <W extends WebWindow> W createInstance(WebPage page,
                                                     org.openqa.selenium.By locator,
                                                     java.lang.Class<W> windowClass,
                                                     java.lang.String... data)
                                          throws java.lang.Exception
Create an instance of the given web window class located in the given page.

When using this factory method, the framework assumes that the given class has a constructor with following parameters:

Parameters:
page - The page from which the window will belong to
locator - The mechanism to find the web window element when opened
windowClass - The framework class of the window
data - Additional data provided when creating the instance as a list of strings
Returns:
The instance of the given window class
Throws:
java.lang.Exception - Thrown if typically the expected class constructor does not exist.