background image
<< Updating Testplan - Typing data directly into the testplan | Updating Testplan - the FindTest testcase >>
Updating Testplan - Specifying data that is shared by multiple tests
<< Updating Testplan - Typing data directly into the testplan | Updating Testplan - the FindTest testcase >>
226
User's Guide
10 A
DDING
D
ATA
TO
A
T
ESTPLAN
Specifying data that is shared by multiple tests
b
If the testcase expects a record, use the same syntax as above, but
open and close the list of record fields with curly braces:
testdata: {data [,data]}
where data is any valid 4Test expression.
Be sure to follow the testdata keyword with a colon. If you enter the
keyword correctly, the statement appears in dark red, the default color.
Otherwise, the statement appears in either blue or black, indicating the
compiler is interpreting the line as a description.
For example:
Specifying data that is shared by multiple tests
If you have many related testcases, using the technique shown above with the
testdata statement can result in a lot of redundant data, which creates a
maintenance burden. For example, look at the testplan in the figure on
page 223. The testcase, FindTest, takes a record. Using testdata, you have to
supply the entire record in each individual test, even though some of the data
is common to several tests.
In order to eliminate that redundancy, you can factor out the data that is
common to a group of tests and define it at a level in the testplan where it can
be shared by the group. To do this, you define symbols and assign them
values.
Definition of a symbol
A symbol represents a piece of data in a data-driven testcase. It is like a 4Test
identifier, except that its name begins with the $ character. For example,
consider the following testplan: