Covid-19 Update!!    We have enabled all courses through virtual classroom facility using Skype or Zoom.    Don't stop learning.    Enjoy Learning from Home.

30% Discount Python        30% Discount Webdesign        30% Discount SEO        30% Discount Angular8        Free SQL Class        Free Agile Workshop       Free HTML Sessions        Free Python Basics

Important JMeter Interview Questions and Answers

JMeter Interview Questions

1. What is JMeter? What are the software applications that can be tested using JMeter?

Apache JMeter is an open source software. It is 100% pure Java based desktop application designed to load test the functional behaviour and measure the performance of the client/server applications.
  • It is useful to test the performance of both static and dynamic resources like files, Servlets, Perl scripts, Java Objects, Data Bases, Queries, FTP Servers and lot more.
  • Along with Functional testing, It also perform various other types of testing like Regression, and Unit testing.

    2. Name some of the protocols supported by JMeter?

    Web Protocol: To test the web applications, it supports both HTTP and HTTPS.
    Web Services Protocol: To test web services applications, it supports both SOAP and REST.
    FTP (File Transfer Protocol): It supports FTP servers and applications.
    Database via JDBC: It is used to test the database applications.
    LDAP (Lightweight Directory Access Protocol): It supports Message-oriented middleware (MOM) via JMS.
    Mail: It is used to test the mail servers such as SMTP(S), POP3(S) and IMAP(S) MongoDB (NoSQL) TCP.

    3. What is test plan in JMeter? List some of test plan elements available in JMeter?

    Generally, A Test Plan defines and provides a layout of how and what to test.
    JMeter can be used to prepare a Test Plan for web application and also client server application. It also acts as the container for running tests.
    A complete Test Plan comprises following elements:
  • Thread Group (mandatory) – Atleast one should be there
  • Controllers
  • Listeners
  • Timers
  • Assertions
  • Configuration Elements
  • Pre-Processor Elements
  • Post-Processor Elements

    4. Explain the Role of Workbench?

    Workbench is simply an area to store test elements while constructing a test plan. Once after the test items designing in Workbench, it can be moved or copied to the Test Plan.
    It also contains non-test elements which are not available in the thread group and Test plan.
    They are,
  • Http mirror server
  • HttpProxy server

    5. What is a thread group and list down its main elements?

  • Thread group is the beginning point of any Test Plan. It is mandatory to have at least one thread group in a Test Plan.
  • All controllers and samplers must be under a thread group.
  • Listeners may be placed directly under the test plan, in which case they will apply to all the thread groups. Controllers allows you to,
  • Set the number of threads
  • Define the ramp-up period
  • Set the number of times to execute the test
  • Some of the main Thread Group elements are, Sampler: It sends various types of requests to the server.
    Listeners: It saves the results of the run. It can also be viewed.
    Timer: It makes the run more realistic by inserting delays between the requests
    Controller: It is responsible for controlling the flow of the thread group.
    For Example: when a request definition includes if-then-else or loop structure.
    Config Element: It has the information about the requests to be added to work with samplers.
    Assertion: To check whether the response is generated within the given time and contain the expected data.

    6. Explain the types of JMeter Controllers?

    There are two types of JMeter Controllers.
  • Samplers Controllers: It enables JMeter to post specific types of requests to a server. It simulates a user’s request for a page from the target server. For example, you can add an HTTP Request sampler if you need to perform a POST, GET, or DELETE operation on an HTTP service.
  • Logical Controllers: It lets you control the Sampler’s processing order in a Thread. It can also change the order of request coming from any of their child elements.
    For example - For Each Controller, While Controller, Loop Controller, IF Controller, Run Time Controller, Interleave Controller, Throughput Controller, and Run Once Controller.

    7. What is configuration element? List down its element?

    Configuration Element allows you to create defaults and variables for Samplers. It can be used to add or modify requests made by the Samplers. It will be executed at the beginning of the scope before any Sampler present in the same range.
    CSV Data Set Config: It supports reading line by line from a file and splitting the line into variables.
    HTTP Authorization Manager: You can specify one or more user logins for web pages that are restricted using server authentication.
    Java Request Defaults: Using this you can set default values for Java testing.
    HTTP Cookie Manager: The Cookie Manager element has two functions:It stores and sends cookies just like a web browser.
    Second, you can manually add a cookie to the Cookie Manager. However, if you do this, the cookie will be shared by all JMeter threads.
    HTTP Request Defaults: It lets you set default values to be used by your HTTP Request controllers.
    HTTP Header Manager: It enables you to add or override the HTTP request headers.

    8. What are listeners? List out few JMeter listeners?

    Listeners enables you to view the results of Samplers in the form of tables, graphs, trees or simple text. It provides visual access to the data gathered by JMeter for the test cases executed in the Sampler. JMeter allows the Listeners to add directly anywhere in the Test Plan.
    It will collect data only from elements at same or lower level.
  • Spline Visualizer
  • Aggregate Report
  • View Result Tree
  • View Result in Table
  • Monitor Results
  • Distribution Graph (alpha)
  • Bean Shell Listener
  • Summary Report
  • Aggregate Graph
  • Assertion Results
  • Backend Listener
  • Comparison Assertion Visualizer
  • Generate summary results
  • Graph Results
  • JSR223 Listener
  • Mailer Visualizer
  • Response Time Graph
  • Save responses to a file
  • Simple data writer

    9. What is Pre - processor? Name few of them?

    Pre-Processor is used to configure a sample request before execution and update the variables present in the response text that may not be extracted.
    Some of the main pre-processor elements are as follows,
  • A modifier for HTTP URL.
  • HTTP user parameter modifier.
  • HTML link parser.
  • Bean Shell pre-processor.

    10. Explain what is Post-Processor?

    Post-processor is used for calling an action after a request.
    For example, suppose JMeter sends an HTTP request to the web server, and the user wants JMeter to stop sending the request. If the web server shows an error, in this case, the user can use post-processor to perform this action.

    11. How can you reduce resource requirement in JMeter?

    Following are the tricks that can help in reducing the resource usage.
  • Use non-GUI mode.
    JMeter-n-t est.jmx-1 test.jt1
  • It is better to use as few Listeners as possible. Applying the “-l” flag as shown in above point may delete or disable all the Listeners.
  • Disable the “View Result Tree” listener as it consumes a lot of memory and may result in JMeter tool running out of memory. It will freeze the console too. It is, however, safe to use the “View Result Tree” listener with only “Errors” kept checked.
  • Instead of using a similar Sampler a large number of times, use the same Sampler in a loop and use variables (CSV Data Set) to vary the sample data. Or perhaps use the Access Log Sampler. Avoid using functional mode.
  • Use CSV output rather than XML.
  • Also, you may like to read some of the mixed points.
  • Try to save the data that you need.
  • Use as few Assertions as possible.
  • Disable all JMeter graphs as they consume a lot of memory. All the real-time graphs can be viewed using the JTL tab in the web interface.
  • Do not forget to erase the local path from CSV Data Set Config when used. Cleaning of the Files tab before every test run.

    12. What is JMeter function?

    JMeter function is a special value that can populate fields of Sampler or other element in a test tree. ${__functionName(var1,var2,var3)}

    13. What is assertion in JMeter and list some of them?

    Assertion helps you to verify whether the server under test returns the expected results.
    Response Assertion: It facilitates the user by comparing the server response against a string pattern to check that the result is as expected. For Example, while waiting for a response from the server the Response Assertion role is to verify that the server response has probable pattern string, “OK” or not.
    Duration Assertion: You may need to test the response from the server reaches in user-defined time. If it takes longer than the defined time, server response fails.
    Size Assertion: It is to test that each response coming from server holds the expected number of bytes. It facilitates the user to specify the size i.e. equal to, greater than, less than or not equal to a given number of bytes. For example, if the response packet from a server is less than expected 5000 bytes in size, then a test case pass, else a test case fails.
    XML Assertion: It verifies that the response coming from the server holds the data in a correct XML format.
    HTML Assertion: It is helpful for checking the syntax of the response data.

    14. List the benefits of JMeter, which offers for performing testing?

    JMeter provides following advantages for performance testing.
  • It can be used to test performance for both, static resources as well as dynamic resources.
  • It can generate and handle a large number of concurrent users as it happens on a live website.
  • It provides the graphical analysis of performance reports.

    15. What is spike testing and how can we perform it in JMeter?

    Suddenly increasing the number of users at the certain point of application and then monitoring its behaviour at that interval is Spike testing.
    In JMeter, Spike testing can be performed using Synchronizing Timer. This timer keeps on blocking the threads until a particular number of threads get reserved. It then releases them at once thus creating large instantaneous load.