public class

FormParameterUtil

extends Object
java.lang.Object
   ↳ com.atlassian.jira.functest.framework.util.form.FormParameterUtil

Class Overview

This class is used to modify form requests that are to be submitted It does this by modifying the request on a form before submitting it. If you attempt to resunbmit a form then an assertion error ewill be thrown. also note that for duration from construction to form submission the validation of parameter values in the test is disabled. You have to work with the returned DOM, rather than with the tester, as the state of the request and response objects will not be in sync

Summary

Public Constructors
FormParameterUtil(WebTester tester, String formIdentifierOrName, String submitButtonName)
Public Methods
void addOptionToHtmlSelect(String select, String[] value)
allows you to add options to an existing select HTML element
void replaceOptionsinHtmlSelect(String select, String[] value)
allows you to replace the options in an existing select HTML element
void setFormElement(String formElementName, String value)
allows you to replace the options in an existing select HTML element
void setParameters(Map<StringString[]> parameters)
allows you to set the value of any parameter in the request
Node submitForm()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public FormParameterUtil (WebTester tester, String formIdentifierOrName, String submitButtonName)

Parameters
tester the currently executing WebTester
formIdentifierOrName either the id or the name of the form you want to modify
submitButtonName the name of the submit button, if null then the default button is used

Public Methods

public void addOptionToHtmlSelect (String select, String[] value)

allows you to add options to an existing select HTML element

Parameters
select the name of the select to which to add an option
value a string array containing the option values you want to submit

public void replaceOptionsinHtmlSelect (String select, String[] value)

allows you to replace the options in an existing select HTML element

Parameters
select the name of the select to which to repalce all options
value a string array containing the option values you want to submit

public void setFormElement (String formElementName, String value)

allows you to replace the options in an existing select HTML element

Parameters
formElementName the name of the formElement
value a string containing the value you want to submit

public void setParameters (Map<StringString[]> parameters)

allows you to set the value of any parameter in the request

Parameters
parameters A map containing the names and values of the parmeters to be submited

public Node submitForm ()

Returns
  • The DOM Document that represents the returned response. To guarantee lower case the DomNodeCopier is used to return a shallow copy of the Document