StressTesting


Apache JMeter is the software testing tool which main purpose is to load test functional behavior of server, group of servers or networks and measure its strength or performance under different load type.
In this tutorial I am going to give you a sample of my project on which I apply normal stress on single server to check its performance by creating multiple login and multiple events against one user at same instance of time.


Multiple User Login

1.Adding Users

First create a Test Plan(A test plan describes a series of steps JMeter will execute when run),and in it describe how many users you want  to login and how many times the loop should run for single user.Here i want login of 72 users in a loop and also add the Ramp up time to tell JMeter how long to delay before starting a new user.For instance we have 100 users and ramp up time is 100 so delay between starting users would be 1 second (100sec /100users)


ThreadGroup




2.Adding HTTP Request

It simply defines the default values that the HTTP Request elements uses,so I add IP address and the path.


HttRequest



3.HTTP Cookie Manager

This will ensure that each thread gets its own cookies.


HttpCookieManager



4.HTTP Authorization Manager

The Authorization Manager lets you specify one or more user logins for web pages that are restricted using server authentication.


HttpAuthorizationManager



5.HTTP Request: (For multiple User Login)

In HTTP Request for multiple login add the request parameters ,i have POST request parameters.


HttpRequest



6.HTTP Header Manager

Each time the browser sends a request to a server, headers with additional information are attached to the request.


HttpHeaderManager



7. CSV Data Set Config

In order to login more than one user,add CSV file in which you can add more than one user’s username and password , give the path of that file in JMeter CSV DATA SET CONFIG and send the request through HTTP Request and send request for the user session. It will login the user perfectly.


CSVDataSetConfig



8. Listeners 

I added View Result Tree ,We can also get several graphical analyses of the performance report,in the graphical analyses try to focus on two parameters "Throughput" and "Deviation".Throughput is ability of  the server to handle a heavy load .The higher the Throughput ,the better is the server performance and Deviation is the deviation from the average, the smaller the better.
Click on Play button and get the result from the server.View Result Tree gives result in the tree form which includes sampler result,the requests and the sampler data.

ViewResultTree



Multiple Events Creation against Single Login


To create multiple event against single user add CSV FILE ,give the path of that file in JMeter CSV Data Set Config ,add HTTP Header Manager of the events and send the request through Http Request



1. Add CSV Data Set Config for Event


CSVDataSetConfig



2. Add HTTP Cookie Manager

Add JSESSON ID ,sid and token of a single user against which you want to create multiple events.

HttpCookieManager



3. Add Regular Expression Extractor for JSESSION id and sid


RegularExpressionExtractor


RegularExpressionExtractor

In this way you can make your testing easy with Apache JMeter and provide the 😊

In the next blog I will guide you how to setup distributed (clustered)environment that enables local JMeter(master)which handles execution of test with multiple other remote JMeter instances for applying Heavy Load on the server to check the threshold(maximum load capacity)of the web server and determine the limit at which web server starts responding slow and produces error.






Post a Comment

Previous Post Next Post