public class WebLink extends WebRequestSource
WebRequest to simulate clicking
on the link.| Modifier and Type | Class and Description |
|---|---|
class |
WebLink.Scriptable |
| Modifier and Type | Field and Description |
|---|---|
static HTMLElementPredicate |
MATCH_CONTAINED_TEXT
Predicate to match part or all of a link's contained text.
|
static HTMLElementPredicate |
MATCH_ID
Predicate to match a link's ID.
|
static HTMLElementPredicate |
MATCH_NAME
Predicate to match a link's name.
|
static HTMLElementPredicate |
MATCH_TEXT
Predicate to match a link's text exactly.
|
static HTMLElementPredicate |
MATCH_URL_STRING
Predicate to match part or all of a link's URL string.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addPresetParameter(java.lang.String name,
java.lang.String value)
Records a parameter defined by including it in the destination URL.
|
java.lang.String |
asText()
Deprecated.
as of 1.6, use #getText instead
|
WebResponse |
click()
Submits a request as though the user had clicked on this link.
|
protected java.lang.String |
getEmptyParameterValue() |
java.lang.String[] |
getParameterNames()
Returns an array containing the names of any parameters defined as part of this link's URL.
|
java.lang.String[] |
getParameterValues(java.lang.String name)
Returns the multiple default values of the named parameter.
|
WebRequest |
getRequest()
Creates and returns a web request which will simulate clicking on this link.
|
java.lang.String |
getText()
Returns the text value of this link.
|
java.lang.String |
getURLString()
Returns the URL referenced by this link.
|
void |
mouseOver()
Simulates moving the mouse over the link.
|
ScriptableDelegate |
newScriptable() |
void |
recordParameters(com.meterware.httpunit.protocol.ParameterProcessor processor)
Iterates through the parameters in this holder, recording them in the supplied parameter processor.
|
protected void |
setDestination(java.lang.String destination) |
doEvent, doEventScript, getAttribute, getBaseResponse, getBaseURL, getClassName, getCurrentFrameContents, getDestination, getDOMSubtree, getElement, getFragmentIdentifier, getFrame, getHTMLPage, getID, getName, getNode, getPageFrame, getParentDelegate, getRelativeURL, getScriptingHandler, getTagName, getTarget, getTitle, handleEvent, isSupportedAttribute, loadDestinationParameters, removeAttribute, setAttribute, setTargetAttribute, submitRequest, submitRequestpublic static final HTMLElementPredicate MATCH_URL_STRING
public static final HTMLElementPredicate MATCH_TEXT
public static final HTMLElementPredicate MATCH_CONTAINED_TEXT
public static final HTMLElementPredicate MATCH_ID
public static final HTMLElementPredicate MATCH_NAME
public java.lang.String getURLString()
public java.lang.String getText()
getText in interface HTMLElementgetText in class WebRequestSourcepublic java.lang.String asText()
public WebResponse click() throws java.io.IOException, org.xml.sax.SAXException
java.io.IOExceptionorg.xml.sax.SAXExceptionpublic void mouseOver()
public ScriptableDelegate newScriptable()
public WebRequest getRequest()
getRequest in class WebRequestSourcepublic java.lang.String[] getParameterNames()
getParameterNames in class WebRequestSourcepublic java.lang.String[] getParameterValues(java.lang.String name)
getParameterValues in class WebRequestSourceprotected void addPresetParameter(java.lang.String name,
java.lang.String value)
WebRequestSourceaddPresetParameter in class WebRequestSourceprotected java.lang.String getEmptyParameterValue()
getEmptyParameterValue in class WebRequestSourceprotected void setDestination(java.lang.String destination)
setDestination in class WebRequestSourcepublic void recordParameters(com.meterware.httpunit.protocol.ParameterProcessor processor)
throws java.io.IOException
java.io.IOException