Here we can learn the basic Interview question and answers which are frequently asked in Performance Testing Interview on JMeter.
1. Explain how JMeter works?
JMeter perform like a group of users sending the requests to a target server. It collects response from the target server and other statistics which show the performance of the application or server via graphs or tables. Apache JMeter testing involves using the open source Apache JMeter software for testing of software application. Apache JMeter testing is applied for performance check of both static and dynamic resources. Apache JMeter simulates a heavy load on application, to test its strength or to analyze overall performance under different load types.
2. Where can we use functions and variables?
Variables and functions can be written into any field of any test component
3. 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
Threads Group Properties:
Number of Threads = Number of users
Ramp-up period (in Seconds) = Ramp up speed during test is speed at which new simultaneous users are trying to access the application.
Loop Count = this property tells JMeter how many times to repeat your test. If you enter a loop count value of 1, then JMeter will run your test only one.
Samplers: 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, thread group decides which type of request it needs to make. Some of the useful samplers are HTTP request, FTP request, JDBC request and so on.
4. Explain what is Test Fragment?
Test fragment is also a type of element like 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.
5. Explain what is Assertion in JMeter? What are the types of assertion?
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
6. Can you explain about JMeter Listeners?
Some of the JMeter Listeners are -
Spline Visualizer
Aggregate Report
View Result Tree
View Result in Table
Monitor Results
Distribution Graph
BeanShell Listener
Summary Report and so on
7. What are the important plugins supported in JMeter?
Thread group Plugin
Listeners Plugin
Samplers Plugin
8. Can you explain about STLC phases - Software Testing Life Cycle
Requirement analysis.
Test planning.
Test case design and development.
Test environment setup.
Test execution.
Test cycle closure.
9. Usually at what timeframe we do the performance testing ?
After the regression build deployed for testing and there are no major defect logged against the build.
10. What is the The 95th percentile?
The 95th percentile is a number that is greater than 95% of the numbers in a given set. The reason this statistic is so useful in measuring data throughput is that it gives a very accurate picture of the maximum traffic generated on an interface. This is a standard measure used in interpreting performance data.
11. What is concurrency testing?
many users have logged into their Flipkart account at a time and the same time multiple users ordering the same product, so testing how the software is behaving at that situation is an example of concurrency testing
12. What is concurrent user and parallel user , simultaneous users ?
Concurrent Users: When multiple users access a website but perform different-different actions at the same time is called concurrent users. Simultaneous Users: When multiple users access a website and Perform the same action at the same time is called simultaneous users.
13. What is Pacing and Think time?
Think time: This is the time interval which is used between transactions, within an iteration. It is used to give a delay which corresponds to the real time interval which a user may take in between performing two actions (say Click). Pacing: Pacing is the time delay given between iterations.
14. Explain performance Testing life cycle ?
Performance testing life cycle (PTLC):
PTLC is a systematic approach to carry out the non-functional testing of a software system or application. Mostly all the software industries follow this process to plan the performance testing activities and find out the performance bottleneck in the software system.
PTLC defines different phases of performance testing as mentioned below-
Risk Assessment- To check the eligibility of the components for performance testing on the basis of a risk score.
Requirement Gathering & Analysis - To understand the client’s expectation and conclude the requirements
Performance Test Planning - To prepare test strategy as per Non-Functional Requirement
Performance Test Design (Scripting) - To create the test scripts as per the approved Performance Test Plan
Workload Modelling - To create the workload scenario as per the approved Performance Test Plan using test scripts
Performance Test Execution & Result Analysis - To execute the performance tests as per timelines documented in the approved Performance Test Plan and analyse the test results
Reporting and Recommendation - To prepare and publish the test report and provide the recommendations
15. What is bottleneck in performance testing?
A performance bottleneck occurs when the rate at which data is accessed cannot meet specified system requirements.
16. How can we manage session and cookies in JMeter?
We can manage the sessions and cookies in Jmeter by using config elements like HTTP Cache Manager which provides an option to clear the cookies in every iteration and also allows to add user-defined cookies.
17. Explain the architecture of JMeter.
Jmeter is an open source application which is Java based, designed for the purpose of Load Testing. Jmeter supports all major protocols which are supported in Load Runner. But unlike any browser, Jmeter works on different levels of protocols and does not execute JavaScript present in HTML web pages.
18. How can JMeter simulate actual browser behavior?
JMeter does not support the actual browser behavior as it does not render the HTML webpages as the normal browser. Such that response can be seen in HTML format but the actual timings are not there in the generated samples.
19. What is the use of Regular Expression in JMeter?
Regular Expression in Jmeter is used for extracting some values dynamically from the responses with an objective to use to it in the subsequent request or save it for reporting purposes. Regular Expression is used in both Pre-Processors as well as Post Processors.
20. What are the different methods used in Data Parametrization in JMeter?
The objective of data parametrization is to make the scripts reusable where the values need not be hardcoded for the same request with different parameters. The data parametrization that is supported in Jmeter are -
1. CSV Data Set Config
2. User Defined Variables
21. How many maximum threads are recommended on a single system?
The recommendation of maximum threads on a single system is based on the hardware configuration of the system which includes a processor, JVM, allocated memory -Xmx, etc.
There are other factors as well that impact this such as the number of components in the test plan like the number of config elements or processors and it also depends on whether you are using GUI/Non-GUI Mode.
22. What is the purpose of listeners?
Listeners are majorly used for storing the execution results of load testing in different forms like table, graph, tree or in any other presentable format which can be presented to the client.
23. What is the difference between Gaussian and Poisson Timers?
Since both Gaussian and Poisson Timers work on a mathematical formula that has some constant delay and additional offset. The point of difference between the Gaussian and Poisson Timers is because of in the fact that the lambda value is calculated in case of Poisson timer and deviation is calculated in case of Gaussian Timer.
24. What is the primary use of co-relation in JMeter?
Co-relation is basically a process in which the values can be extracted from the server response and stored in a variable which is then then used in any other request which is to follow.
For instance in order to test any login functionality if you have to use session ID/cookie ID , you can then extract the value from the response of GET request of the login page and then dynamically use the same while making POST request for login.
There are different type of inbuilt listeners in JMeter and many others can be imported into it by using plugins as per the requirement.
There are some inbuilt listeners like View Results in Table, View Results Tree, Graph Results, Aggregate Graph, Aggregate Report, Assertion Results and Response Time Graph.
25. What will be flow of Test Script Recorder?
The Test Script Recorder is majorly used to record all the http(s) request which is going to the server from the application. Such that there are some other configurations that are required to be done in JMeter in order to make it functional.
We should follow the following steps to record https traffic
1. Firstly add HTTP(s) Test Script Recorder to Work-Bench.
2. Then enter the port number which you want to start your proxy server from.
3. Thirdly select the Target either as “Workbench” only or add a Recording Controller in the test plan and select the same as Target so that all the recordings are stored under it.
4. Next start the Proxy Server.
5. Lastly configure the browser with manual proxy settings pointing to the same port number used in the test script recorder.
26. How can JMeter record actions from Mobile?
Jmeter can record HTTP or https request going to the server from your mobile application also. Therefore Mobile and Jmeter should be on the same network.
The configuration required to record actions from Mobile,
1. First configure the proxy server in JMeter to run at a specified port.
2. Second set up a proxy on the mobile wifi settings and then enter the same port number that is used in the recorder.
3. Third install the Root CA certificate on the mobile.
4. Fourth hit server request from the mobile and observe it getting captured by the specified controller.
27. How would you do master-slave configuration in Jmeter?
Master-Slave configuration is considered as a part of Distributed Testing in which case more than one machine is used to perform load testing of the server under test. Such that it becomes important that all machines are on the same network and all have the same version of Jmeter. Also in distributed testing, one machine is made as the Master and the others are kept as slaves by doing some configurations.
Steps to perform master-slave configuration are -
1. Edit the jmeter.properties file on the master machine, and add the IP addresses of slave machines against the remote_host field in the file.
2. Next save the file and open the Jmeter again.
3. Now from the RUN menu in Jmeter, select Remote Start and choose the IP of the machine to be invoked.
4. Choose RUN menu and select Remote Start all to start all the slave machines for testing.
28. Would you recommend to run JMeter in GUI Mode?
Definitely Yes, JMeter tests can be run both GUI as well as Non-GUI Mode.
But it is recommended to run the load test in Non-GUI mode since AWT Event Thread can kill the tests in case of high load scenarios.
Some of the Non-GUI mode supported with Jmeter such as - Command Line, ANT Plugin, MAVEN Plugin, and Jenkins.
29. Can to run Selenium scripts in JMeter?
We can run selenium scripts in JMeter to get some ideas on their performance.
This can be done by either using Junit libraries to build Selenium scripts and save as Jars and copy the same in JMeter directory. Else add Junit sampler to the test plan and import the Jar file.
Otherwise, we can add the Webdriver sampler plugin in the JMeter ext folder and then restart the Jmeter. We can then write the selenium code in the Webdriver sampler and then execute to see the performance.
The HTTP Cache manager primarily helps you in clearing cache after each iteration as per your requirement in the load tests and thereby limit the number of elements that can be stored in the cache. In which case both the config elements can be attached to the HTTP sampler.
30. Let us suppose I have multiple screens in my mobile app. Then can JMeter measure the time taken to flip the screens or can JMeter measure the performance of a complete application?
At no point of time JMeter measure the transition time between the screens. As it can only measure the server actions not the UI interactions.
31. What is the use of Workbench?
Workbench is primarily used as a storage area for adding components that can be added to test plan as and when required.
Such that the components of workbench does not get saved with the test plan automatically. They have to be saved separately as test fragments.
Workbench is known for HTTP(s) Test script recorder which is extremely useful in recording the https request and later load can be applied on them to measure the response time.
32. Which programming language does JMeter is based on?
JMeter is based on JAVA programming language and not on other programming languages.
33. Which XML parser is present in JMeter?
JMeter comes with Apache's Xerces XML parser and not with other listed options.
34. What is the default protocol used when testing a web server using SSL encryption?
TLS is used when testing a web server using SSL encryption
35. What is the default port for LDAP over SSL
The default port for LDAP over SSL is 625
36. What is Throughput?
Basically, “Throughput” is the amount of proceedings produced over time during a test.
37. How can we verify that a request is successful ?
Response Assertion is a great function for verifying the response status of a server.
38. What is Latency in API testing?
Latency refers to the response time or the delay taken by the request to reach the server. We need to ensure that the latency involved in reaching the server is minimum as higher the latency, greater is the impact in the application’s speed and performance