The strongest, the automated testing framework is summarized and organized, and the road to advanced testing is rolled up...


foreword

The automated testing framework is an integrated system, which includes function libraries for test functions, test data sources, test objects, and reusable modules.

Frame (framework) is a frame - refers to its constraints, but also a shelf - refers to its support. It is a basic conceptual structure used to solve or deal with complex problems.

In software engineering, a framework is a reusable design of the whole or part of the system, expressed as a set of abstract components and methods of interaction between component instances;

Another definition holds that a framework is an application skeleton that can be customized by application developers, the former is defined from the aspect of application and the latter is defined from the aspect of purpose.

For testers, the automated scripts of linear scripts are poor in maintainability and usability, so they can use the designed framework to realize automated testing.

Automated Testing Framework Ideas

Modular thinking ==> modular test scripting framework;
library thinking ==> testing library framework;
data-driven thinking ==> data-driven testing framework;
keyword-driven thinking ==> keyword-driven or table-driven testing framework;
the above Thought integration completes the actual automation of the enterprise ==> hybrid test automation framework;

1. Modular test script framework
It is necessary to create independent and descriptive modules, program fragments and scripts of the application to be tested. These small scripts are combined to form test case scripts that run specific tests independently.

2. The test library framework
is very similar to the modular test script framework and has the same advantages. The difference is that the test library framework decomposes the application under test into procedures and functions instead of scripts. This framework requires the creation of library files describing the modules, fragments, and functionality of the application under test.

3. Data-driven testing framework
The input and output data tested here are read from data files (data pool, ODBC source, CSV file, EXCEL file, Json file, Yaml file, ADO object, etc.) and generated by capture tools or Manually generated code scripts are loaded into variables.

In this framework, variables are used not only to store input values ​​but also to store output validation values. Throughout the program, the test script reads the value file and records the test status and information.

This is similar to table-driven testing, where test cases are contained in data files rather than scripts, and the script is merely a "driver", or delivery mechanism, for the data.

4. Keyword-driven or table-driven test framework
This framework needs to develop data tables and keywords. These data tables and keywords are independent of the test automation tools that execute them, and can be used to "drive" the test script code of the application and data under test. The key-driven tests look very similar to manual test cases.

In a keyword-driven test, the functionality of the application under test is written to a table along with the execution steps of each test.

This test framework can generate a large number of test cases with very little code. The same code is reused while using the data table to generate each test case.

5. Hybrid test automation framework
The most common execution framework is a combination of all the technologies introduced above, taking its strengths and making up for its shortcomings. This hybrid testing framework is an evolution of most of the frameworks over time and through several projects.

Framework Design Goals

The designed framework is directly given to testers, and other testers only need to simply add test cases to it; therefore, our framework design must be three-simplified, that is, simple to operate, easy to maintain, and easy to expand.

When designing the framework, it must be combined with the business process, not just relying on technology. In fact, technology is not difficult to implement, but the difficulty is understanding and grasping the business process.

When designing the framework, the basic ones should be packaged into common ones, such as: get requests, post requests and assertions are packaged into the same basic common classes.

The test case should be separated from the code, which is convenient for use case management, and implemented with a data-driven framework.

Technical points used in the automation framework

Language: python
Test framework: unittest (assertEqual) / pytest
Interface call: requests (API is very concise)
Data driver: paramunittest (parameterized by assembling data in a certain format)
Data management: xlrd (read excel file data), configparser ( Read configuration file)
Data format conversion: ast, json
Log processing: logging - clear execution process, quickly locate problems
Test report: HTMLTestReportCN (created and designed by netizens, the display is clear and beautiful)
Test sending test report: smtplib (email content format Settings), email (send and receive emails)
continuous integration: Jenkins (execute interface test scripts according to policies

Interface automation testing direction: Python+requests+pytest+yaml+alluer+Jenkins;
web automation testing direction: Python+selenium4+pytest+POM+allure+Jenkins;
app automation testing direction: Python+appium+POM+pytest+allure+Jenkins ;

The following is the most complete software test engineer learning knowledge architecture system diagram in 2023 that I compiled

1. From entry to mastery of Python programming

Please add a picture description

2. Interface automation project actual combat

Please add a picture description

3. Actual Combat of Web Automation Project

Please add a picture description

4. Actual Combat of App Automation Project

Please add a picture description

5. Resume of first-tier manufacturers

Please add a picture description

6. Test and develop DevOps system

Please add a picture description

7. Commonly used automated testing tools

Please add a picture description

Eight, JMeter performance test

Please add a picture description

9. Summary (little surprise at the end)

On the road of life, don't be afraid of difficulties and challenges, because only through wind and rain can you see the rainbow. Facing every opportunity bravely, persisting in struggle, believing in your own ability and potential, you will create your own glorious road!

Only by doing our best can we surpass our limits; only by persevering can we achieve a brilliant life. Believe in your dreams, work hard and sweat, and you will eventually find the light of success on the road of struggle.

Only by burning yourself can you light up the dreams of others; only by doing your best can you usher in a brilliant future; only by persevering can you surpass yourself. Struggle, let hard work be your motto!

Guess you like

Origin blog.csdn.net/csdnchengxi/article/details/131788671