0% found this document useful (0 votes)
108 views13 pages

JMeter Database Test Plan Guide

This document provides steps to build a database test plan using JMeter: 1. Add the JDBC driver JAR file and configure the database connection settings including hostname, username, password, and database name. 2. Add a Thread Group to simulate users and requests. 3. Add a JDBC Connection Configuration element with the connection pool name and driver details. 4. Add a JDBC Request sampler with the pool name and SQL query. 5. Add listeners like View Results Tree, View Results in Table, Summary Report, and Spline Visualizer to see the test results.

Uploaded by

Alvaro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
0% found this document useful (0 votes)
108 views13 pages

JMeter Database Test Plan Guide

This document provides steps to build a database test plan using JMeter: 1. Add the JDBC driver JAR file and configure the database connection settings including hostname, username, password, and database name. 2. Add a Thread Group to simulate users and requests. 3. Add a JDBC Connection Configuration element with the connection pool name and driver details. 4. Add a JDBC Request sampler with the pool name and SQL query. 5. Add listeners like View Results Tree, View Results in Table, Summary Report, and Spline Visualizer to see the test results.

Uploaded by

Alvaro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
You are on page 1/ 13

Building a Database Test Plan With Jmeter

JDBC CONFIGURATION :

This example uses the MySQL database driver. To use this driver, its containing .jar file must be
copied to the JMeter lib directory .

➢ First check for JDBC DRIVER .


➢ If you dont have JDBC DRIVER then download “jakarta-jmeter-2.3RC3”.
➢ Search for this Jar file “mysql-connector-java-5.0.8-bin” and copy into following directory:
➢ C:\jakarta-jmeter-2.3RC3\jakarta-jmeter-2.3RC3\lib
➢ This Database test plan used with MySQL and consider the following to build a database test
plan.

Server Host : localhost


Username : root
Password : root
Database Name : testdata

➢ Go to : C:\jakarta-jmeter-2.3RC3\jakarta-jmeter-2.3RC3\bin and click on jmeter.bat batch file.


➢ Now you can show user interface of Jmeter.
1) Adding User : The first step you want to do with every JMeter Test Plan is to add a Thread
Group element. The Thread Group tells JMeter the number of users you want to simulate, how often
the users should send requests, and the how many requests they should send.

-Go ahead and add the ThreadGroup element by first selecting the Test Plan, clicking your right mouse
button to get the Add menu, and then select Add --> ThreadGroup.
2) JDBC Connection Configuration :Begin by selecting the JDBC Users
element. Click your right mouse button to get the Add menu, and then select Add --> Config
Element --> JDBC Connection Configuration.

Set up the following fields (these assume we will be using a local MySQL database called testdb):

Set up the following fields (these assume we will be using a local MySQL database called testdb):

• Variable name bound to pool. This needs to uniquely identify the configuration. It is used by the
JDBC Sampler to identify the configuration to be used.
• Database URL: jdbc:mysql://localhost:3306/test
• JDBC Driver class: com.mysql.jdbc.Driver
• Username: root
• Password: root
3) JDBC Request : Selecting the JDBC Users element again. Click your right mouse
button to get the Add menu, and then select Add --> Sampler --> JDBC Request.

Start by editing the following properties :

Enter the Pool Name: MySQL (same as in the configuration element)

Enter the SQL Query String field.


4)Adding the Listener to View / Store the Test Results :
The final element you need to add to your Test Plan is a Listener . This element is
responsible for storing all of the results of your JDBC requests in a file and presenting a
visual model of the data.

Select the JDBC Users element and add a View Results Tree listener :
(Add --> Listener --> View Results Tree).
5) Displaying Different types of Result :
Now go to : Run--> Start (Ctrl + R) and you will get different types of results.
6) DisplayView Results in Table

Add --> Listener --> View Results in Table


7) Display Summary Report

Add --> Listener --> Summary Report


8) Display Spline Visualizer
Add --> Listener -->Spline Visualizer

You might also like