JMeter Setup on Mac

In summary, this initial setup will create a way for you to record all of the requests that get made when using your web-application. From here, you can save certain thread sets and run tests where multiple instances of these thread-sets are sent to your web app.

My plan is to use this to record what Selenium does, and then use that for load testing. If I use Selenium IDE to make the aforementioned Selenium routines, the redundancy is hilarious. But in all seriousness, I am really excited to pair the two of them together. I am a bit worried though about whether JMeter can keep up with Selenium…
What I am wondering is ‘What benefit is there to using JMeter over Fiddler?’… probably has to do with being able to integrate JUnit tests etc more easily… but I don’t know. Any comments?
First: Installation

  1. Download JMeter. You may download the source code and build it yourself, or you may download the binaries. I just downloaded the binaries.
  2. While on the JMeter Download page, follow the instructions provided to verify the md5 (Mac OSX Snow Leopard Server does not come with pgp, gpg, or pgpk.)
    • In Terminal.app
      • md5 jakarta-jmeter-2.5.1.zip
    • Click ‘md5’ next to the version of JMeter you downloaded. There will be a 20 character value shown, and it should match what you got in the the terminal. A quick way to check this is to just use ⌘+F in your browser and copy in your results from the terminal. 
  3. In your Finder, uncompress jakarta-jmeter-2.5.1, and drill down into the directory called ‘bin’.
  4. Open ApacheJMeter.jar
    • If you prefer the Terminal, use the following:
    • sh ./jakarta-jmeter-2.5.1/bin/jmeter.sh
Setup & Tuning-in to your web-browser
  1. Add (via right click) a Thread group to the Test Plan 1
  2. Add a Non Test Element > HTTP Proxy Server to the Workbench 2
  3. Open the HTTP Proxy Server Page and change the port if required 3
  4. Set the Target Controller to Test Plan > Thread Group on the same page 4
  5. Configure your browser to use the Proxy Server (it’s localhost) 5
    1. Zac Spitzer recommends Firefox. This is probably the case because you can set up proxying internally to Firefox without messing around with your system settings. If you try to go ‘Under the Hood’ in Chrome or into Safari’s ‘Change Settings…’ dialog, it will kick you right into your system preferences. Please note that if your workplace has a special proxy configuration already, or any other network settings that might interfere with setting this up, don’t fight it: submit a ticket to IT. 
      1. ⌘+,
      2. In ‘Advanced’, go to your connection settings and set up your localhost as a proxy server. You can assign different ports to different protocols. 
  6. Press Start at the bottom of the page 6

Now, JMeter will record all the HTTP requests your browser makes, so make sure you have closed all the other tabs you have open. 7

Don’t forget to reset your browser proxy settings! 8

You can delete any requests you don’t want from the list at any time. 9

Remember to read the documentation and be careful! Make sure you know what servers will be affected by your testing, and don’t jump to simple conclusions, 3-tier web apps are complex beasts. 10

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.