Validation actions verify whether the actual value of a variable
at execution time corresponds to the expected value of that variable.
Validation actions can be entered directly into the test behavior
source code or defined from the test data table (TDT).
To insert a
validation action:
- Open the test behavior source code in the Java™ editor.
(To find the source code, open the Package Explorer view, expand the test
project you are storing the test in, and expand the Behavior folder.)
- Position the cursor at the location in the code where you want
to add the validation action. (If you choose to use an existing variable for
the validation action, the cursor must be positioned after that variable first
appears in the code.)
- Right-click and click , and then do
one of the following:
- To use an existing variable for the validation action, click Select
a variable for a Validation Action, select a variable from the
list, and click OK.
- Or create a new variable, click Create a new variable for
a Validation Action, specify a variable name and type, and click OK.
The validation action is added to the test behavior code, and
a new row is added to the test data table. For example, if the variable is
named amount, the following code is added:
ComponentTest.check(amount);
- In the test data table, insert a value for the variable.