How do I emulate multiple users?
In your emulation, you tracked a user booking a flight and choosing an aisle seat. In a real-life setting, however, different users will have varying preferences. To improve your test, you therefore need to check if the booking will work when users choose different seating preferences (aisle, window, or none).To accomplish this, you will parameterize the script. This means that you take the recorded value, Aisle, and replace it with a parameter. You will place values for the parameter in a parameter file. When you run the script, the Vuser will take values from the parameter file (aisle, window, or none) thereby emulating a true travel agency environment.
To parameterize your script:
1. Find the section where you want to vary the data.
Go to Tree view by choosing View > Tree View.
In the Test Tree, double-click the Submit Data: reservations.pl step. The Submit Data Step Properties dialog box opens.
The ABC icons in the right column indicates that the arguments are constants.
2. Indicate that the fixed value will be a varying value.
Select the seatPref value in the seventh line, Aisle.
Click the ABC icon adjacent to Aisle. The Select or Create Parameter dialog box opens.
3. Create a parameter.
Specify a parameter name, seat, using the File parameter type. Click OK.
VuGen replaces the ABC icon with a parameter icon.
4. Click on the parameter icon adjacent to {seat}.
Choose Parameter Properties from the popup menu. The Parameter Properties dialog box opens.
5. Specify some sample values to vary the data.
Click Add Row. VuGen adds a row to the table. Replace the word Value with Window.
Click Add Row. VuGen adds a row to the table. Replace the word Value with None.
Note that the values are not case sensitive.
Keep the default settings in the Select column and File format sections of the dialog box.
6. Define how the test will vary the data.
Keep the default setting that instructs VuGen to take sequential values for each iteration not random values.
Select next row: Sequential Update value on: Each iteration
7. Click Close to close the Parameter Properties dialog box, and click OK to close the Step Properties dialog box.
You have now created a parameter for the seating preference. When you run the load test, the Vusers will use the parameter values instead of the recorded value, Aisle.
When you run the script, the replay log shows the parameter substitution that occurs for each iteration. You will see that for the first iteration, the Vuser chose Aisle and for the second iteration, the Vuser chose Window.
No comments:
Post a Comment