com.appfoundation.automation.framework.gwen.business
Class TestExecutor

java.lang.Object
  extended by com.appfoundation.automation.framework.gwen.business.TestExecutor

public class TestExecutor
extends java.lang.Object

TestExecutor

The purpose of this class is to handle the execution of browser specific test cases, that we derived from user definition tests in the Gwen language.

Author:
john.valentino

Field Summary
private static org.apache.log4j.Logger log
           
 
Constructor Summary
TestExecutor()
           
 
Method Summary
 void execute(ExecutorListener listener, ExecutableTestSuite suite)
          Executes the given suite.
protected  void executeAction(BrowserTestCase testCase, BaseSeleniumTest test, BrowserTestCaseAction action)
          Handles executing the given action in the given test case.
protected  void executeAssertAction(BaseSeleniumTest test, BrowserTestCaseAction exAction)
          Handles executing an Assert Action.
protected  void executeClearAction(BaseSeleniumTest test, BrowserTestCaseAction exAction)
           
protected  void executeClickAction(BaseSeleniumTest test, BrowserTestCaseAction exAction)
          Handles executing a Cick Action.
protected  void executeCommandLine(BaseSeleniumTest test, BrowserTestCaseAction exAction)
           
protected  void executeDragAndDrop(BaseSeleniumTest test, BrowserTestCaseAction exAction)
           
protected  void executeScreenshotAction(BrowserTestCase testCase, BaseSeleniumTest test, BrowserTestCaseAction exAction)
          Handles executing a Screenshot Action.
protected  void executeSwitchAction(BaseSeleniumTest test, BrowserTestCaseAction exAction)
           
protected  void executeTestCaseInBrowser(ExecutableTestSuite suite, TestCaseGroup group, BrowserTestCase testCase)
          Handles executing an individual test case in a specific browser
protected  void executeTypeAction(BaseSeleniumTest test, BrowserTestCaseAction exAction)
          Handles executing a Type Action.
protected  void executeWaitAction(BaseSeleniumTest test, BrowserTestCaseAction exAction)
          Handles executing a Wait Action.
protected  org.openqa.selenium.WebElement find(BaseSeleniumTest test, java.lang.String xpath)
          Handles finding a Web Element using the given XPath.
protected  void loadUrl(ExecutableTestSuite suite, org.openqa.selenium.WebDriver driver, java.lang.String url)
          Attempts to open the given URL in the web browser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.log4j.Logger log
Constructor Detail

TestExecutor

public TestExecutor()
Method Detail

execute

public void execute(ExecutorListener listener,
                    ExecutableTestSuite suite)
Executes the given suite.

Parameters:
suite -

executeTestCaseInBrowser

protected void executeTestCaseInBrowser(ExecutableTestSuite suite,
                                        TestCaseGroup group,
                                        BrowserTestCase testCase)
Handles executing an individual test case in a specific browser

Parameters:
suite -
group -
testCase -

loadUrl

protected void loadUrl(ExecutableTestSuite suite,
                       org.openqa.selenium.WebDriver driver,
                       java.lang.String url)
                throws java.lang.Exception
Attempts to open the given URL in the web browser.

Parameters:
suite -
driver -
url -
Throws:
java.lang.Exception

executeAction

protected void executeAction(BrowserTestCase testCase,
                             BaseSeleniumTest test,
                             BrowserTestCaseAction action)
                      throws ExecuteException
Handles executing the given action in the given test case.

Parameters:
testCase -
test -
action -
Throws:
ExecuteException

executeWaitAction

protected void executeWaitAction(BaseSeleniumTest test,
                                 BrowserTestCaseAction exAction)
                          throws ExecuteException
Handles executing a Wait Action.

Parameters:
test -
exAction -
Throws:
ExecuteException

executeScreenshotAction

protected void executeScreenshotAction(BrowserTestCase testCase,
                                       BaseSeleniumTest test,
                                       BrowserTestCaseAction exAction)
                                throws ExecuteException
Handles executing a Screenshot Action.

Parameters:
testCase -
test -
exAction -
Throws:
ExecuteException

executeTypeAction

protected void executeTypeAction(BaseSeleniumTest test,
                                 BrowserTestCaseAction exAction)
                          throws ExecuteException
Handles executing a Type Action.

Parameters:
test -
exAction -
Throws:
ExecuteException

find

protected org.openqa.selenium.WebElement find(BaseSeleniumTest test,
                                              java.lang.String xpath)
                                       throws ExecuteException
Handles finding a Web Element using the given XPath.

Parameters:
test -
xpath -
Returns:
Throws:
ExecuteException

executeClickAction

protected void executeClickAction(BaseSeleniumTest test,
                                  BrowserTestCaseAction exAction)
                           throws ExecuteException
Handles executing a Cick Action.

Parameters:
test -
exAction -
Throws:
ExecuteException

executeDragAndDrop

protected void executeDragAndDrop(BaseSeleniumTest test,
                                  BrowserTestCaseAction exAction)
                           throws ExecuteException
Throws:
ExecuteException

executeSwitchAction

protected void executeSwitchAction(BaseSeleniumTest test,
                                   BrowserTestCaseAction exAction)
                            throws ExecuteException
Throws:
ExecuteException

executeAssertAction

protected void executeAssertAction(BaseSeleniumTest test,
                                   BrowserTestCaseAction exAction)
                            throws ExecuteException
Handles executing an Assert Action.

Parameters:
test -
exAction -
Throws:
ExecuteException

executeClearAction

protected void executeClearAction(BaseSeleniumTest test,
                                  BrowserTestCaseAction exAction)
                           throws ExecuteException
Throws:
ExecuteException

executeCommandLine

protected void executeCommandLine(BaseSeleniumTest test,
                                  BrowserTestCaseAction exAction)
                           throws ExecuteException
Throws:
ExecuteException