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"/>