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:
-
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.
-
-
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.
-
Begin the test run
-
Begin the run and make sure your application opens.
-
Expand the Data Injection sidebar.
-
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.
-
-
Open the Manage & Map Fields dialog box
On the Data Injection sidebar, click the Manage Fields button . The Manage & Map Fields dialog box opens.
-
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.
-
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:
-
In the Manage & Map Fields dialog box, select the data set row you want to map.
-
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.
-
In your application, click the field you want to map with the selected data set row.
-
Repeat the above step for each field that you want to map and then click OK to close the dialog box.
-
-
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.
-
Inject the data into your application during your run
-
In the Data Injection sidebar select the data set you want to use from the list of data sets.
-
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.
-
Select the row of data you want to inject and click the Inject Data button .
-
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.
For more details, see Data Injection sidebar.
-