Datapools provide variable data to your tests during execution. You can add Variables (columns), Records (rows) and Equivalence Classes (groups of related Records), to define a datapool's structure. This section describes these structural elements. For information about populating a datapool and using the datapool API, see Tutorial: Creating a datapool driven JUnit test application.
Performance tests are based on user emulation. During a session with the application-under-test, the tester uses a feature that real customers will use, and from the recorded session a test is generated containing the exact data that the tester entered. For example, to create a performance test for a dialog in a web-based shopping application that prompts a shopper for an account number, the tester engages the dialog by selecting an item that is offered for sale, clicking a "pay now" button, and entering an account number. During playback of the test, in which the tester might request that hundreds of instances of the transaction be run simultaneously, it is desirable that different account numbers (perhaps a combination of valid and invalid numbers) are used for each of the instances. To supply variable data for tests to use during playback, the tester creates datapools.
Datapools contain three structural elements
Equivalence class. A datapool subset containing a range of data that, when submitted to a test, produces the equivalent pass/fail result. Equivalence classes group related data. A datapool must contain one equivalence class.
Note: you should use only one equivalence class for performance testing. A performance test can open a datapool in one of 3 modes, which determines how virtual users access the datapool: private, shared per machine, or segmented per machine. In the private and shared modes, equivalence classes are ignored but the segmented access mode requires that the datapool contain only 1 equivalence class. For this reason, we recommend that you add only a single equivalence class to datapools that you plan to use for performance testing.
Record. A row of data. Rows are indexed by an equivalence class starting with 0.
Variable. A named data column. Data resides in column cells and is typically typed based on what is expected by the application-under-test.
As shown in the following figure, the datapool editor is a grid similar
to a spreadsheet. Right-clicking on the grid opens the pop-up menu that you
use to add or maintain the datapool structural elements described above. You
add data by typing in a cell.
When you create a datapool, you have the option of initializing the new datapool with data contained in an existing comma-separated value text file (CSV) that you created with a spreadsheet editor or with some external or custom tool. For datapools containing large amounts of data, this approach is recommended. The datapool editor is suitable for entering small amounts of data and modifying individual records but provides no means of generating large amounts of typed data.
Related concepts
Tutorial: Creating a datapool driven
JUnit test application