Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What are the ways of parameterized configuration of JMeter

Shulou Source: shulou.com Published: 2022-06-01 16:49:24 11月10日 Update

This article mainly explains "what are the ways of parameterized configuration of JMeter", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what are the ways of JMeter parameterized configuration?"

1. Parameterized mode 1: user-defined variables (UDV)

Add-configuration components-user-defined variables: the parameters defined here are basically values that will not change during the running of the script, such as ip, port, domain name.

Note: in a test plan, no matter where the UDV is located, it is processed at the beginning of the run, and only once

Then, all ip and port in the search script are replaced with variables

After the above parameterization, it is found that it is still necessary to fill in these unchanged contents. Here's a better way: http requests default values

2. Default value of http request

Add-configuration component-http request default value, once set, you don't have to write these things in every request, if not, take the default value, if there is, use the existing value.

3. Parameterization mode 2: function

There is also a function that works better:

4. Parametric mode 3: add-configure components-CSV Data Set Config

Create a new text file, enter the contents, and change it to a .csv file (it's best not to change excel to csv)

File name: absolute path or relative path; when txt and csv; use relative path, jmeter defaults to go to bin directory and then to script directory

File encoding: the current operating system is used by default. If there is a problem, you can try utf-8, gbk, etc.

Variable name: the variable name of each column in the file. If there are multiple columns, they are separated by English commas. The order of the names should correspond to the content.

Delimiter: the delimiter of the contents of the file. The default is a comma.

Encounter the file Terminator loop again, encounter the file Terminator to stop the thread: they are mutually exclusive, that is, true--false, false--true

Thread sharing mode:

All threads: all threads in the scope share file data, and all threads read the data in turn without repeating each other.

Current thread group: in the scope of the thread group, the threads in each thread group share file data, read the data in turn, and do not repeat each other

Current thread: all threads in scope have the same value in the same loop

At this point, I believe you have a deeper understanding of "what are the ways of parameterized configuration of JMeter?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Thread file parameter content method configuration variable data action element script path function delimiter name method user directory Terminator comma Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft NVidia Docker Shulou Tech Info Xiaomi