jmeter 取样器
***************
取样器
常用取样器:
1
2
3
4
5
6
7http请求:模拟客户端发送http请求 debug取样器:调试参数、系统变量时使用,不发送真实的请求 ftp请求:模拟发送ftp请求,文件传输 tcp取样器:模拟发送tcp请求 java request:测试自定义的Java接口等 jdbc request:向数据库发送连接请求、数据操作等 access log sampler:收集和分析用户操作数据,进行流量分析等
***************
示例:http请求
***********
springboot 应用
Person
1
2
3
4
5
6
7
8@Data public class Person { private Integer id; private String name; private Integer age; }
HelloController
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34@RestController public class HelloController { @GetMapping("/hello") public String hello(){ return "success"; } @GetMapping("/hello2") public String hello2(String name){ return name; } @PostMapping("/hello3") public String hello3(String name, Integer age){ return name+" "+age; } @PostMapping("/hello4") public String hello4(@RequestBody Person person){ return person.toString(); } @PostMapping("/hello5") public String hello5(String name, @RequestBody Person person){ return name+" "+person; } @PostMapping("/hello6") public String hello6(String name, MultipartFile file){ return name+" "+file.getOriginalFilename(); } }
***********
测试计划
线程组
线程组 ==> http请求
线程组 ==> http请求2
线程组 ==> http请求3.1:post url提交,可不设置utf-8内容编码
线程组 ==> http请求3.2:post表单提交,需设置utf-8内容编码,否则会乱码
线程组 ==> http请求4:post消息体提交数据,需设置header、utf-8内容编码
线程组 ==> http请求5:post消息体、url提交数据,需设置header、utf-8内容编码
线程组 ==> http请求6:文件上传,表单提交数据,文件类型multipart/form-data、utf-8编码
最后
以上就是英俊春天最近收集整理的关于jmeter 取样器的全部内容,更多相关jmeter内容请搜索靠谱客的其他文章。
发表评论 取消回复