[share] how does apipost use mock test

Time:2020-10-31

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
[share] how does apipost use mock test

[share] how does apipost use mock test
Apipost’s built-in mock field variable can randomly generate the variable value you need. Here we need to generate a name randomly
[share] how does apipost use mock test

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.

[share] how does apipost use mock test

Then directly copy @ cname() into the parameter value to call.

[share] how does apipost use mock test

We need multiple requests to run multiple times in the process test

[share] how does apipost use mock test
[share] how does apipost use mock test