Defining variables

Within API Testing there are multiple ways to define variables to address different requirements.

Global Datasets

Global Datasets are ones that are common across the whole test and typically does not change between runs based on Input Datasets

Adding a global variable

  1. Log in to the API Manager.
  2. Click the Test APIs tile.
  3. On the Test page, select a test suite tile.
  4. Select a test case.
  5. Go to the Design > Variable System > Data sets tab.

    Global Datasets

  6. In the Global Datasets section, click Add.
  7. Enter the variable name and value.
  8. Click Add.

Editing or deleting a global variable

  1. Log in to the API Manager.
  2. Click the Test APIs tile.
  3. On the Test page, select a test suite tile.
  4. Select a test case.
  5. Go to the Design > Variable System > Data sets tab.
  6. In the Global Datasets section, click the options menu and select Edit.Global Datasets

  7. Update the name and value as needed.
  8. Click Add.
  9. To delete a variable, click the options menu and select Delete.

Input Datasets

The input datasets, is a group of input variables representing a scenario (e.g product id). Where the number of input datasets determines how many times the test will be executed using those values. If 3 input datasets are defined, the test will run 3 times using the inputs defined within each of those sets on each run.

  1. Log in to the API Manager.
  2. Click the Test APIs tile.
  3. On the Test page, select a test suite tile.
  4. Select a test case.
  5. Go to the Design > Variable System > Data sets tab.Global Datasets

  6. In the Input Datasets section, click Add.
  7. Enter a dataset name.
  8. Click Add.

What to do next