Variables store information that can be used in routines, requests and scripts.


# request-1.yml
# statusAssert: status in [ 200, 201 ]
kind: request
name: Cat Breeds - Assertion/Capture Testing
  - ${statusAssert} 

Variables are injected into requests and routines whenever they’re loaded. Variables are reference by name, in the format ${variable}.

In Environments

Variables may be added en masse via environment files.

For the full environment reference, see File Types -> Environments.


Individual variables may be added via the run command’s --param flag.

For the --param command line reference, see Commands -> Run.

In Scripts

Variables may be read and mutated from scripts via nap.env.get(key) and nap.env.set(key, value).

For the full script reference, see File Types -> Scripts.