To genuinely replicate real world impact on an application, parameterizing data is critical. In ScenarioBuilder you can access unlimited rows of data values, stored in comma separated values (CSV) files, to make each playback of a scenario a unique, real user experience.
Create a new scenario parameter CSV file
Start by creating a file that contains the values to be used for Scenario Parameters. Click the “Scenario Parameter” icon in the ScenarioBuilder tool bar. The Scenario Parameters window opens;
Provide a name for the file and click the “Open in Excel”button in the Scenario Parameters window;
Microsoft Excel™ or other default CSV editor will open in a new window;
ScenarioBuilder gets you started by providing two column headings. Feel free to use the generic headings or overwrite them. Enter data values for the rows below the headings. Each column represents a different value to be used in a scenario. Below is a sample file containing office staff;
If using Excel, as in the above example, simply “Save” the file and it will be stored in CSV format in the current Project’s “Variables” folder. Exit Excel.
If using a text editor like Notepad, include commas between headers and values (no spaces);
Save the file and it will be stored in CSV format in the current Project’s “Variables” folder. Close text editor.
Tip: If the editor does not automatically save the file in CSV format, use the editor’s “Save As” option and change the “Save as type” to “All Files (*.*)”; add the .csv extension to the file name and “Save”;
Edit an existing scenario parameter CSV file
Click the folder icon in the Scenario Parameters window to open the current Project’s “Variables” folder;
Double-click the desired file and it will open in your default CSV editor.
Attach a scenario parameter CSV file
Scenario Parameter CSV files can be attached at the scenario level for global access, or at the component level for access limited to the component. Unless your intention is to have the scenario loop through a component multiple times, retrieving a new row from the CSV file with each loop, attach the file at the scenario level. To do so, highlight the scenario name (top row) in the Scenario window, and click the “Variables File Name” property. Enter the name of the desired file, or navigate to it by clicking the “Open” icon;
In the “Variable Access Type” field select “Random” or “Sequential” to determine how values are retrieved from the CSV file;
Add scenario parameters
Now that you have created a CSV file and attached it to the Scenario, you are ready to add the Scenario Parameters. Add a “Type Text” action to the scenario. In the “Properties” pane, right click inside the “Text” field;
At the bottom of the pop-up menu, select "CSV Variable" option and click the CSV file to reveal all of the fields (column headers) from the attached CSV file. Select one of the fields. Typing the name of the field into the Text property field (framed with percentage signs) is also an acceptable method of adding the field.
Last line used in scenario parameters CSV file
After executing a playback of the Scenario, click the “Modify CSV lines” under the “Run” section of the tool bar to display the “Last Line Used” from the attached CSV file;
If accessing the CSV file sequentially, edit the “Last Line Used” value to stage the scenario to retrieve a desired value from the file on the next execution (if accessing randomly, adjusting the “Last Line Used” value will not impact the next playback).