Built-in Environment Variables
Similar to system parameters, which allow users to define custom environment variables from the Testinium Suite UI, Testinium Suite also provides a set of built-in environment variables automatically during test execution.
These variables are generated by the execution itself and can be accessed directly from the test automation code. They help users identify the current execution context, generate execution-specific report links, use execution identifiers in test logic, and track retry-related execution information.
Available Environment Variables
The following built-in environment variables are provided during test execution:
Environment Variable | Description |
|---|---|
EXECUTION_ID | Represents the related plan execution/run. |
TEST_RESULT_ID | Represents the current scenario result. |
SCENARIO_ID | Represents the scenario being executed. |
TOTAL_RETRY_COUNT | Represents the total Failed Test Retry Count value configured in the plan. This value does not include the initial run. |
CURRENT_RETRY_COUNT | Represents the current retry attempt number during execution. For the initial run, this value is 0. |
Usage
Users can access these values from their test automation code as environment variables.
Java Example:
String executionId = System.getenv("EXECUTION_ID");
String testResultId = System.getenv("TEST_RESULT_ID");
String scenarioId = System.getenv("SCENARIO_ID");
String totalRetryCount = System.getenv("TOTAL_RETRY_COUNT");
String currentRetryCount = System.getenv("CURRENT_RETRY_COUNT");Retry Count Behavior
Retry-related variables allow users to understand whether the current execution is the initial run or a retry attempt.
For example, if Failed Test Retry Count is set to 2, the execution flow will be:
Execution Type | TOTAL_RETRY_COUNT | CURRENT_RETRY_COUNT |
|---|---|---|
Initial run | 2 | 0 |
First retry | 2 | 1 |
Second retry | 2 | 2 |
This means:
- When CURRENT_RETRY_COUNT is 0, the execution is the initial run.
- When CURRENT_RETRY_COUNT is greater than 0, the execution is a retry attempt.
- TOTAL_RETRY_COUNT always shows the retry count configured in the plan and does not include the initial run.
Notes
- Built-in environment variables are generated automatically during test execution.
- These variables can be used for reporting, debugging, execution tracking, or custom test logic.
- EXECUTION_ID, TEST_RESULT_ID, and SCENARIO_ID can be used to generate execution-specific report links.
- TOTAL_RETRY_COUNT represents the retry count configured in the plan.
- TOTAL_RETRY_COUNT does not include the initial run.
- CURRENT_RETRY_COUNT is set to 0 for the initial run.
- For retry executions, CURRENT_RETRY_COUNT increases sequentially, such as 1, 2, and so on.
- In Random executions, retry count values are handled across the retry flow.
- In Cross executions, CURRENT_RETRY_COUNT increases based on retries on the same device.