Use "Jmeter study notes," the JDBC components

Demand: From the database query the user name and password, and all users get the log.

Environment Description: mysql database


1, create test plans, add configuration elements JDBC Connection Configuration:

     Note: To use the JDBC database connection components, you need to download the mysql driver file mysql-connector-java-5.1.28.jar and put to the lib directory jmeter, the need to restart after the addition of driver files, or do not take effect!

image.png


2, add a thread group, and two new JDBC Request assemblies, why two? Used to query a user name and password used to query the number of users

   The first JDBC Request for user name and password

image.png

search result:

  image.png

  The second JDBC Request user queries the number of users

image.png

statistical results:

image.png

3, in order to use all users to log in, we use loop controller  is implemented, the number of cycles for the number of users (step query on the number of users is 8, and therefore the 8 cycles)

image.png


spacer.gif

4, because there is a query to the user data columns in multiple rows, in order to obtain the data once, it needs a counter, the counter value of each +1

image.png

Add http requests using a query to the user name and password in the http request, passed as a parameter


image.png

It is worth noting: Jmeter does not support nested variable, where the aid __V () function to implement cited two variables;

This article is the study notes, if wrong, please correct me!

Guess you like

Origin blog.51cto.com/9605182/2433932