API Monitoring & Testing: Initial Script

For each test and shared environment, you can specify a script that runs prior to the first request of an API test. If you have a complicated signature or other value that needs to be generated and is common to all requests (e.g. random number generator), this is the place to define it. The initial script is processed after the Initial Variables are processed and has access to those values through the variables global. Any variable values set with variables.set(name, value) will available to the requests in the test. Any assertions defined in the initial script will be ignored.

An Initial Script specified in the shared environment will be executed before the Initial Script defined in an individual test environment, if the shared environment is inherited by that test environment.


Next: Script Libraries →