Apache JMeter is an open source Java desktop application used to do performance testing.
JMeter can simulate a heavy load on a server, network or object to test its strength or
to analyze overall performance under different load types.
It can also be used for regression testing.
To run JMeter, click on JMeter executable file.Once JMeter is opened,we will see two options-
Test Plan and Workbench.
A test plan describes a series of steps JMeter will execute when run.
We can see two check boxes on this page-
1.Run Thread groups consecutively (i.e. run groups one at a time)
2.Functional Test Mode (i.e. save response data and sampler data).
In performance testing process, we might want to test one thread group after other rather to test all the thread groups at one time. At that time 1st option is used.
With JMeter,we can also perform functional testing so there 2nd option comes in picture.
When we right click on test plan or click on edit + add, we can see different elements like threads(Users), config element, timer, pre processors, post processors, assertions, listener.
1.Thread group- In thread group,we can name the thread group with name option and also add comment. If for any reason,error is encountered,then what action is to be taken can be determined by selecting one of the four options - 1.continue 2.stop thread 3. stop test 4. stop test now
In thread properties, we can determine
(1).Number of threads(users)
(2).Ramp-up Period(in seconds)- It tells JMeter how long to take to
"ramp-up" ( or up and running) to the full number of threads chosen.
e.g.- If thread number =10 and ramp-up period=100 sec,
then JMeter will take 100/10 seconds to start each thread and total 100 sec.
(3).Loop count - we can run the loop forever or for a specific count
(4).Scheduler-
(i) Start Time
(ii)End Time
(iii)Duration(seconds)
(iv)Start Up Delay(seconds)
2. Logic Controller -It lets user 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.
3. Config Element - A config element can add to or modify requests,but can not send requests(exception is HTTP Proxy Server). A config element is accessible only from inside the tree branch where you place the element. It works closely with Sampler.
4. Pre-Processor Elements -These executes some action before a sampler request is made.
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.
5. Post Preprocessor Elements - A Post-Processor executes some action after a Sampler Request has been made. A Post-Processor is most often used to process the response data, often to extract values from it.
6. Timer - Timer is used to add delay between each request. By default, JMeter thread sends requests without any delay between each request. If delay is not introduced between threads,JMeter could overwhelm server by making too many requests in a short amount of time. If more than one timer is introduced to a thread group,then JMeter takes the sum of the timers and pauses for that amount of time before executing samplers.
7. Assertions - Assertions allow you to assert facts about responses received from the server being tested. Using an assertion, you can essentially "test" that your application is returning the results you expect it to.It is a great way to check if response data satisfies the conditions.To view the assertion results, add an Assertion Listener to the Thread Group. Failed Assertions will also show up in the Tree View and Table Listeners, and will count towards the error percentage.
8. Listener - Listeners are a way to show results. Listeners can save data for later use. There are many listeners which essentially present the data/result in different format.
e.g.-Graph result listener plots the response time on a graph,summary listener shows the summary and aggregate listener shows the aggregate.
Listeners can be added anywhere in the test, including directly under the test plan. They will collect data only from elements at or below their level.
9. Sampler - Samplers tells JMeter to send request to the server and wait for the response.
Samplers perform the actual work of JMeter. Each sampler (except Test Action) generates one or more sample results. The sample results have various attributes (success/fail, elapsed time, data size etc) and can be viewed in the various listeners.
Thanks for good intro. Five cents from me.
ReplyDeleteJmeter has not very good out-of-box reporting capabilities, that's why interpreting results may be a challenge. For now, there are two(may be more, I do not know), solutions:
- google-plugins for jmeter;
- blazemeter plugin for jmeter