net.sf.jameleon.plugin.httpunit
Class HttpUnitFunctionTag

java.lang.Object
  extended by org.apache.commons.jelly.TagSupport
      extended by net.sf.jameleon.LocationAwareTagSupport
          extended by net.sf.jameleon.JameleonTagSupport
              extended by net.sf.jameleon.function.FunctionTag
                  extended by net.sf.jameleon.plugin.httpunit.HttpUnitFunctionTag
All Implemented Interfaces:
BreakPoint, Attributable, Storable, DynaTag, LocationAware, Tag
Direct Known Subclasses:
HtmlPageClickLink, HtmlPageValidation, HttpUnitNavigateTag, HttpUnitSubmitForm, HUActionPointGenerator, HUGetMatchingTextTag, HUTestCaseGenerator

public abstract class HttpUnitFunctionTag
extends FunctionTag

An implementation of the HttpUnit plugin for a FunctionTag. Some convience assert methods and other HttpUnit functions are provided. To get fully access to the HttpUnit API, use the session instance variable. A problem is known about links whose target's are set to _new this plugin. The workaround this for now is to get the WebResponse from the WebLink when clicked and use that for all future executions. If it is desired to use this response across multiple functions, it should be okay to throw in the session.

For function points that will always be used to start the test case, the beginSession() method should be called first.


Field Summary
protected  WebResponse currentPage
           
protected  String httpUnitFrameName
          When set, the "current page" is considered to be the frame with this name under the main window.
protected  WebClientListener listener
          A Client Listener used for logging.
protected  long requestTime
          The start time of a request
protected  WebConversation session
          The session that is to be shared among all TestSteps encapsulated within a TestCase.
 
Fields inherited from class net.sf.jameleon.function.FunctionTag
addt, breakPoint, expectException, expectFailure, fResults, functionDelay, functionId, lastFileWritten, log, NO_DELAY, params, postcondition, precondition, st, state, tct, vpt
 
Fields inherited from class net.sf.jameleon.JameleonTagSupport
attributes, broker, contextVars, fp, unsupportedAttributes
 
Fields inherited from class net.sf.jameleon.LocationAwareTagSupport
columnNumber, elementTagName, lineNumber, scriptFileName
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
HttpUnitFunctionTag()
           
 
Method Summary
 void assertFormElementPresent(String msg, WebForm form, String formElementName)
          Asserts that a form input element with a given name is present.
 void assertFormElementPresent(String msg, WebForm form, String formElementName, int assertLevel)
          Asserts that a form input element with a given name is present.
 void assertFormElementPresent(WebForm form, String formElementName)
          Asserts that a form input element with a given name is present.
 void assertFormElementPresent(WebForm form, String formElementName, int assertLevel)
          Asserts that a form input element with a given name is present.
 void assertFormPresent()
          Asserts that there is a form present.
 void assertFormPresent(int assertLevel)
          Asserts that there is a form present.
 void assertFormPresent(String nameOrID)
          Asserts that there is a form with the specified name or id present.
 void assertFormPresent(String nameOrID, int assertLevel)
          Assert that there is a form with the specified name or id present.
 void assertFormPresent(String msg, String nameOrID)
          Assert that there is a form with the specified name or id present.
 void assertFormPresent(String msg, String nameOrID, int assertLevel)
          Assert that there is a form with the specified name or id present.
 void assertImageNotPresent(String nameAltTextOrSrc)
          Checks that an image with given name, alt text or image source is NOT present in the current html.
 void assertImageNotPresent(String nameAltTextOrSrc, int assertLevel)
          Checks that an image with given name, alt text or image source is NOT present in the current html.
 void assertImageNotPresent(String msg, String nameAltTextOrSrc)
          Checks that an image with given name, alt text or image source is NOT present in the current html.
 void assertImageNotPresent(String msg, String nameAltTextOrSrc, int assertLevel)
          Checks that an image with given name, alt text or image source is NOT present in the current html.
 void assertImagePresent(String nameAltTextOrSrc)
          Checks that an image with given name, alt text or image source is present in the current html.
 void assertImagePresent(String nameAltTextOrSrc, int assertLevel)
          Checks that an image with given name, alt text or image source is present in the current html.
 void assertImagePresent(String msg, String nameAltTextOrSrc)
          Checks that an image with given name, alt text or image source is present in the current html.
 void assertImagePresent(String msg, String nameAltTextOrSrc, int assertLevel)
          Checks that an image with given name, alt text or image source is present in the current html.
 void assertLinkPresent(String linkText)
          Checks that a link with given text is present in the current html.
 void assertLinkPresent(String linkText, int assertLevel)
          Checks that a link with given text is present in the current html.
 void assertLinkPresent(String msg, String linkText)
          Checks that a link with given text is present in the current html.
 void assertLinkPresent(String msg, String linkText, int assertLevel)
          Checks that a link with given text is present in the current html.
 void assertLinkPresentInTable(String linkText, String tablePosition, String tableRow, String tableColumn)
          Checks that a link with given text is present in the specified table.
 void assertLinkPresentInTable(String linkText, String tablePosition, String tableRow, String tableColumn, int assertLevel)
          Checks that a link with given text is present in the specified table.
 void assertLinkPresentInTable(String msg, String linkText, String tablePosition, String tableRow, String tableColumn, int assertLevel)
          Checks that a link with given text is present in the specified table.
 void assertOptionDisplayContains(String msg, String valueDisplayed, String selectName, WebForm webForm)
          Validates the text displayed in the select or option form type is contained the text desired.
 void assertOptionDisplayContains(String msg, String valueDisplayed, String selectName, WebForm webForm, int assertLevel)
          Validates the text displayed in the select or option form type is contained the text desired.
 void assertOptionDisplayContains(String valueDisplayed, String selectName, WebForm webForm)
          Validates the text displayed in the select or option form type is contained the text desired.
 void assertOptionDisplayContains(String valueDisplayed, String selectName, WebForm webForm, int assertLevel)
          Validates the text displayed in the select or option form type is contained the text desired.
 void assertOptionDisplayEndsWith(String msg, String valueDisplayed, String selectName, WebForm webForm)
          Validates the text displayed in the select or option form type ends with the text desired.
 void assertOptionDisplayEndsWith(String msg, String valueDisplayed, String selectName, WebForm webForm, int assertLevel)
          Validates the text displayed in the select or option form type ends with the text desired.
 void assertOptionDisplayEndsWith(String valueDisplayed, String selectName, WebForm webForm)
          Validates the text displayed in the select or option form type ends with the text desired.
 void assertOptionDisplayEndsWith(String valueDisplayed, String selectName, WebForm webForm, int assertLevel)
          Validates the text displayed in the select or option form type ends with the text desired.
 void assertOptionDisplayEquals(String msg, String valueDisplayed, String selectName, WebForm webForm)
          Validates the text displayed in the select or option form type equals the text desired.
 void assertOptionDisplayEquals(String msg, String valueDisplayed, String selectName, WebForm webForm, int assertLevel)
          Validates the text displayed in the select or option form type equals the text desired.
 void assertOptionDisplayEquals(String valueDisplayed, String selectName, WebForm webForm)
          Validates the text displayed in the select or option form type equals the text desired.
 void assertOptionDisplayEquals(String valueDisplayed, String selectName, WebForm webForm, int assertLevel)
          Validates the text displayed in the select or option form type equals the text desired.
 void assertOptionDisplayStartsWith(String msg, String valueDisplayed, String selectName, WebForm webForm)
          Validates the text displayed in the select or option form type starts with the text desired.
 void assertOptionDisplayStartsWith(String msg, String valueDisplayed, String selectName, WebForm webForm, int assertLevel)
          Validates the text displayed in the select or option form type starts with the text desired.
 void assertOptionDisplayStartsWith(String valueDisplayed, String selectName, WebForm webForm)
          Validates the text displayed in the select or option form type starts with the text desired.
 void assertOptionDisplayStartsWith(String valueDisplayed, String selectName, WebForm webForm, int assertLevel)
          Validates the text displayed in the select or option form type starts with the text desired.
 void assertOptionValueEquals(String msg, String optionValue, String selectName, WebForm webForm)
          Validates the value of the option in the select form type is equal to the value desired If the test fails display the given message
 void assertOptionValueEquals(String msg, String optionValue, String selectName, WebForm webForm, int assertLevel)
          Validates the value of the option in the select form type is equal to the value desired If the test fails display the given message
 void assertOptionValueEquals(String optionValue, String selectName, WebForm webForm)
          Validates the value of the option in the select form type is equal to the value desired If the test fails display the given message
 void assertOptionValueEquals(String optionValue, String selectName, WebForm webForm, int assertLevel)
          Validates the value of the option in the select form type is equal to the value desired If the test fails display the given message
 void assertTableNotPresent(String tableSummaryOrId)
          Asserts that a table with a given summary or id value is not present.
 void assertTableNotPresent(String tableSummaryOrId, int assertLevel)
          Asserts that a table with a given summary or id value is not present.
 void assertTableNotPresent(String msg, String tableSummaryOrId)
          Asserts that a table with a given summary or id value is not present.
 void assertTableNotPresent(String msg, String tableSummaryOrId, int assertLevel)
          Asserts that a table with a given summary or id value is not present.
 void assertTablePresent(String tableSummaryOrId)
          Asserts that a table with a given summary or id value is present.
 void assertTablePresent(String tableSummaryOrId, int assertLevel)
          Assert that a table with a given summary or id value is present.
 void assertTablePresent(String msg, String tableSummaryOrId)
          Asserts that a table with a given summary or id value is present.
 void assertTablePresent(String msg, String tableSummaryOrId, int assertLevel)
          Asserts that a table with a given summary or id value is present.
 void assertTextInputEquals(String msg, String textInputValue, String textInputName, WebForm webForm)
          Validates the value of the text input field.
 void assertTextInputEquals(String msg, String textInputValue, String textInputName, WebForm webForm, int assertLevel)
          Validates the value of the text input field.
 void assertTextInputEquals(String textInputValue, String textInputName, WebForm webForm)
          Validates the value of the text input field.
 void assertTextInputEquals(String textInputValue, String textInputName, WebForm webForm, int assertLevel)
          Validates the value of the text input field.
 void assertTextNotPresent(String text)
          Asserts that the supplied text is not present in the reponse.
 void assertTextNotPresent(String text, boolean stripHtmlComments)
          Asserts that the supplied text is not present in the reponse.
 void assertTextNotPresent(String text, int assertLevel)
          Asserts that the supplied text is not present in the reponse.
 void assertTextNotPresent(String text, int assertLevel, boolean stripHtmlComments)
          Asserts that the supplied text is not present in the reponse.
 void assertTextNotPresent(String msg, String text)
          Asserts that the supplied text is not present in the reponse.
 void assertTextNotPresent(String msg, String text, boolean stripHtmlComments)
          Asserts that the supplied text is not present in the reponse.
 void assertTextNotPresent(String msg, String text, int assertLevel)
          Asserts that the supplied text is not present in the reponse.
 void assertTextNotPresent(String msg, String text, int assertLevel, boolean stripHtmlComments)
          Asserts that the supplied text is not present in the reponse.
 void assertTextPresent(String text)
          Asserts that supplied text is present.
 void assertTextPresent(String text, boolean stripComments)
          Asserts that supplied text is present.
 void assertTextPresent(String text, int assertLevel)
          Asserts that supplied text is present.
 void assertTextPresent(String text, int assertLevel, boolean stripComments)
          Asserts that supplied text is present.
 void assertTextPresent(String msg, String text)
          Asserts that supplied text is present.
 void assertTextPresent(String msg, String text, boolean stripComments)
          Asserts that supplied text is present.
 void assertTextPresent(String msg, String text, int assertLevel)
          Asserts that supplied text is present.
 void assertTextPresent(String msg, String text, int assertLevel, boolean stripComments)
          Asserts that supplied text is present.
 void assertTitleContains(String titleContains)
          Checks that the title of the current html page contains the expected value, title
 void assertTitleContains(String titleContains, int assertLevel)
          Checks that the title of the current html page contains the expected value, title
 void assertTitleContains(String msg, String titleContains)
          Checks that the title of the current html page contains the expected value, title If the test fails display the given message
 void assertTitleContains(String msg, String titleContains, int assertLevel)
          Checks that the title of the current html page contains the expected value, title If the test fails display the given message
 void assertTitleEquals(String title)
          Checks that the title of the current html page matches the expected value, title
 void assertTitleEquals(String title, boolean trimWhitespace)
          Checks that the title of the current html page matches the expected value, title
 void assertTitleEquals(String title, int assertLevel)
          Checks that the title of the current html page matches the expected value, title
 void assertTitleEquals(String title, int assertLevel, boolean trimWhitespace)
          Checks that the title of the current html page matches the expected value, title
 void assertTitleEquals(String msg, String title)
          Checks that the title of the current html page matches the expected value, title If the test fails display the given message
 void assertTitleEquals(String msg, String title, boolean trimWhitespace)
          Checks that the title of the current html page matches the expected value, title If the test fails display the given message
 void assertTitleEquals(String msg, String title, int assertLevel)
          Checks that the title of the current html page matches the expected value, title If the test fails display the given message
 void assertTitleEquals(String msg, String title, int assertLevel, boolean trimWhitespace)
          Checks that the title of the current html page matches the expected value, title If the test fails display the given message
 void assertTitleNotEquals(String title)
          Checks that the title of the current html page does not matche the expected value, title
 void assertTitleNotEquals(String title, int assertLevel)
          Checks that the title of the current html page does not matche the expected value, title
 void assertTitleNotEquals(String msg, String title)
          Checks that the title of the current html page does not matche the expected value, title If the test fails display the given message
 void assertTitleNotEquals(String msg, String title, int assertLevel)
          Checks that the title of the current html page does not matche the expected value, title If the test fails display the given message
 void beginSession()
          Begin conversation at a url relative to the application root.
 void beginSessionAt(String relativeURL)
          Begin conversation at a url relative to the application root.
 void clickButton(WebForm form, String buttonId)
          Deprecated. Use clickButtonWithName() or clickButtonWithID() instead.
 void clickButtonWithID(WebForm form, String buttonId)
          Click the button with the given id.
 void clickButtonWithName(WebForm form, String buttonName)
          Click the button with the given name.
 WebResponse clickLink(String link)
          Finds a link via the getLink(java.lang.String) method and clicks on it.
 WebResponse clickLink(String link, boolean ignoreTarget)
          Finds a link via the getLink(java.lang.String) method and clicks on it.
 WebResponse clickLink(WebLink webLink, boolean ignoreTarget)
          Finds a link via the getLink(java.lang.String) method and clicks on it.
 WebResponse clickLinkWithId(String linkId)
          Navigate by selection of a link with given id.
 WebResponse clickLinkWithImage(String altText)
          Navigate by selection of a link with a given alt text.
 WebResponse clickLinkWithImageSrc(String src)
          Navigate by selection of a link with a given src.
 WebResponse clickLinkWithText(String linkText)
          Navigate by selection of a link containing the given text.
protected  String getBaseUrl()
          Gets the baseUrl from the context based on the application name, organization ( if set ) and environment.
 WebResponse getCurrentPage()
          A simple wrapper method to the HttpUnit WebConverstation.getCurrentPage() method.
 String getCurrentPageText()
          Gets the text of the current response (page).
 WebForm getForm(String nameOrId)
          Gets the form with the id or the name desired.
 WebConversation getHttpSession()
          Gets the WebConversation that is shared from the HttpUnitSession (hu-session)
 WebImage getImage(String nameIdAltTextOrSrc)
          Gets the image with the name, alt text or the image source desired.
 WebLink getLink(String text)
          Tries to get a link via the following HttpUnit methods in order.
 WebLink getLinkInTable(String text, String tablePosition, String tableRow, String tableColumn)
          Tries to get a link which is located in the specified table cell via the following HttpUnit methods in order.
 String getOptionDisplay(String selectName, String selectValue, WebForm form)
          Gets a select input type's value displayed text from the option.
 String getOptionValue(String selectName, String valueDisplayed, WebForm form)
          Gets a select input type's value attribute from the value displayed.
 String getOptionValueContains(String selectName, String valueDisplayed, WebForm form)
          Gets a select input type's value attribute from the value displayed.
 String getOptionValueEndsWith(String selectName, String valueDisplayed, WebForm form)
          Gets a select input type's value attribute from the value displayed.
 String getOptionValueMatches(String selectName, String valueDisplayed, WebForm form)
          Gets a select input type's value attribute from the value displayed.
 String getOptionValueStartsWith(String selectName, String valueDisplayed, WebForm form)
          Gets a select input type's value attribute from the value displayed.
 WebResponse getResponse(String url)
          A simple wrapper method to the session.getResponse() method which throws several exceptions.
 WebTable getTable(String index, WebTable[] tables)
          Gets table from table index.
 List getTableColumnCells(WebTable table, String colName)
          Searches a table table for a cell containing text colName.
protected  String getTrimmedCellText(WebTable table, int row, int col)
           
 void pluginTearDown()
          Called when the function is done being executed.
 void setFormParameterValueFromContext(WebForm form, String parameterName, String contextVariableName, boolean setOnlyIfNotNull)
          submit the form via it's default button
 void setHttpUnitFrameName(String frameName)
          When set, the "current page" is considered to be the frame with this name under the main window.
 void setupEnvironment()
          Gets the references of the session and the test results from the parent TestCase This method gets called once all attributes are set from the macro language.
 void store(String fName, int event)
           
 void submitForm(WebForm form)
          submit the form via it's default button
 void submitForm(WebForm form, String buttonName)
          submit the form via it's default button
 
Methods inherited from class net.sf.jameleon.function.FunctionTag
addParam, addRequiredAttribute, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertFalse, assertFalse, assertMethod, assertMethodWithLevel, assertNotNull, assertNotNull, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNotSame, assertNotSame, assertNull, assertNull, assertNull, assertNull, assertRegexMatches, assertRegexMatches, assertRegexMatches, assertRegexMatches, assertSame, assertSame, assertSame, assertSame, assertTextContains, assertTextContains, assertTextContains, assertTextContains, assertTextEndsWith, assertTextEndsWith, assertTextEndsWith, assertTextEndsWith, assertTextStartsWith, assertTextStartsWith, assertTextStartsWith, assertTextStartsWith, assertTrue, assertTrue, assertTrue, assertTrue, checkParamTypes, cleanUp, cleanUpEnvironment, delay, delay, doTag, fail, fail, fail, fail, getFunctionId, getFunctionResults, getMatchingRegexText, getParam, getParamLength, getParams, getParentTags, getSessionTag, getStoreToFileName, getStringOrDefault, getTestCaseTag, getVariable, getVariableAsBoolean, getVariableAsList, getVariableAsString, isBreakPoint, isContextVariableNull, recordFunctionResult, regexMatches, removeFunctionResult, removeVariable, setDefaultVariableValue, setDefaultVariableValue, setExpectException, setExpectFailure, setFunctionDelay, setFunctionId, setup, setUpFunctionResults, setVariable, tearDown, testBlock, traceMsg, validate
 
Methods inherited from class net.sf.jameleon.JameleonTagSupport
cleanVariablesInContext, createAttributes, describeAttributes, getAttributeBroker, getAttributes, getAttributeType, getClassAttributes, getFunctionalPoint, getUnsupportedAttributes, loadFunctionalPoint, resetFunctionalPoint, setAttribute, setVariableInContext, testForUnsupportedAttributesCaught
 
Methods inherited from class net.sf.jameleon.LocationAwareTagSupport
getColumnNumber, getElementName, getFileName, getLineNumber, setColumnNumber, setElementName, setFileName, setLineNumber
 
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.commons.jelly.Tag
getBody, getContext, getParent, invokeBody, setBody, setContext, setParent
 

Field Detail

session

protected WebConversation session
The session that is to be shared among all TestSteps encapsulated within a TestCase. This can be used within any Functional Point that extends this to get complete access to the HttpUnit API.


currentPage

protected WebResponse currentPage

requestTime

protected long requestTime
The start time of a request


httpUnitFrameName

protected String httpUnitFrameName
When set, the "current page" is considered to be the frame with this name under the main window.


listener

protected WebClientListener listener
A Client Listener used for logging.

Constructor Detail

HttpUnitFunctionTag

public HttpUnitFunctionTag()
Method Detail

setupEnvironment

public void setupEnvironment()
Gets the references of the session and the test results from the parent TestCase This method gets called once all attributes are set from the macro language. Any required setup should go here.

Overrides:
setupEnvironment in class FunctionTag

pluginTearDown

public void pluginTearDown()
Called when the function is done being executed. Use to clean up resources created in the setup method.

Overrides:
pluginTearDown in class FunctionTag

getBaseUrl

protected String getBaseUrl()
Gets the baseUrl from the context based on the application name, organization ( if set ) and environment. This information is currently grabbed from a file in the classpath starting with the environment name followed by -Applications.properties. For example, if the environment is "test" and the application name is "foo", then this method will look in a file named "test-Applications.properties" for a line starting with "foo.baseUrl=". If the organization is set to "bar", then it will look for a line starting with "bar.foo.baseUrl=".

Returns:
The baseUrl from where to begin all other URLs's for the application provided in the testcase.

getCurrentPage

public WebResponse getCurrentPage()
A simple wrapper method to the HttpUnit WebConverstation.getCurrentPage() method. There is a known problem with getting the current page from the session once a link with the target set to _new is opened. In this case, it is best to get the WebResponse from the WebLink.click() method and run all tests against that.

Returns:
the current response object.

getHttpSession

public WebConversation getHttpSession()
Gets the WebConversation that is shared from the HttpUnitSession (hu-session)

Returns:
the current session or WebConverstaion.

getResponse

public WebResponse getResponse(String url)
A simple wrapper method to the session.getResponse() method which throws several exceptions. This method converts all exceptions thrown by the httpunit getResponse() method to RuntimeExceptions.

Parameters:
url - - the Url required to get
Returns:
the current response object.

beginSession

public void beginSession()
Begin conversation at a url relative to the application root. This uses two variables stored in the context called:
  1. baseUrl - The base absolute URL to the application. i.e. http://sf.net/projects
  2. beginAt - The path which will be appended to the baseUrl. i.e jameleon/.
The two URLs are concatenated into one url. Based on the above examples, the url that would be requested would be http://sf.net/projects/jameleon/.


beginSessionAt

public void beginSessionAt(String relativeURL)
Begin conversation at a url relative to the application root.

Parameters:
relativeURL -

store

public void store(String fName,
                  int event)
           throws IOException
Specified by:
store in interface Storable
Overrides:
store in class FunctionTag
Throws:
IOException

assertTextInputEquals

public void assertTextInputEquals(String textInputValue,
                                  String textInputName,
                                  WebForm webForm)
Validates the value of the text input field.

Parameters:
textInputValue - - The value of the text input field.
textInputName - - The paramenter name of the text input form element.
webForm - - The form that contains the select input type.

assertTextInputEquals

public void assertTextInputEquals(String textInputValue,
                                  String textInputName,
                                  WebForm webForm,
                                  int assertLevel)
Validates the value of the text input field.

Parameters:
textInputValue - - The value of the text input field.
textInputName - - The paramenter name of the text input form element.
webForm - - The form that contains the select input type.
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertTextInputEquals

public void assertTextInputEquals(String msg,
                                  String textInputValue,
                                  String textInputName,
                                  WebForm webForm)
Validates the value of the text input field. If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
textInputValue - - The value of the text input field.
textInputName - - The paramenter name of the text input form element.
webForm - - The form that contains the select input type.

assertTextInputEquals

public void assertTextInputEquals(String msg,
                                  String textInputValue,
                                  String textInputName,
                                  WebForm webForm,
                                  int assertLevel)
Validates the value of the text input field. If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
textInputValue - - The value of the text input field.
textInputName - - The paramenter name of the text input form element.
webForm - - The form that contains the select input type.
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertOptionValueEquals

public void assertOptionValueEquals(String optionValue,
                                    String selectName,
                                    WebForm webForm)
Validates the value of the option in the select form type is equal to the value desired If the test fails display the given message

Parameters:
optionValue - - The value of option field.
selectName - - The paramenter name of the select option input.
webForm - - The form that contains the select input type.

assertOptionValueEquals

public void assertOptionValueEquals(String msg,
                                    String optionValue,
                                    String selectName,
                                    WebForm webForm)
Validates the value of the option in the select form type is equal to the value desired If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
optionValue - - The value of option field.
selectName - - The paramenter name of the select option input.
webForm - - The form that contains the select input type.

assertOptionValueEquals

public void assertOptionValueEquals(String optionValue,
                                    String selectName,
                                    WebForm webForm,
                                    int assertLevel)
Validates the value of the option in the select form type is equal to the value desired If the test fails display the given message

Parameters:
optionValue - - The value of option field.
selectName - - The paramenter name of the select option input.
webForm - - The form that contains the select input type.
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertOptionValueEquals

public void assertOptionValueEquals(String msg,
                                    String optionValue,
                                    String selectName,
                                    WebForm webForm,
                                    int assertLevel)
Validates the value of the option in the select form type is equal to the value desired If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
optionValue - - The value of option field.
selectName - - The paramenter name of the select option input.
webForm - - The form that contains the select input type.
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertOptionDisplayContains

public void assertOptionDisplayContains(String valueDisplayed,
                                        String selectName,
                                        WebForm webForm)
Validates the text displayed in the select or option form type is contained the text desired. If the test fails display the given message

Parameters:
valueDisplayed - - The value displayed by the option field.
selectName - - The paramenter name of the select option input.
webForm - - The form that contains the select input type.

assertOptionDisplayContains

public void assertOptionDisplayContains(String msg,
                                        String valueDisplayed,
                                        String selectName,
                                        WebForm webForm)
Validates the text displayed in the select or option form type is contained the text desired. If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
valueDisplayed - - The value displayed by the option field.
selectName - - The paramenter name of the select option input.
webForm - - The form that contains the select input type.

assertOptionDisplayContains

public void assertOptionDisplayContains(String valueDisplayed,
                                        String selectName,
                                        WebForm webForm,
                                        int assertLevel)
Validates the text displayed in the select or option form type is contained the text desired. If the test fails display the given message

Parameters:
valueDisplayed - - The value displayed by the option field.
selectName - - The paramenter name of the select option input.
webForm - - The form that contains the select input type.
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertOptionDisplayContains

public void assertOptionDisplayContains(String msg,
                                        String valueDisplayed,
                                        String selectName,
                                        WebForm webForm,
                                        int assertLevel)
Validates the text displayed in the select or option form type is contained the text desired. If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
valueDisplayed - - The value displayed by the option field. or the starting text.
selectName - - The paramenter name of the select option input.
webForm - - The form that contains the select input type.
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertOptionDisplayStartsWith

public void assertOptionDisplayStartsWith(String valueDisplayed,
                                          String selectName,
                                          WebForm webForm)
Validates the text displayed in the select or option form type starts with the text desired. If the test fails display the given message

Parameters:
valueDisplayed - - The value displayed by the option field. or the starting text.
selectName - - The paramenter name of the select option input.
webForm - - The form that contains the select input type.

assertOptionDisplayStartsWith

public void assertOptionDisplayStartsWith(String msg,
                                          String valueDisplayed,
                                          String selectName,
                                          WebForm webForm)
Validates the text displayed in the select or option form type starts with the text desired. If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
valueDisplayed - - The value displayed by the option field. or the starting text.
selectName - - The paramenter name of the select option input.
webForm - - The form that contains the select input type.

assertOptionDisplayStartsWith

public void assertOptionDisplayStartsWith(String valueDisplayed,
                                          String selectName,
                                          WebForm webForm,
                                          int assertLevel)
Validates the text displayed in the select or option form type starts with the text desired. If the test fails display the given message

Parameters:
valueDisplayed - - The value displayed by the option field. or the starting text.
selectName - - The paramenter name of the select option input.
webForm - - The form that contains the select input type.
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertOptionDisplayStartsWith

public void assertOptionDisplayStartsWith(String msg,
                                          String valueDisplayed,
                                          String selectName,
                                          WebForm webForm,
                                          int assertLevel)
Validates the text displayed in the select or option form type starts with the text desired. If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
valueDisplayed - - The value displayed by the option field.
selectName - - The paramenter name of the select option input.
webForm - - The form that contains the select input type.
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertOptionDisplayEndsWith

public void assertOptionDisplayEndsWith(String valueDisplayed,
                                        String selectName,
                                        WebForm webForm)
Validates the text displayed in the select or option form type ends with the text desired. If the test fails display the given message

Parameters:
valueDisplayed - - The value displayed by the option field. or the starting text.
selectName - - The paramenter name of the select option input.
webForm - - The form that contains the select input type.

assertOptionDisplayEndsWith

public void assertOptionDisplayEndsWith(String msg,
                                        String valueDisplayed,
                                        String selectName,
                                        WebForm webForm)
Validates the text displayed in the select or option form type ends with the text desired. If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
valueDisplayed - - The value displayed by the option field. or the starting text.
selectName - - The paramenter name of the select option input.
webForm - - The form that contains the select input type.

assertOptionDisplayEndsWith

public void assertOptionDisplayEndsWith(String valueDisplayed,
                                        String selectName,
                                        WebForm webForm,
                                        int assertLevel)
Validates the text displayed in the select or option form type ends with the text desired. If the test fails display the given message

Parameters:
valueDisplayed - - The value displayed by the option field. or the starting text.
selectName - - The paramenter name of the select option input.
webForm - - The form that contains the select input type.
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertOptionDisplayEndsWith

public void assertOptionDisplayEndsWith(String msg,
                                        String valueDisplayed,
                                        String selectName,
                                        WebForm webForm,
                                        int assertLevel)
Validates the text displayed in the select or option form type ends with the text desired. If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
valueDisplayed - - The value displayed by the option field.
selectName - - The paramenter name of the select option input.
webForm - - The form that contains the select input type.
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertOptionDisplayEquals

public void assertOptionDisplayEquals(String valueDisplayed,
                                      String selectName,
                                      WebForm webForm)
Validates the text displayed in the select or option form type equals the text desired. If the test fails display the given message

Parameters:
valueDisplayed - - The value displayed by the option field.
selectName - - The paramenter name of the select option input.
webForm - - The form that contains the select input type.

assertOptionDisplayEquals

public void assertOptionDisplayEquals(String msg,
                                      String valueDisplayed,
                                      String selectName,
                                      WebForm webForm)
Validates the text displayed in the select or option form type equals the text desired. If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
valueDisplayed - - The value displayed by the option field.
selectName - - The paramenter name of the select option input.
webForm - - The form that contains the select input type.

assertOptionDisplayEquals

public void assertOptionDisplayEquals(String valueDisplayed,
                                      String selectName,
                                      WebForm webForm,
                                      int assertLevel)
Validates the text displayed in the select or option form type equals the text desired. If the test fails display the given message

Parameters:
valueDisplayed - - The value displayed by the option field.
selectName - - The paramenter name of the select option input.
webForm - - The form that contains the select input type.
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertOptionDisplayEquals

public void assertOptionDisplayEquals(String msg,
                                      String valueDisplayed,
                                      String selectName,
                                      WebForm webForm,
                                      int assertLevel)
Validates the text displayed in the select or option form type equals the text desired. If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
valueDisplayed - - The value displayed by the option field.
selectName - - The paramenter name of the select option input.
webForm - - The form that contains the select input type.
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertImagePresent

public void assertImagePresent(String nameAltTextOrSrc)
Checks that an image with given name, alt text or image source is present in the current html. See getImage(java.lang.String) for information onw how nameAltTextOrSrc is used to find the image.

Parameters:
nameAltTextOrSrc - - The name, alt text or image src of the image to find.

assertImagePresent

public void assertImagePresent(String msg,
                               String nameAltTextOrSrc)
Checks that an image with given name, alt text or image source is present in the current html. See getImage(java.lang.String) for information onw how nameAltTextOrSrc is used to find the image. If the test fails display the given message

Parameters:
msg - - The message to display if an error occurs
nameAltTextOrSrc - - The name, alt text or source of the image

assertImagePresent

public void assertImagePresent(String nameAltTextOrSrc,
                               int assertLevel)
Checks that an image with given name, alt text or image source is present in the current html. See getImage(java.lang.String) for information onw how nameAltTextOrSrc is used to find the image.

Parameters:
nameAltTextOrSrc - - The name, alt text or image src of the image to find.
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertImagePresent

public void assertImagePresent(String msg,
                               String nameAltTextOrSrc,
                               int assertLevel)
Checks that an image with given name, alt text or image source is present in the current html. See getImage(java.lang.String) for information onw how nameAltTextOrSrc is used to find the image. If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
nameAltTextOrSrc - - The name, alt text or image src of the image to find.
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertImageNotPresent

public void assertImageNotPresent(String nameAltTextOrSrc)
Checks that an image with given name, alt text or image source is NOT present in the current html. See getImage(java.lang.String) for information onw how nameAltTextOrSrc is used to find the image.

Parameters:
nameAltTextOrSrc - - The name, alt text or image src of the image to find.

assertImageNotPresent

public void assertImageNotPresent(String msg,
                                  String nameAltTextOrSrc)
Checks that an image with given name, alt text or image source is NOT present in the current html. See getImage(java.lang.String) for information onw how nameAltTextOrSrc is used to find the image. If the test fails display the given message

Parameters:
nameAltTextOrSrc - - The name, alt text or image src of the image to find.
msg - - The message to display if an error occurs

assertImageNotPresent

public void assertImageNotPresent(String nameAltTextOrSrc,
                                  int assertLevel)
Checks that an image with given name, alt text or image source is NOT present in the current html. See getImage(java.lang.String) for information onw how nameAltTextOrSrc is used to find the image.

Parameters:
nameAltTextOrSrc - - The name, alt text or image src of the image to find.
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertImageNotPresent

public void assertImageNotPresent(String msg,
                                  String nameAltTextOrSrc,
                                  int assertLevel)
Checks that an image with given name, alt text or image source is NOT present in the current html. See getImage(java.lang.String) for information onw how nameAltTextOrSrc is used to find the image. If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
nameAltTextOrSrc - - The name, alt text or image src of the image to find.
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertLinkPresent

public void assertLinkPresent(String linkText)
Checks that a link with given text is present in the current html. See getLink(java.lang.String) for information onw how linkText is used to find the link.

Parameters:
linkText - - The text, name, id or alt text to click

assertLinkPresent

public void assertLinkPresent(String msg,
                              String linkText)
Checks that a link with given text is present in the current html. See getLink(java.lang.String) for information onw how linkText is used to find the link. If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
linkText - - The text, name, id or alt text to click

assertLinkPresent

public void assertLinkPresent(String linkText,
                              int assertLevel)
Checks that a link with given text is present in the current html. See getLink(java.lang.String) for information onw how linkText is used to find the link.

Parameters:
linkText - - The text, name, id or alt text to click
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertLinkPresent

public void assertLinkPresent(String msg,
                              String linkText,
                              int assertLevel)
Checks that a link with given text is present in the current html. See getLink(java.lang.String) for information onw how linkText is used to find the link. If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
linkText - - The text, name, id or alt text to click
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertLinkPresentInTable

public void assertLinkPresentInTable(String linkText,
                                     String tablePosition,
                                     String tableRow,
                                     String tableColumn,
                                     int assertLevel)
Checks that a link with given text is present in the specified table.

Parameters:
linkText - - The text, name, id or alt text to click
tablePosition - - Specifies which table to look in
tableRow - - Specifies the row to look in
tableColumn - - Specifies the column to look in
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertLinkPresentInTable

public void assertLinkPresentInTable(String linkText,
                                     String tablePosition,
                                     String tableRow,
                                     String tableColumn)
Checks that a link with given text is present in the specified table.

Parameters:
linkText - - The text, name, id or alt text to click
tablePosition - - Specifies which table to look in
tableRow - - Specifies the row to look in
tableColumn - - Specifies the column to look in

assertLinkPresentInTable

public void assertLinkPresentInTable(String msg,
                                     String linkText,
                                     String tablePosition,
                                     String tableRow,
                                     String tableColumn,
                                     int assertLevel)
Checks that a link with given text is present in the specified table.

Parameters:
msg - - The message to display if text is not in the response.
linkText - - The text, name, id or alt text to click
tablePosition - - Specifies which table to look in
tableRow - - Specifies the row to look in
tableColumn - - Specifies the column to look in
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertTitleEquals

public void assertTitleEquals(String title)
Checks that the title of the current html page matches the expected value, title

Parameters:
title - expected title value

assertTitleEquals

public void assertTitleEquals(String msg,
                              String title)
Checks that the title of the current html page matches the expected value, title If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
title - expected title value

assertTitleEquals

public void assertTitleEquals(String title,
                              int assertLevel)
Checks that the title of the current html page matches the expected value, title

Parameters:
title - expected title value
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertTitleEquals

public void assertTitleEquals(String msg,
                              String title,
                              int assertLevel)
Checks that the title of the current html page matches the expected value, title If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
title - expected title value
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertTitleContains

public void assertTitleContains(String titleContains)
Checks that the title of the current html page contains the expected value, title

Parameters:
titleContains - text expected to be in the title

assertTitleContains

public void assertTitleContains(String msg,
                                String titleContains)
Checks that the title of the current html page contains the expected value, title If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
titleContains - text expected to be in the title

assertTitleContains

public void assertTitleContains(String titleContains,
                                int assertLevel)
Checks that the title of the current html page contains the expected value, title

Parameters:
titleContains - text expected to be in the title
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertTitleContains

public void assertTitleContains(String msg,
                                String titleContains,
                                int assertLevel)
Checks that the title of the current html page contains the expected value, title If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
titleContains - text expected to be in the title
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertTitleEquals

public void assertTitleEquals(String title,
                              boolean trimWhitespace)
Checks that the title of the current html page matches the expected value, title

Parameters:
title - expected title value
trimWhitespace - - Set to true if leading and trailing whitespace is not to be included in the compare.

assertTitleEquals

public void assertTitleEquals(String msg,
                              String title,
                              boolean trimWhitespace)
Checks that the title of the current html page matches the expected value, title If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
title - expected title value
trimWhitespace - - Set to true if leading and trailing whitespace is not to be included in the compare.

assertTitleEquals

public void assertTitleEquals(String title,
                              int assertLevel,
                              boolean trimWhitespace)
Checks that the title of the current html page matches the expected value, title

Parameters:
title - expected title value
assertLevel - - Only run this test under the assertLevel as described in AssertLevel
trimWhitespace - - Set to true if leading and trailing whitespace is not to be included in the compare.

assertTitleEquals

public void assertTitleEquals(String msg,
                              String title,
                              int assertLevel,
                              boolean trimWhitespace)
Checks that the title of the current html page matches the expected value, title If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
title - expected title value
assertLevel - - Only run this test under the assertLevel as described in AssertLevel
trimWhitespace - - Set to true if leading and trailing whitespace is not to be included in the compare.

assertTitleNotEquals

public void assertTitleNotEquals(String title)
Checks that the title of the current html page does not matche the expected value, title

Parameters:
title - expected title value

assertTitleNotEquals

public void assertTitleNotEquals(String msg,
                                 String title)
Checks that the title of the current html page does not matche the expected value, title If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
title - expected title value

assertTitleNotEquals

public void assertTitleNotEquals(String title,
                                 int assertLevel)
Checks that the title of the current html page does not matche the expected value, title

Parameters:
title - expected title value
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertTitleNotEquals

public void assertTitleNotEquals(String msg,
                                 String title,
                                 int assertLevel)
Checks that the title of the current html page does not matche the expected value, title If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
title - expected title value
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertTextPresent

public void assertTextPresent(String text)
Asserts that supplied text is present.

Parameters:
text - - The text that should be in the response

assertTextPresent

public void assertTextPresent(String msg,
                              String text)
Asserts that supplied text is present. If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
text - - The text that should be in the response

assertTextPresent

public void assertTextPresent(String text,
                              int assertLevel)
Asserts that supplied text is present.

Parameters:
text - - The text that should be in the response
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertTextPresent

public void assertTextPresent(String msg,
                              String text,
                              int assertLevel)
Asserts that supplied text is present. If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
text - - The text that should be in the response
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertTextPresent

public void assertTextPresent(String text,
                              boolean stripComments)
Asserts that supplied text is present.

Parameters:
text - - The text that should be in the response
stripComments - - Strip html comments from the test?

assertTextPresent

public void assertTextPresent(String msg,
                              String text,
                              boolean stripComments)
Asserts that supplied text is present. If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
text - - The text that should be in the response
stripComments - - Strip html comments from the test?

assertTextPresent

public void assertTextPresent(String text,
                              int assertLevel,
                              boolean stripComments)
Asserts that supplied text is present.

Parameters:
text - - The text that should be in the response
assertLevel - - Only run this test under the assertLevel as described in AssertLevel
stripComments - - Strip html comments from the test?

assertTextPresent

public void assertTextPresent(String msg,
                              String text,
                              int assertLevel,
                              boolean stripComments)
Asserts that supplied text is present. If the test fails display the given message

Parameters:
msg - - The message to display if text is not in the response.
text - - The text that should be in the response
assertLevel - - Only run this test under the assertLevel as described in AssertLevel
stripComments - - Strip html comments from the test?

assertTextNotPresent

public void assertTextNotPresent(String text)
Asserts that the supplied text is not present in the reponse.

Parameters:
text - - the text to NOT be found in the response

assertTextNotPresent

public void assertTextNotPresent(String msg,
                                 String text)
Asserts that the supplied text is not present in the reponse.

Parameters:
text - - the text to NOT be found in the response
msg - - a message that will be displayed if the test fails.

assertTextNotPresent

public void assertTextNotPresent(String text,
                                 int assertLevel)
Asserts that the supplied text is not present in the reponse.

Parameters:
text - - the text to NOT be found in the response
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertTextNotPresent

public void assertTextNotPresent(String msg,
                                 String text,
                                 int assertLevel)
Asserts that the supplied text is not present in the reponse.

Parameters:
text - - the text to NOT be found in the response
msg - - a message that will be displayed if the test fails.
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertTextNotPresent

public void assertTextNotPresent(String text,
                                 boolean stripHtmlComments)
Asserts that the supplied text is not present in the reponse.

Parameters:
text - - the text to NOT be found in the response
stripHtmlComments - - whether to strip html comments or not

assertTextNotPresent

public void assertTextNotPresent(String msg,
                                 String text,
                                 boolean stripHtmlComments)
Asserts that the supplied text is not present in the reponse.

Parameters:
text - - the text to NOT be found in the response
msg - - a message that will be displayed if the test fails.
stripHtmlComments - - whether to strip html comments or not

assertTextNotPresent

public void assertTextNotPresent(String text,
                                 int assertLevel,
                                 boolean stripHtmlComments)
Asserts that the supplied text is not present in the reponse.

Parameters:
text - - the text to NOT be found in the response
assertLevel - - Only run this test under the assertLevel as described in AssertLevel
stripHtmlComments - - whether to strip html comments or not

assertTextNotPresent

public void assertTextNotPresent(String msg,
                                 String text,
                                 int assertLevel,
                                 boolean stripHtmlComments)
Asserts that the supplied text is not present in the reponse.

Parameters:
text - - the text to NOT be found in the response
msg - - a message that will be displayed if the test fails.
assertLevel - - Only run this test under the assertLevel as described in AssertLevel
stripHtmlComments - - whether to strip html comments or not

assertTablePresent

public void assertTablePresent(String tableSummaryOrId)
Asserts that a table with a given summary or id value is present.

Parameters:
tableSummaryOrId - summary or id attribute value of table

assertTablePresent

public void assertTablePresent(String msg,
                               String tableSummaryOrId)
Asserts that a table with a given summary or id value is present.

Parameters:
tableSummaryOrId - summary or id attribute value of table
msg - - a message that will be displayed if the test fails.

assertTablePresent

public void assertTablePresent(String tableSummaryOrId,
                               int assertLevel)
Assert that a table with a given summary or id value is present.

Parameters:
tableSummaryOrId - summary or id attribute value of table
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertTablePresent

public void assertTablePresent(String msg,
                               String tableSummaryOrId,
                               int assertLevel)
Asserts that a table with a given summary or id value is present.

Parameters:
msg - - a message that will be displayed if the test fails.
tableSummaryOrId - summary or id attribute value of table
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertTableNotPresent

public void assertTableNotPresent(String tableSummaryOrId)
Asserts that a table with a given summary or id value is not present.

Parameters:
tableSummaryOrId - summary or id attribute value of table

assertTableNotPresent

public void assertTableNotPresent(String msg,
                                  String tableSummaryOrId)
Asserts that a table with a given summary or id value is not present.

Parameters:
msg - - a message that will be displayed if the test fails.
tableSummaryOrId - summary or id attribute value of table

assertTableNotPresent

public void assertTableNotPresent(String tableSummaryOrId,
                                  int assertLevel)
Asserts that a table with a given summary or id value is not present.

Parameters:
tableSummaryOrId - summary or id attribute value of table
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertTableNotPresent

public void assertTableNotPresent(String msg,
                                  String tableSummaryOrId,
                                  int assertLevel)
Asserts that a table with a given summary or id value is not present.

Parameters:
msg - - a message that will be displayed if the test fails.
tableSummaryOrId - summary or id attribute value of table
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertFormElementPresent

public void assertFormElementPresent(WebForm form,
                                     String formElementName)
Asserts that a form input element with a given name is present.

Parameters:
form - - The form that should contain the form element.
formElementName - - The name of the form element to check for.

assertFormElementPresent

public void assertFormElementPresent(String msg,
                                     WebForm form,
                                     String formElementName)
Asserts that a form input element with a given name is present.

Parameters:
msg - - a message that will be displayed if the test fails.
form - - The form that should contain the form element.
formElementName - - The name of the form element to check for.

assertFormElementPresent

public void assertFormElementPresent(WebForm form,
                                     String formElementName,
                                     int assertLevel)
Asserts that a form input element with a given name is present.

Parameters:
form - - The form that should contain the form element.
formElementName - - The name of the form element to check for.
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertFormElementPresent

public void assertFormElementPresent(String msg,
                                     WebForm form,
                                     String formElementName,
                                     int assertLevel)
Asserts that a form input element with a given name is present.

Parameters:
msg - - a message that will be displayed if the test fails.
form - - The form that should contain the form element.
formElementName - - The name of the form element to check for.
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertFormPresent

public void assertFormPresent()
Asserts that there is a form present.


assertFormPresent

public void assertFormPresent(int assertLevel)
Asserts that there is a form present.

Parameters:
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertFormPresent

public void assertFormPresent(String nameOrID)
Asserts that there is a form with the specified name or id present.

Parameters:
nameOrID - - The name of ID of the form to be found.

assertFormPresent

public void assertFormPresent(String msg,
                              String nameOrID)
Assert that there is a form with the specified name or id present.

Parameters:
msg - - A Message to be displayed in event of a failure.
nameOrID - - The name of ID of the form to be found.

assertFormPresent

public void assertFormPresent(String nameOrID,
                              int assertLevel)
Assert that there is a form with the specified name or id present.

Parameters:
nameOrID - - The name of ID of the form to be found.
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

assertFormPresent

public void assertFormPresent(String msg,
                              String nameOrID,
                              int assertLevel)
Assert that there is a form with the specified name or id present.

Parameters:
nameOrID - - The name of ID of the form to be found.
msg - - A Message to be displayed in event of a failure.
assertLevel - - Only run this test under the assertLevel as described in AssertLevel

getOptionValue

public String getOptionValue(String selectName,
                             String valueDisplayed,
                             WebForm form)
Gets a select input type's value attribute from the value displayed. This is most useful when the value attribute and displayed value are different.

Parameters:
selectName - - The parameter name of the select option.
valueDisplayed - - The displayed value of the select input. ( <option value="selectValue">valueDisplayed</option>)
form - - The form that contains ths select input type.
Returns:
Option's value attribute that corresponds with the displayed text.

getOptionValueStartsWith

public String getOptionValueStartsWith(String selectName,
                                       String valueDisplayed,
                                       WebForm form)
Gets a select input type's value attribute from the value displayed. This is most useful when the value attribute and displayed value are different.

Parameters:
selectName - - The parameter name of the select option.
valueDisplayed - - The starting portion of the displayed text
form - - The form that contains ths select input type.
Returns:
Option's value attribute that corresponds with the displayed text.

getOptionValueEndsWith

public String getOptionValueEndsWith(String selectName,
                                     String valueDisplayed,
                                     WebForm form)
Gets a select input type's value attribute from the value displayed. This is most useful when the value attribute and displayed value are different.

Parameters:
selectName - - The parameter name of the select option.
valueDisplayed - - The ending portion of the displayed text
form - - The form that contains ths select input type.
Returns:
Option's value attribute that corresponds with the displayed text.

getOptionValueContains

public String getOptionValueContains(String selectName,
                                     String valueDisplayed,
                                     WebForm form)
Gets a select input type's value attribute from the value displayed. This is most useful when the value attribute and displayed value are different.

Parameters:
selectName - - The parameter name of the select option.
valueDisplayed - - Any portion of the displayed text
form - - The form that contains ths select input type.
Returns:
Option's value attribute that corresponds with the displayed text.

getOptionValueMatches

public String getOptionValueMatches(String selectName,
                                    String valueDisplayed,
                                    WebForm form)
Gets a select input type's value attribute from the value displayed. This is most useful when the value attribute and displayed value are different.

Parameters:
selectName - - The parameter name of the select option.
valueDisplayed - - A regular expression to be performed against the displayed text
form - - The form that contains ths select input type.
Returns:
Option's value attribute that corresponds with the displayed text.

getOptionDisplay

public String getOptionDisplay(String selectName,
                               String selectValue,
                               WebForm form)
Gets a select input type's value displayed text from the option. This is most useful when the value attribute and displayed value are different.

Parameters:
selectName - - The parameter name of the select option.
selectValue - - The option value attribute. ( <option value="selectValue">valueDisplayed</option>)
form - - The form that contains ths select input type.
Returns:
value displayed - Option's value displayed that corresponds with the attribute.

getCurrentPageText

public String getCurrentPageText()
Gets the text of the current response (page).

Returns:
The text of the current response (page) or null if there is no text.
Throws:
RuntimeException - - If there is a communication failure with the server.

clickButton

public void clickButton(WebForm form,
                        String buttonId)
Deprecated. Use clickButtonWithName() or clickButtonWithID() instead.

Click the button with the given id.

Parameters:
buttonId -

clickButtonWithID

public void clickButtonWithID(WebForm form,
                              String buttonId)
Click the button with the given id.

Parameters:
buttonId -

clickButtonWithName

public void clickButtonWithName(WebForm form,
                                String buttonName)
Click the button with the given name.

Parameters:
form - - the form containing the button
buttonName - - the name of the button to click

getTable

public WebTable getTable(String index,
                         WebTable[] tables)
Gets table from table index.


getTableColumnCells

public List getTableColumnCells(WebTable table,
                                String colName)
Searches a table table for a cell containing text colName. Returns all the cell text values in that column, below the first matching cell.

Parameters:
table - The HttpUnit WebTable to search. Nested tables will not be searched.
colName - The text string (column heading) to be contained within a table cell. This string will be compared against each table cell's contents, whitespace trimmed.
Returns:
The list of cell text values (java.lang.String) in the same column as the matched text string colName; only those cells below the matching cell are returned.

getTrimmedCellText

protected String getTrimmedCellText(WebTable table,
                                    int row,
                                    int col)

getForm

public WebForm getForm(String nameOrId)
Gets the form with the id or the name desired. It first tries to get the form via HttpUnit's getFormWithID(String id) method. If there is no form then it tries to get the form via HttpUnit's getFormWithName(String name) method. If there is still no form returned, then it tries to convert the nameOrID to an integer and get the nth form on the page.

Parameters:
nameOrId - - The name or id of the form or index number (as in array) of the form on the page. The index number represents the nth form in HTML page where 0 is the first form.
Returns:
the form with the id of name or null if no form is return from the HttpUnit methods mentioned above.

getImage

public WebImage getImage(String nameIdAltTextOrSrc)
Gets the image with the name, alt text or the image source desired. It first tries to get the image via the name, followed by the alt text, finally by the image source.

Parameters:
nameIdAltTextOrSrc - - the name, alt text or src of image to return
Returns:
the image with the information provided.

getLink

public WebLink getLink(String text)
Tries to get a link via the following HttpUnit methods in order.
  1. getLinkWith() - Gets a link with the diplayed text
  2. getLinkWithID() - Gets a link with the id attribute set.
  3. getLinkWithImageText - Gets a link with the alt attribute or alt text.
  4. getLinkWithName() - Gets a link with the name attribute set.

Parameters:
text - - The link text or the link id or the alt text or the link name.
Returns:
the first link that corresponds to the above mentioned or null if no WebLink is found.

getLinkInTable

public WebLink getLinkInTable(String text,
                              String tablePosition,
                              String tableRow,
                              String tableColumn)
Tries to get a link which is located in the specified table cell via the following HttpUnit methods in order.
  1. getLinkWith() - Gets a link with the diplayed text
  2. getLinkWithID() - Gets a link with the id attribute set.
  3. getLinkWithImageText - Gets a link with the alt attribute or alt text.
  4. getLinkWithName() - Gets a link with the name attribute set.
This method will ingore any link that match the criteria but are not located in the correct place

Parameters:
text - The link text or the link id or the alt text or the link name.
tablePosition - Identifies which table to look in for the link. This can be a table id, or a table specifier in the format table->(row,col)subtable->(row,col)subtable->etc.
tableRow - The row of the table to look in for the link
tableColumn - The column of the table to look in for the link
Returns:
the first link that corresponds to the above mentioned or null if no WebLink is found.

clickLink

public WebResponse clickLink(String link,
                             boolean ignoreTarget)
Finds a link via the getLink(java.lang.String) method and clicks on it.

Parameters:
link - - see getLink(java.lang.String) for more information.
ignoreTarget - - if set, will not open link in new window (if the link has a target).
Returns:
The WebResponse returned by clicking on the link.

clickLink

public WebResponse clickLink(WebLink webLink,
                             boolean ignoreTarget)
Finds a link via the getLink(java.lang.String) method and clicks on it.

Parameters:
webLink - - see getLink(java.lang.String) for more information.
ignoreTarget - - if set, will not open link in new window (if the link has a target).
Returns:
The WebResponse returned by clicking on the link.

clickLink

public WebResponse clickLink(String link)
Finds a link via the getLink(java.lang.String) method and clicks on it.

Parameters:
link - - see getLink(java.lang.String) for more information.
Returns:
The WebResponse returned by clicking on the link.

clickLinkWithId

public WebResponse clickLinkWithId(String linkId)
Navigate by selection of a link with given id.

Parameters:
linkId - The id attribute defined in the link to click.
Returns:
The WebResponse returned by clicking on the link.

clickLinkWithImage

public WebResponse clickLinkWithImage(String altText)
Navigate by selection of a link with a given alt text.

Parameters:
altText - - The alt text for the image
Returns:
The WebResponse returned by clicking on the link.

clickLinkWithImageSrc

public WebResponse clickLinkWithImageSrc(String src)
Navigate by selection of a link with a given src.

Parameters:
src - - The src attribute of an image. This source simply needs to be in the actual image source. For example, if the image source was /images/foo/bar.jpg and the src parameter was set to /foo, then it would click on the first link with that matched. If you want more exact behavior, be sure to pass the full path to the image.
Returns:
The WebResponse returned by clicking on the link.

clickLinkWithText

public WebResponse clickLinkWithText(String linkText)
Navigate by selection of a link containing the given text.

Parameters:
linkText - - the text that shows as a link on the browser.
Returns:
The WebResponse returned by clicking on the link.

submitForm

public void submitForm(WebForm form)
submit the form via it's default button

Parameters:
form - - the form to be submitted

submitForm

public void submitForm(WebForm form,
                       String buttonName)
submit the form via it's default button

Parameters:
form - - the form to be submitted
buttonName - - the name of the button to use to submit the form

setFormParameterValueFromContext

public void setFormParameterValueFromContext(WebForm form,
                                             String parameterName,
                                             String contextVariableName,
                                             boolean setOnlyIfNotNull)
submit the form via it's default button

Parameters:
form - - the form to be submitted
parameterName - - The name of the parameter to set.
contextVariableName - - The name of the variable in the context that will become the value of the parameter name.
setOnlyIfNotNull - - set to true if the variable is only to be set when the value is not null or empty.

setHttpUnitFrameName

public void setHttpUnitFrameName(String frameName)
When set, the "current page" is considered to be the frame with this name under the main window.

This attribute is recognized by Jameleon
Required: false


Copyright © 2003-2008 Christian Hargraves. All Rights Reserved.