Iftikhar Ali Shahid
Iftikhar Ali Shahid

Reputation: 31

How to create new users with JMeter

I have to perform load and performance testing of my new site which requires login functionality. I am using JMeter to test performance and load. Can you please send me the details of how I can create multiple users to the database by using JMeter, so that I can use them to login multiple users at a time?

Thanks.

Upvotes: 2

Views: 6796

Answers (3)

Nachiket Kate
Nachiket Kate

Reputation: 8571

JMeter is a Load testing tool and not a data creation tool.

It should be used for load testing and not functional aspects. Though it can be used for data creation because of its record and replay feature. (of course with parametrization)

To create data,

  1. you need to record create user scenario using JMeter.
  2. parametrize add user request (username,details)with csv data set config element.
  3. add CSV data set config with required no. of entries (500 in your case) where each line represents user details, user1,India,passwd1 user2,US,passwd2
  4. run script with 500 threads (not advisable but a possible way) or single thread with 500 loop count.

This will create users with data from csv. After that you can load test your website.

Upvotes: 2

Dmitri T
Dmitri T

Reputation: 168042

If you need to create users directly in database the correct JMeter Test Element is JDBC Request sampler which allows to execute arbitrary SQL queries against any database which supports JDBC protocol.

  1. Download a relevant JDBC driver for your database and drop it to /lib folder of your JMeter installation
  2. Restart JMeter if it's running (jars loading isn't dynamic and performed on start)
  3. Add JDBC Connection Configuration element to your Test Plan or Thread Group and populate at least the following fields:
    • Variable Name
    • Database URL
    • JDBC Driver Class
    • Username and Password
  4. Configure JDBC Request to insert email/password pairs. You can use it in conjunction with CSV Data Set Config so user credentials could be read from CSV file.
  5. See Building a Database Test Plan guide or select File -> Templates -> JDBC Load Test to get idea on how your Test Plan should look like.

Upvotes: 0

Helping Hands
Helping Hands

Reputation: 5396

First of all you need to set following things to your Jmeter test plan :

1 - Thread group - Here you can set parallel users[Ex: 450 users] , ramp up period[Ex: 300 seconds] and loop count[Ex : 5]

2 - Login page with get and post method

3 - Listener like summary report , table , tree or other which is suitable for you.

Reference detailed link for login process : How to do login using Jmeter

Please let me know if you have any confusion during your load testing.

Upvotes: 0

Related Questions