Skip to main content
blog title image

2 minute read - Test Data

Using Faker in AnyWayData

Jun 21, 2022

Some tips and tricks for using Faker functions in AnyWayData to generate random data.

Because I haven’t written the documentation for AnyWayData.com the test data generation feature is a little obscure. I recommend using Faker API documentation to understand some of the test data generation functions.

Most of the Faker API is implemented. So I can add a column called “first name” and generate values using faker by using the “name.firstName” function.

Listed in the API here: name.firstName

I tend to use the “Test Data Text Schema” text input to create an initial schema.

e.g.

first name
a
last name
b
email
e
address
a

And then edit in the grid to pick the faker api functions from the pop up list in the editor.

Also, AnyWayData.com supports the use of the ‘fake’ function in Faker which makes it easy to combine text and Faker calls into a single string.

Which I can use in a schema to create an address for example:

address
fake {{address.buildingNumber}} {{address.streetName}}

And because the schema text field is just a text field, I can copy the schema into Evernote and re-use it later to generate more data:

first name
name.firstName
last name
name.lastName
email
internet.email
address
fake {{address.buildingNumber}} {{address.streetName}}

Creating Test Data Video

This video shows the process in more detail: