Preparing the Data Table - WinRunner

For each data-driven test, you need to prepare at least one data table. The data table contains the values that WinRunner uses to replace the variables in your data-driven test.

You usually create the data table as part of the test conversion process, either using the DataDriver wizard or the Parameterize Data dialog box. You can also create tables separately in Excel and then link them to the test.

After you create the test, you can add data to the table manually or import it from an existing database.

The following data table displays three sets of data that were entered for the test example described in this chapter. The first set of data was entered using the Table > Parameterize Data command in WinRunner. The next two sets of data were entered into the data table manually.

Preparing the Data Table

  • Each row in the data table generally represents the values that WinRunner submits for all the parameterized fields during a single iteration of the test. For example, a loop in a test that is associated with a table with ten rows will run ten times.
  • Each column in the table represents the list of values for a single parameter, one of which is used for each iteration of a test.

Adding Data to a Data Table Manually

You can add data to your data table manually by opening the data table and entering values in the appropriate columns.

To add data to a data table manually:

  1. Choose Table > Data Table. The Open or Create a Data Table dialog box opens. Select the data table you specified in the test script to open it, or enter a new name to create a new data table. The data table opens in the data table viewer.
  2. Enter data into the table manually.
  3. Move the cursor to an empty cell and choose File > Save from within the data table.

Importing Data from a Database

In addition to, or instead of, adding data to a data table manually, you can import data from an existing database into your table. You can use either Microsoft Query or Data Junction to import the data.

Editing the Data Table

The data table contains the values that WinRunner uses for parameterized input fields and checks when you run a test. You can edit information in the data table by typing directly into the table. You can use the data table in the same way as an Excel spreadsheet. You can also insert Excel formulas and functions into cells.

To edit the data table:

  1. Open your test.
  2. Choose Table > Data Table. The Open or Create a Data Table dialog box opens.
  3. Select a data table for your test. The data table for the test opens.Editing the Data Table

  4. Use the menu commands described below to edit the data table.
  5. Move the cursor to an empty cell and select File > Save to save your changes.
  6. Select File > Close to close the data table.

File Menu

Use the File menu to import and export, close, save, and print the data table. WinRunner automatically saves the data table for a test in the test folder and names it default.xls. You can open and save data tables other than the default.xls data table. This enables you to use several different data tables in one test script, if desired.

The following commands are available in the File menu:
File Menu

Edit Menu

Use the Edit menu to move, copy, and find selected cells in the data table. The following commands are available in the Edit menu:

Edit Menu

Data Menu

Use the Data menu to recalculate formulas, sort cells and edit autofill lists. The following commands are available in the Data menu:

Data Menu

Format Menu

Use the Format menu to set the format of data in a selected cell or cells. The following commands are available in the Format menu:

Format Menu

Technical Specifications for the Data Table

The following table displays the technical specifications for a data table.

Technical Specifications for the Data Table


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

WinRunner Topics