1. What is mock
There is an interface, and the data returned by different parameter ID is different. Now there are multiple pieces of data in the database. As a tester, if you input manually to view the returned results of this interface, it is very difficult and laborious。
We can call the built-in mock field variable in apipost
Apipost’s built-in mock field variable can randomly generate the variable value you need. Here we need to generate a name randomly
We call the built-in mock variable parameter @ cname() in apipost. Because apipost is a product of Chinese people, the following explanation is also in Chinese. It is very friendly to those who are not good at English.
Then directly copy @ cname() into the parameter value to call.
We need multiple requests to run multiple times in the process test