Thursday, January 28, 2010

Tip #4: Using JMeter properties

Sometimes I need to modify some parameters in the Test Plan and it requires me to start JMeter, open the Test Plan file and edit these parameters there. But it's better to use JMeter properties for this task. Look at the image below.



There are JMeter properties used as values of "Number of Threads (users)" and "Loop Count" options: ${__P(users)} and ${__P(count)}. Also we must add two parameters to JMeter command line:

jmeter -t TestPlan.jmx -Jusers=10 -Jcount=50

Now you can specify necessary parameters on the fly. I recommend you to use properties for the following options: number of users, loop count, host, port, results and data filenames, etc.

Thursday, January 21, 2010

Tip #3: Pauses in test plan

For complete user simulation you need to add pause after each transaction. In most cases you will use only two types of pauses:

  1. Add constant pause to test planConstant pause. Just add Test Action controller after the Transaction controller. Specify the pause duration in ms and be sure that "Pause" item of "Action" option is checked.

    Constant pause options
  2. Add variable pause to test planVariable pause. Add Test Action as described above but specify the pause duration as 0 (zero). Then add Uniform Random Timer as a child of Test Action and specify the minimum value and maximum offset value.


Wednesday, January 6, 2010

Tip #2: Basic web test plan structure

The best practice is to group logically related HTTP requests to transactions using Transaction controllers. As the result you will get not only response time values of HTTP requests but response time values of the whole transactions too.

Thread group
    Transaction controller 1
        HTTP Request 1
        HTTP Request 2
        ...
        HTTP Request N
    Transaction controller 2
        HTTP Request 1
        HTTP Request 2
        ...
        HTTP Request N
    ...
    Transaction controller N
        HTTP Request 1
        HTTP Request 2
        ...
        HTTP Request N