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.
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,
you need to record create user scenario using JMeter.
parametrize add user request (username,details)with csv data set config element.
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
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.
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.
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.
Download a relevant JDBC driver for your database and drop it to /lib folder of your JMeter installation
Restart JMeter if it's running (jars loading isn't dynamic and performed on start)
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
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.
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.
Related
Facing some issue while running the performance testing of H2 database for a corda project.
JDBC requests in Jmeter is used for this testing .
some screenshots of Jmeter is given.
jdbc connection issue
jdbc reruest
result
Your question doesn't provide any error details therefore we cannot come up with the comprehensive solution, going forward make sure to include the screenshot or text of the "Sampler Result" tab of the View Results Tree listener and at least the relevant part(s) of the jmeter.log file into your question.
The most possible reason is using the wrong validation query, what you supplied is for Oracle DB, for H2 you should be using just Select 1
Also make sure to put the H2 JDBC Driver to JMeter Classpath and restart JMeter to pick up the .jar
Check out The Real Secret to Building a Database Test Plan With JMeter article for more information on the database load testing using JMeter.
P.S. Be informed that having JMeter and the application under test on the same machine is some form of a performance-testing anti-pattern as both are very resource intensive and in case of CPU/RAM/whatever lack you won't get reliable results.
We are using MongoDB and need to create n users to test the performance of login scenarios by passing these users in JMeter, I can use CSV file to pass username/password values however for this I need to first create 500 users in DB. I saw some info on the net saying to use MongoDB script to generate data but this is Depreciated.
Please suggest how can I create these users.
how to create XX number of users in MongoDB using JMeter and use these users to test login/authorization performance scenarios.
MongoDB test elements were marked as "deprecated" due to low interest of the users in this functionality, however they still can be used.
Add the next line to user.properties file (lives under "bin" folder of your JMeter installation)
not_in_menu=
this way you will be able to restore the access to deprecated test elements via JMeter GUI
Restart JMeter to pick the property up
You should now see and use MongoDB Source Config and MongoDB Script test elements to establish MongoDB Connection and execute arbitrary queries.
See How to Load Test MongoDB with JMeter article for detailed information on working with MongoDB with JMeter.
I have recorded a jmeter script for wiki page. That record was done in one of our test environment. That script is working fine and now i want to perform same load test for another test environment(Both environments are same, only urls are different).Is it possible to reuse?How can i do it?
I have added HTTP Request default element at the begging of test plan creation. Now recorded script consist of many HTTP Request element. Each request element contains Server IP of test instance.
Extract IPs and other env-specific data to .properties file:
http://jmeter.apache.org/usermanual/get-started.html#options
Read them in your JMeter with JMeter built-in function ${__P(someName)} as you see fit
Run your generic JMeter test with env-specific config data in .properties file
Yes. It is possible to run the same test in multiple environments. It all depends on how you design your test plan.
This site has exact details you are looking for.
http://www.testautomationguru.com/jmeter-manage-test-plan/
I have a working script to login and get to one website on the webserver, what I need is how to get to the other 10 plus servers with Jmeter all at once to do a nice stress test on the websites and its interfaces.
Any help is greatly appreciated
I think that you need to use DNS Cache Manager available since JMeter 2.12
DNS Cache Manager allows each JMeter thread to resolve underlying IP address of the request endpoint on its own.
See The DNS Cache Manager: The Right Way To Test Load Balanced Apps guide for detailed explanation of background and configuration details.
This is pretty trivial using the CSV Data Set Config.
Let's assume you are using normal HTTP Request samplers and that these are already set up with a server and path. Let's say it is the server you want to change for each thread. Then you need to:
Create a text file with a different server you want to test on each line.
Add a CSV Data Config element to the top level.
Configure the CSV Data Config to use your text file and set the variable name of server.
In your samplers change the server name to ${server}.
You can use the same method to change the path and other details.
I do the following:
Create a Web Performance Test. Browse around cnn.com while the recorder records the steps.
Create a Load Test. Go through the wizard, attach the Web Perf Test created in the previous step.
Run the Load Test. It seems to run fine with all kinds of colorful statistics and I can see requests going out via TcpView utility. The screen looks like this, while running:
When it's all done, I get a blank screen without any results (see below).
Am I missing something simple?
Load Tests results need to be stored in a database. Have you configure the connection string for the sql server where the LoadTests2010 database exists?
If not, check these links to see how to create the database and configure the connection string:
How to: Create a Load Test Results Repository Using SQL
How to: Select a Load Test Results Repository