Automated testing method, device, equipment and storage medium

By selecting components from the preset basic component library for automated test case configuration and debugging, the problems of inefficiency and high maintenance costs caused by manual writing in existing automation tests are solved, and efficient automated testing and unified testing and maintenance are achieved.

CN118519920BActive Publication Date: 2024-11-19中邮消费金融有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410995631.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-11-19
Estimated Expiration
2044-07-24

AI Technical Summary

Technical Problem

Existing automated testing methods rely on manual scripting, resulting in low testing efficiency, high maintenance costs, and the difference in technology stacks between development and testing increases communication costs.

Method used

When receiving a test task, select target components from the preset basic component library according to the task type, perform case configuration and debugging, generate target test cases, and perform automated tests based on the case, reducing the need for manual scripting.

Benefits of technology

It improves the efficiency of the generation of test cases, reduces the cost of testing, blocks the differences in automation capabilities between personnel, and allows everyone to write maintenance automation tests, reducing post-maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118519920B_ABST
    Figure CN118519920B_ABST
Patent Text Reader

Abstract

The present application discloses an automated testing method, device, equipment and storage medium, which relates to the field of automated testing technology, including: upon receiving a test task, determining the test case type according to the test task, the test case type including interface consistency case, interface case and scenario case; selecting a target component from a preset basic component library according to the test case type; configuring the case according to the target component and preset configuration information to obtain a configuration result; debugging the configuration result to obtain a target test case that has been successfully debugged; scheduling and configuring based on the target test case to perform automated testing. Since the present application selects a target component from a preset basic component library according to the test task for configuration and debugging to obtain a target test case, and performs automated testing based on the target test case, compared to the existing method of manually writing test scripts, the above method of the present application can improve the efficiency of test case generation and reduce testing costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automated testing technology, and in particular to automated testing methods, devices, equipment and storage media. Background Art

[0002] In the field of software testing, automated testing is a very important means to improve testing efficiency. However, conventional automated testing often relies on testers to manually write automated test scripts, which usually brings the following problems: First, manually writing automated scripts requires relatively high skills. When the team members' abilities are not up to par, automated testing falls on a few people who can write scripts, which can easily cause a bottleneck in human resources; second, if the automated scripts of each project team are maintained manually, it is difficult to reuse public methods. The same process may be written once for each project, and since the same project is maintained by multiple people, the writing style cannot be effectively unified. Over time, many redundant and invalid scripts will be generated, making maintenance increasingly difficult; third, since automated scripts are usually written by testers, when the test is shifted left, when the automated scripts are enabled for development use, due to the differences in the technology stack between development and testing, developers cannot know the specific execution logic of the scripts. When problems occur in the script execution, related tests are needed to help troubleshoot, which invisibly increases the communication cost. Summary of the invention

[0003] The main purpose of this application is to provide an automated testing method, device, equipment and storage medium, aiming to solve the technical problem that the existing automated testing scripts rely on manual writing, resulting in low automated testing efficiency.

[0004] To achieve the above objectives, the present application proposes an automated testing method, which includes:

[0005] When receiving a test task, determining a test case type according to the test task, the test case type including an interface consistency case, an interface case, and a scenario case;

[0006] Selecting a target component from a preset basic component library according to the test case type;

[0007] Perform case configuration according to the target component and preset configuration information to obtain a configuration result;

[0008] Debugging the configuration result to obtain a target test case with successful debugging;

[0009] Scheduling configuration is performed based on the target test case to perform automated testing.

[0010] Optionally, the step of selecting a target component from a preset basic component library according to the test case type includes:

[0011] When the test case type is an interface consistency case;

[0012] Determine the interface verification rule corresponding to the test task;

[0013] Selecting a target component from a preset basic component library based on the interface verification rule;

[0014] and / or, when the test case type is an interface case;

[0015] Determine the key elements of the interface case corresponding to the test task, wherein the key elements of the interface case include preconditions, postconditions and assertion verification;

[0016] Selecting a target component from a preset basic component library based on the key elements of the interface case;

[0017] and / or, when the test case type is a scenario case;

[0018] Determine the test steps corresponding to the test task;

[0019] A target component is selected from a preset basic component library based on the test steps.

[0020] Optionally, before the step of determining the test case type according to the test task when the test task is received, the step includes:

[0021] When an interface change is detected, obtain interface change information;

[0022] Determining whether interface consistency case assembly is required based on the interface change information;

[0023] If interface consistency case assembly is required, an interface consistency case is generated according to the interface change information;

[0024] Determine whether the interface is a web interface;

[0025] If the interface is a web interface, the interface is authenticated based on the interface consistency case.

[0026] Optionally, the step of determining whether interface consistency case assembly is required based on the interface change information includes:

[0027] Determine interface change content according to the interface change information;

[0028] When the interface change content is a substantial content change, determine whether there is version information of the interface in redis;

[0029] If it exists, determine whether interface consistency case assembly is required based on the version information and Kafka message update time.

[0030] Optionally, the step of performing case configuration according to the target component and preset configuration information to obtain a configuration result includes:

[0031] Perform application address configuration, database configuration, and middleware configuration according to the target component and preset configuration information to obtain a configuration result;

[0032] The application address configuration includes IP, port, domain name and application context address configuration, the database configuration includes database address configuration, and the middleware configuration includes component environment cluster address configuration.

[0033] Optionally, the step of performing scheduling configuration based on the target test case includes:

[0034] Determine the test tasks, test scope and test results of the target test case;

[0035] Performing preliminary scheduling configuration on the target test case based on the test task, the test scope and the test result to obtain a preliminary scheduling configuration result;

[0036] The scheduling execution is performed based on the preliminary scheduling configuration result, and the scheduling execution includes task execution and task execution record viewing.

[0037] Optionally, before the step of determining the test case type according to the test task when the test task is received, the method further includes:

[0038] Pull the automation script code and determine the code structure of the target layer in the automation script code, wherein the target layer includes the api layer, the commonTools layer, the TestCase layer and the TestSecene layer;

[0039] Analyze the code content in the target layer to obtain analysis results;

[0040] A preset basic component library is constructed according to the analysis results.

[0041] In addition, to achieve the above objectives, the present application also proposes an automated testing device, the automated testing device comprising:

[0042] A receiving module, configured to determine a test case type according to a test task when receiving the test task, wherein the test case type includes an interface consistency case, an interface case, and a scenario case;

[0043] A selection module, used to select a target component from a preset basic component library according to the test case type;

[0044] A configuration module, used to perform case configuration according to the target component and preset configuration information to obtain a configuration result;

[0045] A debugging module, used to debug the configuration result and obtain a target test case with successful debugging;

[0046] The test module is used to perform scheduling configuration based on the target test case to perform automated testing.

[0047] In addition, to achieve the above objectives, the present application also proposes an automated testing device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the automated testing method described above.

[0048] In addition, to achieve the above objectives, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the automated testing method described above are implemented.

[0049] When receiving a test task, the present application determines the test case type according to the test task, and the test case types include interface consistency cases, interface cases, and scenario cases; selects a target component from a preset basic component library according to the test case type; performs case configuration according to the target component and preset configuration information to obtain a configuration result; debugs the configuration result to obtain a successfully debugged target test case; and performs scheduling configuration based on the target test case to perform automated testing. Since the present application selects a target component from a preset basic component library according to the test task for configuration and debugging to obtain a target test case, and performs automated testing based on the target test case, compared to the existing method of manually writing test scripts, the above method of the present application can improve the efficiency of test case generation and reduce testing costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0051] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0052] Figure 1 A flowchart of the first embodiment of the automated testing method of the present application is provided;

[0053] Figure 2 A schematic diagram of component packaging provided in Example 1 of the automated testing method of this application;

[0054] Figure 3 The overall flow chart provided for the first embodiment of the automated testing method of the present application;

[0055] Figure 4 A schematic diagram of the process flow provided for the second embodiment of the automated testing method of the present application;

[0056] Figure 5 A schematic diagram of case generation provided in Example 2 of the automated testing method of this application;

[0057] Figure 6 A case scheduling diagram provided for Example 2 of the automated testing method of this application;

[0058] Figure 7 The overall structural diagram provided for the second embodiment of the automated testing method of the present application;

[0059] Figure 8 This is a schematic diagram of the module structure of the automated testing device according to an embodiment of the present application;

[0060] Fig. 9 This is a schematic diagram of the device structure of the hardware operating environment involved in the automated testing method in the embodiment of the present application.

[0061] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0062] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0063] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0064] The main solution of the embodiment of the present application is: when a test task is received, the test case type is determined according to the test task, and the test case type includes interface consistency case, interface case and scenario case; according to the test case type, a target component is selected from a preset basic component library; according to the target component and preset configuration information, the case is configured to obtain a configuration result; the configuration result is debugged to obtain a target test case that has been debugged successfully; and scheduling configuration is performed based on the target test case to perform automated testing.

[0065] Since this application selects target components from a preset basic component library for configuration and debugging according to the test task, obtains target test cases, and performs automated testing based on the target test cases, compared with the existing method of manually writing test scripts, the above method of this application can improve the efficiency of test case generation and reduce testing costs.

[0066] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, an automated testing device, etc. The following takes the automated testing device as an example to illustrate this embodiment and the following embodiments.

[0067] Based on this, the present application embodiment provides an automated testing method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the automated testing method of the present application.

[0068] In this embodiment, the automated testing method includes steps S10 to S40:

[0069] Step S10, when receiving a test task, determining a test case type according to the test task, wherein the test case type includes an interface consistency case, an interface case, and a scenario case;

[0070] It should be noted that the test tasks may include interface consistency test tasks, tasks for testing the logical correctness of a single interface, and test tasks for testing the accuracy of data interaction between multiple interfaces and business processes. They correspond to interface consistency cases, interface cases, and scenario cases in the test case types, respectively. Specifically, interface consistency cases can also be called case automatic generation, which can be automatically generated according to the definition of the interface, and are used to verify the consistency of relevant fields and names in the interface, reducing the workload of manual maintenance. The interface case is a single interface case, and the test object is a single interface, focusing on the accuracy verification of the logic of a single interface. The test object of the scenario case includes multiple interfaces, focusing on the accuracy of the interaction between various systems in the entire business process. For example, when testing whether the naming of the fields complies with the rules when the interface is generated, an interface consistency case test task is generated. If the accuracy of the logic in the interface needs to be verified, an interface case is generated. If multiple interfaces and the accuracy of data interaction in the business system need to be tested, a scenario case is generated for testing.

[0071] Step S20, selecting a target component from a preset basic component library according to the test case type;

[0072] It should be noted that the preset basic component library can be a packaged component collection that can be used out of the box, and each component is an atomic operation in the test case. Users can realize the automatic case generation of complex scenarios by various combinations of components in the preset basic component library. For example, an automation case can contain multiple test steps, and each test step can be a component in the component library. The components of the component library include interface components, database operation components, built-in scripts, custom scripts, public process components, logic control components, pre- / post-components, assertion components, log components, variable definition components, and variable extraction components. After componentization and encapsulation, users do not need to pay too much attention to how to implement the bottom layer of the automation case, but only need to pay attention to the upper-level scenario design of the automation case. This can well shield the differences in automation capabilities between personnel, so that everyone can write and maintain automation cases.

[0073] It should be noted that the selecting of target components from the preset basic component library according to the test case type may be to determine the test requirements according to the test case type and the test task, and select relevant target components from the preset basic component library according to the test requirements. For example, corresponding preconditions, postconditions, assertion checks and other components are selected according to the test requirements.

[0074] Further, in order to improve the efficiency of automated testing, the step S20 may include: when the test case type is an interface consistency case;

[0075] Determine the interface verification rule corresponding to the test task;

[0076] Selecting a target component from a preset basic component library based on the interface verification rule;

[0077] and / or, when the test case type is an interface case;

[0078] Determine the key elements of the interface case corresponding to the test task, wherein the key elements of the interface case include preconditions, postconditions and assertion verification;

[0079] Selecting a target component from a preset basic component library based on the key elements of the interface case;

[0080] and / or, when the test case type is a scenario case;

[0081] Determine the test steps corresponding to the test task;

[0082] A target component is selected from a preset basic component library based on the test steps.

[0083] It should be noted that the interface verification rules may include: required field verification, field type verification, field length verification, enumeration field verification, special meaning field verification, parameter combination verification and other verification rules. These rules can be set by the user through a visual page. The user can set which type of rules to enable according to which type of rule cases the user expects to generate, and can select one or more rules at the same time to generate corresponding cases. The selection of target components from the preset basic component library based on the interface verification rules can be to select the verification components corresponding to the interface verification rules from the preset basic component library for interface consistency verification.

[0084] It should be noted that the key elements of the interface case include preconditions, postconditions and assertion checks. The preconditions are operations that need to be performed before initiating a test on a specific test object; the postconditions are operations that need to be performed after initiating a test on a specific test object; and the assertion check verifies whether specific conditions meet expectations after the test is executed. The selection of target components from the preset basic component library based on the key elements of the interface case can be to select components corresponding to the preconditions, the postconditions and the assertion check from the preset basic component library to complete the assembly of the case. In a specific implementation, the user can select the corresponding preconditions, postconditions and assertion check components from the preset basic component library by dragging and dropping on the visualization page to arrange and combine them.

[0085] It should be noted that the test object of scenario case assembly is a complete business process, the purpose of which is to verify whether the interaction between systems meets expectations. Scenario cases are usually composed of multiple test steps, each of which can be an interface, a common sub-process, or any component in the basic component library. The assembly of scenario cases is to select different components from the basic component library and arrange them so that they are executed in a certain order. The execution order here is crucial. Even if the selected components are the same, but the execution order is different, it also represents different scenario cases. Therefore, in the process of scenario case assembly, it is necessary to select the corresponding components according to the test steps and assemble them. In the specific implementation, you can intuitively see the components and execution order used by each scenario case through a friendly visualization page, and you can also flexibly adjust the components and execution order used by the scenario case by dragging and dropping. It is worth noting that the parameters between the components used in a complete scenario case can be passed down and shared. In this way, a complete business process can be connected in series.

[0086] Step S30, performing case configuration according to the target component and preset configuration information to obtain a configuration result;

[0087] It should be noted that the preset configuration information includes application address configuration, database configuration and middleware configuration. The application address configuration is to configure and maintain the IP, port, domain name and application context address of each environment application service; the database configuration is to configure and maintain the database address used by each system and environment. The database covers all database types used by the enterprise or system, including oracle, mysql, mariadb, hbase, as, pg, etc.; the middleware configuration includes the configuration of the cluster address of each environment of components such as kafka, redis and zookeeper. In order to reduce the workload of users to carry information from various systems and manually edit, the configuration service in this application is connected with the configuration center, CMDB, performance platform, sql platform, etc. Users only need to select the corresponding application code. This embodiment can automatically obtain the corresponding configuration information from each platform through the application code and integrate it to display it to the user, so as to realize automatic configuration maintenance.

[0088] The case configuration according to the target component and preset configuration information may be a related configuration according to the target component and pre-maintained application address, database and middleware configuration information.

[0089] Step S40, debugging the configuration result to obtain a successfully debugged target test case;

[0090] It should be noted that the debugging of the configuration result can be to determine the accuracy of the target component assembly. For the node or component with an error, an error log will be printed, and debugging will be performed according to the error information in the error log. If the debugging is unsuccessful, the developer can also be reminded to debug until the target test case with successful debugging is obtained. Specifically, the debugging of the configuration result in this embodiment includes two parts: debugging execution and debugging log. Debugging execution is to quickly initiate debugging execution after assembling the interface case or scenario case, that is, the configuration result, to confirm the case combination, that is, the accuracy of the configuration result. The debugging log is for each debugging execution, and a console window will pop up through friendly page interaction, and the debugging execution log will be printed in real time on the console. The log will print the request content, request address, and response content of each operation step of the case. If the flow of variables is involved, the flow change of the value of the variable during the execution of the entire case will also be printed at the same time. For the node with an error in execution, the error log will be printed and highlighted. When the same case is executed, a unified traceId will be generated in the print log to facilitate link tracking during problem troubleshooting. At the same time, users are supported to quickly locate specific logs through Linux commands on the interactive page.

[0091] Step S50, performing scheduling configuration based on the target test case to perform automated testing.

[0092] It should be noted that the scheduling configuration includes the test scope, test time, test triggering conditions, execution record viewing, etc. of the scheduling target test case. Automated testing is performed based on the above scheduling information.

[0093] Further, in order to improve the efficiency of automated testing, the step S50 may include: determining the test task, test scope and test result of the target test case;

[0094] Performing preliminary scheduling configuration on the target test case based on the test task, the test scope and the test result to obtain a preliminary scheduling configuration result;

[0095] The scheduling execution is performed based on the preliminary scheduling configuration result, and the scheduling execution includes task execution and task execution record viewing.

[0096] It should be noted that the test task can be set to set the execution mode of the task to be scheduled execution or manual triggering. If it is set to scheduled execution, the execution frequency and the specific execution cycle and time can be further set. At the same time, the test task setting also needs to specify the environment for task execution. A single environment or multiple environments can be set, wherein the task is an automated test task based on the target test case. The test scope specifies the scope of cases to be executed, and the cases here are the assembled target test cases. The test result is the way in which the test results are notified to the designated personnel after the automated test is executed. The notification method can be set to email or to be sent through software, and the notification personnel can also be set as needed. In short, the scheduling configuration in this embodiment can flexibly configure the task in what way, what frequency, and what time to execute which cases, and in what way to reach the relevant parties with the execution results.

[0097] It should be noted that the scheduling execution includes task execution and task execution record viewing. Task execution is to automatically trigger task execution according to the configuration in the scheduling configuration. During scheduling execution, if it is recognized that multiple scheduling configurations meet the triggering execution conditions at the same time, the task can be automatically scheduled to each machine for execution according to the current resource status of each execution machine. If the resources of each machine have reached a bottleneck at the current time, the task will be placed in waiting, and the task will be automatically triggered after the resources are relatively idle. Each time the scheduling execution is triggered, a task execution record will be generated. Through the task execution record, the user can view the task progress, status and execution log in real time. For tasks in execution, if the user recognizes that there is no need to continue execution, the task can be terminated in time; for tasks that fail to execute, the user can choose to re-run the failed cases in the task; for tasks that succeed, the user can view and download the test report of this execution.

[0098] Furthermore, in order to avoid repeated development of redundant code, component encapsulation is required. Therefore, before step S10, it also includes: pulling the automation script code and determining the code structure of the target layer in the automation script code, wherein the target layer includes the api layer, the commonTools layer, the TestCase layer and the TestSecene layer;

[0099] Analyze the code content in the target layer to obtain analysis results;

[0100] A preset basic component library is constructed according to the analysis results.

[0101] It should be noted that, please refer to Figure 2 , Figure 2Component encapsulation diagram provided for the first embodiment of the automated testing method of the present application; before performing component encapsulation, it is first necessary to identify what components there are. In this embodiment, a comprehensive analysis is performed on some historical manually maintained Python automation scripts to determine the components needed to meet daily automated testing. Specifically, the automation script code of each project group is first pulled from git, and the automation project code structure of each project group is analyzed, including the api layer, commonTools layer, TestCase layer, and TestSecene layer; further in-depth analysis is performed on the specific content of each layer. The api layer is an encapsulation of each interface operation. Therefore, it is obvious that the interface component is an indispensable component in the component library, and it is a minimum test object for automated testing; the commonTools layer is some basic tool classes, such as the encapsulation of database operations and public number-making methods. Through the analysis of this layer, it is found that different project groups write the same operation in their own project groups, resulting in a lot of code redundancy. In order to make public things reusable by each project group , and keep the writing consistent while supporting some personalized needs of each project group. Based on the analysis results, this embodiment provides database operation components (covering various types of databases), built-in script components (some commonly used basic methods), and custom script components (some personalized needs of each project group); the analysis of the TestCase layer and the automation scripts of each project group are based on the pytest framework. The setup and setdown operations of the pyest framework are basically used in the TestCase layer. At the same time, the most important thing in this layer is the verification of the expected results. Based on this, it is necessary to provide pre- / post-components and assertion components in this embodiment to ensure that some operations can be performed before and after the test case and verify whether the case execution results meet expectations; finally, to the TestSecene layer, this layer is mainly the encapsulation of the test scenario, which usually contains some complex business processes, and because multiple interfaces are connected in series, it also involves complex variable transfer and logical judgment. Based on the analysis of this layer, this embodiment provides public process components, logic control components, variable definition components, and variable extraction components. At the same time, in order to facilitate problem location and troubleshooting and unify log printing, this implementation has also made some expansions based on the conclusions after analyzing historical scripts, that is, adding log components. Therefore, according to the analysis conclusion, the basic component library finally includes interface components, database operation components, built-in scripts, custom scripts, public process components, logic control components, pre- / post-components, assertion components, log components, variable definition components, and variable extraction components. After determining the component category, it is time to encapsulate the logic of each component. The purpose of encapsulation is to avoid reinventing the wheel for each project team so that anyone can quickly get started and use it right away. The encapsulation logic of each component is as follows:

[0102] The interface component supports http, https, dubbo, and kafka. At the same time, for the kafka protocol, users can define whether they are producers or consumers according to their own needs. If they are producers, they can set producer parameters, such as the key value and timestamp of the produced message; if they are consumers, they can set consumer groups, consumption timeouts, offsets, maximum consumption quantities at one time, and end consumption assertions.

[0103] The database operation component supports operations on common database types, including oralce, mysql, mariadb, pg, hbase, and as. In addition, the data operation component supports users to customize DML statements according to their own needs. A database operation component can define multiple DML statements at the same time. Multiple statements are separated by ";". At the same time, variables can be used in DML statements. During the case execution process, the component will dynamically replace variables and execute DML statements in a loop according to the separator; further, the component also supports DML statements using database aggregate functions. For example, if the DML statement is a select statement, the component will assemble the results of the select statement into a list and return it. Users can use jsonpath to extract variables from the returned results for the next operation.

[0104] Built-in script components are some basic public scripts that are packaged and can be reused by various systems. The scripts are implemented in Python language, so users can use them immediately without having to reinvent the wheel for each user. The built-in scripts currently provided are divided into several categories: type conversion and calculation, basic tools, time and date processing, random data generation, basic information generation, and unified authentication login. Type conversion and calculation include calculations such as character conversion to integer, integer conversion to character conversion, addition, subtraction, multiplication, and division; basic tools include ssh host, redis operation, and log platform log capture; random data generation includes random string generation, random uuid generation, random string generation, and random serial number generation. Time and date processing includes generating the current date, converting the date into a timestamp, obtaining the date before / after N days, and date format processing; basic information generation is related to business transactions, such as generating ID numbers, generating names, generating email addresses and customer numbers, etc.; unified authentication login is a login script that encapsulates some web system login scripts, through which login tokens can be obtained to facilitate interface authentication verification during case assembly. The built-in script component library can be continuously enriched and expanded at any time according to user needs.

[0105] The custom script component is a script or packaged business component customized by the user according to his own needs. This component integrates the vscode online editor, and users can directly edit and debug online, saving the time of setting up a debugging environment locally.

[0106] The public process component is a sub-process that users have arranged and configured according to the characteristics of each system. It can be configured once and reused infinitely. The public process can be reused across systems. For example, the real-name authentication process arranged by the channel system can be directly reused by the approval system. Compared with the original method of writing automated scripts, it can avoid the same process and each system has to maintain a copy repeatedly. At the same time, due to the continuous iteration of requirements and multiple requirements in parallel, different requirements may handle the same public process differently. Therefore, the public process component introduces version control. The same public process can have multiple versions. Users can choose to use different versions according to their own needs, and can also view the change records of each version through the version history. In addition, when a user modifies a version of a public process, in order not to affect the normal operation of other cases that have introduced the public process component, the user can save it as a temporary version first, and then publish it as a formal version when the changes need to be synchronized to other cases that have introduced the process component. Each time a formal version is released, the version number will automatically change. For public process components, the front end provides a visualization page for users to filter queries in different dimensions and maintain and update public processes. Users can also use the query page to intuitively query how many cases have referenced a public process component. When the public process changes, an entry is provided for users to batch select which cases need to synchronize the changes.

[0107] The logic control component includes loop, conditional branch judgment, and waiting. Through the logic control component, the configuration of complex business scenarios can be realized. The loop supports while loop and for in loop. The while loop can set the number of loops, and the for in loop supports setting variables. Both loops can be additionally set, including interrupt conditions, errors, and continue settings. The interrupt condition is to end the loop when a specific condition is met. The interrupt condition expression supports equal, not equal, less than, less than or equal to, greater than, greater than or equal to, exists, does not exist, contains, does not contain, is empty, is not empty, regular matching, belongs to a set, does not belong to a set, is true, and is false; you can set how to deal with the loop when an error occurs during the loop processing. You can choose to end the loop, ignore the error, end the run, or jump to the next loop; the continue is to jump out of the current loop and directly proceed to the next loop when a specific condition is met. Multiple continues can be set in one loop setting. The conditional branch judgment supports if, elif, and else settings. When setting the conditional branch, you can only set the if condition, and elif and else must be used in conjunction with the if condition. Through the conditional branch setting, the test case can execute different test steps when different conditions are met, such as executing test step A when the if condition is met, executing test step B when the elif condition is met, and executing test step C when the else condition is met. Whether it is an if condition, an elif condition, or an else condition, variables are supported in the condition, and complex conditional expressions are also supported. Waiting refers to how long you need to wait before executing the next test step after the previous test step is executed. For example, the total execution time of the previous test step is 10s, and the next test step needs to depend on the execution result of the previous test step, then you can set a wait between the two test steps.

[0108] Pre-condition / post-condition components are mainly applicable to the combination of interface cases, which represent the operations that need to be performed before / after an interface request is initiated. Interface components, built-in script components, custom script components, variable extraction components, variable definition components, and database operation components can be nested in pre-condition / post-condition components. An automation case can reference multiple different pre-condition / post-condition conditions at the same time.

[0109] The assertion component verifies the expected result. It supports the verification of variables, response bodies, response time, database data, and kafka data. The expressions of all types of verification support equal, not equal, less than, less than or equal to, greater than, greater than or equal to, exists, does not exist, contains, does not contain, is empty, is not empty, regular match, belongs to a set, does not belong to a set, is true, and is false. For variable verification, the relevant variables must have been defined before the assertion verification. If the value of the relevant variable is a complex data type, such as json messages and arrays, you can use jsonpath expressions or regular expressions for further extraction to do the final verification. For response body verification, you can verify the entire response body or a field in the response body. The response body format supports text, json, and xml. For response messages in json format, you can use jsonPath to extract certain fields for verification; for xml, you can use xpath to extract a certain field for verification; for response bodies in text format, you can use regular expressions to extract specific content for verification. For response time verification, it is usually necessary to set the time within which an interface request is executed and the response result is returned. In performance testing, response time is usually of great concern. For database data verification, user-defined dml statements are dynamically executed. For database operations of assertion components, dml statements here are usually select statements. After the corresponding statements are executed, the specified content is obtained from the execution result to determine whether the expected value is met. For Kafka data verification, it is necessary to set the monitoring of data in a topic and verify whether the monitored data meets the preset value. Kafka data verification requires the setting of consumption parameters, such as consumption timeout, consumption offset, and consumption topic name.

[0110] The log component supports user-defined log output. The default level of customized log output is info level and supports customized log using variables. When the automation case is executed, the log component will dynamically replace the variables. Customized log output facilitates users to better locate problems when debugging and executing test cases.

[0111] The variable definition component supports users to define a constant (the constant can be a string or a file) as a variable. All operations after the variable is defined can use the variable. The advantage of this approach is that when the value of the variable needs to change, you only need to modify the value when the variable is defined, which is easy to maintain and manage.

[0112] The variable extraction component supports users to extract specific content into a temporary variable or global variable through jsonpath, xpath or regular expression for subsequent operations. The variable extraction component can be nested in the interface component, database operation component and assertion component. The variable extraction component actually defines a variable, but the value of the variable is dynamic and depends on the content of the variable extraction object.

[0113] In the specific implementation, please refer to Figure 3 , Figure 3The overall flow chart provided for the first embodiment of the automated testing method of this application; the case assembly service of this embodiment includes automatic case generation (i.e., interface consistency case generation), interface case assembly (i.e., interface case), scenario case assembly, and case debugging. The automatic case generation is to automatically generate interface verification cases based on interface definitions and based on some preset case generation rules to reduce the workload of manual maintenance. Users can also perform secondary arrangement based on the generated cases, that is, generate interface cases based on existing interface consistency cases, and further generate scenario cases; the interface case assembly and scenario case assembly, the entire case assembly process is to arrange and combine the components in the preset basic component library. In order to facilitate users to see the arrangement process of the entire case more intuitively, this embodiment provides a friendly front-end interactive page, so that users can directly arrange and combine by dragging and dropping the page and building blocks. For interface cases, a complete automation case may include preconditions, interfaces (test objects of corresponding interface cases), postconditions, and assertion verification. Preconditions, postconditions, and assertion verification can be dragged from precondition / postcondition components and assertion verification components. The preconditions of an interface case can drag multiple precondition components, multiple postcondition components, and multiple assertion verification components. Of course, for interface cases, preconditions and postconditions are not necessary, which depends on the complexity of the corresponding interface cases, but interfaces and assertion verification are necessary. Interfaces are the basic test objects of interface cases, and assertions are the basic conditions for judging whether the case is valid. For scenario cases, they are composed of one or more test steps. A test step represents a component in the basic component library. Like interface cases, you can also drag the corresponding components from the basic component library to the scenario case by dragging and dropping for arrangement and combination. It is worth noting that the order of test steps is crucial for scenario cases. Even if the same components are selected, if the order of arrangement and combination is different, the final presentation effect will be completely different. After case assembly (i.e., component selection, assembly, and case configuration), case debugging can be quickly initiated through page interaction. Case debugging includes debugging execution and debugging log. During debugging execution, the scheduling execution of the automated execution scheduling service will be called. Unlike the scheduling configuration execution of the automated execution scheduling service, which uses asynchronous kakfa and batch execution, case debugging is called by synchronously requesting http, and is a single case execution. After the call, it will synchronously wait for the execution result, and display the debugging result to the user through page interaction. For each debugging, a debugging log file of the person + case will be generated and stored on the server. If the same person debugs the same case multiple times, only the latest debugging log will be stored. The logs of different people debugging the same case will not interfere with each other. The front-end interactive page reads the log file through the websocket connection and displays it to the user. The abnormal logs will be highlighted to facilitate users to quickly locate the problem.

[0114] When receiving a test task, this embodiment determines the test case type according to the test task, and the test case types include interface consistency cases, interface cases, and scenario cases; selects a target component from a preset basic component library according to the test case type; performs case configuration according to the target component and preset configuration information to obtain a configuration result; debugs the configuration result to obtain a target test case that has been successfully debugged; and performs scheduling configuration based on the target test case to perform automated testing. Since this embodiment selects a target component from a preset basic component library according to the test task for configuration and debugging to obtain a target test case, and performs automated testing based on the target test case, compared to the existing method of manually writing test scripts, the above method of this embodiment can improve the efficiency of test case generation and reduce testing costs.

[0115] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 4 , before step S10, the method further includes the following steps:

[0116] Step S001: when an interface change is detected, interface change information is obtained, and based on the interface change information, it is determined whether interface consistency case assembly is required;

[0117] It should be noted that the detection of interface changes may be the detection of a new interface or a change in an existing interface. The interface change information may be the content of the interface change, such as the interface name, interface annotation, and substantial structural content in the interface. The determination of whether interface consistency case assembly is required may be the determination of whether the interface change information involves a substantial change in the interface, such as whether the interface message structure is changed. If only the interface name, annotation, etc. are changed, there is no need to perform interface consistency case assembly.

[0118] Step S002: if interface consistency case assembly is required, an interface consistency case is generated according to the interface change information;

[0119] It should be noted that the generating of the interface consistency case according to the interface change information may be generating the interface consistency case corresponding to the changed interface according to the interface change information, and the details may refer to the interface consistency case generating step in the above embodiment.

[0120] Step S003: Determine whether the interface is a web-side interface. If the interface is a web-side interface, perform authentication verification on the interface based on the interface consistency case.

[0121] It should be noted that if the corresponding interface is marked as a web interface, since these interfaces will have authentication verification, the prerequisite component of the basic component library needs to be called in the automatically generated case to obtain the login cookie of the corresponding system.

[0122] In the specific implementation, please refer to Figure 5 , Figure 5It is a schematic diagram for case generation provided in the second embodiment of the automated test method of this application; first, listen for interface change messages on the interface management platform, and judge the integrity of the interface message structure in the interface change message. If the integrity of the interface message structure is complete, that is, only formal content such as the interface name and annotation is changed, then discard the corresponding message without processing. If the integrity of the interface message structure is incomplete, that is, the interface message structure is changed, judge whether there is a record of this interface and this version in redis according to the interface id and interface version. If it exists, compare the update time of the record in redis with the update time of the current kafka message, where the historical generated interface consistency cases are cached in redis. If the time in redis >= the time in the kafka message, then this message is discarded without processing, that is, it is determined that there are existing interface consistency cases and no need to regenerate; if the time in redis < the time in the kafka message, then update the time in redis to the time in the kafka message body. If there is no record of this interface and this version, add a new record to redis, with the key being the interface id # interface version and the value being the interface update time; then, according to different interface types, call the interface components in the basic component library to assemble the interface message. It should be noted that if the corresponding interface is marked as a web - end interface, since there will be authentication verification for these interfaces, the pre - condition components in the basic component library need to be called in the automatically generated cases to obtain the login cookie of the corresponding system. At the same time, when assembling the message and filling in test data, the built - in script components in the basic component library will be called to generate test data; finally, match the enabled rules in the case generation rule library, and loop to generate cases corresponding to the rules until all enabled rules are covered. The more enabled rules there are, the more cases will be automatically generated. After the cases are generated, they will be notified to the corresponding users through instant messaging tools such as email, and a visualization page will be provided to display the automatically generated cases. Users can re - arrange the generated cases through the interface case assembly or scenario case assembly module. During the automatic case generation process, the case generation rules are crucial. The current detailed case generation rules are as follows: (1) Mandatory field verification: The mandatory field is not passed, the mandatory field is passed as "", the mandatory field is passed as null, and the normal value is passed. (2) Field type verification: Currently, the basic field types defined by the interface platform are string, integer, and boolean. For the string type: pass integer or boolean, pass the normal string type; for the integer type: pass string or boolean, pass the normal integer; for the boolean type: pass string or integer, pass the wrong boolean value, pass the normal true, false.(3) Field length check: For maximum length, the transmitted field is greater than the length limit +1; for fixed length, the transmitted length is greater than the fixed length -1; greater than the fixed length +1, the transmitted length is the normal length. (4) Enumeration field check: normal enumeration (covering all enumeration values), abnormal enumeration. (5) Verification of fields with special meanings: The generation rules vary according to the meanings of different fields. Currently, based on the analysis of various system interfaces, some common fields with special meanings that affect the interface logic mainly include the following: Email field: transmit values ​​that are not in email format; Phone number; Mobile phone: transmit non-11-digit phone number, transmit number format is incorrect (such as mixed letters); Landline: transmit only phone number, transmit area code-phone number, transmit area code+phone number, transmit format is incorrect; Time-related fields: do not conform to the time format, incorrect time (such as 20220230); Amount-related fields: transmit 0, transmit negative numbers, transmit amounts greater than 2000000, transmit normal amounts; ID number: transmit 18-digit ID number, transmit 15-digit ID number, transmit ID number with the last digit as a letter (uppercase and lowercase), transmit ID number that does not conform to the ID format; Address / name / Chinese related fields: the address contains special characters such as #¥&%, character encoding utf-8 / gbk, etc. (6) Parameter combination check: For most interfaces, both mandatory and non-mandatory parameters are included. Parameter combination cases mainly include mandatory fields and multiple non-mandatory fields. Here, the mandatory parameters can be regarded as a whole (because they are mandatory), so the combination rules can be mandatory + 1 non-mandatory, mandatory + 2 non-mandatory, and so on, until all non-mandatory fields are covered. If there are 4 non-mandatory fields, then combine them.

[0123] In the specific implementation, please refer to Figure 6 , Figure 6A case scheduling diagram provided for the second embodiment of the automated testing method of the present application; in this implementation, the scheduling configuration of the target test case is performed based on the automated execution scheduling service, and the automated execution scheduling service includes scheduling configuration and scheduling execution. The scheduling configuration includes test task settings, test scope settings, and test result settings, and the scheduling execution includes task execution and task execution records. The specific processing logic of the automated execution scheduling service is as follows: According to the test task settings in the scheduling configuration, determine whether the task is a manually triggered task or a timed triggered task. For manually triggered tasks, when the user triggers, the execution environment in the test task settings and the automated cases in the test scope settings are obtained, and they are assembled into a kafka message and delivered to the task execution module; for timed triggered tasks, after the user configures the task, the scheduling configuration module in the automated execution scheduling service will automatically start a timed task to poll whether the task triggering conditions are currently met. If so, the kafka message is also assembled and delivered to the task execution module. After the task execution module listens to the message of related task execution, it enters the task execution logic. First, it determines whether the automation case to be executed is an interface case or a scenario case. If it is an interface case, it determines whether the interface case has a referenced precondition component. If so, the relevant precondition component is called to perform pre-operation processing; if not, the request address, request message and request header of the interface corresponding to the interface case are assembled, and the corresponding interface component is called according to the interface protocol to initiate the interface request; then it is determined whether the interface case has a referenced postcondition component. If so, the relevant postcondition component is called to perform post-operation processing; if not, it is further determined whether the interface case has a referenced assertion verification component; if it is determined that the assertion component is referenced, the relevant assertion component is called for assertion verification; if it is determined that the assertion component is not referenced, the execution of the entire interface case ends; if it is a scenario case, it is executed in sequence according to the test steps set in the scenario case. Which component is referenced in the step will be called for processing. If the interface component is referenced, the interface component is called to process a certain interface operation. Whether it is an interface case or a scenario case, if a global variable is defined through a variable definition component, the global variable will be initialized at the entry of the task execution, and during the execution process, the execution log will be written to the log file while executing, so that users can view the execution log in real time on the front-end page. Since in the actual testing process, the same automation case is usually executed by multiple people at the same time, in order to avoid interference from each other's execution logs when multiple people execute, the log file is case + person + execution dimension, so that everyone sees the execution log of their own execution. In order to ensure the efficiency of task execution, the task execution module is deployed on multiple nodes, and nodes can be expanded at any time as needed.It should be noted that for each task execution, the task execution module will generate a task execution record and provide an interactive page for users to query. Through the task execution record, users can intuitively see the execution status, execution progress and execution log of the current task. For successfully executed tasks, they can view and download test reports; for failed tasks, users can choose to re-run the failed cases; for tasks in progress, they can directly terminate the task through page operations.

[0124] In order to solve the problems of low efficiency, high maintenance cost, and high skill requirements for personnel caused by the traditional manual writing of automation scripts, this embodiment provides a component-based automation test device, which encapsulates each atomic operation of the automation case into components, and provides a friendly visual page to the user. The components are flexibly combined and arranged by dragging and dropping to achieve automation of complex scenarios, thereby effectively shielding the ability differences between personnel, so that everyone can participate in automation maintenance, and human resources are no longer the bottleneck of automation testing, which can greatly improve the output and coverage of automation testing. In addition, the automation case structure generated by this embodiment is highly unified and highly readable, and invalid and redundant cases can be quickly identified, which can significantly reduce the cost of later maintenance.

[0125] In the specific implementation, please refer to Figure 7 , Figure 7The overall structural diagram provided for the second embodiment of the automated testing method of this application; this embodiment includes a basic component library, a configuration service, a case assembly service and an automated execution scheduling service; the basic component library is a packaged component collection that can be used immediately, and each component is an atomic operation in a complete test case; the configuration service includes application address configuration, database configuration, and middleware configuration, and the application address configuration is the service IP port and domain name configuration for each application and each environment; the database configuration is the database address configuration used by each system and each environment; the middleware configuration is the middleware cluster address configuration for each environment; the case assembly service includes single interface case assembly, scenario case assembly and case debugging, and the test object of the single interface case assembly is a single interface, focusing on the accuracy verification of the single interface logic; the test object of the scenario case assembly is to include multiple interfaces, focusing on the accuracy of the interaction of each system in the entire business process. The case debugging is to quickly initiate debugging execution after the case is assembled and arranged to confirm the accuracy of the case combination; the automated execution scheduling service includes scheduling configuration and scheduling execution, and the scheduling configuration includes the configuration of execution scope, execution time, execution frequency, execution environment and execution result notification, and users can flexibly configure according to their own needs. The scheduling execution is distributed according to the scheduling configuration and the resource situation of the execution machine. After execution, the corresponding test report is generated, and the report is pushed to the user according to the result notification configuration of the scheduling configuration. This embodiment uses a componentized approach to transform the original method of maintaining automation by manually writing scripts into a method of combining components by dragging and dropping on the page to achieve automation, thereby shielding the skill differences between personnel, so that everyone can participate in the maintenance of automation and improve the output of automated testing. At the same time, the automation case structures generated in this way are highly unified and are all described in natural language, which greatly improves the readability and maintainability of the automation case, and can significantly reduce the later maintenance costs of the automation case.

[0126] This application also provides an automated testing device, please refer to Figure 8 , the automated testing device comprises:

[0127] The receiving module 10 is used to determine the test case type according to the test task when receiving the test task, and the test case type includes an interface consistency case, an interface case and a scenario case;

[0128] A selection module 20, used to select a target component from a preset basic component library according to the test case type;

[0129] A configuration module 30, configured to perform case configuration according to the target component and preset configuration information to obtain a configuration result;

[0130] A debugging module 40, used to debug the configuration result to obtain a target test case that is successfully debugged;

[0131] The testing module 50 is used to perform scheduling configuration based on the target test case to perform automated testing.

[0132] When receiving a test task, this embodiment determines the test case type according to the test task, and the test case types include interface consistency cases, interface cases, and scenario cases; selects a target component from a preset basic component library according to the test case type; performs case configuration according to the target component and preset configuration information to obtain a configuration result; debugs the configuration result to obtain a target test case that has been successfully debugged; and performs scheduling configuration based on the target test case to perform automated testing. Since this embodiment selects a target component from a preset basic component library according to the test task for configuration and debugging to obtain a target test case, and performs automated testing based on the target test case, compared to the existing method of manually writing test scripts, the above method of this embodiment can improve the efficiency of test case generation and reduce testing costs.

[0133] The automated testing device provided by the present application adopts the automated testing method in the above embodiment, which can solve the technical problem that the existing automated testing scripts rely on manual writing, resulting in low efficiency of automated testing. Compared with the prior art, the beneficial effects of the automated testing device provided by the present application are the same as the beneficial effects of the automated testing method provided by the above embodiment, and the other technical features in the automated testing device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0134] The present application provides an automated testing device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the automated testing method in the above-mentioned embodiment one.

[0135] Reference below Fig. 9, which shows a schematic diagram of the structure of the automated test equipment suitable for implementing the embodiment of the present application. The automated test equipment in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The automated testing equipment shown is merely an example and should not impose any limitation on the functions and scope of use of the embodiments of the present application.

[0136] like Fig. 9 As shown, the automated test equipment may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the automated test equipment are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the automated test equipment to communicate with other equipment wirelessly or by wire to exchange data. Although the figure shows an automated test equipment with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0137] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0138] The automated testing device provided by the present application adopts the automated testing method in the above embodiment, which can solve the technical problem that the existing automated testing scripts rely on manual writing, resulting in low efficiency of automated testing. Compared with the prior art, the beneficial effects of the automated testing device provided by the present application are the same as the beneficial effects of the automated testing method provided by the above embodiment, and the other technical features in the automated testing device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0139] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0140] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0141] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the automated testing method in the above-mentioned embodiment.

[0142] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0143] The computer-readable storage medium may be included in the automated testing equipment; or may exist independently without being assembled into the automated testing equipment.

[0144] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the automated testing equipment, the automated testing equipment executes the automated testing method.

[0145] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0146] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0147] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0148] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned automated testing method, and can solve the technical problem that the existing automated testing scripts rely on manual writing, resulting in low efficiency of automated testing. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the automated testing method provided by the above-mentioned embodiment, and will not be elaborated here.

[0149] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. An automated testing method, characterized in that: The automated testing method comprises the following steps: When receiving a test task, determining a test case type according to the test task, the test case type including an interface consistency case, an interface case, and a scenario case; Selecting a target component from a preset basic component library according to the test case type; Perform case configuration according to the target component and preset configuration information to obtain a configuration result; Debugging the configuration result to obtain a target test case with successful debugging; Performing scheduling configuration based on the target test case to perform automated testing; The step of selecting a target component from a preset basic component library according to the test case type includes: When the test case type is an interface consistency case; Determine the interface verification rule corresponding to the test task; Selecting a target component from a preset basic component library based on the interface verification rule; and / or, when the test case type is an interface case; Determine the key elements of the interface case corresponding to the test task, wherein the key elements of the interface case include preconditions, postconditions and assertion verification; Selecting a target component from a preset basic component library based on the key elements of the interface case; and / or, when the test case type is a scenario case; Determine the test steps corresponding to the test task; Selecting a target component from a preset basic component library based on the test steps; The preset basic component library includes interface components, database operation components, built-in scripts, custom scripts, public process components, logic control components, pre- / post-components, assertion components, log components, variable definition components and variable extraction components; Before the step of determining the test case type according to the test task when the test task is received, the method further includes: Pull the automation script code and determine the code structure of the target layer in the automation script code, wherein the target layer includes the api layer, the commonTools layer, the TestCase layer and the TestSecene layer; Analyze the code content in the target layer to obtain analysis results; A preset basic component library is constructed according to the analysis results.

2. The automated testing method according to claim 1, wherein: Before the step of determining the test case type according to the test task when receiving the test task, the method includes: When an interface change is detected, obtain interface change information; Determining whether interface consistency case assembly is required based on the interface change information; If interface consistency case assembly is required, an interface consistency case is generated according to the interface change information; Determine whether the interface is a web interface; If the interface is a web interface, the interface is authenticated based on the interface consistency case.

3. The automated testing method according to claim 2, wherein: The step of judging whether interface consistency case assembly is required based on the interface change information includes: Determine interface change content according to the interface change information; When the interface change content is a substantial content change, determine whether there is version information of the interface in redis; If it exists, determine whether interface consistency case assembly is required based on the version information and Kafka message update time.

4. The automated testing method according to claim 1, wherein: The step of performing case configuration according to the target component and the preset configuration information to obtain a configuration result includes: Perform application address configuration, database configuration, and middleware configuration according to the target component and preset configuration information to obtain a configuration result; The application address configuration includes IP, port, domain name and application context address configuration, the database configuration includes database address configuration, and the middleware configuration includes component environment cluster address configuration.

5. The automated testing method according to any one of claims 1 to 4, characterized in that: The step of performing scheduling configuration based on the target test case includes: Determine the test tasks, test scope and test results of the target test case; Performing preliminary scheduling configuration on the target test case based on the test task, the test scope and the test result to obtain a preliminary scheduling configuration result; The scheduling execution is performed based on the preliminary scheduling configuration result, and the scheduling execution includes task execution and task execution record viewing.

6. An automated testing device, characterized in that: The automated testing device is applied to the automated testing method according to any one of claims 1 to 5, and the automated testing device comprises: A receiving module, configured to determine a test case type according to a test task when receiving the test task, wherein the test case type includes an interface consistency case, an interface case, and a scenario case; A selection module, used to select a target component from a preset basic component library according to the test case type; A configuration module, used to perform case configuration according to the target component and preset configuration information to obtain a configuration result; A debugging module, used to debug the configuration result and obtain a target test case with successful debugging; The test module is used to perform scheduling configuration based on the target test case to perform automated testing.

7. An automated testing device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the automated testing method according to any one of claims 1 to 5.

8. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the automated testing method according to any one of claims 1 to 5 are implemented.