How to use loop control actions to handle iterative processes.
In the My streamlining test module you created
previously, create a new test case:
Place your cell pointer on a line somewhere below the existing set of
action lines (but before the FINAL section, if any).
Click Create New Test Case
on the toolbar.
A test case line similar to the following is inserted.
In the second column of the new line, assign the test
case an ID of TC 02 (if not already set to that
Press Tab to
advance to the next column, and provide a description for your test
case, such as loop it.
Copy the first two local variable action lines from Test Case
TC 01 (not from the INITIAL
section), and paste them lines into the new test case.
Under your new action lines, enter a repeat action in the
Note that an until action is automatically inserted
several lines below the repeat action. Together, these two
actions form a loop in which all action lines appearing between them are
repeatedly executed until a condition is satisfied. That condition is specified
in the until action's condition to stop
Insert additional blank rows after the repeat action, so
that the repeat and until lines are at
least nine rows apart. (Note that you can press Ctrl+I to
insert rows above the cell pointer.)
This allows two action lines to be inserted into the loop.
Select one of the report action lines from Test Case
TC 01, copy it, then paste it under the
repeat action line of TC 02.
Under that line (but before the until action line), enter
the following action line:
local variable car price # car price + 5000
With this line, during execution, the local variable car
price is incremented with each iteration of the
repeat/until loop, achieving the same
thing as each of the last two local variable lines of the
first test case TC 01.
Finally, enter the expression # car price > 30000 as the
condition to stop argument of the
This comparison expression serves as the terminating condition of the
repeat/until loop. It is evaluated
each time the until statement is executed. If false,
execution returns to the first action line under the
repeat. If true, the loop is exited, and execution
continues with the next action line under the until.
Your test case should now resemble the following:
Execute Test Case 02 of your test.
With your test displayed in the editor, do the
The status bar (at the bottom left of the
TestArchitect window) indicates the stages of the test as it progresses.
The Execute Test dialog box appears.
In the Test Modules panel, expand the
Ensure that only the check box for
test case TC 02 is
In the test results, click the View detailed results per test
line link to open the detailed test lines on a web
On the Result Details tab, view the output of the
report action lines, which are identical to those of test
case TC 01.
Given the small size of TC 01 (only three redundant
report actions), it does not pose much of a problem. But if
it were required to produce more report lines for a wider range
of car prices (at a constant incremental change in value), the test would need to
grow in proportion to the number of reports required. By
contrast, the same can be accomplished in Test Case TC 02 without
any additional action lines – only an adjustment of its
repeat/until loop's terminating condition
would be required.