Generate synthetic data
Generate random test data with the built-in faker object for names, emails, numbers, and more.
Last updated
Generate random test data with the built-in faker object for names, emails, numbers, and more.
In Maestro, you can use the built-in DataFaker integration to generate dynamic, randomized data for your test. This is useful for bypassing unique-field constraints (like sign-up forms) and creating realistic testing environments without manual data entry.
faker objectMaestro provides a global faker object available within the JavaScript engine. This object is a wrapper around the DataFaker library and follows the same usage patterns and providers found in its Java documentation.
For additional information about DataFaker, check its documentation.
The faker object provides access to a wide variety of data types, ranging from standard user information to specialized domains.
Check the DataFaker to see all Fake Data Providers.
Generate standard user information for forms:
First Name: faker.name().firstName()
Full Name: faker.name().fullName()
Credit Card: faker.finance().creditCard() or via expression: faker.expression('#{finance.creditcard}')
Generate random ranges or specific number patterns:
Between Range: faker.expression("#{number.numberBetween '1' '10'}")
Digits: faker.number().digits(5)
DataFaker also supports "fun" providers for non-critical placeholder text:
Lord of the Rings: faker.lordOfTheRings().character() or faker.lordOfTheRings().location()
You can use faker within evalScript to store values in the output object, or directly inside UI commands.
Using expressions allows you to combine multiple faker providers into a single string:
Last updated
- launchApp
- inputText:
text: ${faker.name().firstName()}
- inputText:
text: ${faker.internet().emailAddress()}- evalScript: '${output.bio = faker.expression("#{name.fullName} lives in #{address.city}")}'
- console.log: ${output.bio}