当前位置:网站首页>JMeter connection database
JMeter connection database
2022-07-03 19:31:00 【Xiaoqiang ~】
First, introduce jar package mysql-connector-java-8.0.11.jar, Put in :\apache-jmeter-5.3\lib\ext Under the table of contents .
1. Create a new configuration component in the thread group :

2. Fill in the above configuration elements : To connect mysql For example
Database URL: jdbc:mysql://localhost:3306/student_info?charset=utf-8&useSSL=false&serverTimezone=UTC&allowMultiQueries=true

3. Create a new thread in the thread group JDBC Request Sampler :

4. Get the response result of the sampler , Response status code :
Add to sampler Post Processors :beanshell Postprocessor ,
// Get the result information of the return sampler :
String response = prev.getResponseDataAsString();
// Get and return the sampler status code
String status = prev.getResponseCode();
// Output log information
log.info(response);
log.info(status);
// preservation 、 Take out the object
vars.putObject(" Object name ",Object); # Save the object
vars.getObject("OBJECT_NAME"); # Take out the object
5. Use regular expressions to extract response result field values


Check whether the extracted content is correct : You can add Sampler - Commissioning the samplers (debug-sampler)
5.1 Add... To the thread group BeanShell Sampler
Output the contents of regular expression :
log.info("msg1:"+"${msg1}");
6. Assertion - Response assertion :

6.1BeanShell Assertion :
String message ="${msg1}";
if(!message.equals("success")){
Failure = true;
FailureMessage = " Assertion failed ";
}else{
FailureMessage = " Assert success ";
}
In the view result tree, you can view the prompt of assertion failure
边栏推荐
- Win10 share you don't have permission
- Why should the gradient be manually cleared before back propagation in pytorch?
- QT -- qfile file read / write operation
- Flume learning notes
- Leetcode 1189. Maximum number of balloons (special character count)
- Ego planner code parsing Bspline_ Optimizer section (2)
- The most valuable thing
- 第一章:求所有阶乘和数,大奖赛现场统分程序设计,三位阶乘和数,图形点扫描,递归求n的阶乘n!,求n的阶乘n!,舍罕王失算
- [wallpaper] (commercially available) 70 wallpaper HD free
- BUUCTF
猜你喜欢

5- (4-nitrophenyl) - 10,15,20-triphenylporphyrin ntpph2/ntppzn/ntppmn/ntppfe/ntppni/ntppcu/ntppcd/ntppco and other metal complexes
![Free hand account sharing in September - [cream Nebula]](/img/4f/fec31778a56886585e35be87885452.jpg)
Free hand account sharing in September - [cream Nebula]

Ae/pr/fcpx super visual effects plug-in package fxfactory

Ego planner code parsing Bspline_ Optimizer section (3)

Summary of composition materials for 2020 high-frequency examination center of educational resources

BOC protected alanine porphyrin compound TAPP ala BOC BOC BOC protected phenylalanine porphyrin compound TAPP Phe BOC Qi Yue supply

Chapter 1: find the factorial n of n!

SQL injection for Web Security (1)

Common text labels

第一章:喝汽水,阶梯电费计算,阶梯电费计算函数,个人所税,求解平方根不等式,简化求解平方根不等式,求解调和级数不等式,解不等式:d<1+1/2-1/3+1/4+1/5-1/6+..士1/n
随机推荐
Sentinel source code analysis part I sentinel overview
Pecan - route
IPv6 experiment
The way to treat feelings
Free year-end report summary template Welfare Collection
Pecan — @expose()
Use unique_ PTR forward declaration? [repetition] - forward declaration with unique_ ptr? [duplicate]
PR 2021 quick start tutorial, how to create new projects and basic settings of preferences?
【LeetCode】【SQL】刷题笔记
The most valuable thing
2022-06-30 網工進階(十四)路由策略-匹配工具【ACL、IP-Prefix List】、策略工具【Filter-Policy】
第一章: 舍罕王失算
Chapter 2: 4-digit Kaplan number, search even digit Kaplan number, search n-digit 2-segment sum square number, m-digit ingenious square number without 0, specify the number to form a 7-digit square nu
Floating source code comment (38) parallel job processor
Go home early today
Recommend a GIF processing artifact less than 300K - gifsicle (free download)
OSPF - detailed explanation of stub area and full stub area
Bad mentality leads to different results
BOC protected phenylalanine zinc porphyrin (Zn · TAPP Phe BOC) / iron porphyrin (Fe · TAPP Phe BOC) / nickel porphyrin (Ni · TAPP Phe BOC) / manganese porphyrin (Mn · TAPP Phe BOC) Qiyue Keke
PR 2021 quick start tutorial, how to create a new sequence and set parameters?