Skip to main content
Back to blog
tutorials 5 May 2020 2 min read

Dummy Sampler

A guide to using the Dummy Sampler plugin in Apache JMeter for creating custom requests and responses as test stubs.

M

Mark

Performance Testing Expert

The Dummy Sampler is a valuable JMeter plugin that provides a localised method of sending a custom request and returning a custom response. It functions effectively as a stub within test plans.

Installation Process

  1. Download the plugins-manager.jar file
  2. Place it in the lib/ext directory
  3. Restart JMeter
  4. Navigate to Options > Plugins Manager
  5. Select Available Plugins
  6. Search for “dummy sampler”
  7. Apply changes

Key Features

The jp@gc - Dummy Sampler offers configurable options including:

  • Response codes
  • Response messages
  • Connect time
  • Latency
  • Response time
  • Request/response data
  • URLs

Practical Example

You can use the Random function to generate varied response codes between 1-5 with a suffix pattern:

${__Random(1,5)}00

Additional configurations include:

  • Random latency: ${__Random(1,100)}
  • Response time variations: ${__Random(10,1000)}
  • Response data with random numbers: ${__Random(1,1000)}

Use Cases

The tool proves particularly valuable for testing incomplete applications, such as when APIs remain under development. Developers can substitute dummy samplers for unfinished endpoints while returning valid responses, allowing testing to proceed without waiting for backend services to be complete.

This approach enables:

  • Testing UI flows before APIs are ready
  • Simulating various response scenarios
  • Validating error handling with custom response codes
  • Creating predictable test conditions

Further Reading

Tags:

#jmeter #plugins #testing #stubs #performance-testing

Need help with performance testing?

Let's discuss how I can help improve your application's performance.

Get in Touch