Thursday 14 August 2014

Jmeter:Performance Tool for Web and Mobile


Following are some of the features of JMeter:
 Feature:-Its free. Its an open source software.

 It has simple and intuitive GUI.
 JMeter can load and performance test many different server types: Web - HTTP, HTTPS, SOAP, Database via JDBC, LDAP, JMS, Mail - POP3
 It is platform-independent tool. On Linux/Unix, JMeter can be invoked by clicking on JMeter shell script. On Windows it can be invoked by starting the jmeter.bat file.
 It has full Swing and lightweight component support (precomputed JAR uses packages javax.swing.* ).
 JMeter store its test plans in XML format. This means you can generate a test plan using a text editor.
 It's full multi-threading framework allows concurrent sampling by many threads and simultaneous sampling of different functions by separate thread groups.
 It is highly Extensible.
 Can also be used to perform automated and functional testing of your application.

 How JMeter Works?

  JMeter simulates a group of users sending requests to a target server, and return statistics that show the performance/functionality of the target server / application via tables, graphs etc. The figure below depicts this process:Jmeter Test Plan:
A Test Plan defines and provides a layout of how and what to test.
A Test Plan would comprise at least one Thread Group. Within each Thread Group we may place a combination of one or more of other elements: 


Elements of test plan:
Thread Group:
Setup number of thread.
Set up number of ramp period.
No. of times test executes.
Controllers:
Sampler (Send request to server).
Logic Controller (control order of processing of Samplers in a Thread).

Listener:
View result in Tree.
View result in Graph.
View result in table and many more.
Timers:
Delay next request for certain amount of time.
Constant Timer and many more.
Assertions:
Allow you to assert fact about response received from HTTP request.
Response Assertion.
XML/HTML Assertion.

Configuration Elements:
Allow you configure settings.
Preprocessor :
Execute prior to sampler request.
Post Processor:
Execute some action after sampler request.


Following is the execution order of the test plan elements:
Configuration elements
Pre-Processors
Timers
Sampler
Post-Processors (unless SampleResult is null)
Assertions (unless SampleResult is null)
Listeners (unless SampleResult is null)

Following is the execution order of the test plan elements:

Configuration elements
Pre-Processors
Timers
Sampler
Post-Processors (unless SampleResult is null)
Assertions (unless SampleResult is null)
Listeners (unless SampleResult is null)

Start jmeter.
Add Thread group.
Add Sampler (i.e. Http Request).
Add listener.
Run the test plan.
View output and analyze the result.

Fetching data using CSV.
Use of Regular expression in Jmeter. (http://www.regular-expressions.info/)
Recording your script using set proxy in your browser.
Using script.
Visit : https://jmeter.apache.org/usermanual/


No comments:

Post a Comment