Learn JMeter Performance Testing in 18 minutes ..
Articles,  Blog

Learn JMeter Performance Testing in 18 minutes ..


Hello, everyone My name is Inder P Singh and I have a blog website and a group called software testing space. In this short video I will be showing you a load test Demo using the leading open source tool, Apache JMeter. The website we’ll be testing is my blog which is Software Testing Space as you can see over here. Now in order to run this load test, we will consider two user profiles. There will be a user profile of first-time users and there will be a user profile of repeat visitors. So the first time visitors basically will have a business transaction that consists of looking at the websites home page and also scrolling down to look at my profile as you can see over here. So that is what the first time visitors will do in their business transaction. The repeat visitors would already be familiar with the website so instead of navigating to the home page, they will have a business transaction which consists of directly going to the link for the category of Test automation, so there is a category of test automation here. So they will go to this particular URL where they can see all the Test Automation articles that I have written. Apart from that, they will also go to the Functional Testing category and the Performance and Load Testing category by navigating to those appropriate links. Okay. Now, I have Apache JMeter version 2.9 open in front of me and how this is organized is as two main elements in the tree view on the left hand side pane in the JMeter console that you can see right now. The top element is called the test plan and whenever we click on any element in the JMeter tree view it opens up that elements control panel that you can see on the right hand side. So right now, I have selected the test plan element and we can see the settings or the items we can set for this element, so the default name that JMeter gives is the “Test Plan”. But we can change any default names so I am calling my test plan SoftwareTestingSpace and there is another element in the tree view called Workbench, which is used in the recording process that we will not use in this demo, at all. Now, if I expand my Test Plan, so you can see that there are a couple of elements here. First Time Visitors and Repeat visitors. The first time visitors and repeat visitors are both thread groups. A user group in JMeter is called as a thread group and what we need to do is specify how many users will be there in that thread group? What will be the ramp-up period and what will be the Loop Count? (iterations that they perform) So it being a blog website of specialized topics, the number of concurrent users is going to be small, so just as in reality, we can have 10 users or 15 concurrent users on my blog website. So, I have kept a small number here, so there will be three concurrent users (a maximum of three concurrent users) The ramp-up period Is going to be six seconds. That means these three users will be loaded by JMeter in a period of six seconds. That means, one user will be brought to life by JMeter every two seconds. Each user will perform ten iterations, so whatever requests are present in this thread group, that we will see shortly, each user will perform that set of requests ten times. Similarly, we have settings for repeat visitors thread group in Repeat Visitors thread group. I usually get more repeat visitors than brand-new users. So there will be six concurrent users (a maximum of six concurrent users). The ramp-up period Is the same. So one new user will be made active by JMeter every second and each user will perform all the the entire set of requests ten times. Now let us go a little deeper into the first time visitors thread group. So, as you can see, that here are the requests view Home page, for going to the home page of my website and then we have the View Profile page and View Profile image. Now, view Home page is the request. It is called the HTTP request. HtTP request is the sampler in JMeter that sends off the request to the particular server name or IP address. So, we can specify a server name or IP address within the HTTP request and, if required, we can also specify the path. Now, View Home page is not directly under the thread group. We can of course keep it directly under the thread group, but it is inside a container. This container is called (there are other containers also in JMeter), and it is called a Controller. So we have the View Home page here now. It is also possible to put functional checks in JMeter by something called Assertion. So, here is a Response Assertion. So what I am asserting is that when I send off the request to view the home page and the JMeter gets a response back, there will be a pattern Software Testing Space contained in the text response. If JMeter does not find this pattern in the response then it will assume that it is a failing response. Otherwise, it will assume that it is a correct response. Similar to the View Home page controller, we have the View Profile controller Differences being that View Profile controller instead of containing a single HTTP request, it contains two HTTP requests – one is to view the Profile page and here you can see, we have the server name or IP address. Here the server name is there and there is a path also and then there is another HTTP request for the profile image. So it goes to a particular server name, and there is a path. Now that’s about the first time visitor user profile. Then we have the repeat visitor user profile. In Repeat visitor user profile, again, there is a simple controller. There is no logic associated with this controller. That is why it is called a simple controller. And it has three HTTP requests. One is view Test Automation. It goes to my website and it goes to a particular path in the website showing all the test automation articles. Similarly, we have one HTTP request for view Performance Testing. So again it goes to my website and there it goes to all the articles on Performance Testing and similarly, we have another HTTP request for the Functional Testing. Now when we start the test (as we are going to shortly start the test), so JMeter starts sending the requests to the server and getting their responses back. Now there are multiple reports available in JMeter. In JMeter, the reports are called LISTENERS. So there are two types of listeners in JMeter. One show you the tabular test results in the form of a table with more details and the other type of listener is the Graphical Listener which show you the results in a graphical format. So, now we will run the test. Before running the test keep in mind that there will be three First Time visitors, and there will be six Repeat visitors. So let us run the test and notice in the top right corner. It is shown how many threads or users are running and what is a maximum number of threads. So maximum we have three concurrent users for First-Time visitors and six concurrent users for the Repeat visitors. So, I am going to start the test by clicking on the start button. The test has started and as you can see the number of concurrent users is picking up, and it is nine out of nine which means that the maximum number of users are active at this time out of total of nine concurrent users and we can see the Results are started coming in. Now if I stop the scrolling and take you to the top of the results. So, here you can see the first time visitors are there and I am going to select a few of those requests and the responses data. So the first time visitor 1 – 1. Here the first digit 1 stands for the thread group number. so first time visit is the first thread group, so it will always show it as 1. The repeat visit thread group is a second thread group. It will always show it as 2 in this particular test plan. So I am selecting 1 – 1 which means the first read group first user so so lot of requests are over here and this is another one, and this is the third one so if we see from the top so the way the first request of the first thread group first user was to view the homepage which is a first request and then if we scroll down we can see the second and third requests over here, so the second request is to view the profile page, so it shows a view profile in page and the third request is to view the profile image and It shows… sorry! Here it is. It shows the View Profile image now in the test results. It shows a number of columns. So it shows the sample number sample number is shown for the response Sample number it shows a Start Time. So it is 11:37 p.m. It shows the label – whatever label that we have typed in the name field. Then it shows the response time in milliseconds, so it to view the homepage it took a total of 1.4 seconds to send the request for the request to travel from my computer to the website for the web server to understand the request, generate the response and send the entire response back to my computer. Overall, it took 1.4 seconds and the status is OK and there were 80,940 bytes in the response. So this is all the responses’ data for the test results. Same way, we have the graphical results and before we analyze the graphical results. Look here that now only 3 users are running out of a total of 9 users because the other 6 users have finished off their transactions and they have been dropped by JMeter. Only the work of 3 users is remaining at this time and once the test is stopped, this green box will turn gray indicating that the test has stopped. So here, there are two graphs that I have selected. One is the average response time. So if we look at the blue line over here, we see that the average response time initially was low, then it picked up as the number of requests increased and then it kind of Increased a bit and it settled down. Okay, and the Green line is for the Throughput. So as we can see initially, the throughput dropped but then it increased and then it stabilized and finally the throughput dropped because there were less users with remaining iterations and in the bottom right, we can see the average response time came out to be more. So it came out to be more than the first one that we saw it came out to be 4.4 seconds. Which is still okay if our performance requirement was that we should get every response

89 Comments

  • Sangam

    Very good explanation on using JMeter tool for load testing purposes. Similarly, we can perform load testing on web services etc.. using JMeter – a very good test tool!!

  • Niroop N Gowda

    Hi Inder. Really helpful videos. My request is, can you please upload a video explaining the correlation in JMeter.? That would be really helpful. Thanks in advance

  • Alok Samantara

    how can i get to know response time of a web page,if the web link(http) is same for all the pages but the content in page were differ,so the time also differ as per the content in the web page.
    eg, suppose in e-learning website 1)one student loged in 2)and go through the course,but for one course there will be many web pages of different content but same web link(path) so in this scenario how to get the response time of individual web page??

  • srinivasan naryanaswamy

    i want to know few things i.e., (i) How many virutual users can be used in Jmeter at a time?(ii) If i want to learn jmeter can u give me basic tutorials?

  • Ranjith Behara

    Hi.. I have a doubt. How can we connect Firefox to jmeter? Because i want to user jmeter for checking the performance of my company website..how can check its performance when more number of users are login at a time..How can i give more user names and passwords from my perspective

  • Palla Subramanyam

    I want to know few things in Jmeter i.e
    1) How to send graph results to our superior for reference
    2) How to do performance testing on web portals like sharepoint applicaitons

  • Palla Subramanyam

    Hi inder thank you for your quick reply if possible can you please upload one share point application performance testing related video this is very help full to who are working in share point application testing.
    1) Which type of graph results is easy to under stand like graph results , Tree results, Table format results….etc
    Thanks,
    Subbu

  • pratik oza

    Hi While testing and adding the View results in Tree, the response data tab shows the login page displaying the browser is not supported even though I have entered the correct path and the website in the HTTP request, also it shows the success request. how do i proceed.

    Thanks.

  • Palla Subramanyam

    Hi Inder,
    1) I have followed above video to create load testing on your site
    2) In my jmeter screen now displaying How many threads or users are running count in top right hand side corner.
    Thanks,
    Subbu

  • Palla Subramanyam

    Hi inder,
    1) I have executed one thread group
    2) I have taken listener as view results in table
    3) In status column warning icon is displayed & sample time displayed as zero and latency also zero 
    what is the problem, if this situation how i can  fix my problem, please suggest me your suggestion is appreciated.
    Thanks,
    Subbu

  • Stride Purple

    Hi Inder,

    I would like further details about your Jmeter training videos. The cost, how should the payment should be made etc.

  • Stride Purple

    Whats the advantage of putting the http requests under a controller as opposed to having it directly under the Thread Group

  • girish dhobe

    Hello Mr. Inder Singh. Thanks for crisp and clear tutorial on JMeter for beginners. It is very easy to understand and implement after following your tutorial than the tutorials available in youtube.

  • Nageswara Rao Vekkanti

    Very nice video.Could you please share more videos on JMeter.I am beginner to JMeter, where will i get complete information on this? do we have Complete video for JMeter ? if yes, could you please share link for it.
    Thanks in Advance !!!

  • Kumar Vikram

    Hi there, you have used method as "get". can we have example for post methods too…if u have any sample video with post method please share

  • ABHRA BANERJEE

    Hi Sir
    I tried to replicate the exact same scenario as you did but the problem is that the assertion test results are not coming correctly. I have written the exact same text but the error code is:

    Assertion error: false
    Assertion failure: true
    Assertion failure message: Test failed: text expected to contain /Software Testing Space/

    Please help me on this.

  • Karim Taleb

    You mentioned at the beginning of the video, that the load and performance tests results need to either be compared with something either an existing system or compare them to testing standards. which will allow us to have a good understanding about the results.My question: What are the "official" load and performance standards to which we can compare our results to. And be able to make a conclusion and say that the tests results were good /acceptable  or not good. Thank you,

  • Amruth H R

    Hey Inder Singh.

    I liked your tutorial, it very nice, flow was very good, able to practice simultaneously. Must watch tutorial for beginners.

    Great going, keep it more coming.

  • Rajesh Babu Kunapareddy

    Hi Inder Singh,
    This was a great tutorial for beginners, i would like to take a deep jump into performance testing,
    That would be great if you can let access such in depth concept of JMeter, concept like how to create whole test plan to conduct performance testing on whole big websites like login do operations/transactions(all transactions).
    By the way i have watched all related to JMeter in your channel.

  • Srikanth Shetty

    How to send more than one sql query or Multiple query in JDBC request with different parameter in jmeter. This is one requirment in load informix DB testing. please assist

  • Srikanth Shetty

    Understood the below answers from you and Thanks to get to clear. One more question here is, I Need to run heavy JDBC load test in Linux, so which is best Listener to use to get the detailed result report, so that i can able to measures the time to process the request and number of the query fired..etc. PLEASE SUGGEST.

  • Fouziya Hanif

    Hi, Im using J meter for the time , My android application having 6 categories(Modules )Each module having seperate URL's It is possible to test the seperate URL'S to test the load

  • Fouziya Hanif

    Hi, as my app having 6 modules I have created 6 Thread group to test the load individual when 1)News 2) post and comment 3) gallery 4) suggestions 5) Help 6) sermons when .. Number of users replying or commenting at the same time here I'm going to test the load of the application if I want to test the Modules "4" and "6" I want to test now both modules of the app at the same here what I have to do . Merge options is Correct.

  • Fouziya Hanif

    Hi,

    My app having six modules for each modules having separate Urls

    1)http://church/wpApp/api.php?mod=gallery&method=get Videos&format=json — with this url i can done the load test Using J meter .

    My another Sub- category Url having ID based URL. Here it is possible to apply load test Why because this URL having id this ID based Test only for particular ID.

    2)http://felda/wpApp/api.php?mod=posts&method=ratetopost&post_id=510&comment_author_email=t_content=hello&user_id=28. ( "ID=28")–

    It is possible to do LOAD test "ID "Based url's.

  • Fouziya Hanif

    Can please send the Link how can i record A script for J meter . What are the steps i have to do.

    Thanks in advance.

  • Fouziya Hanif

    Hi,

    while using the Jmeter in 8 GB Ram capacity (Desktop) How much it can handle the Number of concurrent users. (THreads- Users)

    Thanks in advance.

  • SANTHOSH KUMAR

    can u pls solve my query ASAP….Step 1: Given wrong password In Excel file
    step 2: Read the value from CSV data Config.
    Step 3: why it not shown Error to the Particular sampler.how it is possible why jmeter Validate the Credentials ??

  • Dinh Tani

    Thank you very much. I have a question, at 7:27, I see the screen display in box of Timeouts (miliseconds). What is this for? and when we will setup for it?

  • sai sharan mereddy

    Hi I just watched your video I liked it. I have an issue to deal with requests on storage api side. Initially we were getting 200-300 requests per min so I set db connections as max of 500 but now once it is deployed in prod we are getting 6000 requests per minute. Can you help me what to do to make my DB withstand for those many requests using JMETER or anything?

  • Rahul Bakshi

    help me I want to test a performance of the E commerce website and i want to make a report on that please tell me how i can complete this task

  • SUSHANT SHAURAV

    i want to ask one question why every vlogger start their video from middle mean to say that you have created everything already before and then you start explaining why you all are not explaining from the scratch like how to create a test plan branch and every thing.

  • SUSHANT SHAURAV

    means if i open jmeter viewhomepage option will be appear with it, no na it is created by you please explain from the beginning how to create and all those thing

  • Fouziya Hanif

    Hi, Here My Question is it is possible to add parameter values on add scenario by using J meter.(Like as webservice testing)
    Thanks in advance.

  • Fouziya Hanif

    Hi Inder, i was trying to hit the server for 10 VIRTUAL USERS.But the DB hitting only 2 threads may i know what would be the reason.
    Thanks in advance.

  • Alex G

    Hey, what do you think is 'Selenium with Java Script' is less favor
    combination that 'Selenium with Java' in terms of finding a new job , or
    both combinations offer equal opportunities on job market?

  • Osama A. H. Al Tameemi

    @4:40 you mention concurrent users, as far as I know the users are sequential, to make them concurrent you have to use either the parallel-controller or timers to make sure they start at the same time. Can you confirm that plz?

Leave a Reply

Your email address will not be published. Required fields are marked *