Automatic testing method, device and equipment and computer readable storage medium

By converting test cases into activity list arrays and combining them into function execution flows, combined with multi-process execution, the time-consuming and error-prone problems of traditional software testing are solved, and efficient automated testing is achieved.

CN120653538APending Publication Date: 2025-09-16BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410263854.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-07
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

Traditional software testing methods require manual modification of test execution scripts, which is time-consuming and error-prone, and cannot efficiently adapt to parameter modifications and automated testing.

Method used

Convert the test case into an activity list array, obtain the preset execution script that matches it, combine it into a function execution flow according to the test order, and execute the test task through multiple processes. Monitor the success or failure of the script and generate alarm information.

Benefits of technology

It realizes automated testing, improves testing efficiency and consistency, reduces manual intervention and errors, and enhances testing flexibility and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120653538A_ABST
    Figure CN120653538A_ABST
Patent Text Reader

Abstract

The invention relates to an automatic testing method, device and equipment and a computer readable storage medium. The method comprises the steps that a test case is converted into an activity list array; obtaining a plurality of preset execution scripts matched with the activity list array; combining the plurality of preset execution scripts into a function execution stream according to a test sequence of the test case; and executing a test task corresponding to the test case through the function execution flow. According to the method, automatic writing of the function execution flow is completed through matching of the test cases and the preset execution scripts and sequential combination of the multiple preset execution scripts, so that automatic testing is achieved, and the testing efficiency and consistency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of software testing technology, and in particular to an automated testing method, apparatus, device, and computer-readable storage medium. Background Art

[0002] Cloud-hyperviso is an open-source virtual machine manager (VMM) built on the Rust programming language, focused on supporting modern cloud workloads. Libvirt is a unified, stable, and open virtual machine management solution that provides management of various virtual machine devices and related interfaces in C, Python, and other languages.

[0003] Cloud-hypervisor and Libvirt have completed their phased development phase and now require the design and execution of automated software testing to verify the functionality and stability of the software. Traditional software testing methods require manual execution, where test scripts are written for specific test scenarios.

[0004] However, if some parameters in a test task need to be modified, the source code parameters in the test execution script need to be modified for the modified test task, and the test execution script needs to be rewritten, which is time-consuming and error-prone. Summary of the Invention

[0005] In order to solve the above technical problems, the present disclosure provides an automated testing method, apparatus, device and computer-readable storage medium to improve testing efficiency and consistency.

[0006] In a first aspect, an embodiment of the present disclosure provides an automated testing method, comprising:

[0007] Convert test cases into an array of activity lists;

[0008] Obtaining multiple preset execution scripts that match the activity list array;

[0009] Combining the plurality of preset execution scripts into a function execution flow according to the test order of the test case;

[0010] The test task corresponding to the test case is executed through the function execution flow.

[0011] In some embodiments, converting the test case into an activity list array includes:

[0012] Parsing the test case to obtain multiple test items in the test case;

[0013] Convert each of the test items into an element to obtain a plurality of active elements;

[0014] The multiple activity elements are organized into an activity list array according to the test order.

[0015] In some embodiments, obtaining a plurality of preset execution scripts that match the activity list array includes:

[0016] For each of the test items, based on the name of the test item and the names of multiple candidate execution scripts, at least one preset execution script that matches the test item is determined from the multiple candidate execution scripts, and the name of the test item and the name of the preset execution script contain the same function name.

[0017] In some embodiments, when the function execution flow needs to be executed N times in a loop, executing the test task corresponding to the test case through the function execution flow includes:

[0018] Create N processes, each of which is used to execute the function execution flow once, where N is a positive integer;

[0019] The function execution flow is executed simultaneously by the N processes to complete the test task.

[0020] In some embodiments, executing the test task corresponding to the test case through the function execution flow includes:

[0021] Monitor whether each preset execution script in the function execution flow runs successfully;

[0022] If each preset execution script in the function execution flow runs successfully, it is determined that the test task is executed successfully.

[0023] In some embodiments, monitoring whether each preset execution script in the function execution flow is successfully executed includes:

[0024] Monitor whether the interface corresponding to each preset execution script is called successfully;

[0025] Monitor whether the return value obtained by each preset execution script is correct.

[0026] In some embodiments, the method further comprises:

[0027] When there is a preset execution script that fails to run in the function execution flow, an alarm message is generated.

[0028] In a second aspect, an embodiment of the present disclosure provides an automated testing device, comprising:

[0029] The conversion module is used to convert the test case into an array of activity lists;

[0030] An acquisition module, configured to acquire a plurality of preset execution scripts matching the activity list array;

[0031] A combining module, configured to combine the plurality of preset execution scripts into a function execution flow according to the test order of the test case;

[0032] An execution module is used to execute the test task corresponding to the test case through the function execution flow.

[0033] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:

[0034] Memory;

[0035] processor; and

[0036] computer programs;

[0037] The computer program is stored in the memory and is configured to be executed by the processor to implement the method as described in the first aspect.

[0038] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the method described in the first aspect.

[0039] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the automated testing method as described above is implemented.

[0040] The automated testing method, apparatus, device, and computer-readable storage medium provided by the embodiments of the present disclosure automatically write function execution flows by matching test cases with preset execution scripts and sequentially combining multiple preset execution scripts, thereby realizing automated testing and improving testing efficiency and consistency. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0042] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0043] Figure 1 A flow chart of the automated testing method provided in an embodiment of the present disclosure;

[0044] Figure 2 A flow chart of an automated testing method provided by another embodiment of the present disclosure;

[0045] Figure 3 A schematic diagram of a multi-process test provided in an embodiment of the present disclosure;

[0046] Figure 4 A schematic diagram of the structure of an automated testing device provided in an embodiment of the present disclosure;

[0047] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0048] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features therein can be combined with each other in the absence of conflict.

[0049] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0050] The embodiments of the present disclosure provide an automated testing method, which is described below in conjunction with specific embodiments.

[0051] Figure 1 This is a flow chart of the automated testing method provided by an embodiment of the present disclosure. This method can be applied to a test system for performing software testing on cloud-hypervisor and Libvirt. It is understood that the automated testing method provided by an embodiment of the present disclosure can also be applied in other scenarios.

[0052] Below Figure 1 The automated testing method shown in FIG. 1 is introduced, and the specific steps of the method are as follows:

[0053] S101. Convert the test case into an activity list array.

[0054] A test case is a description of a test task for a specific software product, which includes multiple test items and reflects the test plan, method, technology and strategy.

[0055] The test case also includes the configuration information of the system or application to be tested, including environment settings, test parameters, specified multi-threaded execution parameters, specified test process number parameters, etc.

[0056] A global environment configuration file can be generated based on the test case. This file contains all the environment configurations required to start and run the test case, simplifying the preparation work before testing.

[0057] Converting a test case into an active list array means converting each test item into an element in the active list array, breaking down the test case into a series of ordered operations to facilitate the execution of test tasks and result verification.

[0058] S102: Acquire multiple preset execution scripts that match the activity list array.

[0059] A preset execution script is a pre-written execution script corresponding to a test item. For example, a preset execution script can be a Python script that contains code to implement specific activities, such as data validation and interface operations.

[0060] For example, various pre-defined execution scripts can be written based on the libvirt API to perform various operations. The libvirt API is a set of application programming interfaces (APIs) for managing and monitoring virtualized environments. It provides a unified interface, allowing developers to programmatically operate virtualized environments, achieving automated management and control. For example, virtual machine lifecycle management operations, such as creating, starting, pausing, resuming, and destroying virtual machines, facilitate the creation of new virtual machines or control the status of existing virtual machine instances. Virtual machine migration operations, used to migrate a running virtual machine from one physical host to another without interrupting service, can include pausing the virtual machine, copying its state to the new host, and resuming the virtual machine on the new host. Network card and disk device hot-swapping operations, used to add or remove virtual network cards or virtual disks while a virtual machine is running. When executing these operations, multiple operations are handled simultaneously through multi-process scripts; log scripts track the execution of operations, and result scripts collect and report the results of the operations.

[0061] The active list array represents multiple ordered test items, each of which corresponds to one or more preset execution scripts. That is, for each test item, one or more preset execution scripts are matched to it, and multiple preset test scripts corresponding to the active list array are obtained.

[0062] S103: Combining the multiple preset execution scripts into a function execution flow according to the test order of the test case.

[0063] The multiple test items in a test case have a defined execution order, known as the test sequence. Specifically, the multiple preset execution scripts corresponding to each test item also have a corresponding order. Based on the test sequence, these preset execution scripts are combined to generate executable actions, resulting in a function execution flow.

[0064] S104: Execute the test task corresponding to the test case through the function execution flow.

[0065] For example, simulating user interactions, validation functions, etc.

[0066] Optionally, the test case parameters also specify the number of executions, and the function execution flow is executed concurrently based on the number of executions.

[0067] Optionally, you can enable the cleanup optional parameter and call the cleanup function after the function execution flow is completed to perform the corresponding environment cleanup actions.

[0068] The embodiment of the present disclosure converts a test case into an activity list array; obtains multiple preset execution scripts that match the activity list array; combines the multiple preset execution scripts into a function execution flow according to the test order of the test case; executes the test task corresponding to the test case through the function execution flow, and completes the automatic writing of the function execution flow through the matching of the test case and the preset execution script, and the sequential combination of multiple preset execution scripts, thereby realizing automated testing and improving testing efficiency and consistency.

[0069] Figure 2 A flow chart of an automated testing method provided by another embodiment of the present disclosure is shown as follows: Figure 2 As shown, the method includes the following steps:

[0070] S201: parse a test case to obtain multiple test items in the test case.

[0071] A test case includes multiple ordered test items.

[0072] For example, if some files in the test case are as follows:

[0073]

[0074]

[0075] is a test item, which is used to perform the power-on operation; similarly,

[0076]

[0077] is a test item, and so on.

[0078] S202: Convert each of the test items into an element to obtain a plurality of active elements.

[0079] Combined with the test items in the above steps,

[0080]

[0081] Converting to active element yields:

[0082]

[0083] Converting to active element yields:

[0084]

[0085] Converting to active element yields:

[0086]

[0087] Converting to active element yields:

[0088] 'Monitor:monitor_vm':{'channelpath0':'$channelpath0','Mac':'$mac'}

[0089] S203: Organize the multiple activity elements into an activity list array according to the test order.

[0090] Specifically, the test sequence includes the order between each test item and the number of cycles of the test items.

[0091] For example, end_loop i represents the number of loops for this test item. When i is 2, the test case needs to be looped twice.

[0092] Correspondingly, the activity list array is represented as:

[0093]

[0094] In some embodiments, if the test case needs to be executed cyclically, each activity element in the corresponding activity list array is also repeated accordingly. Here, only one execution is used as an example for description.

[0095] S204. For each of the test items, determine, based on the name of the test item and the names of multiple candidate execution scripts, at least one preset execution script that matches the test item from the multiple candidate execution scripts, where the name of the test item and the name of the preset execution script contain the same function name.

[0096] In automated testing systems, there are predefined naming conventions to ensure that the names of candidate or pre-defined execution scripts correspond to the functions or activities they implement. For example, if an activity verifies a user login, the corresponding Python script might be named "user_login_validation.py" or a function name containing "user_login." This allows the system to quickly match candidate execution scripts to the pre-defined execution script corresponding to the test item.

[0097] In practical applications, the names of candidate or pre-set execution scripts should be concise and clear, accurately reflecting the functions or activities they implement, to facilitate system matching and invocation. At the same time, appropriate naming standards should be established to ensure the uniqueness and readability of candidate or pre-set execution script names.

[0098] S205: Combine the multiple preset execution scripts into a function execution flow according to the test order of the test case.

[0099] Optionally, the function execution flow of the above test case can be expressed as: start_ch-->monitor_vm-->monitor_info-->monitor_vm-->monitor_info-->destroy_ch.

[0100] S206: Execute the test task corresponding to the test case through the function execution flow.

[0101] Specifically, the implementation process and principle of S205-S206 are the same as those of S103-S104, and will not be repeated here.

[0102] It should be noted that the above test case also includes other required parameters such as relative path directory, which are not shown in the code.

[0103] The disclosed embodiment parses a test case to obtain multiple test items in the test case; converts each of the test items into an element to obtain multiple active elements; organizes the multiple active elements into an active list array according to the test order; for each of the test items, determines at least one preset execution script that matches the test item from the multiple candidate execution scripts based on the name of the test item and the names of multiple candidate execution scripts, wherein the name of the test item and the name of the preset execution script contain the same function name; combines the multiple preset execution scripts into a function execution flow according to the test order of the test case; executes the test task corresponding to the test case through the function execution flow, and completes the automatic writing of the function execution flow through the matching of the test case and the preset execution script, and the sequential combination of multiple preset execution scripts, thereby realizing automated testing and improving testing efficiency and consistency.

[0104] Figure 3 A schematic diagram of a multi-process test provided in an embodiment of the present disclosure. Based on the above embodiment, when the function execution flow needs to be executed N times in a loop, executing the test task corresponding to the test case through the function execution flow includes: creating N processes, each of which is used to execute the function execution flow once, where N is a positive integer; and executing the function execution flow simultaneously through the N processes to complete the test task.

[0105] Optionally, determine whether the multi-process function is enabled. For example, multiprocess=on in the above embodiment indicates that the multi-process function is enabled.

[0106] The test case specifies the number of loops for the function execution flow. For example, in the above embodiment, option times=N means that the function execution flow is looped N times. When N-2 and i=2, the corresponding activity list array is represented as:

[0107]

[0108] That is, the function execution flow is executed twice: start_ch-->monitor_vm-->monitor_info-->monitor_vm-->monitor_info-->destroy_ch.

[0109] like Figure 3 As shown, when the multi-process function is turned on, N processes are created, including process 1, process 2, ..., process N. Each process executes the above function execution flow once, and N processes are executed simultaneously; when the multi-function process is turned off, the function execution flow is executed N times in a cycle.

[0110] The embodiment of the present disclosure creates multiple processes to concurrently execute the function execution flow when the function execution flow needs to be executed multiple times, which greatly saves the time required for the cyclic execution of the function execution flow and further improves the efficiency of automated testing.

[0111] On the basis of the above embodiment, executing the test task corresponding to the test case through the function execution flow includes: monitoring whether each preset execution script in the function execution flow runs successfully;

[0112] If each preset execution script in the function execution flow runs successfully, it is determined that the test task is executed successfully.

[0113] Specifically, monitoring whether each preset execution script in the function execution flow runs successfully includes: monitoring whether the interface corresponding to each preset execution script is called successfully; and monitoring whether the return value obtained by each preset execution script is correct.

[0114] The preset function execution script performs various operations or completes various functions by calling various interfaces and receiving corresponding return values. That is, for each preset execution script, when the correct interface is successfully called during the execution of the preset execution script and the correct return value is received, it can be determined that the preset execution script has run successfully; when each preset execution script runs successfully, the test task is executed successfully. Correspondingly, for each preset execution script, when the interface fails to be called during the execution of the preset execution script, or the wrong interface is called, or the wrong return value of the interface is received, it can be determined that the preset execution script has failed to run; when any one or more preset execution scripts fail to run in the function execution flow, the test task fails to execute.

[0115] Optionally, when the return value of the preset execution script is set to 1, the preset execution script runs successfully; when the return value of the preset execution script is set to 0, the preset execution script fails to run.

[0116] During test execution, the system collects detailed information about the test, including system status and operation results. If a test fails, or if an exception occurs during execution, the system automatically triggers an alarm and generates an alert. The system also compiles and organizes the test results, generating reports and statistical data. These results can be further analyzed to provide the development team with a basis for improvement or repair.

[0117] For example, abnormal situations that occur during the execution of the test task include but are not limited to: the function execution flow cannot be executed, the test data is incorrect, the function execution flow execution timeout, insufficient resources, unavailable external dependencies, automation tool or framework errors, insufficient test coverage, etc.

[0118] The disclosed embodiment monitors the execution process of the test task, obtains relevant logs and result statistics, and intuitively reflects the test results, making it easier for developers to discover and correct problems in a timely manner.

[0119] Figure 4 This is a schematic diagram of the structure of the automated testing device provided in the embodiment of the present disclosure. The automated testing device may be the test system described in the above embodiment, or the automated testing device may be a component or assembly in the test system. The automated testing device provided in the embodiment of the present disclosure may execute the processing flow provided in the embodiment of the automated testing method, such as Figure 4 As shown, the automated testing device 40 includes: a conversion module 41, an acquisition module 42, a combination module 43, and an execution module 44; the conversion module 41 is used to convert the test case into an activity list array; the acquisition module 42 is used to obtain multiple preset execution scripts that match the activity list array; the combination module 43 is used to combine the multiple preset execution scripts into a function execution flow according to the test order of the test case; the execution module 44 is used to execute the test task corresponding to the test case through the function execution flow.

[0120] Optionally, the conversion module 41 includes a parsing unit 411, a conversion unit 412, and an organization unit 413; the parsing unit 411 is used to parse the test case to obtain multiple test items in the test case; the conversion unit 412 is used to convert each of the test items into an element to obtain multiple active elements; the organization unit 413 is used to organize the multiple active elements into an activity list array according to the test order.

[0121] Optionally, the acquisition module 42 specifically determines, for each of the test items, at least one preset execution script that matches the test item from the multiple candidate execution scripts based on the name of the test item and the names of multiple candidate execution scripts, and the name of the test item and the name of the preset execution script contain the same function name.

[0122] Optionally, the execution module 44 includes a creation unit 441 and an execution unit 442; when the function execution flow needs to be executed in a loop N times, the creation unit 441 is used to create N processes, each of which is used to execute the function execution flow once, where N is a positive integer; the execution unit 442 is used to execute the function execution flow simultaneously through the N processes to complete the test task.

[0123] Optionally, the execution module 44 further includes a monitoring unit 443 for monitoring whether each preset execution script in the function execution flow runs successfully; if each preset execution script in the function execution flow runs successfully, it is determined that the test task is executed successfully.

[0124] Optionally, the monitoring unit 443 is specifically configured to monitor whether the interface corresponding to each preset execution script is successfully called; and monitor whether the return value obtained by each preset execution script is correct.

[0125] Optionally, the monitoring unit 443 is further configured to generate an alarm message when a preset execution script that fails to run exists in the function execution flow.

[0126] Figure 4 The automated testing device of the illustrated embodiment can be used to execute the technical solution of the above-mentioned method embodiment. Its implementation principle and technical effects are similar and will not be described in detail here.

[0127] Figure 5 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. The electronic device may be a device where the test system described in the above embodiment is located. The electronic device provided by an embodiment of the present disclosure may execute the processing flow provided by an embodiment of the automated test method, such as Figure 5 As shown, the electronic device 50 includes: a memory 51, a processor 52, a computer program and a communication interface 53; wherein the computer program is stored in the memory 51 and is configured so that the processor 52 executes the above-mentioned automated testing method.

[0128] In addition, an embodiment of the present disclosure further provides a computer-readable storage medium on which a computer program is stored. The computer program is executed by a processor to implement the automated testing method described in the above embodiment.

[0129] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, 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), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0130] In some embodiments, the client and server can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0131] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0132] In addition, an embodiment of the present disclosure further provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the automated testing method as described above is implemented.

[0133] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, 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 stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving 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., through the Internet using an Internet service provider).

[0134] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.

[0135] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0136] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

[0137] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0138] The foregoing description is intended only to provide specific embodiments of the present disclosure, intended to enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the embodiments described herein, but rather to be construed in the broadest manner consistent with the principles and novel features disclosed herein.

Claims

1. An automated testing method, characterized in that: The method comprises: Convert test cases into an array of activity lists; Obtaining multiple preset execution scripts that match the activity list array; Combining the plurality of preset execution scripts into a function execution flow according to the test order of the test case; The test task corresponding to the test case is executed through the function execution flow.

2. The method according to claim 1, characterized in that The test case is converted into an active list array, including: Parsing the test case to obtain multiple test items in the test case; Convert each of the test items into an element to obtain a plurality of active elements; The multiple activity elements are organized into an activity list array according to the test order.

3. The method according to claim 2, characterized in that The obtaining of a plurality of preset execution scripts matching the activity list array includes: For each of the test items, based on the name of the test item and the names of multiple candidate execution scripts, at least one preset execution script that matches the test item is determined from the multiple candidate execution scripts, and the name of the test item and the name of the preset execution script contain the same function name.

4. The method according to claim 1, wherein When the function execution flow needs to be executed N times in a loop, executing the test task corresponding to the test case through the function execution flow includes: Create N processes, each of which is used to execute the function execution flow once, where N is a positive integer; The function execution flow is executed simultaneously by the N processes to complete the test task.

5. The method according to claim 1, wherein The executing the test task corresponding to the test case through the function execution flow includes: Monitor whether each preset execution script in the function execution flow runs successfully; If each preset execution script in the function execution flow runs successfully, it is determined that the test task is executed successfully.

6. The method according to claim 5, characterized in that The monitoring of whether each preset execution script in the function execution flow is successfully executed includes: Monitor whether the interface corresponding to each preset execution script is called successfully; Monitor whether the return value obtained by each preset execution script is correct.

7. The method according to claim 5, characterized in that The method further comprises: When there is a preset execution script that fails to run in the function execution flow, an alarm message is generated.

8. An automated testing device, characterized in that: include: The conversion module is used to convert the test case into an array of activity lists; An acquisition module, configured to acquire a plurality of preset execution scripts matching the activity list array; A combining module, configured to combine the plurality of preset execution scripts into a function execution flow according to the test order of the test case; An execution module is used to execute the test task corresponding to the test case through the function execution flow.

9. An electronic device, characterized in that: include: Memory; processor; as well as computer programs; The computer program is stored in the memory and configured to be executed by the processor to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.