Back to TresekoView full library

Environments, datasets and variables

How to change data and environments without rewriting every script or test case.

Practical guide

1 guide found

All guides

Environments, datasets and variables

How to change data and environments without rewriting every script or test case.

Open guide
Reading
8 min
Updated
2026-07-18
Version
1.0.6

When to use this guide

Use it when the same test case needs to run against QA, staging or another environment, or when data changes per build.

Expected result

Test cases and workers consume clear variables, with values per environment, without credentials hardcoded in scripts.

Environments separate where you test and datasets separate what data you test with. Technical variables are resolved from the component and execution context to avoid hardcoded URLs, users or IDs.

For automated tests, this separation is key. A script that only works on one person's machine is not reliable automation.

Not all values should be visible to everyone. Credentials and tokens need careful handling, appropriate permissions and cautious logging.

Recommended flow

  1. Create environments with simple names: QA, Staging, Demo or Controlled Production.
  2. Define common variables like base_url, tenant, test_user or feature_flag.
  3. Separate sensitive data from public test case data.
  4. Associate datasets to project, build or suite as appropriate.
  5. Use variables in automated steps or worker scripts.
  6. Run a short test to confirm value substitution.
  7. Review logs to ensure they do not print secrets.

How to verify

  • Changing the environment changes URL or data without editing the test case.
  • The worker receives expected variables.
  • Sensitive values do not appear in screenshots or unnecessary logs.
  • The execution records which environment was used.

Common pitfalls

  • Using real production values for destructive tests.
  • Storing passwords in plain text within the test case step.
  • Naming variables differently in each suite.
  • Not recording the environment and then not knowing where it failed.
environmentsdatasetsvariablesautomationtest data