Different jmeter pressure test database methods, I am afraid you have never used it

jmeter--pressure measurement database

Common scenarios that require database manipulation include the following:

Prepare test data
Obtain and query test data
Clean up test data
Database pressure test
Set database driver

To perform database operations in jmeter, you need to use a database link. My database is mysql version 5.7 deployed on the Alibaba Cloud server using docker. Need to find the corresponding mysql connector.

You can find it here: https://dev.mysql.com/downloads/connector/j/

After downloading and decompressing, copy the following and put it in the bin directory under jmeter

 

Select our driver under Test Plan

Note: The version of the connector package corresponds to the version of the mysql server. If an error is reported that the version is not compatible, please consider whether your version of the mysql server is compatible with the Connector

select query statement

Add a JDBC Connection Configuration

 Sending a request requires adding a JDBC request

After adding a view result tree

The structure is as follows

Common parameters of JDBC Connection Configuration are as follows

 

Common parameters of JDBC Request are as follows

Run the script and view the resulting tree

insert new statement

Extract the data of the database query and use it in the next request

Sometimes we need to get data from the database for other requests

Suppose we want to use the query statement to get the id=5 then

After getting it, references in other places should use  variable name + underscore + number, which will refer to the specific result in the return value sequence

 run to see the result

Finally: The following are the supporting learning materials. For friends who do [software testing], it should be the most comprehensive and complete preparation warehouse. This warehouse also accompanied me through the most difficult journey. I hope it can help you too!

Tidying up is not easy, prostitution is too easy! The way to obtain it is very simple: readers and friends in need can help Sanlian support, click on the small card below

Guess you like

Origin blog.csdn.net/qq_73332379/article/details/132624058
Recommended