当前位置:网站首页>Software testing skills, JMeter stress testing tutorial, obtaining post request data in x-www-form-urlencoded format (24)
Software testing skills, JMeter stress testing tutorial, obtaining post request data in x-www-form-urlencoded format (24)
2022-07-03 20:56:00 【Test pursuit】
Catalog : Reading guide
One 、 Preface
post Some of the requested parameters are json Format , There are also some x-www-form-urlencoded Format , When we talked about signature, we got post The request is json Format
This article continues x-www-form-urlencoded Format request body How to get
Two 、x-www-form-urlencoded
Add... To the request header Content-Type The type is x-www-form-urlencoded
Define user variables , Account and password
post Request parameter to fill in key value pair
3、 ... and 、BeanShell Preprocessor
add to - Preprocessor -BeanShell Preprocessor
Use getArgumentsAsMap() Method to get a request for a key value pair body
import org.apache.jmeter.config.Arguments;
import org.apache.jmeter.config.Argument;
import org.json.JSONObject;
import org.json.JSONArray;
import org.apache.commons.codec.digest.DigestUtils; // Import md5 Encrypted package
Arguments arguments = sampler.getArguments();
Map reqMap = arguments.getArgumentsAsMap();
log.info("------------------------body------------------");
for (String key : reqMap.keySet()) {
log.info("key: " + key + ",value: " + reqMap.get(key));
}
log.info(reqMap.get("username"))
Four 、 View the run results
The number of results can be viewed from the request header parameter type
request body data :username=test&password=123456

边栏推荐
- Introduction to golang garbage collection
- Ask and answer: dispel your doubts about the virtual function mechanism
- Offset related concepts + drag modal box case
- 鹏城杯 WEB_WP
- Yyds dry goods inventory TCP & UDP
- "Designer universe" argument: Data Optimization in the design field ultimately falls on cost, safety and health | chinabrand.com org
- Hcie security Day12: supplement the concept of packet filtering and security policy
- What is the maximum number of concurrent TCP connections for a server? 65535?
- Based on laravel 5.5\5.6\5 X solution to the failure of installing laravel ide helper
- 【leetcode】1027. Longest arithmetic sequence (dynamic programming)
猜你喜欢
leetcode-540. A single element in an ordered array
jvm jni 及 pvm pybind11 大批量数据传输及优化
[Yugong series] go teaching course 002 go language environment installation in July 2022
Design e-commerce seckill system
Measurement fitting based on Halcon learning -- Practice [1]
Viewing Chinese science and technology from the Winter Olympics (II): when snowmaking breakthrough is in progress
Basic knowledge of dictionaries and collections
Pengcheng cup Web_ WP
Apprentissage intensif - notes d'apprentissage 1 | concepts de base
Yyds dry goods inventory TCP & UDP
随机推荐
It is discussed that the success of Vit lies not in attention. Shiftvit uses the precision of swing transformer to outperform the speed of RESNET
Reinforcement learning - learning notes 1 | basic concepts
Basic number theory -- Chinese remainder theorem
How to choose cache read / write strategies in different business scenarios?
强化學習-學習筆記1 | 基礎概念
Is flush account opening and registration safe and reliable? Is there any risk?
内存分析器 (MAT)
Discussion Net legacy application transformation
Rhcsa third day notes
如临现场的视觉感染力,NBA决赛直播还能这样看?
Set, weakset, map, weakmap in ES6
Analyse de REF nerf
2.7 format output of values
JMeter plug-in installation
Thread, thread stack, method stack, the difference of creating thread
jvm jni 及 pvm pybind11 大批量数据传输及优化
Producer consumer mode (multithreading, use of shared resources)
Do you really know how old you are?
Example of peanut shell inner net penetration
In 2021, the global general crop protection revenue was about $52750 million, and it is expected to reach $64730 million in 2028