[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

Recommended Today

10 most recommended vs Code plug-ins in 2020

preface Original address:https://blog.bitsrc.io/top-10…Author: shaumik daityari The text begins here~ 1 Import Cost During the development process, you may often find yourself adding dependencies to the project. Although modular development has become a key part of today’s software development, it is best to make sure that you are careful with your input. JavaScript and typescript’s import […]