Skip to content
  • ZipCode Api
  • Blog
  • About RedLine13
RedLine13
RedLine13
Primary Navigation Menu
Menu
  • Start Testing
  • Demo
  • Pricing
  • JMeter
  • Partners
  • Docs
    • Documentation Home
    • AWS Set Up for load testing
    • AWS Approval for Large Tests
    • PHP, NodeJS, Python Load Tests
    • Scalability
    • Jenkins Plugin Setup
    • Premium Features
    • Knowledge Base

Random Data in JMeter Performance Tests

By: David Koziel

In a related post, we discussed how to parameterize your JMeter tests from a CSV source file. In this article we will take things a step further, and show you how to introduce variability into your requests by pulling from your CSV source file to have random data in your JMeter performance tests.

Using Random CSV Source Data in Your JMeter Tests

Random CSV Data Set Config Plugin

Building upon the functionality of the CSV Data Set Config plugin that ships with JMeter, there is an additional Random CSV Data Set Config plugin that is available to install from the Plugin Manager. You can access the Plugin Manager from main “Options” menu directly within the JMeter GUI:

You can access the Plugin Manager directly within JMeter under the Options menu
You can access the “Plugin Manager” directly within JMeter GUI under the “Options” menu.

To find the plugin you may search for “Random CSV” under the “Available Plugins” tab, which should present options to install the Random CSV Data Set component. You may have to restart JMeter after this is installed:

Random Data in JMeter Performance Tests
The “Random CSV Data Set” plugin can be installed within JMeter via the Plugin Manager.

Using a CSV Data Source for Random Data in JMeter Performance Tests

For the purposes of this example we have prepared a basic CSV data file. This is to be used for a hypothetical case of automatically filling out a website feedback form which requires first and last name, an email address, a phone number, and a brief comment. The structure of our data file is as follows:

Structure of the CSV data file used for the purposes of this example
Structure of the CSV data file used for the purposes of this example.

The options for setting up the Random CSV Data Set Config element are similar to those of the ordinary CSV Data Set Config component. One important difference that is pertinent to our example is setting the “Random order” checkbox. This will change the reading behavior from sequential, to returning random rows from within the *.CSV file. Here is an example of how we will configure this element:

Setting options for Random Data in JMeter Performance Tests
Setting options for randomly extracting data rows from a source CSV file.

A useful feature of this component is the built-in ability to test reading of CSV data into local variables before running our test. This is useful in eliminating the trial-and-error practice of setting up a test otherwise. In addition to this we can also test the randomization of results read from the CSV file. Repeatedly clicking on the “Test CSV Reading” button will load a different, randomly selected row into the results area as shown below:

We can test reading of CSV data in random sequence
We can test reading of CSV data in random sequence.

Once you have added the Random CSV Data Set Config element to your test plan, your samplers will be able to access your CSV data fields using the standard ${...} variable convention as explained in our previous post.

Combine Randomization with Split Feature

You can further increase the variability of your load tests by combining CSV parameter randomization as described above with the “Split” functionality when attaching your data source file. This will equally divide your CSV file amongst your load generator servers, randomly selecting a subset of your data for each request. To utilize this feature, simply check the “Split” option when uploading your *.CSV file:

Split feature for dividing CSV data files amongst load generator servers


Did you know that RedLine13 offers a full-feature free trial? Sign up now and start testing today!

2023-05-17
Previous Post: Filtering the JMeter Dashboard Report
Next Post: Top 10 JMeter Plugins

Recent Posts

  • JMeter XML Format Post Processor
  • Order of Elements in JMeter
  • The JMeter Synthesis Report
  • Using the JMeter Plugins Manager
  • JMeter Rotating JTL Listener

Related

  • JMeter XML Format Post Processor
  • Order of Elements in JMeter
  • The JMeter Synthesis Report
  • Using the JMeter Plugins Manager
  • JMeter Rotating JTL Listener
  • Using Test Fragments in JMeter Tests
  • Step-by-Step Guide to Testing with JMeter
  • Functional Testing vs Performance Testing
  • A Gentle Introduction to Load Testing
  • Using the JMeter Counter Element

© RedLine13, LLC | Privacy Policy | Contract
Contact Us: info@redline13.com

Designed using Responsive Brix. Powered by WordPress.