<field-expect>

The <field-expect> element allows for the validation of a detail screen field’s value and state. State information includes hidden or visible, and enabled or disabled. The contents of the field that can be validated include its current value, for duration fields the current value of each portion of the duration value (hours, minutes, seconds), for list fields the total number of rows in a list, or the current value of a row or rows within a list. When validating the value of a field, the validation attribute should be set indicating the type of validation. To validate multiple facets of a field, such as current value and enabled or disabled, multiple <field-expect> elements are required to validate each facet. To validate the value of multiple rows within a list, the <field-expect> element must contain on <row> element for each row to be validated. Note that only drop down lists may be validated by this element. For list view or list tile view fields, the <list-expect> element must be used. If the field does not match the expected criteria as specified by the <field-expect> element, a script error is thrown.

Structure

Contains:
  • Text - The value that the field is expected to contain, or the value of the state being checked by the element.
  • <row>
Contained By:
  • <script>
Attributes
Name Description Data Type Default Value Required
type This attribute specifies what is being checked for within the field by this element. Valid values include:
  • string - The field’s string value
  • bool - The field’s Boolean value.
  • long - The field’s integral number value.
  • decimal - The field’s decimal number value.
  • validateValue - The field’s value.
  • enabled - The field’s enabled or disabled state.
  • visible - The field’s visible or hidden state.
  • list - The field is a drop down list.
  • format - The label for a button field.
string string No
special This attribute specifies that the field’s value should or should not be equal to its defined special value. The value t is true and the field is expected to be set to its special value. The value f is false. string f No
part This attribute is valid only when checking a duration field. It specifies the portion of the duration value to be checked. Valid values for this attribute include:
  • hours - The hours portion of the duration.
  • decimalHours - The hours portion of the duration as a decimal.
  • minutes - The minutes portion of the duration.
  • seconds - The seconds portion of the duration.
string none Required for duration field edit types. Otherwise ignored.
row The row index to be checked by the element when the field is a drop down list. This index is 0-based, meaning the first row in the list is at position 0. This attribute is only valid when the edit type of the field is Complex Table Drop Down, Data Table Selection, or List Selection. If the <field-expect> contains one or more <row> elements, the first row checked is indicated by this attribute. Additional <row> elements are expected to be contained in the list in the order in which their corresponding <row> elements are contained in the <field-expect>. non-negative integer none Required for drop down list fields. Otherwise ignored.
count This attribute specifies the expected number of rows in the list. non-negative integer none No
common field attributes This element contains the following common field attributes:
  • name
  • id
  • label
N/A N/A N/A
common script attributes A set of related attributes common to most elements within the Agentry Test Script. N/A N/A N/A