Beruflich Dokumente
Kultur Dokumente
1
Index…
Download JMeter...................................................................................................................3
Run the JMeter.bat................................................................................................................3
JMeter GUI.............................................................................................................................3
Adding Basic controls to the Test Plan.................................................................................4
Thread Group control...................................................................................................................................4
JDBC Request control..................................................................................................................................5
JDBC Connection Configuration control.....................................................................................................6
“http://jakarta.apache.org/jmeter/usermanual/build-db-test-plan.html”.......................................................6
View Result Tree control..............................................................................................................................6
Parameterization....................................................................................................................6
User Parameters Control...............................................................................................................................6
Calling Procedure.....................................................................................................................7
Download JMeter
http://jmeter.apache.org/download_jmeter.cgi
JMeter GUI
Right click on the Test Plan and add the Thread Group control.
Note: Thread Group allows us to run script with n no. of users with defined ramp-up period and also the
scheduling of execution.
JDBC Request control
Note: JDBC Connection Configuration control is used to configure the database i.e. Oracle, SQL Server etc.
In this control, we need to provide values to the following parameters to communicate with DB server
For Oracle
Database Connection Configuration
============================
Database URL: jdbc:oracle:thin:@localhost:IP:service (e.g. IP: 1521, Service: oracle)
JDBC Driver Class: oracle.jdbc.driver.OracleDriver
Username: Username of the database (e.g. Username: scott)
Password: Password of the user (e.g. Password: tiger)
sqljdbc.jar
For MySQL
Database Connection Configuration
============================
Database URL: jdbc:mysql://localhost:3306/mydb
JDBC Driver Class: com.mysql.jdbc.Driver
Username: Username of the database (e.g. Username: guest)
Password: Password of the user (e.g. Password: password)
Where “mydb” is Database Name
E.g. for MySQL is given in jmeter’s user manual
“http://jakarta.apache.org/jmeter/usermanual/build-db-test-plan.html”
Copy this jar file to “lib” folder.
This is jdbc driver for MySQL
mysql-connector-jav
a-5.1.20-bin.jar
View Result Tree control
Note: View Result Tree control is used to view the result of the query executed.
Parameterization
User Parameters Control
Note: User Parameters control allows the script to be run with multiple values like username,
password, department no. etc. We can add variables and also provide values of the variable for
multiple users.
Calling Procedure
1. Add the JDBC Request control to the Thread Group.
2. Procedure which we are going to call must exist in database.
3. Type the following command in SQL Query parameter of the JDBC Request control
begin
{call update_DEPT_PKG.update_DEPT(10)};
end;
Whichever procedure we want to call must be inside the begin…end block. Call keyword is used to
call the procedure from the database.