net.sf.jameleon.plugin.htmlunit.tags
Class HtmlUnitSetSelectFieldTag

java.lang.Object
  extended by org.apache.commons.jelly.TagSupport
      extended by net.sf.jameleon.LocationAwareTagSupport
          extended by net.sf.jameleon.JameleonTagSupport
              extended by net.sf.jameleon.function.FunctionTag
                  extended by net.sf.jameleon.plugin.htmlunit.HtmlUnitFunctionTag
                      extended by net.sf.jameleon.plugin.htmlunit.tags.HtmlUnitSetSelectFieldTag
All Implemented Interfaces:
BreakPoint, Attributable, Storable, DynaTag, LocationAware, Tag

public class HtmlUnitSetSelectFieldTag
extends HtmlUnitFunctionTag

This tag is used to select or unselect options in a select field.

To use XPath to select a select field named sf_1 of an option with the value attribute of sfo_1 that exists in a form with the name testform:


     <htmlunit-set-select-field
            functionId="Select the select field option with the value 'sfo_1'"
            xpath="//form[@name='testform']/select[@name='sf_1']/option[@value='sfo_1']"
            selected="true"/>
 

To use XPath to unselect a sf_1 select field option with the value attribute of sfo_1 that exists in a form with the name testform:


     <htmlunit-set-select-field
            functionId="Select the select field option with the value 'sfo_1'"
            xpath="//form[@name='testform']/select[@name='sf_1']/option[@value='sfo_1']"
            selected="false"/>
 

To use the form, field name and option value to select an option with the value sfo_1 that exists in a form with the name testform:


     <htmlunit-set-select-field
            functionId="select the select field option with the value attribute of 'sfo_1'"
            form="testform"
            fieldName="sf_1"
            optionValue="sfo_1"
            selected="true"/>
 

To use the form, field name and option text to select an option by it's displayed text Select Me that exists in a form with the name testform:


     <htmlunit-set-select-field
            functionId="select the select field option with the displayed text 'Select Me'"
            form="testform"
            fieldName="sf_1"
            optionText="Select Me"
            selected="true"/>
 

To use the form, field name and option text to select the 3rd option that exists in a form with the name testform:


     <htmlunit-set-select-field
            functionId="select the third select field option"
            form="testform"
            fieldName="sf_1"
            optionIndex="2"
            selected="true"/>
 

Tag Name: <htmlunit-set-select-field> Type: action

Field Summary
protected  String fieldName
          The field name in the form.
protected  String form
          The identifier of the form.
protected  int optionIndex
          The position of the option to select.
protected  String optionText
          The the displayed text of the option's value attribute
protected  String optionValue
          The the value of the option's value attribute
protected  Boolean selected
          The xpath that matches the desired option to select.
protected  String xpath
          The xpath that matches the desired option to select.
 
Fields inherited from class net.sf.jameleon.plugin.htmlunit.HtmlUnitFunctionTag
helper, sessionTag, workingForm
 
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
 
Fields inherited from class net.sf.jameleon.JameleonTagSupport
attributes, broker, contextVars, fp, unsupportedAttributes
 
Fields inherited from class net.sf.jameleon.LocationAwareTagSupport
columnNumber, elementTagName, lineNumber, scriptFileName
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
HtmlUnitSetSelectFieldTag()
           
 
Method Summary
 void testBlock()
           
 
Methods inherited from class net.sf.jameleon.plugin.htmlunit.HtmlUnitFunctionTag
assertTextPresent, assertTextPresent, assertTextPresent, assertTextPresent, assertTitleEquals, assertTitleEquals, assertTitleEquals, assertTitleEquals, assertXPathMatches, assertXPathMatches, assertXPathMatches, assertXPathMatches, clickElementWithXPath, getHtmlElementByAttributeNameAndValue, getHtmlElementByXPath, getHtmlForm, getHtmlFormById, getHtmlFormByIndex, getHtmlFormByName, getHtmlFormByXPath, getWorkingForm, navigate, setCheckBox, setCheckBox, setFileField, setHiddenField, setHtmlInputValue, setHtmlInputValueByXPath, setPasswordField, setRadioButton, setSelectFieldByIndex, setSelectFieldByOptionText, setSelectFieldByValue, setSelectFieldByXPath, setTextArea, setTextField, setupEnvironment, setWorkingForm, setWorkingFormById, setWorkingFormByIndex, setWorkingFormByName, setWorkingFormByXPath, store
 
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 net.sf.jameleon.LocationAwareTagSupport
getColumnNumber, getElementName, getFileName, getLineNumber, setColumnNumber, setElementName, setFileName, setLineNumber
 
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
 
Methods inherited from interface org.apache.commons.jelly.Tag
getBody, getContext, getParent, invokeBody, setBody, setContext, setParent
 

Field Detail

form

protected String form
The identifier of the form. Value indentifiers are, the name, id, index or XPath expression Only the form or xpath attribute can be set at once

This attribute is recognized by Jameleon

fieldName

protected String fieldName
The field name in the form.

This attribute is recognized by Jameleon

optionValue

protected String optionValue
The the value of the option's value attribute

This attribute is recognized by Jameleon

optionIndex

protected int optionIndex
The position of the option to select. The first displayed option would be 1

This attribute is recognized by Jameleon

optionText

protected String optionText
The the displayed text of the option's value attribute

This attribute is recognized by Jameleon

xpath

protected String xpath
The xpath that matches the desired option to select.

This attribute is recognized by Jameleon

selected

protected Boolean selected
The xpath that matches the desired option to select.

This attribute is recognized by Jameleon
Required: true
Constructor Detail

HtmlUnitSetSelectFieldTag

public HtmlUnitSetSelectFieldTag()
Method Detail

testBlock

public void testBlock()
Overrides:
testBlock in class FunctionTag


Copyright © 2006-2008 Christian Hargraves. All Rights Reserved.