Posts Tagged ‘jmeter’

Jmeter-server 2.3.4 failed to start in Ubuntu 9.10

May 18, 2010 Leave a comment


I’m using jmeter 2.3.4 distribution in my ubuntu 9.10, tried running the jmeter-server but encountered the following error:

Server failed to start: java.rmi.RemoteException: Cannot start. <computer_name> is a loopback address.


* Go to /etc folder

* Edit hosts file by changing to your absolute IP address

Then run your jmeter-server again, to verify, you should be able to see the following logs in jmeter-server.log file

INFO  – jmeter.engine.RemoteJMeterEngineImpl: Starting backing engine on 1099

Now you’re ready to start your distributed testing with Jmeter 😀

Jmeter: Statistics Aggregate Report

January 7, 2010 6 comments

I found this blog that features an interesting Jmeter plugin that would make your Jmeter reporting more effective.

To enhance your graph and reports with Jmeter, here’s a listener plugin that you could add in your distribution file.

1. Download Statistics Aggregate Report here

2. To install, unzip the file to your Jmeter directory. Please note that the zip file consists of 4 files and should be extracted as follows:





3. Restart Jmeter, in GUI right click from your Testplan, select Add -> Listener menu, an option “Statistical Aggregate Report” should now be available. 😉

statistical aggregate report

Categories: jmeter Tags: , ,

JMeter: Using property function to fetch data from user input

November 3, 2009 5 comments

If our objective is to run our test scripts from the command line with variable number of users and ramp up period without editing our test plan every now and then, we could do this using JMeter’s simplified property function(“__P”).

First we need to set our Thread Group property as follows:

Thread group properties

Thread group thread and ramp-up properties

That is changing the value of Threads and Ramp-up as:

Threads: ${__P(group1.threads)}

Ramp-up: ${__P(group1.ramp)}

We could also use the property function when saving our test results. ${__property(result_dir)}/graph.jtl

Graph test result

Save graph result to a file

From the above settings, Jmeter will automatically generate a graph.jtl file inside result_dir folder.

Notice that number of threads, ramp-up period, result filename are all set as parameters.

After adding samplers and listeners to our testplan. We run our test from the command line by invoking:

jmeter -n -t test.jmx -Jgroup1.threads=10 -Jgroup1.ramp=5

From here onwards we could set different number of threads and ramp up period depending on the scenarios we’d like to test. Cool huh!

Categories: jmeter Tags: ,

JMeter: Run scripts from the console

October 29, 2009 7 comments

Running Jmeter scripts from the console is one way of reducing the resources needed to execute the load as compared to a GUI mode.

From the console, we say:
jmeter -n -t <testplan filename> -l <listener filename>
(e.g. jmeter -n -t testplan.jmx -l listener.jtl)

The first time I tried to run my scripts from the command line, this is what I exactly saw:

D:\Jmeter\bin>jmeter -n -t testplan.jmx -l listener.jtl
 Created the tree successfully using testplan.jmx
 Starting the test @ Fri Oct 28 07:50:29 CST 2009 (1256255429500)
 Waiting for possible shutdown message on port 4445
 Tidying up ...    @ Fri Oct 28 07:50:34 CST 2009 (1256255434468)
 ... end of run

This information tells us that execution was successful. But if I wanted to see more results of the test, Jmeter provides a listener that displays the summary results also from the console where we type our commands.

We do this by adding the “Generate Summary Results” listener in our testplan.

generate results

Again we type the same command in the console:

D:\Jmeter\bin>jmeter -n -t testplan.jmx -l listener.jtl
Created the tree successfully using testplan.jmx
Starting the test @ Thu Oct 29 11:23:49 CST 2009 (1256786629265)
Waiting for possible shutdown message on port 4445
Generate Summary Results +     5 in   8.5s =    0.6/s Avg:   981 Min:   296 Max:  2344 Err:     0 (0.00%)
Generate Summary Results +     1 in   0.2s =    4.3/s Avg:   232 Min:   232 Max:   232 Err:     0 (0.00%)
Generate Summary Results =     6 in   9.6s =    0.6/s Avg:   856 Min:   232 Max:  2344 Err:     0 (0.00%)
Tidying up ...    @ Thu Oct 29 11:24:02 CST 2009 (1256786642453)
... end of run

From here we could clearly see the results happening per thread which I prefer more than the first.

Here are some commands that we could use when running test in nonGUI mode:

-h, –help -> prints usage information and exit
-n, –nongui -> run JMeter in nongui mode
-t, –testfile <argument> -> the jmeter test(.jmx) file to run
-l, –logfile <argument> -> the file to log samples to
-r, –runremote -> Start remote servers (as defined in remote_hosts)
-H, –proxyHost <argument> -> Set a proxy server for JMeter to use
-P, –proxyPort <argument> -> Set proxy server port for JMeter to use


jmeter -n -t test1.jmx -l logfile1.jtl -H -P 8080

could clearly see the results per thread which I prefer more than the first.

Categories: jmeter Tags: ,

Jmeter: Add “Cookie Manager”

June 29, 2009 10 comments

Objective: Create an automated scripts using JMeter that will do the following scenarios in a healthcare system application and use the same scripts to register more patients.

1. admin user login

2. register new patient

3. save registration

4. verify new patient in the patient’s list

5. admin logout

Issue: Changing values of an automated scripts does not add the new value to the database on test playback.

Here’s how we do it:

1. In our JMeter testplan, add a Non-Test Element>Proxy Server in the WorkBench to do the initial recording.

2. Add Constant Timer under your HTTP Proxy with value “S{T}” to capture the actual delay during recording.

3. Start your browser, enable proxy in your browser and start recording.

4. After one action is recorded, JMeter generates a Header Manager which allows you to customize what information JMeter sends in the HTTP request header. Make a copy of the Header Manager from the first sample and paste it as a child of  your thread group before all the HTTP requests, this will serve as the default header manager to be used.  Continue recording until all the scenarios are finished.

5. After recording, update the samples to a more descriptive names just like this:

Recorded scripts

At this point, new user created during recording is successfully added in the database when manually validated. Next steps will help us parameterized and set new values for our new user.

6. To parameterized your login account, go to your thread group, add a Config Element > User Defined Variable. Then set values for login and password that are accepted in the appliication (in my case, login = admin; password=admin)

Login parameterization

7. Update your “login” sample by changing Value to ${Variable_name}


8. Now go to your “fill out express registration form” sample and edit new values for last name, first name and middle name.

new user

8. Run playback or hit CTRL-R to add to automatically add the new user values.

Actual: Scripts are successfully run but new user is not added in the user list

Expected: Succesfully run the script and add the new user in the user list

Solution: After futher readings of JMeter forums and wikis, I bumped across this post, and in its one reply suggest to add a Cookie Manager. True enough after adding a Config Element > Cookie Manager, set its Policy to “Compatibility,” and rerun the scripts, the new user value we edited was successfully added in the user list.

cookie manager

Cookie Manager, saves the day!

JMeter 101: Using HTTP Proxy to Record your Test

March 18, 2009 62 comments

HTTP Proxy Server is a non-test element feature of JMeter which enables user to record scripts from a real browser.

1. Add Thread Group in your Testplan

Add Thread Group

2. Add Proxy Server to WorkBench

  • Add Non-test Elements > HTTP Proxy Server


  • Set “Target Controller” where your recorded scripts will be added


  • Set URL patters to INCLUDE or EXCLUDE

    • .* – all
    • .*\.png – all png images
    • .*\.gif – all gif images
    • .*\.jpg – all jpg images
    • .*\.php
    • .*\.jsp
    • .*\.html
    • .*\.htm
    • .*\.js
  • Click START


3. Set your Browser to use Proxy (I used IE7 browser)

  • Go to Tools > Internet options > Connections > LAN Setting
  • Select “proxy server”
  • Set Address = localhost; Port = 8080


4. Browse your application and record

5. In HTTP Proxy Server, click “Stop” when finished

To verify if recording was successful, you should be able to see HTTP requests generated under your “Target Controller”

More Tricks:

Add a Constant Timer to the HTTP Proxy Server node to record your think-time (right-click on the “HTTP Proxy Server” node and choose “Add,” “Timer,” and then “Constant Timer.”)

Next change the “Thread Delay” on the timer to “${T}” to tell the proxy server to record your time rather than to add a constant time for each request.

JMeter 101: Analyze your Test Results

March 18, 2009 1 comment

To help you analyze your testing efforts, JMeter provides different types of Listeners. Listeners are JMeter components that show the results of the samples. The results can be shown in the form of a tree, tables, graphs or simply a log file.

Here are some of the listeners that I’ve tried:

1. Graph Full Results / Graph Result

2. Aggregate Graph

3. Aggregate Result

4. Summary Result

5. View Result in Table

6. View Result Tree