当前位置:网站首页>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
边栏推荐
- 交叉编译Opencv带Contrib
- Web Security (VII) specific process of authentication with session cookie scheme
- math_ Taylor formula
- 2022-07-02 网工进阶(十五)路由策略-Route-Policy特性、策略路由(Policy-Based Routing)、MQC(模块化QoS命令行)
- Day10 -- forced login, token refresh and JWT disable
- Summary of composition materials for 2020 high-frequency examination center of educational resources
- 第一章: 舍罕王失算
- Day10 ---- 强制登录, token刷新与jwt禁用
- Cross compile opencv with contrib
- Strict data sheet of new features of SQLite 3.37.0
猜你喜欢

Think of new ways

Flutter network and data storage framework construction-b1

QT -- qfile file read / write operation

Ctrip will implement a 3+2 work system in March, with 3 days on duty and 2 days at home every week

BOC protected alanine zinc porphyrin Zn · TAPP ala BOC / alanine zinc porphyrin Zn · TAPP ala BOC / alanine zinc porphyrin Zn · TAPP ala BOC / alanine zinc porphyrin Zn · TAPP ala BOC supplied by Qiyu

Chapter 2: find the box array, complete number in the specified interval, and improve the complete number in the specified interval

kubernetes集群搭建efk日志收集平台

This Chinese numpy quick look-up table is too easy!

Detailed explanation of shuttle unity interworking principle

If the warehouse management communication is not in place, what problems will occur?
随机推荐
Think of new ways
2022-06-27 advanced network engineering (XII) IS-IS overhead type, overhead calculation, LSP processing mechanism, route revocation, route penetration
Chapter 2: find the classical solution of the maximum Convention and the least common multiple of a and B, find the conventional solution of the maximum Convention and the least common multiple of a a
BUUCTF
Thesis study - 7 Very Deep Convolutional Networks for Large-Scale Image Recognition (3/3)
原生表格-滚动-合并功能
The earliest record
Chapter 1: sum of three factorials, graph point scanning
The space of C disk is insufficient, and the computer becomes stuck. Quickly expand the capacity of C disk to make the system more smooth
FBI警告:有人利用AI换脸冒充他人身份进行远程面试
Octopus online ecological chain tour Atocha protocol received near grant worth $50000
The necessity of lean production and management in sheet metal industry
交叉编译Opencv带Contrib
Ego planner code parsing Bspline_ Optimizer section (3)
Strict data sheet of new features of SQLite 3.37.0
Zhang Fei hardware 90 day learning notes - personal record of day 3, please see my personal profile / homepage for the complete
How does if ($variable) work? [repeat] - how exactly does if ($variable) work? [duplicate]
第一章:求所有阶乘和数,大奖赛现场统分程序设计,三位阶乘和数,图形点扫描,递归求n的阶乘n!,求n的阶乘n!,舍罕王失算
第一章: 舍罕王失算
SQL injection for Web Security (1)