Cagy.org
Doing stuff since the late 1970's

Generate lots of complex mock data for testing your projects - A tutorial for the Test Data Generator

2021-03-30T00:06:12+02:00

When in need for test data, look no further.

The Test Data Generator can easily produce a large amount of test data for testing your projects.

What can it generate?

It's a lot, so let's get you started.

Test Case: I need mock data for a user database

Let's create mock data for a USER database containing user data in this format:

id(incremental), name, email address, country, registered, ip address
  1. Open 'Special’ in the menu on the left and click “increment ( $start )"
    1. Notice the increment function is displayed
  2. Double click the increment ( $start ) function in the tree menu to add it to the pattern bar.
    1. Notice the function is added to the pattern bar with a default starting value of 1000.
    2. Edit the starting value to match your needs.
  3. Test the pattern by clicking the Generate Data button.
    1. Notice 20 rows of data are generated in the output window starting at the value defined in the function.
  4. Now we need to add a random Username by double clicking the fname() function under People & Localisation. Click the Generate Data button.
    1. Notice data is generated in the output window but no ‘separator’ is present.
  5. Add a ; separator between the increment() and fname() functions. Click the Generate Data button.
  6. Let's add an e-mail address by adding a ; separator and double clicking the email() function. Click the Generate Data button.
    1. The pattern bar should look like this now: increment(1000);fname();email()
  7. Add the country() function, the datetime() function and the ip() function and remember to use ; separators
    1. The pattern bar now shows: increment(1000);fname();email();country();datetime();ip()
  8. Update the X input field from 20 to 20'000 and click that Generate Data button.

Congratulations, your computer just created 20'000 user accounts in milliseconds.

test data genrator example

Have fun!

 


Cagy.org • v0.1337.0.42.0.1984.0.666.0.3,14159265359.0.50210.001 • Marquees are obsolete, its use is discouraged.