Dry goods: Examples of 9 necessary functions of the interface automation test framework

When you are ready to use an interface automation testing framework or self-made wheels, perhaps you need to first understand what functions the next interface automation testing framework must have.

 1. Check

This is easy to understand. If there is no verification and simply execute the interface, then there is no test. Therefore, it is a necessary function to support the verification of the return value.

2. Data isolation

Data isolation means that the specific request interface, parameters, verification and other data are isolated from the code for easy maintenance. Once you need to adjust the interface use cases or add new interface use cases, you can quickly find the location. Another benefit of isolation is that it can be easily maintained. Reuse, the framework can be promoted to other teams, users can use the same code, only need to fill in the respective use cases according to the requirements to test it.

 3. Data transfer

After achieving data isolation and maintenance, data transmission is another more important requirement.

Data transfer means that parameters can be passed down between interface use cases. For example, we create an order by creating an order interface, and the interface will return an order number. Next, we need to call the order query interface, from the returned data Check with the data in the order creation use case. At this time, the request data of the second interface needs to be extracted from the return in the first interface use case. Such examples abound, so supporting data transfer is another essential feature.

 4. Dynamic functions

In actual use case scenarios, we may have requirements such as randomly generating a mobile phone number and string encryption. After the data is separated from the code, we need the code to support the implementation of the corresponding function to fill when the corresponding keyword is recognized. For example, when filling in phone() in the data, it will be replaced with 137XXXXXXXX when it is executed, and when filling in random(5), it will be replaced with a five-digit random number. and many more.

5. Configurable

Sometimes, our requirement is that use cases can not only be executed in one environment, but the same interface use case may be executed in multiple environments such as QA, pre-release, and online. Therefore, the framework needs to be configurable, easy to switch, and calling different configuration files can be executed in different environments.

6. Log

The log contains the specific execution interface, request method, request parameter, return value, verification interface, request time, time-consuming and other key information. The advantage of the log is that it can be easily located when there is a problem with the new use case. There is a problem. Second, it is convenient to provide data to the development feedback when a bug is found. Development can quickly locate the problem from information such as trigger time and parameters.

7. Visual report

After the use case is executed, it is time to show the results to the team. A visual report can facilitate team members to understand the number of successes and failures of each automated interface use case execution.

8. Use case driven

1. The driving mode of the use case involves how to store test data, how to describe the use case, and how to reuse it;

2. Concurrency should be supported if efficiency is considered;

3. Of course, the test report cannot just record the success and failure, there are also the time-consuming use case execution, the time-consuming interface call, and the statistics of various values ​​such as the pass rate of the scene.

9. Data isolation

1. Whether the use case can be reused should be related to the design of the use case, not very much to the framework.

2. Concurrency is not necessary in terms of interface automation. Of course, some are more perfect.

3. The report is indeed the stronger the better. It is best to have data that the boss cares about and data that the development cares about.

Here comes the following benefits

Here I have collected and sorted out the past few years, the whole is organized around [software testing], the main content includes: python automated testing exclusive video, Python automated details, a full set of interview questions and other knowledge content.
Insert picture description hereInsert picture description here
For software testing friends, it should be the most comprehensive and complete interview preparation warehouse. In order to better organize each module, I also refer to many high-quality blog posts and projects on the Internet, and strive not to miss every knowledge point. Friends relied on these contents to review, and got offers from big factories such as BATJ. This warehouse has also helped many software test learners, and I hope it can also help you.

Follow the WeChat public account [Programmer Erhei] to receive the super hard core resources for Python automated testing

Guess you like

Origin blog.csdn.net/m0_53918927/article/details/113192938