< Previous | Next >

Lesson 4.2: Add test data to a manual test script

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:

  1. If you have not already done so, log in as the tester (Userid: tony, Password: tony).
  2. First, create a CSV file:
    1. Open an Excel spreadsheet.
    2. In the spreadsheet, the first row of data must be the column definitions. Follow this format: 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.
      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
    3. When you are finished typing the data, click File > Save.
    4. In File name, type Classics_Java.
    5. In Save as type, select CSV (Comma delimited).
    6. Click Save, and then click OK and Yes.
  3. Next, import the CSV file:
    1. To open the Test Data editor, point to Construction (Construction), and click Create Test Data.
    2. For the name, type Classics Java Test Data; for the description type Test data for the New Order Test Script.
    3. In the Data File section, browse for the Classics_Java.csv file, and click Open. The data records are displayed in the Data Records section:
      Data File section
    4. Click Save at the top of the page.
  4. Finally, use the test data in a manual test script:
    1. 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 Construction (Construction), and click View Test Cases. From the list, click New Customer Order Test Case to open it.
    2. 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.
    3. From the Test Data list, select Classics Java Test Data.
      Note: If you do not see Classics Java Test Data listed, refresh the browser.
    4. Next, insert the CardNumber variable into the manual test script:
      1. Click Step 9, and then use the mouse to highlight the credit card number in the step.
      2. From the Action bar, click the Insert Test Data Column icon (Insert Test Data Column).
      3. Select the CardNumber variable, and click OK. The variable is inserted at that point in the step:
        Data Records section
    5. 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.
< Previous | Next >

Feedback