Verify


The Verify element is used to verify an expression or to compare two data values – or two data structures. It has an expected value and an actual value. The result will be marked as having validation errors if they are not equal.

The Verify element can use other Replaceable elements for verification. For instance, the Verify expression element is useful for making string operations.

Add Verify to the Test Scenario by dragging it from the tool palette. This opens the Insert a new Verify element popup. Here are the fields available when setting up this element:

  • Label - this is the label name you want assigned.
  • Description - an optional description of the Test Element.
  • Stop execution when verification errors checkbox - attribute that will immediately stop execution of the test scenario if the Verify element validates to false. The state of the test scenario will always be Failed when a Verify element validates to false.
  • Verify expression - attribute to contain an actual verify expression.
Example 1
out["xatstcb1-copybook"].wdays.day1 == "Sunday"
  • Type the ID (of the Functional Test element Properties tab) followed by a . (period). You will be giving a list of the next selection in the path to get to the end field. Keep repeating this until reaching the end field.
  • Type the operator.
  • Type the value.
Example 2
the expression

This requires an expression inside the Statement element. The expression must evaluate to true or false.

Warning

The Verify expression is evaluated using a JavaScript engine, which does not allow hyphens in variable names. Variable names containing hyphens will need to be referenced as ["variable-name"] without the prefixed dot, as shown in Example 1.

  • Actual/expected value - attributes to contain the expression:
    • Expected use expression checkbox - when checked the expression is used.
    • Actual use expression checkbox - when checked the expression is used.
      For an example for both of these, follow the sample models as in the Verify expression above.
  • Compare rules - optional, can be used to define rules to exclude part of each line in the comparison. The Rules element can only be used when Actual/Expected values or Verify expressions are used and when the resulting values are text based and not complex data structures.
  • From pos - attribute specifies a start position of each line/record in the Actual/Expected data. The position is 0-based, meaning that the first position in the record is 0.
  • To pos - attribute specifies a end position of each line/record in the Actual/Expected data. The position is 0-based meaning, that the first position in the record is 0.
  • When - attribute can be used to only apply the rule if the value of the when attribute is equal the value of the text between the From pos and To pos.
  • In - attribute specifies where to compare with the when value.
  • Type -
    • Exclude - Exclude text between start and end position in actual and expected values from comparison. The When and In attribute can setup conditions as well.
    • Include - Include only text between start and end position in actual and expected values. The When and In attribute can setup conditions as well.
    • Excludeall - Exclude complete records based on their numbers.
    • Ignoreline - Exclude complete line/record when text between start and end position actual or expected value is equal the value of the When attribute.
  • OK / Cancel - click on OK to save your element.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*