|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
com.canoo.webtest.steps.Step
com.canoo.webtest.steps.AbstractBrowserAction
com.canoo.webtest.steps.form.AbstractSetFieldStep
public abstract class AbstractSetFieldStep
Abstract class for steps which update form fields. This class handles the attributes name/formName, htmlId or xpath.
| Field Summary | |
|---|---|
static String |
MESSAGE_ARGUMENT_MISSING
|
static String |
MESSAGE_ARGUMENT_REDUNDANT
|
| Fields inherited from class com.canoo.webtest.steps.Step |
|---|
DEFAULT_DESCRIPTION, ELEMENT_ATTRIBUTE_ID, ELEMENT_ATTRIBUTE_NAME, PROPERTY_TYPE_ANT, PROPERTY_TYPE_ANT_STRICT, PROPERTY_TYPE_DEFAULT, PROPERTY_TYPE_DYNAMIC |
| Fields inherited from class org.apache.tools.ant.Task |
|---|
target, taskName, taskType, wrapper |
| Fields inherited from class org.apache.tools.ant.ProjectComponent |
|---|
description, location, project |
| Constructor Summary | |
|---|---|
AbstractSetFieldStep()
|
|
| Method Summary | |
|---|---|
void |
doExecute()
Called to perform the step's functionality. |
protected List |
findFields(com.gargoylesoftware.htmlunit.html.HtmlForm form)
Finds all possible input fields. |
protected abstract com.gargoylesoftware.htmlunit.html.HtmlForm |
findForm()
Finds the relevant form. |
String |
getFieldIndex()
|
String |
getForLabel()
|
String |
getFormName()
|
String |
getHtmlId()
|
String |
getName()
|
String |
getXpath()
|
protected boolean |
keepField(com.gargoylesoftware.htmlunit.html.HtmlElement elt)
Called by findFields(com.gargoylesoftware.htmlunit.html.HtmlForm) to filter out elements
with the correct name but not matching some other selection criteria. |
static com.gargoylesoftware.htmlunit.html.HtmlElement |
selectField(List fieldList,
String indexStr,
Step step)
Finds the desired field by selecting either a specific field designated by indexStr or the first one if indexStr is left blank |
protected abstract void |
setField(com.gargoylesoftware.htmlunit.html.HtmlElement field)
Sets a field according to the step. |
void |
setFieldIndex(String index)
Set the index. |
void |
setForLabel(String text)
Set the text of the label associated with the field to set. |
void |
setFormName(String formName)
Set the form name. |
void |
setHtmlId(String htmlId)
Set the html id. |
void |
setName(String name)
Set the name. |
void |
setXpath(String xpath)
Set the xpath. |
protected List |
trimFields(List fields)
Apply keepField(com.gargoylesoftware.htmlunit.html.HtmlElement) to trim the list of fields found. |
protected void |
verifyParameters()
Called to let the step's implementation validate its parameters. |
| Methods inherited from class com.canoo.webtest.steps.AbstractBrowserAction |
|---|
setSave, setSavePrefix, setSaveResponse |
| Methods inherited from class org.apache.tools.ant.Task |
|---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
| Methods inherited from class org.apache.tools.ant.ProjectComponent |
|---|
getDescription, getLocation, getProject, setDescription, setLocation, setProject |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.canoo.webtest.interfaces.IBrowserAction |
|---|
getTaskName |
| Field Detail |
|---|
public static final String MESSAGE_ARGUMENT_MISSING
public static final String MESSAGE_ARGUMENT_REDUNDANT
| Constructor Detail |
|---|
public AbstractSetFieldStep()
| Method Detail |
|---|
public void setName(String name)
name - public String getName()
public void setForLabel(String text)
text - the label textpublic String getForLabel()
public String getXpath()
public void setXpath(String xpath)
xpath - public void setFormName(String formName)
formName - public String getFormName()
public String getHtmlId()
public void setHtmlId(String htmlId)
htmlId - public void setFieldIndex(String index)
index - public String getFieldIndex()
public void doExecute()
throws SAXException,
IOException
Step
doExecute in class StepSAXException
IOException
protected abstract void setField(com.gargoylesoftware.htmlunit.html.HtmlElement field)
throws IOException
field - The field to set.
IOExceptionprotected abstract com.gargoylesoftware.htmlunit.html.HtmlForm findForm()
protected List findFields(com.gargoylesoftware.htmlunit.html.HtmlForm form)
form - The form to search.
protected List trimFields(List fields)
keepField(com.gargoylesoftware.htmlunit.html.HtmlElement) to trim the list of fields found.
fields - All fields found.
protected boolean keepField(com.gargoylesoftware.htmlunit.html.HtmlElement elt)
findFields(com.gargoylesoftware.htmlunit.html.HtmlForm) to filter out elements
with the correct name but not matching some other selection criteria.
elt - One of the elements with the correct name.
public static com.gargoylesoftware.htmlunit.html.HtmlElement selectField(List fieldList,
String indexStr,
Step step)
fieldList - A list of fields.indexStr - The index of the desired field.step - The calling step, for exception.
protected void verifyParameters()
StepStep.doExecute().
This implementation does nothing, overwrite as needed.
verifyParameters in class Step
|
Copyright © 2001-2007 Canoo Engineering AG, Basel. All rights reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||