DATE: Sep 01, 2014
AUTHOR: Ashish Vijaywargiya
Snappy performance is key to the success of any web application. With that in mind, companies conduct performance testing prior to launching a new website or application to ensure that it performs as planned in various scenarios. There are various performance testing tools available on the market today, and it is important to choose one works well for you.
Apache JMeter is an open source performance testing tool from Apache Software Foundation. Apache JMeter is used to test performance both on static and dynamic resources (files, Servlets, Perl scripts, Java Objects, Data Bases and Queries, FTP Servers and more). Here we will see how to setup Apache JMeter in a Linux environment and will also see how to create test plan.
screen jmeter -n -t test.jmx -l log.csv
— screen: It is used to run test plan in screen utility so that plan can be resumed in case of network issues.
— jmeter -n: Used to run JMeter in non GUI mode
— –t test.jmx: Specified file name containing test script
— -l log.csv : Specified log file name which stores logging information
Below are some basic elements of JMeter Test Plan:
You can use GUI mode to prepare your test. Start the JMeter in GUI mode to prepare test.
1. Define Use Case: Before writing test script, you need to define the use case of test
For example: – User hits the main page of the application
– Clicks on contact-us link
– Completes the contact-us form and submits
2. Implement JMeter scripts
– Create a test plan and set UserDefined variables for Host and port entries
– Add a Thread Group with number of Threads and Ramp-up Period
– Add HTTP Request Defaults with
– Add HTTP Request as per use case
– Run the test
Below is the screenshot of an example test plan defined above.
Screen shot of test plan to show Form submit with parameters.
3. Analyze the results: For analyzing results, we can add some listener like:
— View Results Tree
— Agregate Report
— Agregate Graph
So there you have it! Those are the basics. For additional information, please tale a look at the reference links below. Good luck and happy testing!
You tube video