Inject data into your application

This section describes how to automatically enter pre-defined data into a form in your application. Entering data automatically can make the data entry process faster and less error-prone.

Data Injection can be used only in tests run in Power Mode.

This task includes the following steps:

  1. Prerequisites

    • To use data injection, you must add data sets for your application. For details, see the step on configuring data injection in Prepare a test to run in Power Mode.

    • To use data injection, you can only have one instance of your application open.

  2. Determine whether you need to do automatic or manual mapping

    When performing data injection, you can do automatic or manual mapping. In automatic mapping, Sprinter attempts to map the headers in your data set to fields in your application. If the column and field names are identical, you can use automatic mapping.

    If, however, the field names are different or duplicated, you cannot rely on automatic mapping. In these cases, use manual mapping to select the fields in which to inject data.

  3. Begin the test run

    1. Begin the run and make sure your application opens.

    2. Expand the Data Injection sidebar.

    3. If you have more than one data set, select the data set you want to use from the drop-down list. For details, see Data Injection sidebar.

  4. Open the Manage & Map Fields dialog box

    On the Data Injection sidebar, click the Manage Fields button . The Manage & Map Fields dialog box opens.

  5. Map the fields - Automatic Mapping

    In the Manage & Map Fields dialog box, click the Map Automatically button . Sprinter scans the application for matching fields and maps them to the columns of the data set.

  6. Map the fields - Manual Mapping

    If you determined that you need to use manual mapping, or if the automatic mapping did not succeed, continue with the following steps:

    1. In the Manage & Map Fields dialog box, select the data set row you want to map.

    2. In the Manage & Map Fields dialog box, click the Map Manually button .

      At this stage, your mouse pointer becomes a pointing hand. You use the pointing hand to select an object in your application.

      Tip: To enable your mouse during the selection mode, for example to scroll or view a right-click menu in your application, hold down the left Ctrl button on the keyboard. You can then change the window focus or perform operations in Sprinter or your application.

    3. In your application, click the field you want to map with the selected data set row.

    4. Repeat the above step for each field that you want to map and then click OK to close the dialog box.

  7. Define which fields you want to inject, and in what order - Optional

    If you want to use all the fields in your data set, in the order by which they appear, you can skip this step.

    To define which fields to fill in your application and the order by which they should be entered, click the Manage Fields button in the Data Injection sidebar. Clear the check box adjacent to the fields that you do not want to inject. Use the Move Up and Move Down buttons to set the order.

    For details, see Manage (& Map) Fields dialog box.

  8. Inject the data into your application during your run

    1. In the Data Injection sidebar select the data set you want to use from the list of data sets.

    2. Click the Display Field Mapping button to verify the field mapping between your data set and the fields in your application . Click it again to hide the highlighting.

    3. Select the row of data you want to inject and click the Inject Data button .

    4. The Data Injection sidebar displays an icon in its tab indicating the success or failure of the injection. If you did not previously map any of the fields, Sprinter offers to perform automatic mapping. If the data injection fails, a popup box opens with additional details.

    5. For more details, see Data Injection sidebar.