TestMace
0.0.1-beta.7
0.0.1-beta.7
  • Getting Started
  • Interface
    • The Menu
    • Interface Overview
    • Scratches
    • Node Types
    • Keyboard Shortcuts
  • Node Types
    • Project
    • Folder
    • RequestStep
    • Assertion
      • Compare
      • Contains
      • Script
      • XPath
    • Link
    • API description
      • ApiRootFolder
      • ApiFolder
      • ApiRoute
      • API Description Import
    • Broken
    • Script
  • Variables
    • User-Defined Variables
      • Static Variables
      • Dynamic Variables
    • Default Variables
    • Environment Variables
  • Working with the project
    • Cookie
    • Authorization
  • Settings
    • Proxy
  • Other features
    • Bulk Edit
    • Import & Export
      • Shared
      • cURL
      • Swagger
      • Postman
    • Default HTTP headers
Powered by GitBook
On this page
  • Creating environment variables
  • Importing environment from Postman
  • Using Environment Variables
  • Local Environments

Was this helpful?

  1. Variables

Environment Variables

Change variables values used in the project in one click.

PreviousDefault VariablesNextCookie

Last updated 5 years ago

Was this helpful?

In TestMace you can create changeable variables, for instanсe, to switch between stage and prod environments.

Creating environment variables

In this example we'll create a single variable for stage and prod environments.

  1. Click on the settings icon.

  2. In the pop-up window choose a new environment by clicking on the Add environment button and name it stage.

    • Create the serverUrl variable and set the stage server url as its value.

  3. Add the prod environment by clicking on the Add environment button.

    • Create the serverUrl variable and set the prod server url as its value.

Importing environment from Postman

TestMace allows you to import your environments from . To do that, click the + Import environment button, that may be found in the variables editing dialog right under the list with all available environments. After you click the + Import environment button, you'll see the dialog where you should enter the path to the file.

Using Environment Variables

To create a changeable variable use the ${$env.%VARIABLE%} reference. Change the value of our variable in every node to ${$env.serverUrl}. Now you can change this variable value anytime.

Where to use environment variables?

Just like plain variables, you can use environment variables in any string field of the node.

Local Environments

Local environments are just usual environments that are not saved into project files, but are stored in the application's local storage. We reccomend you use this environment while working with local and privite data, such as logins, passwords, API-tokens, etc.

You can see local environments at the bottom of the sidebar. Each local environment has the (local) prefix, so that you could distinguish from other environments.

Drag and drop your local environments to turn them into ordinary ones and vice versa.

Postman
Local environments in the environments variables dialog