Quickstart Guide to Creating Fake Data for Load Testing Parameters

  August 20, 2019

Browser-based load testing is becoming an increasingly popular way to identify bottlenecks in software applications. Rather than testing server response times and error rates, you can recreate the user experience from a real browser. These browser-based tests measure both the server’s response times and the browser’s HTML and JavaScript render times to provide a more comprehensive look at the user experience. Read more about this in our article on Best Practices for Creating Browser-based Load Test Scripts

Here's a quickstart guide to generating fake parameterized data for your load tests:

Single Fake Data Points

  1. Download Faker CLI or install with a package manager.
  2. Run the following command in your console: `faker-cli -[argument] -[value]`, where the argument is an option for a particular type of data (e.g. a name or address) and value is the key for that value. For example, `faker-cli -n firstName` will generate a random name for a person with the key “firstName”.

JSON Schema with Fake Data

  1. Download JSON Schema Faker or install with a package manager.
  2. Create a JavaScript file and `import jsf from ‘json-schema-faker`.

Create a schema with data types defined, such as:
const schema = {
            email: {
                        type: ‘string’,
                        format: ‘email’,
                        faker: ‘internet.email’

Check out our article on Best Practices for Creating Browser-based Load Test Scripts. If you're ready, sign up for a free LoadNinja trial today