Datapools provide variable data to your tests during execution.
Performance tests are based on user emulation. During a session with the system-under-test, the tester actually 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 actually 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. By default, a datapool contains one equivalence class named EquivalenceClass1.
A performance test can open a datapool in one of three modes, which determine how virtual users access the datapool: private, shared per machine, and 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, you should not add equivalence classes to datapools that you plan to use for performance testing.
Variable. A named data column. Data resides in column cells and is typically typed based on what is expected by the system-under-test. One column named Variable1::String is created by default. Typically you will rename this column and add additional column names descriptive of the data that they contain.
Record. A row of data. Rows are indexed starting with 0.
As shown in the following figure, the datapool editor is a grid similar
to a spreadsheet, with a separate tab along the bottom for each equivalence
class in the datapool. Right-clicking on the grid opens the popup menu that
you use to add or modify datapool columns and rows. You add data by typing
in a cell and add a record by pressing the Enter key.
To rename, add, or remove an equivalence class, click the Overview tab,
shown below. You can also maintain columns from from the Overview tab rather
than use the popup datapool editor shown above. To rename a variable or equivalence
class from the Overview tab, double-click it.
When you create a datapool, you have the option of initializing the new datapool with data contained in an existing comma-separated-value (CSV) file 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.
Parent topic: Creating test data