Use Randomized Values with Faker
BlinqIO integrates the faker.js library to help you generate realistic and randomized test data dynamically. This is especially useful when you want each test run to use unique values. For example, you might generate different names, email addresses, or prices in every execution.
How to Use
Replace any static values in your Gherkin file with Faker expressions. BlinqIO will generate different values in every test run.
Common Faker Expressions
Syntax | Description |
---|---|
{{person.firstName()}} | Random first name |
{{internet.email()}} | Random email address |
{{phone.number()}} | Random phone number |
{{company.name()}} | Random company name |
{{commerce.price()}} | Random price |
Example: Scenario with Multiple Steps and Faker Rows
Below is a sample Gherkin scenario with multiple steps and several Examples
rows. Each row uses Faker expressions to inject unique test data during execution.
Each test run will generate different usernames and passwords to simulate a wide range of test scenarios.
Tip
This method is helpful when testing workflows that require distinct data in every execution. Common use cases include user registrations, form submissions, and invoice generation.