Quickstart Guide to Creating Fake Data for Load Testing Parameters
Test and Monitor | Posted 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

Close

By submitting this form, you agree to our
Terms of Use and Privacy Policy

Thanks for Subscribing

Keep an eye on your inbox for more great content.

Continue Reading

Add a little SmartBear to your life

Stay on top of your Software game with the latest developer tips, best practices and news, delivered straight to your inbox