Going through this session, assumes that you have successfully set-up JMeter distribution(latest version is 2.3.2) in your box, but if not, it’s never too late you can still check it out on my previous post – JMeter 101: Introduction.
Using the friendly GUI of Jmeter, lemme me help you explore and write your first load test script.
1. Go to “bin” folder of your JMeter distribution, double click “jmeter.bat” file
2. Simulate users by adding a Thread Group.
- Set Number of threads(users) = 5, => the number of concurrent users we want to simulate
- Set Ramp-up Period(in seconds) = 10, => the amount of time it will take to create the threads/users
In this example, Jmeter will create a thread every 2 seconds (10/5). If ramp-up period is set to “0” or blank, Jmeter will create all the threads immediately.
- Set Loop count = 1, => the number of times to execute the test
3. Simulate web requests by adding Sampler > HTTP Request
- Set a descriptive HTTP request name
- Set Server name or IP = http://www.yahoo.com
- Set Path = “/”, which is Yahoo Homepage
4. To help us analyze the results, add the following listeners
- Listener > Aggregate Report
- Listener > View Result Tree
5. Save your script with .jmx extension
6. Go to Run > Start (ctrl + R)
I. What is Jmeter?
Apache JMeter is a 100% pure Java desktop application designed to load test functional behavior and measure performance. JMeter may be used to test performance both on static and dynamic resources . It can be used to simulate a heavy load on a server, network or object to test its strength or to analyze overall performance under different load types.
II. Why choose Apache Jmeter?
There are wide load testing tools to choose from. There are open source tools like Open STA, http_load, The Grinder, Siege including Jmeter. And commercial tools like LoadRunner, WebLoad etc. But why would we pick Jmeter from this list? Lemme help you decide…
- Jmeter is FREE! – no monthly charges
- Easy to install and use – 100% JAVA with friendly GUI
- Feature rich
- Record from browser
- Load test data from files
- Add logic, variables and functions
- Run distributed testing from multiple machines
- Variety of protocols: Web – HTTP, HTTPS; SOAP; Database via JDBC; LDAP; JMS; Mail – POP3
III. What are the requirements of Jmeter?
- Java Virtual Machine – JMeter requires a fully compliant JVM 1.4 or higher
- Operating System
- Unix (Solaris, Linux, etc)
- Windows (98, NT, XP, etc)
- OpenVMS Alpha 7.3+
IV. Where to get Jmeter?
I choose the binary version of 2.3.2 release for my Windows XP box.
V. How to run JMeter?
- Unzip Jmeter distribution file to desired path
- Go to “bin” directory
- Run Jmeter file
- Windows : double click jmeter.bat
- Mac : double click ApacheJmeter.jar
- Unix : double click jmeter.sh OR run ./jmeter from the command line
From Jmeter’s friendly GUI, we can now create, record and configure scripts for our load test.
For comprehensive tutorials visit http://jakarta.apache.org/jmeter/
Cool stuff for load testing…
BrowserMob patronizes Selenium IDE, a known Firefox plug-in. Load testing made simple in 3 easy steps:
RECORD the scripts on a real web browser using Selenium IDE, saves the actions done and no need to worry on cookies and traffics. Easy record and playback.
SCHEDULE tests and define your load data.
ANALYZE results through their Test Statistics and Charts.
For the past 2 days I’ve been filing my blog stuff on the right folder, and I believe this old post of mine belongs here.
Check out how you can record Jmeter scripts on a real browser using Badboy application. Dig in HERE!
No need to download just fireup your browser, go to these sites and input the URL of your application under test.
1. Web Page Analyzer (http://www.websiteoptimization.com/services/analyze/)
This is a free helper website, which gives you a diagnosis of the elements, size and download time of your web page. If it’s your first time to do performance test, this tool is a good start. The generated web page speed report will provide you an analysis and recommendations on how to optimize your site. Cool huh!
2. Gomez Instant Site Test (http://www.gomez.com/info_center/instant-test.php)
A performance tool which will help you know how your website is performing from a specified testing location. This instant test provides page download time, DNS lookup, connection time and all page objects.
BTW these are just helper sites to help you optimize your webapps, but there are a lot of free performance tool out there like Jmeter, OpenSta etc. that can give you a concrete analysis of your website’s performance.
Happy testing 😀