Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

What is Jmeter and How it works? An Overview and Its Use Cases

History & Origin of Jmeter

JMeter was developed by Stefano Mazzucci of the Apache Software Foundation. The first version 1.0 was released in 1998. Revised version 5.1, was February 19, 2019. JMeter was first developed by Stefano Mazzocchi of Apache Software Foundation. He sat down and built it primarily to test the performance of Apache JServ, later replaced by the Apache Tomcat project. JMeter is one of the most popular performance testing tools provided by the Apache Software Foundation.

What is Jmeter?

JMeter is software that can perform load testing, performance-oriented business (functional) testing, regression testing, etc., on various protocols or technologies. Stefano Majocchi of the Apache Software Foundation was the original developer of JMeter. He wrote it mainly to test the performance of Apache JServ (now called the Apache Tomcat project). Apache subsequently redesigned JMeter to enhance the GUI and add functional testing capabilities. JMeter is a Java desktop application with a graphical interface that makes use of the Swing graphical API. Therefore it can run on any environment/workstation that accepts Java Virtual Machine, for example – Windows, Linux, Mac, etc.

Features of Jmeter are

  • Result Analysis and Caches
  • Highly Extensible Core
  • 100% Java scripted
  • Pluggable Samplers
  • Multithreading Framework.
  • Data Analysis and Visualization.
  • Dynamic Input

Why use Jmeter?

In addition to load testing, testers can use Apache JMeter to perform performance, spike, and unit testing.

Performance testing is the process of determining the speed, responsiveness, and stability of a computer, network, software program, or device under a workload.
Spike testing is a form of load testing that rapidly increases and decreases the load over short bursts of time before returning to an average load. Spike tests simulate a system where there is an unexpected increase and decrease in loads (for example an e-commerce store on Black Friday).
Unit tests will analyze the smallest testable parts of an application. Jmeter can be used to unit test processes and protocols such as JDBCdatabase connections, LDAP, JMS, and HTTP.

Advantages of Apache JMeters

  • Open-source software.
  • Does not need any specific skills or domain knowledge to use it.
  • Platform-independent.
  • Apache JMeter supports different formats for reporting like text, XML, HTML, and JSON.
  • Supports different protocols like HTTP, FTP, SOAP, JDBC, JMS, and LDAP.

Disadvantages of Apache JMeters

  • Consumes more memory.
  • Supports only web application testing only but does not support desktop applications.
  • As it is not a browser, cannot run Javascript in a web application.

Best Jmeter Alternative

  1. LoadRunner
  2. Gatling
  3. Apache Benchmark
  4. TSung
  5. Funkload
  6. Loadninja
  7. SmartMeter

Best resources to learn Jmeter

https://www.devopsschool.com/

https://www.devopsschool.com/blog/?s=Jmeter

Free Video Tutorials Jmeter

Jmeter Interview Questions and Answers

1) Explain what is JMeter?
JMeter is a Java tool, which is used for performance Load Testing.

2) Explain how JMeter works?
JMeter acts like a group of users sending requests to a target server. It collects responses from the target server and other statistics which show the performance of the application or server via graphs or tables.

3) Explain where you can use functions and variables?
Variables and functions can be written into any field of any test component.

4) Mention what are regular expressions in JMeter?
Based on the pattern, a regular expression is used to search and manipulate text. JMeter is useful in interpreting forms of regular expression or patterns being used throughout a JMeter test plan.

5) Explain what is Samplers and Thread groups?
Thread group: For any test plan, JMeter is the beginning part of thread group elements. It is an important element of JMeter, where you can set a number of users and time to load all the users given in the thread group
Samplers: The sampler generates one or more sample results; these sample results have many attributes like elapsed time, data size, etc. Samplers allow JMeter to send specific types of requests to the server, through samplers, the thread group decides which type of request it needs to make. Some of the useful samplers are HTTP requests, FTP requests, JDBC requests, and so on.

6) Whether the test plans built using JMeter are OS-dependent?
Usually, Test plans are saved in their XML format, so there is nothing to do with any particular O.S. It can be run on any OS where JMeter can run.

7) Mention what are the types of a processor in JMeter?
The types of a processor in JMeter are

Pre-processor
Postprocessor


8) Explain what are Pre-processor Elements? List some of the pre-processor elements?
A pre-processor is something that will happen before the sampler executes. To configure the sample request prior to its execution or to update variables that are not extracted from response text pre-processor elements are used.

Some of the pre-processor elements are:

HTTP URL re-writing modifier
HTTP user parameter modifier
HTML link parser
BeanShell PreProcessor


9) Mention the execution order of Test Elements?
The test plans elements execution order is

Configuration elements
Pre-processors
Timers
Samplers
Post-processors
Assertions
Listeners


10) What do “contain” and “matches” indicate in the regular expression?
The regular expression contains indicates that the regular expression matched at least some part of the target. While matches mean the regular expression matched the whole target. So, ‘alphabet’ is “matched” by ‘al.*t.’

11) Explain what is the configuration elements?
A configuration element works parallel with a Sampler. To set up defaults and variables for later use by samplers configuration elements can be used. At the start of the scope, these elements are processed before any samplers in the same scope.

12) Explain what is a timer in JMeter and what are the types of it?
A JMeter thread by default will send requests continuously without any pause. To get a pause between the request, Timers are used. Some of the Timers used are Constant Timer, Gaussian Random Timer, Synchronizing Timer, Uniform Random Timer, and so on.

13) Explain what is Test Fragment?
Test fragment is also a type of element like the Thread Group element. The only difference is test fragment is not implemented unless it is referenced by either a Module controller or an Include controller.

14) Explain what is Assertion in JMeter? What are the types of assertions?
Assertion helps to verify that your server under test returns the expected results

Some commonly used Assertion in JMeter are

Response Assertion
Duration Assertion
Size Assertion
XML Assertion
HTML Assertion


15) Explain how you can reduce the resource requirement in JMeter?
To reduce the resource requirements in JMeter

Use non-GUI mode: jmeter –n –t test.JMX –l test.jtl
During the load, a test doesn’t use “view results tree” or “view results in table” listeners, use them only during the scripting phase
Don’t use functional mode
Instead of using lots of similar samplers, use the same sampler in a loop and use the variable to vary the sample

16) Name the common techniques for performance testing?
There are five testing techniques that are common in the present scenario. They are

Spike Testing
Load Testing
Volume Testing
Endurance testing
Stress testing
These techniques measure the behavior of applications, their working conditions, handle apps with large records, and ensure functionality in case the overall number of users increases rapidly.

17) Explain Performance Testing?
The process of evaluating the performance of applications under greater load is known as Performance Testing. Basically, it’s nonfunctional testing and is generally done prior to categorizing the app on production. Actually, this ensures that the app will work fine under all the circumstances and don’t face issues like crashing during the real load. Performance monitoring is a very essential task.

18) Performance Testing needs a lot of activities to be performed. Name a few?
There are certain activities that are generally performed during this task and they are:

Testing tool selection
Performance test execution
Performance test planning
Analysis of test requirements
Analysis of test results
Script implementation
These activities are pretty common and can simply be performed.

19) What do you mean by the term Jmeter?
It is basically a Java-based tool that is meant to test the performance of apps. Its open-source nature makes it simply the best for this task. A number of testing related to the performance of the apps can simply be handled with this tool. It really doesn’t matter whether it’s web services or web-based apps. Moreover, it is capable to handle databases as well as FTP servers.

20) How requests are sent to the server in JMeter?
Basically, this is done with the help of Samplers. There are several samplers that are present in the JMeter and a few of them that are used commonly are:

Junit request
JDBC request
HTTP request


21) What do you know about JMeter features?
Extensibility, portability as well as robustness are some of its key features. It is a Java-based approach, and thus it supports all applications based on the same. It is possible for the users to have a final outcome in graphical or tabular form. Test scripts can be created very fast and this is because of the playback feature that JMeter is equipped with. Also, a user needs not to worry about the protocols that can be tested through this tool.

22) Explain the Process of Parameterization?
Basically, it is a very simple process that parameterizes the different types of inputs. This is helpful in using the distinct values for the users.

23) What do you know about the correlation?
It is basically a process of enticing the data from the previous calls and then sending it to consecutive requests in the form of parameters. It is very helpful in making the scripting easy and the good this is it cut a lot of complexity from the process of handling sessions.

24) Tell something about configuration elements?
Customizing the requests that often come from samplers is an important task in JMeter. The same is performed with the help of configuration elements. They can also be used when it comes to integrating the sampler requests with the data obtained from the CSV file.

25) What exactly do you know about a Workbench in Jmeter?
Many times while handling the tasks in Jmeter, the need for storing the test elements is felt. Workbench stores them all on a temporary basis. In addition to the testing elements, there are certain nontest elements that are also present in it. There is a browser in this tool that helps in configuring these elements simply. Keeping anything on the Workbench doesn’t actually mean it is stored in the memory permanently.

Rajesh Kumar
Follow me
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x