2. Open Jmeter from : apache-jmeter_home/bin/jmeter.bat or ApacheJMeter.jar
3. Add Users
Select the Test Plan, right click on Test Plan, select Add> Threads(Users)> Thread Group
Set up the following fields for Users:
a. Set value for Numbers of Threads(users): 5
b. Set value for Ram-up Periods : 2.
It means that 5 users connect to MYSQL server withine 2 seconds.
4.Add JDBC Connection Configuration
Right click on the 'Thread Group', select Add > Config Element > JDBC Connection Configuration.
Set up the following fields for MySQL database:
a. 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. We have named it as 'Postgresqlpool'.
b. Database URL: jdbc:postgresql://IPAddress:PortNo/DatabaseName?autoReconnect=true
c. JDBC Driver class: org.postgresql.Drive
d. Username: username of database
e. Password: password of database
f.The other fields can be left as the defaults
5. Add JDBC Requests
Right click on the 'Thread Group', select Add > Sampler > JDBC Request.
Then, select this new element to view its Control Panel. Edit the properties as below:
a. Enter the Pool Name: Postgresqlpool (same as in the configuration element)
b. Query Type: Select statement
c. Enter the SQL Query String field.
6. Adding a Listener to View/Store the Test Results
Right click on the 'Thread Group', select Add --> Listener --> View Results Tree and Summary Report
Save the test plan, and run the test with the menu Run --> Start or Ctrl+R
This comment has been removed by the author.
ReplyDeleteCannot load JDBC driver class 'org.postgresql.drive'
ReplyDeleteI get this error when I tried everything. Am I missing anything?
i am getting this error too...Help please
DeletePUT JAR RELATED TO THAT IN APACHE FOLDER/LIB
Deletethat's a typo. you need to add "r" at the end. it is "org.postgresql.driver"
DeleteDid you copy the driver into the jmeter lib folder?
ReplyDeletehttps://jdbc.postgresql.org/download.html
Note that class name should be org.postgresql.Driver
Yes the class name should be org.postgresql.Driver
Deletei have had that driver in lib but still got "Cannot create JDBC driver of class org.postgresql.Driver' for connect URL 'jdbc:postgresql.
ReplyDeletemany many thanks!!!
ReplyDeleteHi, I am seeing this error "Cannot create PoolableConnectionFactory (ERROR: relation "dual" does not exist
ReplyDeletePosition: 15)" and the URL I used is jdbc:postgresql://HostName:5432/qa