As with most of the posts here, I will be using linux. In a few simple steps you find out how to get JMeter to work on you local machine.
Downloading & installation
Get you installation package from the jmeter site. I recommend using version 3.0+. You will see why in later posts. Download the binaries in either tar.gz or zip format and verify the integrity. Then extract it to a dedicated location for your loaddrivers. You may have multiple versions of jmeter and upgrading to new versions is easier.
For tar files
1 | tar xvfz ~/Downloads/apache-jmeter-3.1.tgz --directory /path/to/directory |
For zip files
1 | unzip ~/Downloads/apache-jmeter-3.1.zip -d /path/to/directory |
Done.!! We will be leaving these directories untouched.
1 | ~/training/loaddrivers$ ls |
Project Folder Structure
I recommend the following project folder structure.
{wherever}/projects/{application}/
./lib ## location for additional supporting libraries that would usually go in {jmeter_home}/lib
./lib/ext ## location for additional external plugins that would usually go in {jmeter}/lib/ext
./properties ## location for your jmeter property files (if used)
./scripts ## location where you store your jmeter scripts
./scripts/lib ## location where you can store any additional custom helper scripts
./scripts/data ## location to store any payloads you might need
./scenarios ## location to store any scenarios you create
./logs ## location where you store the test logs
./jmeter ## symbolic link to the jmeter installation you want to use
./java ## symbolic link to the java installation you want to use
./run_jmeter.sh ## how you will run jmeter
This directory structure allows you a lot of flexibility and provides structure for your project. Switching the version of jmeter is as simple and changing the symlink (if plugins are compatible) . The same goes for your java version. The run_jmeter.sh script will pass all your arguments to the {jmeter_home}/bin/jmeter.sh script as well as setup some JMETER variables.
You might ask why create this extra script just to call the jmeter.sh script. This allows you to separate your development environment and your production environment. In your project folder you only have the plugins/libraries/scripts etc required for your project. A common jmeter installation can be used for everyone.
Sample run_jmeter.sh script
1 |
|
Author: Aodan