Adding Datapool Mapper

You can include a Datapool Mapper in a compound test or a schedule to assign the datapool values to the variables that are defined in multiple tests. In previous releases, to apply the datapool values to multiple tests, you had to associate the datapool to each test. The Datapool Mapper is able to map the datapool columns with the variables.

Before you begin

You must have created at least one datapool. See Creating a datapool in the workspace.

About this task

For the Datapool Mapper to fetch the test variables, in the Variable Details section of the Test editor, you must set the Visible In field for the variable to All tests for this user. You can also fetch the variables from the custom code calls.

If the compound test or the schedule includes a Datapool Mapper that retrieves values from one datapool and a test in the compound test or schedule is also associated with another datapool, the run uses both the datapools.
Note: When you run the schedule or compound test with a Datapool Mapper, by default the test picks up the datapool values from the first row. For the test to pick up all of the datapool values, put the test in a loop.

Procedure

To add the Datapool Mapper to the schedule or compound test:

  1. In the Schedule or Compound test editor, click Add > Datapool Mapper.
  2. In the Select Datapool dialog box, select a datapool to use for the tests and click OK. To change the datapool after it is associated, in Datapool Mapper Details, click Browse and select another datapool.
  3. Select the Open mode for the datapool. This mode determines the view that virtual users have of the datapool. This option is useful when you do a parallel test run.
    Option Description
    Shared (per machine) (default)

    Virtual users on each computer draw from a shared view of the datapool, with datapool rows apportioned to them collectively in sequential order and, on a first-come-first-served basis.

    This option makes it likely that the virtual users or loop iterations will use data from different rows and that the server will see variable data. The exact row access order among all virtual users or iterations cannot be predicted, because this order depends on the test execution order and the duration of the test on each computer.

    Private

    Virtual users draw from a private view of the datapool, with datapool rows apportioned to each user in sequential order.

    This option ensures that each virtual user gets the same data from the datapool in the same order. However, because each user starts with the first row of the datapool and accesses the rows in order, different virtual users will use the same row. The next row of the datapool is used only if you add the test that is using the datapool in a loop with more than one iteration.

    Segmented (per machine)

    Virtual users on each computer draw from a segmented view of the datapool, with data apportioned to them collectively from their segment in sequential order and, on a first-come-first-served basis. The segments are computed based on how a schedule apportions virtual users among computers. For example, if a schedule assigns 25% of users to group 1 and 75% to group 2, and assigns these groups to computer 1 and computer 2, the computer 1 view will consist of the first 25% of datapool rows and the computer 2 view will consist of the remaining 75% of rows.

    This option prevents virtual users from selecting duplicate values (for example, account IDs). If you disable wrapping, no row can be used more than once.

  4. Select the Access mode for the datapool:
    • Sequential: Rows in the datapool are accessed in the order in which they are physically stored in the datapool file, beginning with the first row and ending with the last.
    • Random: Rows in the datapool are accessed in any order, and any given row can be accessed multiple times or not at all. Each row has an equal chance of being selected each time.
    • Shuffled: Before each datapool access, the order of the rows is changed, and a different sequence results. Rows are accessed randomly but all rows must be selected once before a row is selected again.
  5. Select whether the test will reuse data when it reaches the end of the datapool.

    By default, when a test reaches the end of a datapool or datapool segment, it reuses the data from the beginning. To force a test to stop at the end of a datapool or segment, clear the check box beside Wrap when the last row is reached. Forcing a stop might be useful if, for example, a datapool contains 15 records, you run a test with 20 virtual users, and you do not want the last five users to reuse information. Although the test is marked 'Fail' because of the forced stop, the performance data in the test is still valid. However, if it does not matter to your application if data is reused, the default of wrapping is more convenient. With wrapping, you need not ensure that your datapool is large enough when you change the workload by adding more users or increasing the iteration count in a loop.

  6. Select whether the test will make the data in the datapool record permanent for each virtual user.

    By default, one row is retrieved from the datapool for each execution of a test, and the data in the datapool row is available to the test only for the duration of the test. Select Fetch only once per user to specify that every access of the datapool from any test being run by a particular virtual user will always return the same row.

    To illustrate how these options affect the rows that are returned, assume that a test contains a loop which accesses a datapool. The loop has 2 iterations. The following table shows the row that is accessed in each iteration:
    Datapool option Iteration 1 Iteration 2
    Sequential and Private row 1 row 2
    Shared and Shuffled row x row y
    Fetch only once per user row x row x
  7. In the Columns mapping table, the Column is automatically filled with the column names from the datapool.
  8. To use the variable names from the test, click the cell and click the Ellipsis button Ellipsis button and select the variable. By default, the variable names are also created with the same names as the datapool columns.
  9. To fetch all the datapool values, put the Datapool Mapper in a loop. Select the Datapool Mapper in the schedule and click Insert > Loop.
  10. Save the changes.

Feedback