when you use Badboy to record your test script, the next step is to debug the script.
in my opinion, debugging should include the following aspects:
1. modify the script according to the test scenario.
2. script parameterization;
3. add an appropriate listener to collect test results.
today we are talking about the parameterization of scripts.
In jmeter, all components that can be configured for the request are included in configuration elements.
CSV Data Set config is the main character of our speech today.
if you want to test the search performance of a website, you have recorded an HTTP request for search.
when jmeter is used, you can see that in the recording script, the search field is named P, for example:
parameterized Step 1: replace the value of the item to be parameterized in HTTP request with $ {parameter name}. For example, change the value of P to $ {searchitem}.
parameterized Step 2: add CSV Data Set config to simple concoller named Step 1
parameterized Step 3: set CSV Data Set config
Filename --- parameter item File
File encoding --- file compilation method, which is generally empty
Vaiable names-the parameter items in each column in the file. Each parameter item is separated by a comma. The parameter item name should be consistent with the parameter item in HTTP request.
Delimiter --- if the file is separated by commas (,), enter commas (,). If tab is used, enter \ t;
Recycle on EOF? --- True = when reading the file to the end, re-read the file
False = stops reading files when they are read to the end.
Stop thread on EOF? --- When recycle on EOF? Valid when one item is false; true = stops the process when the file is read to the end.
After completing these three steps, the parameterization of the script is complete.
In fact, in my opinion, most of the test software's parameterization is similar. They all use symbols to replace the projects that require parameterization, and then define the parameters in the parameter file to achieve parameterization.
Compared with jmeter2.2, CSV Data Set config adds file encoding (which is useless in my opinion); tab is added for separators between parameters; stop thread on EOF?
In addition to parameterization for HTTP requests, jmeter also supports parameterization for other requests.