----- Original Message ----- 
From: "Sonam Chauhan" <[EMAIL PROTECTED]>
To: "'JMeter Users List'" <[EMAIL PROTECTED]>
Sent: Thursday, December 18, 2003 4:32 AM
Subject: Practices for JMeter command line testing


> Hi - I was wondering what strategies/practices people use for JMeter command
> line testing. I tried the approach below - while it works, I'd like some
> feedback and had a few questions.
>
> In general, I want to run a JMeter test from the command line script that
> reports any errors in the test run. So I first create the JMX in the GUI. At
> the end of the JMX, below the thread groups, I insert a 'View Results in
> Table' to write test errors to a file (say "test.log").
> -----------------------------------------------
> Test Plan
> Thread Group 1
> ...
> Thread Group n
> View Results in Table [ Write errors to 'test.log' ]
> -----------------------------------------------
>
> I then call the whole thing in a shell script. Any errors in the run are
> logged to the 'test.log' file. The script inspects 'test.log' to see if the
> test run had any errors. It looks like this:
> -------------------
> #!/bin/bash
> rm -rf test.log
> jmeter -t test.jmx -n
> ERRORS=`wc -l test.log`
> echo "Errors: $ERRORS"
> -------------------
>
> Some questions:
> 1. Any feedback on this method would be welcome.
>    In particular are there better methods to use JMeter tests
> from the command line?

If you want to collect all the results, and not just errors, then there is no need to 
include a View Results in Table element - you
can just add the command-line switch  -l logfilename

For example:

jmeter -n -t test27a.jmx -l test27a.jtl

You could then scan the jtl file for errors by looking for samples that failed, i.e. 
with "false" in the appropriate column.

The JTL files can also be loaded into a Listener to look at the stats, or you can 
process them with Perl or Excel etc to generate
statistics.

> (I read somewhere about Junit/Ant interfaces for JMeter,
> but can't find the link.)

There is an Ant task in the extras directory, as well as a short guide - see 
extras/JMeter Ant Task.html

>
> 2. For substitution of a few test variables, is there any advantage to
> using __CVSRead or _StringFromFile (plain files) over just
> __property
> (reading from property files)?

Depends how often the variables are changed. Properties can be specified on the 
command line as well as in files. See the JMeter FAQ
for some info on parameterising test runs.

For test runs that require thousands of values, use _StringFromFile, as __CSVRead 
slurps the entire file into memory.

__CSVRead currently only supports a single file for the whole test run.

>
> 3. Is there documentation on the 'View Results in Table' file format?
> E.g.: Here is a single error line in test.log:
> What do "1071715008642" and "Thread Group 11-1" represent?

System.currentTimeMillis() for the END of the sample (may be changed to the START in a 
future version)
i.e. milliseconds since midnight, January 1, 1970 UTC.
and
the thread group name - thread number.

The extra 1 after the thread group name is a bug, which is corrected in CVS.

> (the thread group name is really "Thread Group 1")
> -----------------------------------------------
> 1071715008642,265,Login 1,Non HTTP response code,Non HTTP response
> message,Thread Group 11-1,text,false

Fields above are:
Timestamp (End)
elapsed (ms)
Sample Title
Response Code (e.g. 404, 200 for HTTP)
Response Message
Thread Group name - thread number
type of response data
success flag (can be set false by a failed sample or a failed assertion)

Note that jmeter.properties contains some information on how to include/exclude 
different fields when creating CSV format log files.

HTH.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to