In this tutorial, we will be studying the creation of a Performance Test Plan for Web Applications in JMeter. We will see the different test plan elements required for creating the test script along with their usage and configurations. Before going further, you are requested to go through our very important tutorial on planning a load test - Planning a Load Test, to get hold of the whole planning process.
The following things should be known beforehand while creating performance test plan for web applications-
The following steps need to taken in order to create a performance test plan for web applications-
Now, let's see how we can perform each step mentioned above in detail.
Based on the number of user group required for performing different operations, we will add Thread Groups and Logic Controllers to our Test Plan. For example - if we have two set of users performing searching and login operations on a website. Then we will create two Thread Groups and add different Logic Controllers to simulate the different operations performed by the users. Steps to perform-
Add the of configuration our test plan will look like this-
Please note that we have used transaction controller here, as within this controller we can have multiple HTTP requests and after the atest execution, we will get the overall response time of the whole transaction which is desirable. Depending on the scenarios, we can also add different Logic Controllers like Loop Controllers, Random Controller etc.
When we perform an operation like cliking a button, several HTTP requests are sent to the server. While scripting we need to create all these requests, in order to determine the time taken for processing the requests. One way of doing this is to add different HTTP request and configure them with values like - URL, Port, request type(Get, Put, Post, Delete etc), request body, request Header etc. But this can get very cumbersome unless we are required to test very limited requests or need to test a particular HTTP request.
To perform this efficiently JMeter provides us an HTTP(s) Test Script Recorder, using which we can record scripts in JMeter directly by performing operations on a browser. Check our tutorial on recording scripts Record and Playback in JMeter.
Once we get hold of recording scripts, we can select a transaction controller like "Launch application" from the Target Controller of the HTTP(s) Test Script Recorder and perfom the operations like launching the web application on the configured browser, the different HTTP requests will get added to the selected Controller.
We can add Timers between two transaction controllers to introduce think time like a timer with of 3 seconds timeout value can be introduced between "Launch application" and "Search a Keyword" controllers to simulate the time a user takes to process the response and type a keyword to search.
In order to store and analyze the test results, we can different types of listners studied in our tutorial - Listners in JMeter.
Before performing the test with actual number of users we need to dry run the test with very small number of users in order to validate the correctness of the script.
Once the scripts is verified, we will configure the load test with desired number of users and schedule the load test.
Once the whole test script creation and configuration is done, we will run the test by clicking the play icon or pressing Ctrl+r on keyboard. During the test execution, we will monitor the server in parallel. Once the test gets over, we can store and analyze the test results.
Now we have seen a basic test plan for a web application, still there are couple of things which needs to be taken care of-