|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.meterware.httpunit.ParameterHolder | +--com.meterware.httpunit.WebRequestSource | +--com.meterware.httpunit.WebForm
This class represents a form in an HTML page. Users of this class may examine the parameters
defined for the form, the structure of the form (as a DOM), or the text of the form. They
may also create a WebRequest
to simulate the submission of the form.
Inner Class Summary | |
class |
WebForm.Scriptable
|
Method Summary | |
protected void |
addPresetParameter(String name,
String value)
Records a parameter defined by including it in the destination URL. |
String |
getAction()
Returns the action defined for this form. |
String |
getCharacterSet()
Returns the character set encoding for this form. |
String |
getMethod()
Returns the method defined for this form. |
int |
getNumTextParameters(String name)
Returns the number of text parameters in this form with the specified name. |
String[] |
getOptions(String name)
Returns the displayed options defined for the specified parameter name. |
String[] |
getOptionValues(String name)
Returns the option values defined for the specified parameter name. |
String[] |
getParameterNames()
Returns an array containing the names of the parameters defined for this form. |
String |
getParameterValue(String name)
Returns the default value of the named parameter. |
String[] |
getParameterValues(String name)
Returns the multiple default values of the named parameter. |
WebRequest |
getRequest()
Creates and returns a web request which will simulate the submission of this form with an unnamed submit button. |
WebRequest |
getRequest(String submitButtonName)
Creates and returns a web request which will simulate the submission of this form with a button with the specified name. |
WebRequest |
getRequest(String submitButtonName,
String submitButtonValue)
Creates and returns a web request which will simulate the submission of this form with a button with the specified name and value. |
WebRequest |
getRequest(SubmitButton button)
Creates and returns a web request which will simulate the submission of this form by pressing the specified button. |
WebRequest |
getRequest(SubmitButton button,
int x,
int y)
Creates and returns a web request which will simulate the submission of this form by pressing the specified button. |
WebForm.Scriptable |
getScriptableObject()
Returns an object which provides scripting access to this form. |
SubmitButton |
getSubmitButton(String name)
Returns the submit button defined in this form with the specified name. |
SubmitButton |
getSubmitButton(String name,
String value)
Returns the submit button defined in this form with the specified name and value. |
SubmitButton[] |
getSubmitButtons()
Returns an array containing the submit buttons defined for this form. |
SubmitButton |
getSubmitButtonWithID(String ID)
Returns the submit button defined in this form with the specified ID. |
boolean |
hasParameterNamed(String soughtName)
Returns true if a parameter with given name exists in this form. |
boolean |
hasParameterStartingWithPrefix(String prefix)
Returns true if a parameter starting with a given name exists, |
boolean |
isFileParameter(String name)
Returns true if the named parameter accepts files for upload. |
boolean |
isMultiValuedParameter(String name)
Returns true if the named parameter accepts multiple values. |
boolean |
isSubmitAsMime()
Returns true if this form is to be submitted using mime encoding (the default is URL encoding). |
boolean |
isTextParameter(String name)
Returns true if the named parameter accepts free-form text. |
void |
removeParameter(String name)
Removes a parameter name from this collection. |
void |
reset()
Resets all parameters to their initial values. |
void |
selectImageButtonPosition(SubmitButton imageButton,
int x,
int y)
Specifies the position at which an image button (if any) was clicked. |
void |
setParameter(String name,
String value)
Sets the value of a parameter in this form. |
void |
setParameter(String name,
String[] values)
|
void |
setParameter(String name,
UploadFileSpec[] files)
Sets the multiple values of a file upload parameter in a web request. |
Methods inherited from class com.meterware.httpunit.WebRequestSource |
getBaseURL, getDestination, getDOMSubtree, getID, getName, getNode, getTarget, loadDestinationParameters |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public String getMethod()
public String getAction()
public boolean hasParameterNamed(String soughtName)
public boolean hasParameterStartingWithPrefix(String prefix)
public SubmitButton[] getSubmitButtons()
public SubmitButton getSubmitButton(String name)
public SubmitButton getSubmitButton(String name, String value)
public SubmitButton getSubmitButtonWithID(String ID)
public WebRequest getRequest(String submitButtonName, String submitButtonValue)
public WebRequest getRequest(String submitButtonName)
public WebRequest getRequest(SubmitButton button)
public WebRequest getRequest(SubmitButton button, int x, int y)
public String getParameterValue(String name)
public String[] getOptions(String name)
public String[] getOptionValues(String name)
public boolean isMultiValuedParameter(String name)
public int getNumTextParameters(String name)
public boolean isTextParameter(String name)
public boolean isSubmitAsMime()
public void reset()
public WebForm.Scriptable getScriptableObject()
public String getCharacterSet()
public boolean isFileParameter(String name)
public String[] getParameterNames()
getParameterNames
in class WebRequestSource
public String[] getParameterValues(String name)
getParameterValues
in class WebRequestSource
public WebRequest getRequest()
getRequest
in class WebRequestSource
protected void addPresetParameter(String name, String value)
addPresetParameter
in class WebRequestSource
public void selectImageButtonPosition(SubmitButton imageButton, int x, int y)
public void removeParameter(String name)
public void setParameter(String name, UploadFileSpec[] files)
public void setParameter(String name, String value)
public void setParameter(String name, String[] values)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |