Overview
Effective test automation requires flexible data management. Supatest provides tools to create, store, and use data in your tests—from environment variables to dynamic expressions.Data Management Tools
Environments
Configure variables for different environments
Context Hub
Provide application context to AI features
Expressions
Use dynamic values in test steps
Creating and Storing Data
First, set up your data sources in Supatest. Environments and Context Hub are where you add and store data.Environments
Environments store variables for different testing contexts:- Run same tests against different URLs
- Store credentials securely
- Configure environment-specific settings
Context Hub
Context Hub stores documents that help AI understand your application:- Application structure
- Business terminology
- Test data conventions
- User flows
Using Data in Tests
Once your data is set up, use expressions to access it in test steps.Expressions
Expressions let you use dynamic values in steps:Where to Use Expressions
| Step Field | Example |
|---|---|
| Navigate URL | {{ env.BASE_URL }}/login |
| Fill value | {{ env.TEST_EMAIL }} |
| Verify text | Welcome, {{ vars.userName }} |
| API headers | Bearer {{ env.API_TOKEN }} |
Data Flow in Tests
Example Flow
Best Practices
Environment Variables
- Do store URLs, credentials, API keys
- Do create separate environments for dev/staging/prod
- Don’t hardcode values that change between environments
Extracted Variables
- Do extract values needed for later verification
- Do use descriptive variable names
- Don’t extract values you won’t use
Random Data
- Do use for unique identifiers (emails, usernames)
- Do use when tests run multiple times
- Don’t use when specific values are required
Common Patterns
Login with Environment Credentials
Generate Unique User
Extract and Verify
API with Auth Token
Troubleshooting
Variable Not Found
- Check variable name spelling
- Verify environment is selected
- Ensure extract step ran before usage
Expression Not Evaluating
- Check syntax:
{{ env.NAME }}not${NAME} - Verify curly braces are correct
- Check for typos in expression
Wrong Environment Used
- Verify correct environment selected before run
- Check test plan environment setting
- Confirm CI/CD passes correct environment

