The Test That Works Once
You build a beautiful registration test:[email protected]. Your database now has that email. The second run tries to create the same user again, and your app correctly rejects it as a duplicate.
The solution you don’t want: Manually delete the test user after each run, or use a different email each time. Both are tedious and unsustainable.
The solution you need: Random data that generates a unique email every single run.
What Is Random Data?
Random data is Autonoma’s ability to generate unique values automatically for each test run. Instead of hardcoding[email protected], you use {{random:email}}. Autonoma generates a fresh email every time:
- First run:
[email protected] - Second run:
[email protected] - Third run:
[email protected]
Your First Random Data Test
Let’s fix that broken registration test. Before (breaks after first run):Types of Random Data
Autonoma can generate random data for virtually any text concept. Here are the most common types: Email addresses:{{random:product_name}}. Need a random book title? {{random:book_title}}. Autonoma’s AI understands the concept and generates appropriate data.
Real-World Example: Complete Registration Form
Let’s test a full registration form with multiple fields:{{random:password}}. Within a single test run, the same random placeholder generates the same value. This ensures the password and confirmation match.
When to Use Random Data
Use random data whenever you need values that: Must be unique:- Email addresses (can’t register twice)
- Usernames (must be unique in system)
- Account numbers (no duplicates allowed)
- Customer names in customer creation
- Product SKUs in inventory tests
- Order references
- Form validations with different inputs
- Search features with different queries
- Filters with various values
- Different users creating accounts
- Various addresses for shipping
- Multiple phone number formats
Random Data vs Variables
Let’s clarify when to use each: Use variables when:- You want the same value in all test runs
- You’re logging into an existing account
- You’re testing with specific known data
- You want a different value each test run
- You’re creating new accounts/data
- You need unique values to avoid conflicts
- Variables are like your personal email address—stable and reusable
- Random data is like disposable email addresses—new one each time
Combining Random Data with Extraction
Here’s a powerful pattern: Use random data to create something, then extract the value to verify it later.Testing Multiple Scenarios with Random Data
Random data makes it easy to test forms with various inputs:Random Data for Edge Case Testing
You can even request random data for edge cases:The Cleanup Question
You might wonder: “If I’m creating new users every test run, won’t my database fill up with junk data?” Yes—and that’s usually fine for staging/test environments. Test databases are meant to accumulate test data. If cleanup is critical:- Run tests against a test environment that resets periodically
- Use a cleanup script that runs nightly to delete test data
- Use Autonoma’s fetch actions to call an API endpoint that deletes test users after runs

