Data Base Testing (JDBC Request)

                         Using JDBC request sampler we can test the database.
Steps to do the database testing.
Step 1: open jmeter
step 2: add thread group to test plan
step 3 : Add the config element (JDBC connection cofig)

( see the following screenshot for reference.)


 The Config Element- "JDBC Connection Configuration" is required to be added as child of the Thread Group. The properties in "Connection Pool Configuration" and "Connection Validation by Pool" can be kept with default values. Appropriate values for the following parameters need to be configured in "Database Connection Configuration" section-
  1. Database URL - The URL of the database server
  2. JDBC Driver class - The database driver name e.g. com.mysql.jdbc.Driver
  3. Username - The username of the user having access to run the SQL query in the database
  4. Password - The password of the user having access to run the SQL query in the database
step 4: Add JDBC request sampler.
(see the following screenshot)



The Sampler- JDBC Request needs to be added as child of the Thread Group below the JDBC Connection Configuration. Here we can select the type of SQL query form the "Query Type" drop-down and place the SQL query in the "Query" text field.

Step 5: Add the listeners . ( To know the output we have to add the listeners.)
Step 6: add assertion also if you want. (For validation)
step 7: Run the test.



No comments:

Post a Comment