Environment Test Data | Testsigma Documentaion

Environment Test Data


In Testsigma, you can handle and use specific sets of test data linked to different test environments with Environment Test Data. You can include this data in the specific environment where the app is tested, like server names, port numbers, and database credentials. Integrating this environment-specific data into test cases allows you to verify the app's behaviour across different environments such as development, testing, staging, and production. This guide provides an overview of using Environment Test Data in Testsigma across test steps, ad-hoc runs, and test plans.


Prerequisites


Use Environment in Test Steps

  1. Use NLP to create a new step in the Test Case and include a placeholder for test data.
  2. Click the test data placeholder to replace it, and then select the * Environment from the Test Data Types dropdown menu.
  3. Select Environment in the Environments overlay screen from the right-side panel. Environment in Test Step

Use Environment in Ad-hoc Run page

  1. On the Ad-hoc Run page, click the right arrow before Additional Settings to reveal the feature.
  2. Select Environmet from the drop-down list. Environment in Ad-hoc Run

Use Environment in Test Plan

  1. Navigate to the Test Plan Settings tab on the Create or Edit Test Plan page.
  2. In the Additional Settings section, select Environment from the drop-down list. Environment in Test Plan

Environment Variables

You can effectively manage environmental variables, which ensures consistency across various environments.

Testsigma introduced a centralized master list of environment variables, where users can maintain a clean and organized list of Variables, streamlining the selection process during test authoring.

You can modify environment variable values directly on the Ad-Hoc Run page before execution.

Testsigma also automates the creation of new and updated keys across all environments, eliminating the need for manual replication and ensuring that changes are cloned consistently.


Add Keys & Values to all Environments Globally

  1. From the left navigation bar, go to Test Data > Environments and click the Variables tab. Variables
  2. Enter the Variable name and Value and click Add. Add Variables
NOTE:

Variable names should be unique and can not be changed once added.

  1. Once the Variable is added to the list, click Update. Update
  2. Verify the Variable added in the Environments. Verify Variable

Alternatively, you can also add Variables by clicking on Add Variable. This will open the Add Environment Variable prompt. Add Variable

  • Enter the Variable name and Value and click Create. Variable Details
  1. There will be a default indication with the letter D for all the Variables added globally. Default Indication
NOTE:

Once you edit the Variable from the Environment page, the default indication with the letter D will not be displayed. No Default Indication

  1. From the Test Case Details page, click Run. This will open the Ad-Hoc Run overlay. Ad-Hoc Run
  2. Go to the Environment section and confirm the variables by clicking on Manage Variables. Manage Variables
  3. Update the changes and click Apply. New Changes
  4. Click on Run Now to execute the test with updated Environment and Variable. Run Now
NOTE:

Some existing users may notice some empty values in their Environment list. This happens as we have curated your Environment list into a master list. The empty values indicate that the corresponding Environment variables were not previously part of your Environment. With the transition to a master list, these variables are added to ensure the proper usage of the Environment functionality. This change will not impact your existing test cases.


Use Environment Variables to Select Test Data Values

Environment variables can filter test data sets by name during data-driven testing. This method provides flexibility and reusability, making your test cases more adaptable to different scenarios.

  1. Create an Environment and add the name-value pairs that match the set names and values in your Test Data Profile. create environment parameter using tdp
  2. On the Test Case Details page, click the Test Case Settings icon in the right navigation bar.
  3. Select the Test Data Profile from the dropdown menu to associate it with the test case. Enable the Data-Driven toggle. enable data driven to use environment parameter
  4. Choose Parameters as the Filter type. Select Equals, Contains, Starts with or Ends with as the Comparison Metric from the dropdown menu. Choose Parameter Set Name from the dropdown.
  5. Type *| to open the Environment overlay and choose the Environment Parameter Name to add the filters. use environment variables to select test data values
  6. When you run the test case, it will execute using the specified filters.

Getting Environment ID

  1. Navigate to Test Data > Environments.
  2. Click Environment for which you want to get Environment ID.
  3. The <ENV_ID> can be found in the URL of the Environment details page.

    Env ID