当前位置:网站首页>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
边栏推荐
- 第二章:求a,b的最大公约与最小公倍数经典求解,求a,b的最大公约与最小公倍数常规求解,求n个正整数的的最大公约与最小公倍数
- Chapter 1: find the algebraic sum of odd factors, find the same decimal sum s (D, n), simplify the same code decimal sum s (D, n), expand the same code decimal sum s (D, n)
- Day11 ---- 我的页面, 用户信息获取修改与频道接口
- Day10 -- forced login, token refresh and JWT disable
- Analyse du Code du planificateur ego bspline Section Optimizer (1)
- UE source code analysis: uccharactermovementcomponent - rootmotion
- 2022-07-02 advanced network engineering (XV) routing policy - route policy feature, policy based routing, MQC (modular QoS command line)
- I didn't cancel
- Ego planner code parsing Bspline_ Optimizer section (3)
- Xctf attack and defense world crypto advanced area best_ rsa
猜你喜欢

第一章:求n的阶乘n!

03 -- QT OpenGL EBO draw triangle

Octopus online ecological chain tour Atocha protocol received near grant worth $50000

PR 2021 quick start tutorial, how to create a new sequence and set parameters?

QT -- qfile file read / write operation

Why should the gradient be manually cleared before back propagation in pytorch?

Why should we do feature normalization / standardization?

Flutter network and data storage framework construction-b1

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

05 -- QT OpenGL draw cube uniform
随机推荐
What is the content of game modeling
[optics] vortex generation based on MATLAB [including Matlab source code 1927]
Sentinel source code analysis part II - sentinel dashboard console startup and configuration
Unittest framework is basically used
Ctrip will implement a 3+2 work system in March, with 3 days on duty and 2 days at home every week
第二章:求a,b的最大公约与最小公倍数经典求解,求a,b的最大公约与最小公倍数常规求解,求n个正整数的的最大公约与最小公倍数
Zhang Fei hardware 90 day learning notes - personal records on day 4, please see my personal profile / homepage for the complete
Flume learning notes
Yolov3 network model building
PR FAQ: how to set PR vertical screen sequence?
Php based campus lost and found platform (automatic matching push)
Zhang Fei hardware 90 day learning notes - personal records on day 2, please see my personal profile / homepage for the complete
论文阅读 GloDyNE Global Topology Preserving Dynamic Network Embedding
2022-06-25 advanced network engineering (XI) IS-IS synchronization process of three tables (neighbor table, routing table, link state database table), LSP, cSNP, psnp, LSP
【LeetCode】【SQL】刷题笔记
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
原生表格-滚动-合并功能
kubernetes集群搭建efk日志收集平台
Chapitre 1: le roi de shehan a mal calculé
Ego planner code parsing Bspline_ Optimizer section (3)