Jmeter script parameterization

Source: Internet
Author: User

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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.