When you record a test, you perform a sequence of steps
that you expect a typical user to perform. From the recording, a test
is generated that exactly captures these interactions. When you run
this test, it uses the same data that you used during recording. To
vary the data in the test, you use a data pool, which contains variable
data. At run time, this variable data is substituted for the data
in the recorded test.
In the previous lesson, you recorded a test by adding two
integers (8 + 4). Now, you will create a data
pool that has the -,*,/ operators and use the
data pool in the test. In the data pool, you will have two columns
and three rows. The first column will contain the operators and the
second column will contain the result of the mathematical operation.
At run time, the test will dynamically substitute the + operator
with the ones from the first column in the data pool. In a succeeding
lesson, the test will also use the second column to verify the recorded
results.
To create a data pool:
- In the Test Navigator view, right-click myAndProj and
click .
- In Name, type Calcdata
pool and click Next.
- In Variables (or columns), type 2.
- In Records (or rows), type 3 and
click Finish.
- In the data pool editor, click Variable1:String and
change the column name to Operators. Similarly,
click Variable2:String and change the column
name to Results.
- Click each cell and enter data so that your data pool looks
like this:
- Click to save the data pool.