Continue
Monday, 9 March 2015
Thursday, 5 March 2015
JMeter interview Questions and Answers Part - 5
Performance testing is an important process of any software development. Even though these are not common interview questions for Java developers, you can bring it up yourself to many open-ended questions. Setting up a performance/load test script is always the first step in fixing non-functional and hard to reproduce issues relating to memory leaks, database deadlocks, thread-safety, CPU usage, excessive disk I/O, etc.Below is the list of jmeter interview questions and answers.
What is Jmeter?
Jmeter is one of the Java tools which is used to perform load testing client/server applications. It is opensource software Designed to load test functional behavior and measure performance of the application.It was originally designed for testing Web Applications but has since expanded to other test functions
Jmeter is one of the Java tools which is used to perform load testing client/server applications. It is open
What are the other applications tested by Jmeter?
JMeter may be used to test performance both on static and dynamic resources (files, Servlets, Perl scripts, Java Objects, Data Bases and Queries, FTP Servers and more)
JMeter may be used to test performance both on static and dynamic resources (files, Servlets, Perl scripts, Java Objects, Data Bases and Queries, FTP Servers and more)
What do you see when you open jmeter?
By defaultTest Plan & Workbench are seen
What is Test Plan in Jmeter?
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 conrollers, sample generating controllers, listeners, timers, assertions, and configuration elements.
What is Work bench?
The Workbench is simply an area to store test elements while you are in the process of constructing a test.
The Workbench is a sandbox for any test or portion of a test that you are working on.
When you are ready to test what you have designed in the Workbench, you can copy or move the elements into the Test Plan.
It also contains Non- Test Elements
Http mirror sever
Http Proxy server {which is not available in the thread group & Test plan }
What is Thread Group?
Thread group elements are the beginning points of any 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.
- The controls for a thread group allow you to:
- Set the
number of threads - Set the ramp-up period
- Set the number of times to execute the test
What are the parts of thread group?
- Sampler :Sends various types of requests to the server
- Listeners :
Results of the Run can be viewed & saved - Timer : Makes th erun more realistic by inserting delays between the requests
- Controller : responsible for controlling the flow of the thread group.If we have defined request to be executed on some logic like if-then-else or loop structure in java
- Config Element : Info about the requests are added to work with samplers using this.
- Assertion : To
check if the responses are within given time and containing expected data.
What are Controllers and its types?
JMeter has two types of Controllers
JMeter has two types of Controllers
Samplers Controllers
Logical Controllers
Logical Controllers
Samplers Controllers
Samplers tell JMeter to send requests to a server.
For example, add an HTTP Request Sampler if you want JMeter to send an HTTP request. You can also customize a request by adding one or more Configuration Elements to a Sampler.
Samplers tell JMeter to send requests to a server.
For example, add an HTTP Request Sampler if you want JMeter to send an HTTP request. You can also customize a request by adding one or more Configuration Elements to a Sampler.
Logical Controllers
Logical Controllers let you customize the logic that JMeter uses to decide when to send requests.
Logic Controllers can change the order of requests coming from their child elements.
For example, you can add an Interleave Logic Controller to alternate between two HTTP Request Samplers.
Logical Controllers let you customize the logic that JMeter uses to decide when to send requests.
Logic Controllers can change the order of requests coming from their child elements.
For example, you can add an Interleave Logic Controller to alternate between two HTTP Request Samplers.
What is Configuration element?
A configuration element works closely with a Sampler
Configuration elements can be used to set up defaults and variables for later use by samplers.
Note that these elements are processed at the start of the scope in which they are found, i.e. before any samplers in the same scope.
Note that these elements are processed at the start of the scope in which they are found, i.e. before any samplers in the same scope.
Its elements:
CSV Data Set Config: Used to read lines from a file, and split them 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: 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: This element lets you set default values that your HTTP Request controllers use.
HTTP Header Manager : The Header Manager lets you add or override HTTP request headers
What are Listeners?
A listener is a component that shows the results of the samples .The results can be shown in a tree, tables, graphs or simply written to a log file
The Graph Results listener plots the response times on a graph.
The “View Results Tree” Listener shows details of sampler requests and responses, and can display basic HTML and XML representations of the response.Other listeners provide summary or aggregation information.
The “
Every listener in JMeter provides a field to indicate the file to store data to.They also provide means to view, save, and read saved test results.
How did you go about fixing a performance issue?
Set up JMeter to reproduce the production like scenario to put through concurrent requests and put the system under heavy load. Used a profiling tool to monitor CPU times, memory usage, etc.
Set up JMeter to reproduce the production like scenario to put through concurrent requests and put the system under heavy load. Used a profiling tool to monitor CPU times, memory usage, etc.
What are some of your recent accomplishments?
Reduced the response time from 4seconds to 2 seconds. Set up JMeter to put the system under peak load. Used a profiling tool to monitor CPU times, memory usage, etc. Identified the bottle neck, and improved the situation by fixing the offending database connection leak, back tracking regular expression, and a badly constructed SQL query with Cartesian joins.
Reduced the response time from 4
What are Pre-Processor and Post-Processor elements? In what order does JMeter process various type of elements?
A Pre-Processor executes some action prior to a Sampler Request being made. If a Pre-Processor is attached to a Sampler element, then it will execute just prior to that sampler element running. A Pre-Processor is most often used to modify the settings of a Sample Request just before it runs, or to update variables that aren’t extracted from response text.
A Pre-Processor executes some action prior to a Sampler Request being made. If a Pre-Processor is attached to a Sampler element, then it will execute just prior to that sampler element running. A Pre-Processor is most often used to modify the settings of a Sample Request just before it runs, or to update variables that aren’t extracted from response text.
A Post-Processor executes some action after a Sampler Request has been made. If a Post-Processor is attached to a Sampler element, then it will execute just after that sampler element runs. A Post-Processor is most often used to process the response data, often to extract values from it.
A Regular Expression Extractor can be used as a Post-Processor element to extract values to be used elsewhere in subsequent requests.
How do you ensure re-usability in your JMeter scripts?
- Using config elements like “CSV Data Set Config“, “User Defined Variables“, etc for greater data reuse.
- Modularizing shared tasks and invoking them via a “Module Controller“.
- Writing your own BeanShell functions, and reusing them.
Does Jmeter generate any scripts? How to use the Jmeter tool and also the How to analyze the results?
When you create a test in Jmeter, save the file. The file saves with the extension .jmx.
Open the .jmx file in an editor. There you can see script.
When you create a test in Jmeter, save the file. The file saves with the extension .jmx.
Open the .jmx file in an editor. There you can see script.
For what purpose Jmeter used?
Jmeter is a Performance Tool. It is used to test the performance of the application. Apache JMeter is a 100% pure Java desktop application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions.
Jmeter is a Performance Tool. It is used to test the performance of the application. Apache JMeter is a 100% pure Java desktop application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions.
Can we Parametrize via Jmeter?
Yes, you can parametrize via CSV file, User define variables or XML sheet.
Yes, you can parametrize via CSV file, User define variables or XML sheet.
JMeter Interview Questions and Answers Part - 4
JMeter Interview Questions
In this post we'll see some JMeter interview questions. I will continue adding more question to this post as and when I will come across new ones.
Ques. 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 load of large number of users. The reason of using more than one system for load testing is the limitation of single system to generate 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]
Ques. 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, following practices should be incoroprated in the tests-
- Use 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 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 functional mode
- Use CSV output rather than XML
- Only save the data that you need
- Use as few Assertions as possible
Ques. What is Spike testing and how can we perform it in JMeter?
Ans. Suddenly spiking or increasing the number of users at certain point of application and then monitoring the behavior at that intervals is spike testing.
In JMeter spike testing can be achieved using Synchronizing Timer. Synchronizing timer blocks the threads until a particular number of threads have been blocked, and then release them at once thus creating large instantaneous load.
In JMeter spike testing can be achieved using Synchronizing Timer. Synchronizing timer blocks the threads until a particular number of threads have been blocked, and then release them at once thus creating large instantaneous load.
Ques. What all activities are performed during performance testing of any application?
Ans. Activities performed-
1. Createuser scenarios
2. User Distribution
3. Scripting
4. Dry run of the application
5. Running a load test and analyzing the result
1. Create
2. User Distribution
3. Scripting
4. Dry run of the application
5. Running a load test and analyzing the result
Ques. What is 90% line in JMeter?
Ans. The aggregate report listener have 90% line as one of the metric. 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.
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. What is BlazeMeter?
Ans. BlazeMeter is a cloud based service compatible with Apache JMeter. It generates large amount of instant load and provide very comprehensive reporting and analysis features.
In Blazemeter we can just upload the JMeter script and run the load test on cloud with predefined number of users.
In Blazemeter we can just upload the JMeter script and run the load test on cloud with predefined number of users.
Ques. What is correlation?
Ans. Correlation is the most important aspect of scripting. It generally includes fetching dynamic data from preceding requests/calls and posting it to the subsequent requests. [For more details, refer to the post- Correlation in JMeter]
Ques. Explain parameterization in JMeter?
Ans. Parameterization is process of generalizing some user input, so as to use it for multiple users or executions. [For more details, refer to the post- Parameterization in JMeter]
- See more at: http://artoftesting.com/interviewSection/interview.html#sthash.XOOBykRq.dpufJMeter Interview Questions and Answers Part -3
Q1: What is the use of Jmeter?
Ans: Jmeter is an open source desktop application software, 100% pure Java application, which is designed to perfom load testing of web based application.
Q2: Is it mandatory to install java first, to run jmeter?
Ans: Yes, Jmeter is an java based application. So you should install java 1.5 or later version in your system.
Q3: Can we do regression testing with Jmeter?
Ans: Yes we can, after-all it is all about java-script. :)
Q4: How we can run jmeter?
Ans: By simplyclicking on Jmeter.bat, or by using commnad: C:\>Jmeter
Q5: What are the options, do you see when jmtere window opens?
Ans: 1. Test Plan 2. Workbench
Ans: Jmeter is an open source desktop application software, 100% pure Java application, which is designed to perfom load testing of web based application.
Q2: Is it mandatory to install java first, to run jmeter?
Ans: Yes, Jmeter is an java based application. So you should install java 1.5 or later version in your system.
Q3: Can we do regression testing with Jmeter?
Ans: Yes we can, after-all it is all about java-script. :)
Q4: How we can run jmeter?
Ans: By simply
Q5: What are the options, do you see when jmtere window opens?
Ans: 1. Test Plan 2. Workbench
Q6: Which component, do we need to add, to record script?
Ans: We need to add Http proxy server, by simply right clicking on Workbench > Non-Test elements > Http proxy server.
Also need to enable proxy, with port 8080, by going to internet settings> Connections > Lan. Name will be "localhost".
Then click on start button on jmeter http proxy server window.
Q7: Can we perform load testing of database with jmeter?
Ans: Yes we can. To see the process follow: Database load testing with jmeter link. You should be aware of sql queries.
Q8: What are listeners in Jmeter?
Ans: Listeners in jmeter are used to capture the response data of load test. We can have response data (result) in , cvs, image (graph) or in html format.
Q9: Name 4-5 listeners in jmeter, which are commonly used.
Ans: 1. View result tree 2. Summary report 3. Aggregate Graph 4. Response time vs thread 5. Composite graph
Q10: What is Response time in Jmeter report?
Ans: Response time in Jmeter report, is the time taken by web server, toanswer the requested query. In simple words, it is the time taken by a web server to respond the http request.
Q11: What is median in jmeter listener?
Ans: It is anumber which divides the samples into two equal halves. Half of the samples are smaller than the median, and half are larger.
Q12: What is throughput in jmeter listener?
Ans: Throughput is relation between time and data.It shows the relation between http request and unit time. Means how many requests are processed in how much time.
Throughput = Number of requests / Time(second or millisecond)
Q13: Which Jmeter elements are used for Parameterization?
Ans: 1. User parameter 2. CSV Data Set config
Q14: Which controllers are used as an conditional controllers in jmeter?
Ans: If controller and While controller
Q15: What is heapsize in jmeter?
Ans: Jmeter is work in java, and heap size isrelated to java. Java heap is the heap size allocated to JVM applications which takes care of the new objects being created. If the objects being created exceed the heap size, it will throw an error of java.lang.out.of.memory.
Java's default heap size limit in Jmeter is 256 MB.
Q16: Is it possible that, if we increase the heap size in Jmeter, then application(jmeter) might not work?
Ans: Yes, it is possible. Because heap size depends upon the empty space of your machine in c drive as well as your RAM. If the RAM is 1 Gb and you increased the heap 2048, it may not work.
Q7: Can we perform load testing of database with jmeter?
Ans: Yes we can. To see the process follow: Database load testing with jmeter link. You should be aware of sql queries.
Q8: What are listeners in Jmeter?
Ans: Listeners in jmeter are used to capture the response data of load test. We can have response data (result) in , cvs, image (graph) or in html format.
Q9: Name 4-5 listeners in jmeter, which are commonly used.
Ans: 1. View result tree 2. Summary report 3. Aggregate Graph 4. Response time vs thread 5. Composite graph
Q10: What is Response time in Jmeter report?
Ans: Response time in Jmeter report, is the time taken by web server, to
Q11: What is median in jmeter listener?
Ans: It is a
Q12: What is throughput in jmeter listener?
Ans: Throughput is relation between time and data.It shows the relation between http request and unit time. Means how many requests are processed in how much time.
Throughput = Number of requests / Time(second or millisecond)
Q13: Which Jmeter elements are used for Parameterization?
Ans: 1. User parameter 2. CSV Data Set config
Q14: Which controllers are used as an conditional controllers in jmeter?
Ans: If controller and While controller
Q15: What is heap
Ans: Jmeter is work in java, and heap size is
Java's default heap size limit in Jmeter is 256 MB.
Q16: Is it possible that, if we increase the heap size in Jmeter, then application(jmeter) might not work?
Ans: Yes, it is possible. Because heap size depends upon the empty space of your machine in c drive as well as your RAM. If the RAM is 1 Gb and you increased the heap 2048, it may not work.
JMeter Interview Questions and Answers Part -2
|
JMeter Quiz
Jmeter is used for
|
---|
Is Jmeter open source software?
|
Jmeter is not used for
|
Jmeter does not support
|
BSF stands for
|
Select INVALID configuration element in Jmeter.
|
Jmeter can be used to test performance of
|
Stress testing is possible by Jmeter?
|
Select INVALID timer in Jmeter
|
Which assertion is not used in Jmeter?
|
Which is the assertion tests where each server response was received within a given amount of time?
|
Select Status Code for Page not Found Error
|
Logic Controllers determine
|
Select INVALID controller in Jmeter
|
Select controller which makes the user request run specified number of times
|
Select processor which executes some action before making Sampler Request.
|
Select testing which uses multiple systems to perform stress testing.
|
Jmeter supports all the OS supported by Java application
|
Timer which delays each user request for a random amount of time.
|
What is a component of Distributed Jmeter Test
|
Subscribe to:
Posts (Atom)