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
- Log in to the API Manager.
- Click the Test APIs tile.
- On the Test page, select a test suite tile.
- Select a test case.
- Go to the Design > Variable System > Data sets tab.
- In the Global Datasets section, click Add.
- Enter the variable name and value.
- Click Add.
Editing or deleting a global variable
- Log in to the API Manager.
- Click the Test APIs tile.
- On the Test page, select a test suite tile.
- Select a test case.
- Go to the Design > Variable System > Data sets tab.
- In the Global Datasets section, click the options menu and select Edit.
- Update the name and value as needed.
- Click Add.
- 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.
- Log in to the API Manager.
- Click the Test APIs tile.
- On the Test page, select a test suite tile.
- Select a test case.
- Go to the Design > Variable System > Data sets tab.
- In the Input Datasets section, click Add.
- Enter a dataset name.
- Click Add.
What to do next
- Next topic: Running a test case