|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.jira.functest.framework.util.form.FormParameterUtil
public class FormParameterUtil
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
Constructor Summary | |
---|---|
FormParameterUtil(net.sourceforge.jwebunit.WebTester tester,
String formIdentifierOrName,
String submitButtonName)
|
Method Summary | |
---|---|
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<String,String[]> parameters)
allows you to set the value of any parameter in the request |
Node |
submitForm()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FormParameterUtil(net.sourceforge.jwebunit.WebTester tester, String formIdentifierOrName, String submitButtonName)
tester
- the currently executing WebTesterformIdentifierOrName
- either the id or the name of the form you want to modifysubmitButtonName
- the name of the submit button, if null then the default button is usedMethod Detail |
---|
public void addOptionToHtmlSelect(String select, String[] value)
select
- the name of the select to which to add an optionvalue
- a string array containing the option values you want to submitpublic void replaceOptionsinHtmlSelect(String select, String[] value)
select
- the name of the select to which to repalce all optionsvalue
- a string array containing the option values you want to submitpublic void setFormElement(String formElementName, String value)
formElementName
- the name of the formElementvalue
- a string containing the value you want to submitpublic void setParameters(Map<String,String[]> parameters)
parameters
- A map containing the names and values of the parmeters to be submitedpublic Node submitForm()
DomNodeCopier
is used to return a shallow copy of the Document
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |