Environments

Environments help you create variables that you can reuse in requests and scripts.

An environment allows you to group together a set of variable data. You can reference the variable data you define in an environment throughout PruTAN when sending requests or using scripts. Environments are also useful when you need to manage shared variables with a team. You can create environments and share them with your workspace members.

Click on the "Environments" icon on the sidebar to create environments.

Types of Environments

  1. Global Environment – The global environment is workspace-specific and accessible to all members within that workspace. Variables defined in the global environment are always available for use without requiring manual selection, providing a consistent and shared configuration across the workspace.
  2. Personal Environment – The personal environment is private to the workspace and can be shared only with its members. It can be created for specialized or temporary use cases within the same workspace. A personal environment must be explicitly selected from the dropdown to be active, and when selected, its variables take precedence over the global environment variables for that execution.

Using Scripts

You can also create environment variables using scripts in the Rules tab.

// To create environment variable for currently selected environment else global environment
env.set('key', 'value');

You can also fetch environment variables using scripts.

// To get environment variable
env.get('key');

Environments Import/Export

PruTAN also provides environment import/export functionality. If you want to share a created environment with members who are not part of the team or use this environment collection in another team, you can export the specific environment or all environments simultaneously as a JSON file. After that, the file can be imported into PruTAN environments.

Image 1: Export Single Environment Collection

Steps to export a single environment collection:

  1. Go to the Environment sidebar and hover on the environment you want to export.
  2. On hover, you will see three vertical dots; click on them.
  3. On click, a dropdown will show the export button.
  4. Click on it and the environment will be exported.

Image 2: Import & Export All Environments Simultaneously

A. Steps to export all environment collections:

  1. Go to the environment sidebar section.
  2. Click on the Import/Export button icon.
  3. A dialog box will open with the option to export.
  4. Click on the export button and all the environments will be exported.

B. Steps to import environment collections:

  1. Go to the environment sidebar section.
  2. Click on the Import/Export button icon.
  3. A dialog box will open with the option to import.
  4. Click on the import button, select an env JSON file exported from PruTAN, and import it.

Duplicating an Environment

Create a copy of an existing environment to modify or test different configurations without affecting the original:

  1. Click the "Environments" icon in the sidebar to view all existing environments.
  2. Hover over the environment you want to duplicate; a three-dot icon will appear. Click on the three-dot icon.
  3. From the dropdown menu, select "Duplicate". A new environment with the suffix "- Duplicate" will be created.

To learn how to create an environment: Environment