Tuesday April 13, 2021
Jmeter is one of the most robust tools out there in the market when it comes to performance testing of apps. So for obvious reasons testers who can handle the tool will have more prominence in grabbing the job than others. To able to answer the questions about Jmeter Interview Questions you must go through the most frequently asked interview questions about the tool. Let’s have a look.
Q 1: What is JMeter?
Ans: JMeter is a Java-based tool used for Performance and Load Testing. It simulates virtual users and sends multiple requests to the server. It then collects the response and other details to assess the performance of the system under different conditions.
Q 2: Explain Samplers and Thread Groups in JMeter?
Ans: Sampler generates sample results sets with different attributes like time, data size, etc. These allow JMeter to send requests to the server. Some of the most frequently used samplers are HTTP request, JDBC request, etc.
Thread Groups are user sets that contain the details of the number of users to be loaded into the system and the time gap between them. It is the basic step for any load testing activity.
Q 3: What is a pre-processor element? Name some.
Ans: A pre-processor is something that is executed before the sampler executes. It can be used to set the values for the sample request.
Some of the pre-processor elements are:
Q 4: What is the order in which the test elements are executed?
Ans: The sequence is:
Q 5: What is a regular expression? What is the difference between “contain” and “matches” in the regular expression?
Ans: A regular expression is a pattern used to search and match a particular text.
In a regular expression, “contain” means the search text can be some part of the matched expression. Like “press” in “expression”. “Matches” on the other hand need to match the complete expression. “exp.n” for “expression”.
Q 6: What are the configuration elements?
Ans: A configuration element works in parallel with Samplers. They are used to set the default values for variables.
Q 7: What is a timer in JMeter? Mention different types of timers?
Ans: JMeter is designed to send requests to the server continuously without a break. If we need a pause in between successive requests we can make use of the timer. There are many timers available and some of the most common ones are:
Q 8: What is an assertion? Name some assertions in JMeter.
Ans: Assertions are used to help validate and verify the server response with the expected results.
Some of the common Assertions are:
Q 9: Can you do spike testing using JMeter?
Ans: With help of a synchronization timer we can achieve a spike effect in JMeter. A synchronizing timer will block all request till a particular number of threads are blocked and then release them all together, creating a huge load or spike.
Q 10: What is distributed load testing?
Ans: The load testing in which loads are simulated from numerous systems to create a huge load is called distributed load testing. In JMeter, we can use the master-slave configuration to achieve distributed load testing.
Q 11: What are the benefits of JMeter?
Ans: The benefits of JMeter are:
Q 12: What are the protocols supported by JMeter?
Ans: The protocols supported by JMeter are:
Q 13: What is the difference between Test Fragment and Thread Group?
Ans: Test Fragments are similar to Thread Groups with the difference that they are implemented only when they are referenced by a Module controller or an Include controller.
Q 14: What are Configuration Elements?
Ans: Configuration Elements are used to create variables and default values for the Samplers. They can also be used to alter the requests made by the Samplers. It is executed at the start of the scope and can be accessed only within that branch.
Q 15: How will use ensure the reusability of your JMeter scripts?
Ans: Some things that help improve the reusability are:
Q 16:Name some listeners in JMeter?
Ans: Some listeners are:
Q 17: Name the different types of controllers?
Ans: There are mainly 2 types of controllers in JMeter:
Q 18: What is a workbench?
Ans: Workbench is like a storage area for components that can be added to the test plan as per the need. They are not saved with the test plan but get saved as Test Fragments separately.
Q 19: What is co-relation in JMeter?
Ans: Co-relation is the process of extracting a value from the response received, to use in upcoming requests. This is especially useful for session-id, cookies, etc.
Q 20: Can JMeter be used for load testing mobile applications?
Ans: Yes, JMeter can be used for sending HTTP or HTTPS to the server from your mobile application provided both the mobile and the server are on the same network.
Q 21: What is a root CA certificate?
Ans: In the case of HTTPS requests, when the browser hits the server, authentication is required. JMeter can generate this certificate temporarily to intercept the traffic and record the actions. To perform the action on mobiles, the certificate needs to be installed on your mobile as well. These are called the root CA certificates.
Q 22: What is the default screen in JMeter?
Ans: The default screen in JMeter opens the Test Plan and Workbench tabs.
Q 23: What is a Test Plan and what the important elements in the Test Plan?
Ans: A test plan contains the details of the things to test and how the tests are carried out. A test plan in JMeter contains the following elements:
Q 24: Is it possible to reduce resource utilization in JMeter?
Ans: Some of the popular ways to minimize resource utilization while running JMeter are:
Q 25: What is Beanshell scripting?
Ans: BeanShell is a lightweight java scripting that can help you with complex and application-specific tasks.
Q 26: What is the difference between Gaussian and Poisson Timers?
Ans: Both the timers use mathematical formulas to create delays and offsets. The difference between the two is that in the Gaussian Timer the deviation value is calculated whereas in Poisson the lambda value is calculated.
Q 27: How can you configure the master-slave configuration?
Ans: The master-slave configuration is used for distributed load testing.
To configure we can:
Q 28: Which is the XML parser present in JMeter?
Ans: Apache’s Xerces XML parser
Q 29: What is the default protocol used for testing a web service using SSL encryption?
Ans: TLS protocol is used for testing web services using SSL encryption.
Q 30: What is the default LDAP port over SSL?
Q 31: What is the maximum number of users that can be simulated by JMeter?
Ans: JMeter can simulate an unlimited number of users. The number of users is equal to the number of threads in a test plan. The only limitation to the number of threads is the hardware resources of the test machine. For getting a higher number of users we may need to scale up the hardware.
Q 32:Can JMeter be used for API testing?
Ans: Yes, it can be used for SOAP and REST web services testing. Performance testing of RESTful API can also be done with JMeter.
Q 33: What is a JTL file in JMeter?
Ans: JTL stands for JMeter Test Logs. It contains the results of the tests. The file extension of the JTL file can be selected before the execution. If the same file is selected for multiple runs, each subsequent result gets appended to the end of the same file.
Q 34: What is the latest version of JMeter?
Ans: The latest version is JMeter 5.4.1 and it was released in January 2021.
Q 35:What is Throughput in JMeter?
Ans: Throughput is the number of requests served or successfully processed per unit of time.
Throughput = (No. of requests)/(total time)
Q 36:How can you calculate the number of concurrent users?
Ans: Concurrent users mean the number of users performing the same operation at the same time in the system. The number of users in the system can be found out using the number of threads. But a vague calculation of the number of concurrent users – if there are
100 unique visitors, with each visitor spending 10 mins in the system. Then we can say that the number of concurrent users is 100/10 = 10 users.
Q 37: What is the load time in JMeter?
Ans: In JMeter, load time refers to the total time before sending a request to after receiving a response. For multiple threads, the load time is calculated at the thread level and is the total time between the thread request and the response received.
Load Time = Time after a response is received – Time before a request is sent.
Q 38: What are Monitor Tests?
Ans: Monitor Tests are generally used for stress testing. They provide additional information about server performance. It also helps to monitor multiple servers from the console.
Q 39:Can we use Selenium scripts in JMeter?
Ans: Yes we can. One way is by using Junit libraries to create Selenium scripts, save them as Jars and copy them to the JMeter directory. Another way is to add the web driver sampler plugin to the JMeter ext folder.
Q 40: Explain how JMeter works?
Ans: JMeter simulates multiple concurrent users using threads and sends requests to the server, create a load. It then measures the time and performance of the server and displays it in the form of tables and graphs.
Q 41: What is the ramp-up period in JMeter?
Ans: While running load tests, all the users are not loaded into the system together. The number of users is slowly and progressively increased to better understand the system bottlenecks and performance. The ramp-up period is thus the time taken for all the users to get into the system.
Q 42: What is the Rendezvous Point?
Ans: The Rendezvous Point is the term used with stress testing. It is the point at which all the delayed requests are released to hit the server and create a spike.
Q 43: What are Post-Processors?
Ans: Post-Processors are the elements of the test plan that are executed after the sampler request execution. Generally, they are used for extracting some values from the sampler response.
Q 44: What is the 90% line in JMeter?
Ans: 90% line is one of the metrics of the Aggregate Report Listener. It means 90% of the responses were within this limit. It is similar to the percentile value and can also be called the 90th percentile of the response time.
Q 45: What are the common techniques of Performance Testing?
Ans: The most common performance testing techniques are:
Q 46: How can you run JMeter in GUI mode?
Ans: The following command is used to run JMeter in GUI mode:
:jmeter -n -ttest.jmx -l test.jtl
Q 47: How can you analyze the JMeter results?
Ans: The JMeter results are stored in the .jtl file. It is possible to add different graphs like the response time graph, aggregate report, etc. We can also analyze the response time and the TPS (transactions per second). In some cases, we may also want to add some plugins to get additional graphs.
Q 48:Is it possible to configure email notifications in JMeter?
Ans: Yes, we can use the SMTP sampler to trigger emails at the start and end of the JMeter tests.
Q 49: What are the different types of recording in JMeter?
Ans: JMeter allows manual and automation recording. For automation recording, we can use the workbench to record the script. For manual recording, we can make use of fiddler or network log (F12)
Q 50: How can you forcefully stop a test in the middle of the execution?
Ans: For Windows machines, we can double-click on the stoptest.bat and shutdown.bat to forcefully stop the test. In the case of Mac, stoptest.sh and shutdown.sh files need to be double-clicked.
Hope you have gone through all of the Jmeter interview questions we have listed here. We wish you all the best!