Jmeter Interview Question
1. Explain the architecture of JMeter
Ans: JMeter is a Java based open source application that is basically designed for the purpose
of Load Testing.
It supports all major protocols that are supported in Loadrunner. Unlike any browser, JMeter
works on levels of protocols and does not execute JavaScript present in HTML web pages.
JMeter works in a master-slave architecture for load testing. Component of master slave
architecture are:
Master
Slave
Target
2.What are different timers used in Jmeter?
Ans: In JMeter, there are 9 different Timer types.
1. Constant Timer
2. Uniform Random Timer
3. Precise Throughput Timer
4. Constant Throughput Timer
5. Gaussian Random Timer
6. JRS223 Timer
7. Poisson Random Timer
8. Synchronizing Timer
9. BeanShell Timer
Each timer has its own behavior. Let’s have a look at some major Timers.
Constant Timer: This is the most basic timer JMeter provides. All Samplers will wait a constant
time interval according to the value you provided. The thread delay is in milliseconds.
Uniform Random Timer: This timer lets your Samplers wait in a specific time interval
according to the given values. You should provide two values. First one is the constant delay,
the second one is the random delay.
Example:
Constant Time: 500ms
Random Delay: 100ms
Our samplers will wait x amount of milliseconds between 400ms and 600ms.
Gaussian Random Timer: It follows a normal or Gaussian distribution method. It provides a
delay based on a constant and standard deviation.
JRS223 Timer and BeanShell Timers: They both require you to write some scripts by using
javascript, groovy or BeanShell scripting language.
3.How requests are sent to the server in JMeter?
Ans: JMeter will send requests as fast as it can, to wit:
1. It will start all threads (virtual users) you define in Thread Group within the
ramp-up period (in your case - 100 threads in 1 second)
2. Each thread (virtual user) will start executing Samplers which are present in the
Thread Group upside down (or according to the Logic Controllers)
3. When there are no more samplers to execute or loops to iterate the thread will
be shut down
4. When there are no more active threads left - JMeter test will end.
With regards to requests per second - it mostly depends on your application response
time, i.e.
● if you have 100 virtual users and response time is 1 second - you will get 100
requests/second
● if you have 100 virtual users and response time is 2 seconds - you will get 50
requests/second
● if you have 100 virtual users and response time is 500 milliseconds - you will get
200 requests/second etc.
4.Explain the Process of Parameterization
5.Does JMeter simulate actual browser behavior?
Ans: No, JMeter does not support the actual browser behavior. It does not render the HTML
webpages as the normal browser does. The response can be viewed in HTML format but the
actual timings are not present in the generated samples.
6.What is Distributed testing?
Ans: Distributed Testing means using multiple machines for load testing in which one of the
machines can be made master and others can be kept as a slave. It is very important to note
that all the machines should be on the same network and should have the same version of
Java and JMeter
7.What are the types of processors in JMeter?
Ans: Basically there are two types of processors in JMeter namely Pre-Processor and Post
Processor.
Pre-Processors execute before the main sampler and can change the scope of the sampler
whereas Post Processors execute after the main sampler and are applicable to all samplers in
the same scope of Test Plan. They can be used to extract some fields from the server response
and store them in variables.
8.What are the different ways of Data Parameterization in JMeter?
Ans: Data Parameterization makes the scripts reusable where the values are not required to be
hardcoded for the same request with different parameters.
Below is the data parameterization that is supported in JMeter:
1. CSV Data Set Config
2. User-Defined Variables.
9.What are the maximum recommended threads on a single system?
Ans: It depends on the hardware configuration of your system which includes a processor, JVM,
allocated memory -Xmx, etc.
Other factors that impact thread count are the number of components in your test plan i.e. the
number of config elements or processors and it also depends on whether you are using
GUI/Non-GUI Mode.
10.What are the major differences between JMeter and LoadRunner.
Ans: JMeter is considered as the major competitor of Load Runner in the industry. Enlisted are
some of the major differences:
11.What is the use of correlation in JMeter?
Ans:
12.Latest version of jmeter?
Ans: Latest version of jmeter is 5.4.1
13.What are the different types of listeners?
Ans: Listeners are used for storing the execution results of load testing in different forms be it in
a table, graph, tree or in any other presentable format so that it can be presented to the client.
There are different types of inbuilt listeners in JMeter and many others can be imported into it by
using plugins as per the requirement.
Some of the inbuilt listeners are:
1. View results in Table
2. View results in Tree
3. Graph results
4. Aggregate graph
5. Aggregate report
6. Assertion results
7. Response time graph
14.Can JMeter record actions from mobile? If yes, how?
Ans: Yes, JMeter can record HTTP or Https requests going to the server from your mobile
application also. It is required that mobile and JMeter are on the same network.
Below is the configuration required:
1. Configure your proxy server in JMeter to run at a specified port.
2. Set up the proxy on your mobile wifi settings and enter the same port number that is
used in the recorder.
3. Install the Root CA certificate on your mobile.
4. Hit server requests from your mobile and observe it getting captured by the specified
controller.
15.How to do master-slave configuration in JMeter?
Ans: Master-slave configuration is a part of distributed testing in which more than one machine
is used to perform load testing of the server under test.
It is very important that all machines are on the same network and all have the same version of
JMeter. In distributed testing, one machine is considered as the master and the others are kept
as slaves by doing some configurations.
The process is specified below:
On the master machine, edit the JMeter.properties file and add the IP addresses of slave
machines against the remote_host field in the file.
Save the file and open the JMeter again.
Now, from the RUN menu in JMeter, select Remote Start and choose the IP of the machine to
be invoked.
Choose the RUN menu and select Remote Start all to start all the slave machines for your
testing.
16.Why is it recommended to run JMeter in GUI mode?
Ans: JMeter tests can be run both GUI as well as Non-GUI Mode. It is highly recommended to
run the load test in Non-GUI mode because the AWT event thread can kill the tests in case of
high load scenarios.
The various Non-GUI mode supported with JMeter are:
1. Command-line
2. ANT plugin
3. MAVEN plugin
4. Jenkins
17.How do you manage sessions and cookies in JMeter?
Ans: Sessions and cookies can be managed in JMeter by using config elements such as HTTP
Cache Manager which provides an option to clear the cookies in every iteration and also allows
users to add user-defined cookies.
HTTP Cache manager helps you in clearing cache after each iteration as per your requirement
in the load tests and also limits the number of elements that can be stored in the cache. Both of
these config elements can be attached to the HTTP sampler.
18.What are the important steps for testing JDBC requests?
Ans: JDBC requests are used to establish a connection with the databases and then measure
the response time of the queries.
Important steps for testing JDBC requests are:
Setting up Config Element, JDBC Connection configuration in which Database URL and JDBC
Driver Class needs to be added as per the database which is being used. Also, add the variable
name for this connection configuration so as to use it in the sampler.
Add JDBC Request. Add the same variable name added above and write your queries to the
test.
19.What is BeanShell scripting?
Ans: BeanShell is a lightweight Java scripting that is used in JMeter to perform some complex
tasks. BeanShell samplers can perform various functions with the use of coding. You can print
the thread number, get the current sampler executed, fetch the cookies, etc.
20.Can JMeter measure the performance of a complete application? For Example,
you have multiple screens in your mobile app. Can JMeter measure the time
taken to flip the Screens?
Ans:No, JMeter does not measure the transition time between the screens. It can only measure
the server actions, not the UI interactions.
21.What is a Root CA certificate?
Ans: HTTPS connection requires a certificate to authenticate the connections which get
established when the browser hits the web server. JMeter generates it temporarily to intercept
the SSL traffic in order to record the actions. For recording actions via mobile, you need to have
this certificate on your mobile to record the actions.
22.Which factors decide the maximum threads that one should generate per
system?
Ans:It depends on the hardware of the system.
For Example, on a 2-3 GHz CPU, 400-600 threads can be generated. It also depends on the
components in your test plan. More the processors and XML parsing elements, the more the
CPU load and hence fewer threads. For high load, it is recommended to use multiple machines
for load testing.
23.What is a Workbench and why is it required?
Ans:Workbench is a storage area for adding some components which can be added to the test
plan if required.
Components of the workbench do not get saved with the test plan automatically. They have to
be saved separately as test fragments. A most important part of the Workbench is HTTP(s) Test
script recorder which is highly useful in recording the https request and later load can be applied
to+9859 them to measure the response time.
24.What is Tidy Parsing?
Ans:Tidy Parsing is a type of parsing that is used in Xpath extractor. If the response is in pure
XML then tidy parsing is not required whereas, in the case of XHTML, it is mandatory to check
the tidy parsing option in order to fetch the correct results.
25.What are the important plugins that are supported in JMeter?
Ans: JMeter supports different types of plugins which are helpful in generating high-quality
results.
Below are the major plugins that are supported:
1. Thread group plugin – Stepping thread group plugin.
2. Samplers plugins like Webdriver.
3. Listeners plugins.
26.What are the types of the controller in JMeter?
Ans: Controllers are used in JMeter to control the flow of execution of requests.
Below are the controllers that are used in JMeter:
1. Recording controller
2. IF controller
3. While controller
4. Transaction controller
5. Loop controller
6. Simple controller
7. Module controller
27.Explain Ramp up period?
Ans:The ramp-up period tells JMeter how long to take to "ramp-up" to the full number of threads
chosen. If 10 threads are used, and the ramp-up period is 100 seconds, then JMeter will take
100 seconds to get all 10 threads up and running. Each thread will start 10 (100/10) seconds
after the previous thread has begun.
28.What are the roles of Listeners in JMeter? Can you name a few of them?
Ans: Listener allows us to view and analyze the Sampler request and response in the form of
tables, graphs, trees etc. You can also save results in a file and read saved results later. You
can access the sampler result in an ongoing load/stress test without waiting till the end.
Listeners can be added anywhere in the test plan. It will gather data only from elements defined
in its scope.
List of listeners is as follows:
1. Aggregate Graph
2. Aggregate Report
3. Assertion Results
4. Backend Listener
5. BeanShell Listener
6. BSF Listener
7. Comparison Assertion Visualizer
8. Generate Summary Results
9. Graph Results
10. JSR223 Listener
11. Mailer Visualizer
12. Monitor Results
13. Response Time Graph
14. Saves Responses to a file
15. Simple Data Writer
16. Summary Report
17. View Results in Table
18. View Results Tree
29.Name a few timers in JMeter. For what purpose are they considered?
Ans: A JMeter Timer is a built in plug in tool for JMeter that can help with spacing out your
samplers requests.
1. Constant Timer.
2. Uniform Random.
3. Gaussian Random Timer.
4. Poisson Random Timer.
5. Synchronizing Timer.
6. Constant Throughput Timer.
30.What do you mean by Rendezvous point?
Ans:
31.What do you know about assertions?
Ans: Assertion in JMeter is used to validate the response of the request that you have sent to
the server. Assertion is a process where you verify expected results with the actual result of the
request at run time. If you need to apply assertion on a particular Sampler, then add it as a child
of that Sampler.
You can view assertion results by adding “Assertion Listener” to the Thread Group. Failed
assertions will be displayed in other listeners as well.
32.What do you know about the Preprocessors in JMeter?
Ans:Pre-Processor element is defined to alter the settings of Samplers in their scope. It will
always execute before the actual sampler request.
33.Is it possible to run JMeter in GUI? If so, explain how?
Ans:
34.What are the different protocols that are supported by JMeter?
Ans:The protocols supported by JMeter are:
1. Web: HTTP, HTTPS sites 'web 1.0' web 2.0 (ajax, flex and flex-ws-amf)
2. Web Services: SOAP / XML-RPC
3. Database via JDBC drivers
4. Directory: LDAP
5. Messaging Oriented service via JMS
6. Service: POP3, IMAP, SMTP
7. FTP Service
35.What are the main parts of a Thread Group?
Ans:Thread Groups is a collection of Threads. Each thread represents one user using the
application under test. Basically, each Thread simulates one real user request to the server.
36.How sampler and logical controllers in JMeter are different?
Ans:
37.Name at least 10 Listeners that JMeter is equipped with?
Ans:
38.What are the applications that you can test with JMeter?
Ans:Apache JMeter may be used to test performance both on static and dynamic resources,
Web dynamic applications. It can be used to simulate a heavy load on a server, group of
servers, network or object to test its strength or to analyze overall performance under different
load types.
39.What are Post-Processors in JMeter?
Ans:Post-Processors are actions that are performed after your sampler has been executed. You
can use them to perform some actions on your response or extract some values out from the
response and save them in a variable that can be used later.
40.What do you know about the Concurrent user hit in JMeter?
Ans:Concurrent Users. Throughput is a measure of how many units of work are being
processed. In the case of load testing, this is usually hits per second, also known as requests
per second. Concurrent users are the number of users engaged with the app or site at a given
time.
41.List some of the test plan elements in JMeter.
Ans:A test plan describes a series of steps JMeter will execute when run. A complete test plan
will consist of one or more Thread Groups, logic controllers, sample generating controllers,
listeners, timers, assertions, and configuration elements.
42.What are Controllers and their types?
Ans:
43.What is the execution order of Test Elements?
Ans:
44.What is the 90% line in JMeter?
Ans:90% Line (90th Percentile) is the value below which 90% of the samples fall. The remaining
samples took at least as long as the value. This is a standard statistical measure.
45.What is heap size in jmeter?
Ans:
46.What is median in jmeter listener
Ans:Median: is a number which divides the samples into two equal halves. Half of the samples
are smaller than the median, and half are larger (Some samples may equal the median.)
47.Is it possible that, if we increase the heap size in Jmeter, then
application(jmeter) might not work?
Ans:
48.What is BlazeMeter?
Ans:In other words, BlazeMeter provides a performance testing tool that you then configure to
your particular needs, be it in the form of a load test or stress test or something else. This is
where you scale up your test to run across multiple engines and even from multiple locations
around the world, if you like.
49.How do you ensure re-usability in your JMeter scripts?
Ans:Steps to Create Reusable Test Fragment
Step 1 – Adding “Simple Controller” to the Test Fragment
Step 2 – Adding “HTTP Request” to the Simple Controller
Step 3 – Adding “HTTP Header Manager” to the HTTP Request