In the previous lesson, you created a manual test script.
In this lesson, you add test data to the script to supply realistic
data values.
To complete this lesson, you need Microsoft® Excel.
When you create test data, you import the data from a comma
separated values (CSV) file. To use external data in a manual test,
you associate the test data with a manual test script and then insert
variables into the test script, replacing literal values. During execution,
the variables in the manual test script are replaced with data from
the imported CSV file. In this lesson, you continue as the tester
to create test data and add it to the test script,
New
Customer Order Test Script.
To create test data:
- If you have not already done so, log in as the tester (Userid: tony, Password: tony).
- First, create a CSV file:
- Open an Excel spreadsheet.
- In the spreadsheet, the first row of data must be the
column definitions. Follow the format of ColumnName:TYPE,
where the type can be STRING, NUMBER, BOOLEAN,
or ENUMERATION.
Type the following
rows of data:
Tip: You can cut and paste the data into
your spreadsheet.
Table 1. A |
B |
C |
D |
E |
F |
G |
Composer:STRING |
Item:STRING |
Quantity:STRING |
CardNumber:STRING |
CardType:ENUMERATION |
ExpDate:STRING |
Total:STRING |
Haydn |
Violin Concertos |
1 |
1111 1111 1111 1111 |
Visa |
12/11/2008 |
15.99 |
Haydn |
Violin Concertos |
2 |
2222 2222 2222 2222 |
Visa |
12/11/2008 |
30.98 |
Haydn |
Violin Concertos |
5 |
3333 3333 3333 3333 |
Visa |
12/11/2008 |
75.95 |
Haydn |
Violin Concertos |
10 |
4444 4444 4444 4444 |
Visa |
12/11/2008 |
150.90 |
Haydn |
Violin Concertos |
50 |
5555 5555 5555 5555 |
Visa |
12/11/2008 |
750.50 |
- When you are finished typing the data, click .
- In the File name field, type Classics_Java.
- In the Save as type field, select CSV
(Comma delimited).
- Click Save, then click OK and Yes.
- Next, import the CSV file:
- To open the Test Data editor, point to the Construction icon
(
), and click Create
Test Data.
- For the name, type Classics Java Test Data;
for the description type Test data for the New Order Test
Script.
- In the Data File section, browse for the file, Classics_Java.csv,
and click Open. The data records display in
the Data Records section:
- Click Save at the top of the
page.
- Finally, use the test data in a manual test script:
- Return to the New Customer Order Test
Case by clicking the tab.
Note: If you do
not already have the test case open, point to the
Construction icon
(

), and click
View
Test Cases. In the View Builder window, deselect
My
test cases only, and click
Run.
From the list, click
New Customer Order Test Case to
open it.
- Click the Test Scripts section,
and then click the New Customer Order Test Script to
open it. The test script opens in the Manual Test editor.
- From the Test Data list, click Classics Java
Test Data, and then click Save.
This action associates the test data with the test script.
Note: If
you do not see Classics Java Test Data listed,
refresh the browser.
- Next, insert the CardNumber variable into the manual
test script:
- Click Step 12, and then use the mouse to
highlight the credit card number in the step.
- From the toolbar, click the Insert Test Data Column icon
(
).
- Select the CardNumber variable, and click OK.
The variable is inserted at that point in the step:
- Click Save.
During test execution, the literals are replaced with the
test data.
In the next lesson, you continue as the tester to create
and add a keyword to the manual test script.