net.sf.jameleon.plugin.watij.tags
Class WatijSetSelectListTag
java.lang.Object
org.apache.commons.jelly.TagSupport
net.sf.jameleon.LocationAwareTagSupport
net.sf.jameleon.JameleonTagSupport
net.sf.jameleon.function.FunctionTag
net.sf.jameleon.plugin.watij.WatijFunctionTag
net.sf.jameleon.plugin.watij.tags.AbstractWatijGetTag
net.sf.jameleon.plugin.watij.tags.WatijSelectListTag
net.sf.jameleon.plugin.watij.tags.WatijSetSelectListTag
All Implemented Interfaces: BreakPoint , Attributable , Storable , DynaTag , LocationAware , Tag
public class WatijSetSelectListTag extends WatijSelectListTag
Selects a given option of a select list.
For example, set a select field by the displayed text option (<option>two</option>):
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-set-select-list
functionId="Set the 'two' option of a select field"
how="name"
what="selectFieldName"
select="two"/>
</watij-session>
</testcase>
To select the option by its value attribute setting (<option value="2">two</option>)
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-set-select-list
functionId="Set the 'two' option of a select field"
how="xpath"
what="//SELECT[@name='selectFieldName']"
selectValue="2"/>
</watij-session>
</testcase>
To clear the selected option(s):
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-set-select-list
functionId="Clear the selected options"
how="xpath"
what="//SELECT[@name='selectFieldName']"
clearSelection="true"/>
</watij-session>
</testcase>
To select multiple values (2, and 3) against a multi select list:
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-set-select-list
functionId="Set the 'two' option of a select field"
how="xpath"
what="//SELECT[@name='selectFieldName']"
selectValue="2"/>
<watij-set-select-list
functionId="Set the 'two' option of a select field"
how="name"
what="selectFieldName"
select="three"/>
</watij-session>
</testcase>
See the javadocs on watij's SymbolFactory for a complete list of supported symbols.
Tag Name : <watij-set-select-list> Type : action
Steps:
Find the matching select field
Verify it exists
Select the desired option
Field Summary
protected boolean
clearSelection
Clear the optioh selection.
protected String
select
Select the option with the matching displayed text
protected String
selectValue
Select the option with the matching value attribute's value
Fields inherited from class net.sf.jameleon.function.FunctionTag
addt , breakPoint , expectException , expectFailure , fResults , functionDelay , functionId , lastFileWritten , log , NO_DELAY , params , postcondition , precondition , st , state , tct , vpt
Methods inherited from class net.sf.jameleon.function.FunctionTag
addParam , addRequiredAttribute , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertFalse , assertFalse , assertFalse , assertFalse , assertMethod , assertMethodWithLevel , assertNotNull , assertNotNull , assertNotNull , assertNotNull , assertNotSame , assertNotSame , assertNotSame , assertNotSame , assertNull , assertNull , assertNull , assertNull , assertRegexMatches , assertRegexMatches , assertRegexMatches , assertRegexMatches , assertSame , assertSame , assertSame , assertSame , assertTextContains , assertTextContains , assertTextContains , assertTextContains , assertTextEndsWith , assertTextEndsWith , assertTextEndsWith , assertTextEndsWith , assertTextStartsWith , assertTextStartsWith , assertTextStartsWith , assertTextStartsWith , assertTrue , assertTrue , assertTrue , assertTrue , checkParamTypes , cleanUp , cleanUpEnvironment , delay , delay , doTag , fail , fail , fail , fail , getFunctionId , getFunctionResults , getMatchingRegexText , getParam , getParamLength , getParams , getParentTags , getSessionTag , getStoreToFileName , getStringOrDefault , getTestCaseTag , getVariable , getVariableAsBoolean , getVariableAsList , getVariableAsString , isBreakPoint , isContextVariableNull , pluginTearDown , recordFunctionResult , regexMatches , removeFunctionResult , removeVariable , setDefaultVariableValue , setDefaultVariableValue , setExpectException , setExpectFailure , setFunctionDelay , setFunctionId , setup , setUpFunctionResults , setVariable , tearDown , traceMsg , validate
Methods inherited from class net.sf.jameleon.JameleonTagSupport
cleanVariablesInContext , createAttributes , describeAttributes , getAttributeBroker , getAttributes , getAttributeType , getClassAttributes , getFunctionalPoint , getUnsupportedAttributes , loadFunctionalPoint , resetFunctionalPoint , setAttribute , setVariableInContext , testForUnsupportedAttributesCaught
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass , findAncestorWithClass , findAncestorWithClass , findAncestorWithClass , findAncestorWithClass , findAncestorWithClass , getBody , getBodyText , getBodyText , getContext , getParent , invokeBody , isEscapeText , isTrim , setBody , setContext , setEscapeText , setParent , setTrim , trimBody
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
select
protected String select
Select the option with the matching displayed text
This attribute is recognized by Jameleon
selectValue
protected String selectValue
Select the option with the matching value attribute's value
This attribute is recognized by Jameleon
clearSelection
protected boolean clearSelection
Clear the optioh selection. If this is true and select or selectValue
are set, then the list will be cleared first, and the new option will
be selected. This option is for multi select boxes only.
This attribute is recognized by Jameleon Default Value: false
WatijSetSelectListTag
public WatijSetSelectListTag ()
testBlock
public void testBlock ()
throws Exception
Overrides: testBlock in class AbstractWatijGetTag
Throws:
Exception
Copyright © 2006-2008 Christian Hargraves. All Rights Reserved.