Creating a datapool
Datapools provide variable test data to tests during execution. Test data (for example, input and output data) is stored in a
datapool and substituted in the test during execution. Test data can be added, modified,
and deleted from the datapool and substituted in the test during execution without any
modifications to the test.
Datapools contain three structural elements:
-
Equivalence class: A subset of related test data in the datapool with an associated name that produces the equivalent pass/fail result for a test. A datapool contains at least one equivalence class.
-
Variable: A column of test data within each equivalence class with an associated name and type.
-
Record: A slice or row of test data within an equivalence class with one or more variables.
Datapools are created with the New Datapool wizard:
- Open the
Test Perspective, right-click in the
Test Navigator, select New > Test Element... > Test Assets > Datapool, and click Next.
- Select the parent folder and define the name of the datapool and click Next.
- Provide a description for the datapool.
- Provide the dimensions for the datapool. The dimensions represent the number of variables (or columns) and records (or rows) in each equivalence class of the datapool.
- Test data can be created and edited in a
Comma-Separated Value (CSV) file editor (for example, Microsoft® Excel®) and imported into a new or existing datapool. When working with large
quantities of data, this approach is recommended. To import test data from a Comma-Separated Value (CSV) file into the datapool, select Import CSV file into the new datapool:
- Provide or select (click Browse...) the path to the Comma-Separated Value (CSV) file.
- Select the encoding of the Comma-Separated Value (CSV) file. This encoding is used to read the Comma-Separated Value (CSV) file.
- Select First row of the CSV file contains the variable names and optional suggested types if the first row of the Comma-Separated Value (CSV) file contains the variable names and optional suggested types. That is, the first row of the Comma-Separated Value (CSV) file contains:
<variable 1 name>[::<variable 1 type>],<variable 2 name>[::<variable 2 type>]...<variable n name>[::<variable n type>]
- Select First column of the CSV file contains the equivalence class names and optional record numbers if the first column of the Comma-Separated Value (CSV) file contains the equivalence class names and optional record numbers. That is, the first column of the Comma-Separated Value (CSV) file contains:
<equivalence class 1 name>[::0]
<equivalence class 2 name>[::1]
...
<equivalence class n name>[::<n>]
- Click Finish to create the datapool.
- The Confirm Open Editor dialog may appear (see the Window > Preferences... > Test > Open Editor preference), confirming if the new datapool is to be opened in the Datapool editor.
Related concepts
Datapool Editor
Related tasks
Importing a Comma-Separated Value (CSV) file as a Datapool
Exporting a Datapool as a Comma-Separated Value (CSV) file
Related samples
Tutorial: Accessing a datapool from a TPTP JUnit test