Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the ways of parameterized configuration of JMeter

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report