Prepare for the JMeter interview with our comprehensive list of interview questions. These interview questions are designed for both beginners and professionals. We will start with fairly simple questions and move to a more advanced level as the post progresses.
Ques.1. What is Performance Testing?
Ans. Performance testing is non-functional testing in which the application’s performance is evaluated under expected or higher load. It is done before the application is deployed on production to ensure that it doesn’t crash and responds within standard/acceptable time at real load.
Ques.2. What are the different types of Performance Testing techniques?
Ans. The different types of performance testing are-
- Load Testing – Type of performance testing to measure the application behavior under the expected workload.
- Stress Testing – Evaluating the application’s behavior under load higher than the application’s threshold or peak load conditions.
- Endurance Testing – Testing application under prolonged load test, usually used to detect memory leaks in the application.
- Spike Testing – Evaluating the application’s behavior on a sudden increase in the number of users.
- Volume Testing – Testing the application with a large amount of data(usually with large records of data in the database).
Ques.3. What all activities are performed during performance testing of any application?
Ans. Activities performed during performance testing-
- Performance Test Requirements Gathering & Analysis – In this phase, all the details about the application are gathered from the client and other stakeholders of the application.
- Testing Tool Selection – This phase involves the selection of the performance test tools.
- Performance Tests Planning – The test planning phase includes planning the whole performance testing process, infrastructure, and environment setup; use case scenarios to be scripted, etc.
- Test Script Implementation – In this phase, the performance test scripts are created using the tool selected in the previous phases.
- Performance Test Execution – In this phase, the test script is executed for a predefined time specified during the planning phase.
- Test Result Analysis – The result analysis phase includes consolidating the test results for determining the different performance attributes of the application and finding the performance bottlenecks.
Ques.4. What is JMeter?
Ans. JMeter is an open-source performance testing tool developed in Java. It can be used for carrying out performance testing of web-based applications, web services(both SOAP and Rest), FTP server, Databases, LDAP server etc.
Ques.5. Why should we choose the JMeter tool for performance testing?
Ans. The advantages of using JMeter tool for performance testing are-
- It is free to use with zero licensing costs.
- It is open-source, anyone can customize it for their specific use.
- It has good online community support and tutorials.
- It supports performance testing of a wide variety of applications ranging from websites, web services to FTP and Databases.
- It is easy to learn and use.
Ques.6. What are some features of JMeter?
Ans. Some of the features of JMeter are-
- JMeter is 100% Java-based. So, it has all the advantages of Java-based applications like portability, extensibility, robustness, etc.
- It has a record and playback feature that ensures easy and fast creation of test scripts.
- It provides different listeners to capture and analyze the test results in both tabular and graphical format.
- It can be used to load test different protocols- HTTP, HTTPS, FTP, LDAP, TCP etc.
Ques.7. What kind of applications can be tested using JMeter?
Ans. The different kinds of applications that can be tested using JMeter are-
- Web services both – REST and SOAP
- Shell scripts
- SMTP, POP3, IMAP
Ques.8. Explain parameterization in JMeter?
Ans. Parameterization is the process of parameterizing the user input or other test inputs, so as to use different values for different users and loops iterations. Example – an external CSV file can be created with multiple login credentials and then passed to the load test script in order to fetch different credentials for each iteration. [For more details, refer to the post- Parameterization in JMeter]
Ques.9. What is correlation?
Ans. Correlation is the most important aspect of scripting in JMeter. It includes fetching dynamic data from preceding requests/calls and passing them to the subsequent requests as parameters. For example – we can extract the values of session variables from the response of the request with login details and then pass those values to the subsequent requests (thus handling the sessions). [For more details, refer to the post- Correlation in JMeter]
Ques.10. What is a Test Plan?
Ans. A Test plan in JMeter is a logical container that contains all the test elements which drive the performance test. Some of the different elements in a test plan are – Thread Group, Samplers, Timers, Assertions, Listeners, etc.
Ques.11. What is Workbench?
Ans. A Workbench in JMeter is a temporary area of storage for the test elements. It also contains non-test elements like HTTP Proxy Server, which can be configured to record scripts via browser in JMeter. Any element placed in the workbench doesn’t get saved after with the test plan’s JMX script.
Ques.12. What is a thread group in JMeter?
Ans. A Thread Group is an element of a JMeter test plan that represents a pool of virtual users performing a set of operations.
Ques.13. What is the ramp-up period?
Ans. At the beginning of the load test of an application instead of putting all the users live, we slowly ramp up the number of users in order to study their effect in the application’s performance. In JMeter, the ramp-up period defines the time period within which all the specified users get in running state.
Ques.14. What are samplers in JMeter?
Ans. Samplers are used for sending different types of requests to the server. Some of the commonly used samplers are – HTTP Request, JDBC Request, SOAP-XML Request, JUnit request, TCP Sampler, etc. [For more details, refer to the post- here]
Ques.15. What are Listeners in JMeter? State some of the widely used Listeners?
Ans. Listeners are used for viewing, saving of test results and also help in tabular and graphical analysis of the test results. Some of the widely used Listeners are – Aggregate Report, Aggregate Graph, Graph Results, View Results Tree, etc.
Ques.16. What are the different timers in JMeter?
Ans. Timers are used for halting the test execution of a thread for a certain predefined time. These timers are used for simulating the real user think time. The different types of timers available in JMeter are – Constant Timer, Gaussian Random Timer, Uniform Random Timer, Constant Throughput Timer, Synchronizing Timer, Beanshell timer, BSF Timer, etc.
Ques.17. What is a Rendezvous Point?
Ans. The Rendezvous point in JMeter is used to perform spike testing. It is performed using “Synchronizing Timer” by waiting until the number of active users reaches a certain specified value during the load test.
Ques.18. What are assertions in JMeter? Explain the available assertions in JMeter.
Ans. Assertions in JMeter are used for verification of certain values in the response of Sampler’s requests. The commonly used assertions are – response assertion, size assertion, XML assertion, BeanShell assertion, HTML Assertion, XPath assertion, etc.
Ques.19. What is the use of Configuration elements?
Ans. Configuration elements are used for customizing the sampler requests e.g. CSV Data Set Config can be used for parameterizing the sampler requests with values fetched from the external CSV file.
Ques.20. What are Pre-Processors?
Ans. Pre-processors are the test plan elements that are executed before the sampler request execution. Some commonly used pre-processor in JMeter are BeanShell PreProcessor, HTML Link Parser, HTTP URL Re-writing Modifier, RegEx User Parameters, etc.
Ques.21. What are Post-processors?
Ans. Post-processors are the test plan elements that are executed after the sampler request execution. Generally, post processors are used for fetching some values from the sampler response.
Ques.22. How can we run JMeter in non-GUI mode?
Ans. Command to run JMeter in non-GUI mode-
jmeter -n -t test.jmx -l test.jtl where,
n specifies that JMeter will run in non-GUI mode
-t for test script file
-l for jtl file having each sample’s result
Ques.23. How can we reduce the resource requirement in JMeter?
Ans. To make the best out of the available resources and in general as a practice, the following practices should be incorporated in the tests-
- Use the non-GUI mode: jmeter -n -t test.jmx -l test.jtl
- Use as few Listeners as possible; if using the -l flag as above they can all be deleted or disabled.
- Don’t use “View Results Tree” or “View Results in Table” listeners during the load test, use them only during the scripting phase to debug your scripts.
- Rather than using lots of similar samplers, use the same sampler in a loop, and use variables (CSV Data Set) to vary the sample. Or perhaps use the Access Log Sampler. [The Include Controller does not help here, as it adds all the test elements in the file to the test plan.]
- Don’t use JMeter’s functional mode during the load test executions.
- Use CSV output rather than XML.
- Only save the data that you need.
- Use as few Assertions as possible.
[ source: JMeter Best Practices by Apache]
Ques.24. What is 90% line in JMeter?
Ans. The aggregate report listener has 90% line as one of the metrics. The Apache JMeter manual describes 90% line as- “90% of the samples took no more than this time”. It is actually the 90 percentile of the response times of the samples –
90 percentile = (90/100)*N+1/2 where N is the number of samples
So, if there are 10 samples then 90%line will be 9.5 or 9. It means the 9th value in the sorted list of samples (sorted according to ascending order of their response times) will be the 90%line value.
Ques.25. What is distributed load testing? How can it be achieved in JMeter?
Ans. Distributed load testing is the process using which multiple systems can be used for simulating the load of a large number of users. The reason for using more than one system for load testing is the limitation of a single system to generate a large number of threads (users). In JMeter, we can do distributed load testing using the master-slave configuration. [For complete steps to perform distributed load testing refer to the post- Distributed load testing in JMeter]