Package com.meterware.httpunit
Class FormControl.Scriptable
java.lang.Object
com.meterware.httpunit.scripting.ScriptableDelegate
com.meterware.httpunit.FormControl.Scriptable
- All Implemented Interfaces:
DocumentElement
,IdentifiedDelegate
,Input
,NamedDelegate
,ScriptingEventHandler
,ScriptingHandler
- Enclosing class:
- FormControl
implementation of Scriptable input elements
-
Field Summary
Fields inherited from class com.meterware.httpunit.scripting.ScriptableDelegate
NULL_SCRIPT_ENGINE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
blur()
simulate blurvoid
click()
allow calling click for this controlvoid
focus()
simulate focus;get the given propertyprotected HTMLElement
getAttribute
(String attributeName) get the content of the given attributegetID()
get my IDgetName()
get my Nameboolean
handleEvent
(String eventName) Executes the event Handler script for the specified event (such as onchange, onmousedown, onclick, onmouseup) if it is defined.void
removeAttribute
(String attributeName) remove the given attributevoid
allow firing a sendOnChangeEventvoid
set the given property to the given valuevoid
setAttribute
(String attributeName, Object value) set the given attribute to the given valueMethods inherited from class com.meterware.httpunit.scripting.ScriptableDelegate
clearCaches, doEvent, doEventScript, evaluateExpression, get, getDelegates, getScriptEngine, getScriptEngine, runScript, setScriptEngine, supportsScriptLanguage
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.meterware.httpunit.scripting.Input
removeAttribute
-
Constructor Details
-
Scriptable
public Scriptable()construct a Scriptable
-
-
Method Details
-
getName
get my Name- Specified by:
getName
in interfaceNamedDelegate
- Returns:
- the name of this scriptable
-
getID
get my ID- Specified by:
getID
in interfaceIdentifiedDelegate
- Returns:
- the id of this scriptable
-
get
get the given property -
set
set the given property to the given value- Specified by:
set
in interfaceInput
- Overrides:
set
in classScriptableDelegate
- Parameters:
propertyName
- - the property to setvalue
- - the value to use
-
setAttribute
set the given attribute to the given value- Specified by:
setAttribute
in interfaceInput
- Parameters:
attributeName
- - the name of the attribute to setvalue
- - the value to use
-
click
allow calling click for this control- Specified by:
click
in interfaceInput
- Throws:
IOException
SAXException
-
blur
public void blur()simulate blur -
focus
public void focus()simulate focus; -
sendOnChangeEvent
public void sendOnChangeEvent()allow firing a sendOnChangeEvent- Specified by:
sendOnChangeEvent
in interfaceInput
-
get_element
- Returns:
- the _element
-
getAttribute
get the content of the given attribute- Parameters:
attributeName
-- Returns:
- the attribute as a string
-
removeAttribute
remove the given attribute- Parameters:
attributeName
-
-
handleEvent
Description copied from class:ScriptableDelegate
Executes the event Handler script for the specified event (such as onchange, onmousedown, onclick, onmouseup) if it is defined.- Specified by:
handleEvent
in interfaceScriptingEventHandler
- Overrides:
handleEvent
in classScriptableDelegate
- Parameters:
eventName
- the name of the event for which a handler should be run.- Returns:
- whether the event with the given name was handled
-