com.flexiblewebsolutions.xdriveunit
Class WebXDriveTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.flexiblewebsolutions.xdriveunit.XDriveTestCase
              extended by com.flexiblewebsolutions.xdriveunit.WebXDriveTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
LoadWebXDriveTestCase

public abstract class WebXDriveTestCase
extends XDriveTestCase

XML Driven Test Case that is used to test web applications.

Author:
Donavon Buss

Field Summary
protected  com.gargoylesoftware.htmlunit.WebClient _WebClient
           
protected  net.sourceforge.jwebunit.WebTester _WebTester
          Framework Test API clients
static int HTMLUNIT
          HTML Unit HTTP Testing API
static int JWEBUNIT
          JWEBUnit Http Testing API
 
Fields inherited from class com.flexiblewebsolutions.xdriveunit.XDriveTestCase
_TestInput, _ThreadName
 
Constructor Summary
WebXDriveTestCase(java.lang.String pName, java.lang.StringBuffer pTestInput, java.lang.StringBuffer pTestOptions, java.lang.String pThreadName)
          Constructor for WebXMLTestCase
 
Method Summary
protected  void assertTextPresent(java.lang.String pText)
          Verify that some text is included on the page
protected  void clickButton(java.lang.String pButtonID, java.lang.String pButtonDesc)
          Clicks an html button
protected  void clickElementById(java.lang.String pId, java.lang.String pDescription)
          Clicks a variety of html element types that are clickable.
protected  void clickLink(java.lang.String pLinkName, java.lang.String pPageDescription)
          Clicks on a link
protected  void clickLinkWithImage(java.lang.String pLinkImg, java.lang.String pLinkDesc)
          Clicks the link of an image
protected  void clickLinkWithText(java.lang.String pLinkText, int pIndex, java.lang.String pLinkDesc)
          Clicks the link on a page using text between anchor tag
protected  void clickLinkWithText(java.lang.String pLinkText, java.lang.String pLinkDesc)
          Clicks the link on a page using text between anchor tag
protected  void dumpResponseToFile(java.io.File pFile)
          Captures current page text to specified file
protected  java.lang.StringBuffer dumpResponseToString()
          Capture current page text to a StringBuffer
 java.lang.String getClassName()
           
 java.io.File getTestDirectory()
           
abstract  int getTestFramework()
           
 java.io.File getTestTmpDirectory()
           
protected  void setCurrentForm(java.lang.String pFormName)
          Sets the form to use when assigning values to fields
protected  void setUp()
           
protected  void submit(java.lang.String pSubmitDesc)
          Submits the form that has been previously set.
protected  void submit(java.lang.String pFormName, java.lang.String pSubmitDesc)
          Submits the form specified by the supplied name
protected  void tearDown()
           
 
Methods inherited from class com.flexiblewebsolutions.xdriveunit.XDriveTestCase
checkBooleanParameter, getFile, getTestOptions, init, init, setupTestOptions
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HTMLUNIT

public static final int HTMLUNIT
HTML Unit HTTP Testing API

See Also:
Constant Field Values

JWEBUNIT

public static final int JWEBUNIT
JWEBUnit Http Testing API

See Also:
Constant Field Values

_WebTester

protected net.sourceforge.jwebunit.WebTester _WebTester
Framework Test API clients


_WebClient

protected com.gargoylesoftware.htmlunit.WebClient _WebClient
Constructor Detail

WebXDriveTestCase

public WebXDriveTestCase(java.lang.String pName,
                         java.lang.StringBuffer pTestInput,
                         java.lang.StringBuffer pTestOptions,
                         java.lang.String pThreadName)
Constructor for WebXMLTestCase

Parameters:
pName - - Name of test method
pTestInput - - XML containing test input
pTestOptions - - XML containing test options
pThreadName - - Name of thread running test, can be blank
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception
See Also:
TestCase.setUp()

tearDown

protected void tearDown()
                 throws java.lang.Exception
Overrides:
tearDown in class junit.framework.TestCase
Throws:
java.lang.Exception
See Also:
TestCase.tearDown()

getTestFramework

public abstract int getTestFramework()

clickLink

protected void clickLink(java.lang.String pLinkName,
                         java.lang.String pPageDescription)
Clicks on a link

Parameters:
pLinkName - - Name attribute of the link
pPageDescription - - Description of action for logging

clickElementById

protected void clickElementById(java.lang.String pId,
                                java.lang.String pDescription)
Clicks a variety of html element types that are clickable.

Parameters:
pId - - Id attribute of the element
pDescription - - Description of action for logging

clickButton

protected void clickButton(java.lang.String pButtonID,
                           java.lang.String pButtonDesc)
Clicks an html button

Parameters:
pButtonID - - Id attribute of the button
pButtonDesc - - Description of action for logging

clickLinkWithImage

protected void clickLinkWithImage(java.lang.String pLinkImg,
                                  java.lang.String pLinkDesc)
Clicks the link of an image

Parameters:
pLinkImg - - Src attribute of image
pLinkDesc - - Description of action for logging

clickLinkWithText

protected void clickLinkWithText(java.lang.String pLinkText,
                                 java.lang.String pLinkDesc)
Clicks the link on a page using text between anchor tag

Parameters:
pLinkText - - Link text as it appears to user.
pLinkDesc - - Description of action for logging

clickLinkWithText

protected void clickLinkWithText(java.lang.String pLinkText,
                                 int pIndex,
                                 java.lang.String pLinkDesc)
Clicks the link on a page using text between anchor tag

Parameters:
pLinkText - - Link text as it appears to user.
pIndex - - Numbered occurence in page if more than one Link
pLinkDesc - - Description of action for logging

submit

protected void submit(java.lang.String pSubmitDesc)
Submits the form that has been previously set.

Parameters:
pSubmitDesc - - Description of action for logging

submit

protected void submit(java.lang.String pFormName,
                      java.lang.String pSubmitDesc)
Submits the form specified by the supplied name

Parameters:
pFormName - - Name of form to submit
pSubmitDesc - - Description of action for logging

assertTextPresent

protected void assertTextPresent(java.lang.String pText)
Verify that some text is included on the page

Parameters:
pText - - Any text that is visible on the page.

setCurrentForm

protected void setCurrentForm(java.lang.String pFormName)
Sets the form to use when assigning values to fields

Parameters:
pFormName - - value from html

dumpResponseToFile

protected void dumpResponseToFile(java.io.File pFile)
Captures current page text to specified file

Parameters:
pFile - - File to write response to

dumpResponseToString

protected java.lang.StringBuffer dumpResponseToString()
Capture current page text to a StringBuffer

Returns:
Page Contents

getClassName

public java.lang.String getClassName()

getTestDirectory

public java.io.File getTestDirectory()

getTestTmpDirectory

public java.io.File getTestTmpDirectory()


Copyright © -2005 . All Rights Reserved.