Automatic test case execution method and device, computer equipment and storage medium
By obtaining and configuring the to-configure items of test cases, the problem of insufficient configuration efficiency and environmental stability of test cases in traditional methods is solved, and a more efficient and reliable testing process is achieved.
Patent Information
- Application Number
- CN202411980812.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-11
AI Technical Summary
Traditional automated test case execution methods have problems such as low test case configuration efficiency and low test environment stability.
By obtaining the target identity of the test case to be executed, query the use case header information file to obtain the requirements information and standard definition values of the items to be configured, display the requirements information and perform configuration operations, determine the configuration results, and execute or interrupt the test case separately when the configuration is successful or failed.
It improves the configuration efficiency of test cases and the stability of test environment, enhances the controllability and traceability of test cases, facilitates analysis and problem solving, and improves the safety of the test process.
Smart Images

Figure CN119807067A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software testing technology, and in particular to an automated test case execution method, apparatus, computer equipment and storage medium. Background Art
[0002] At present, the new generation of information technology represented by cloud computing, big data, and artificial intelligence is changing with each passing day. The Internet, mobile terminals, and the Internet of Things are developing rapidly. The software forms are diversified, the scale of software is expanding, and the complexity is increasing day by day. In order to ensure the functionality, stability, and security of the software, software testing is essential. Software testing is the process of operating the program under specified conditions to find program errors, measure software quality, and evaluate whether it can meet the design requirements. Corresponding to the expansion of software scale, the number of automated test cases is also growing. In order to improve test efficiency and meet test quality requirements, the proportion of automated testing is increasing. Among them, automated test case testing technology is a technology that uses automated tools and technologies to execute test cases to verify the functions and performance of software applications. This technology can greatly improve test efficiency and accuracy and reduce manual intervention and errors.
[0003] However, traditional automated test case execution methods have problems such as low test case configuration efficiency or low test environment stability. Summary of the invention
[0004] Based on this, it is necessary to provide an automated test case execution method, device, computer equipment and storage medium that can improve the test case configuration efficiency and the test environment stability in response to the above technical problems.
[0005] In a first aspect, a method for executing an automated test case is provided, the method comprising:
[0006] Obtain the target identity of the current test case to be executed, query the case header information file according to the target identity, obtain the requirement information of each target configuration item of the current test case to be executed and the standard definition value of the corresponding target configuration item, and display the requirement information of each target configuration item; wherein the case header information file is used to store the header information of each test case to be executed in the test case group; the header information includes the identity of the corresponding test case to be executed, the requirement information of each configuration item and the standard definition value of the corresponding configuration item;
[0007] In response to performing configuration operations on each target item to be configured, determining a configuration value of each target item to be configured, and determining a configuration result of the current test case to be executed according to the configuration value of each target item to be configured and the standard definition value of the corresponding target item to be configured; the configuration result includes configuration success or configuration failure;
[0008] In response to the configuration result being successful, executing the current test case to be executed;
[0009] In response to the case running mode being the debug mode and the execution status of the current test case to be executed being execution failure, the execution of the current test case to be executed and other test cases to be executed in the test case group are interrupted, and execution error information of the current test case to be executed is output.
[0010] In one of the embodiments, the configuration result of the current test case to be executed is determined according to the configuration value of each target to-be-configured item and the standard definition value of the corresponding target to-be-configured item, including: comparing the configuration value of each target to-be-configured item and the standard definition value of the corresponding target to-be-configured item to obtain the comparison result of each target to-be-configured item; the comparison result includes the same value or the different value; if all the comparison results are the same value, the configuration result is determined to be a successful configuration; if there is a comparison result that the value is different, the configuration result is determined to be a failed configuration.
[0011] In one of the embodiments, the method further includes: in response to the configuration result being configuration failure, outputting configuration abnormality prompt information; the configuration abnormality prompt information is used to indicate that there is a configuration abnormality in the target to-be-configured items whose comparison results are different values.
[0012] In one of the embodiments, the method also includes: in response to the case running mode being the full running mode and the execution status of the current test case to be executed being execution failure, interrupting the execution of the current test case to be executed, and recording the execution error information record and the execution status of the current test case to be executed in the execution result log of the test case group; updating the current test case to be executed according to the test case group, and returning to obtain the target identity of the current test case to be executed, querying the case header information file according to the target identity to obtain the requirement information of each target to be configured item of the current test case to be executed and the standard definition value of the corresponding target to be configured item, and displaying the requirement information of each target to be configured item, until all the test cases to be executed in the test case group have been executed.
[0013] In one of the embodiments, the method also includes: in response to the execution status of the current test case to be executed successfully, recording the execution status of the current test case to be executed in the execution result log of the test case group; updating the current test case to be executed according to the test case group, and returning to obtain the target identity of the current test case to be executed, querying the case header information file according to the target identity to obtain the requirement information of each target configuration item of the current test case to be executed and the standard definition value of the corresponding target configuration item, and displaying the requirement information of each target configuration item, until all the test cases to be executed in the test case group have been executed.
[0014] In one of the embodiments, interrupting the execution of the current test case to be executed and other test cases to be executed in the test case group includes: setting the current global flag variable to 1 to interrupt the execution of the current test case to be executed and other test cases to be executed in the test case group according to the current global flag variable.
[0015] In one embodiment, the execution error information includes one or more of the error type, error occurrence time, and error occurrence location of the current test case to be executed.
[0016] In a second aspect, an automated test case execution device is provided, the device comprising a data acquisition module, a configuration item configuration module, a test case execution module and a test case interruption module.
[0017] The data acquisition module is used to obtain the target identity of the current test case to be executed, and obtain the requirement information of each target configuration item of the current test case to be executed and the standard definition value of the corresponding target configuration item after querying the test case header information file according to the target identity, and display the requirement information of each target configuration item; wherein the test case header information file is used to store the header information of each test case to be executed in the test case group; the header information includes the identity of the corresponding test case to be executed, the requirement information of each configuration item and the standard definition value of the corresponding configuration item; the configuration item configuration module is used to respond to the requirements of each target configuration item Perform configuration operations, determine the configuration values of each target item to be configured, and determine the configuration result of the current test case to be executed according to the configuration value of each target item to be configured and the standard definition value of the corresponding target item to be configured; the configuration result includes configuration success or configuration failure; the use case execution module is used to execute the current test case to be executed in response to the configuration result being configuration success; the use case interruption module is used to interrupt the execution of the current test case to be executed and other test cases to be executed in the test case group in response to the use case running mode being the debugging mode and the execution status of the current test case to be executed being execution failure, and output the execution error information of the current test case to be executed.
[0018] In a third aspect, a computer device is provided. The computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the steps of any method in the above method embodiments are implemented.
[0019] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any method in the above method embodiments are implemented.
[0020] The above-mentioned automated test case execution method, device, computer equipment and storage medium obtain the target identity of the current test case to be executed, obtain the requirement information of each target to be configured item of the current test case to be executed and the standard definition value of the corresponding target to be configured item after querying in the case header information file according to the target identity, and display the requirement information of each target to be configured item; wherein the case header information file is used to store the header information of each test case to be executed in the test case group; the header information includes the identity of the corresponding test case to be executed, the requirement information of each to be configured item and the standard definition value of the corresponding to be configured item; then, in response to the configuration operation on each target to be configured item, the configuration value of each target to be configured item is determined, and according to the configuration value of each target to be configured item and the standard definition value of The configuration result of the current test case to be executed is determined according to the standard definition value of the target configuration item; the configuration result includes configuration success or configuration failure; then, in response to the configuration result being configuration success, the current test case to be executed is executed; finally, in response to the case running mode being the debugging mode and the execution status of the current test case to be executed being execution failure, the execution of the current test case to be executed and other test cases to be executed in the test case group are interrupted, and the execution error information of the current test case to be executed is output, which improves the test case configuration efficiency, the test environment stability and the reliability of the test process, enhances the controllability and traceability of the test case in the test, facilitates the staff to analyze and solve problems according to the execution error information of the current test case to be executed, and improves the safety of the test process. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 An application environment diagram of an automated test case execution method in an embodiment;
[0022] Figure 2 A schematic diagram of a first process flow of a method for executing automated test cases in one embodiment;
[0023] Figure 3 A schematic diagram of a flow chart of determining a configuration result of a current test case to be executed according to a configuration value of each target item to be configured and a corresponding standard definition value of the target item to be configured in one embodiment;
[0024] Figure 4 A second flow chart of the method for executing automated test cases in one embodiment;
[0025] Figure 5 A third flow chart of an automated test case execution method in one embodiment;
[0026] Figure 6 A fourth flow chart of a method for executing automated test cases in one embodiment;
[0027] Figure 7A structural block diagram of an automated test case execution device in one embodiment;
[0028] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0030] In order to facilitate understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. Embodiments of the present application are provided in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.
[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0032] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first resistor may be referred to as a second resistor, and similarly, a second resistor may be referred to as a first resistor. Both the first resistor and the second resistor are resistors, but they are not the same resistor.
[0033] It can be understood that the “connection” in the following embodiments should be understood as “electrical connection”, “communication connection”, etc. if the connected circuits, modules, units, etc. have electrical signals or data transmission between each other.
[0034] When used herein, the singular forms "a", "an", and "said / the" may also include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" etc. specify the presence of stated features, wholes, steps, operations, components, parts or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts or combinations thereof.
[0035] The automated test case execution method provided in this application can be applied to Figure 1In the application environment shown, the terminal 102 communicates with the server 104 through a network. The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0036] In one embodiment, Figure 2 As shown, a method for executing an automated test case is provided, which is applied to Figure 1 The server 104 in the example is used for explanation, and the steps include the following steps 201 to 204.
[0037] Step 201, obtain the target identity of the current test case to be executed, query the case header information file according to the target identity to obtain the requirement information of each target configuration item of the current test case to be executed and the standard definition value of the corresponding target configuration item, and display the requirement information of each target configuration item.
[0038] The use case header information file is used to store the header information of each test case to be executed in the test case group; the header information includes the identity of the corresponding test case to be executed, the requirement information of each item to be configured and the standard definition value of the corresponding item to be configured.
[0039] Specifically, the current test case to be executed is the test case to be executed in the test case group at the current moment; the target identity is the identity of the test case to be executed corresponding to the current test case to be executed in the test case group. Server 104 can obtain the target identity of the current test case to be executed; then, according to the target identity, query in the case header information file to obtain the requirement information of each target item to be configured of the current test case to be executed and the standard definition value of the corresponding target item to be configured; then, display the requirement information of each target item to be configured, so that the staff can configure each target item to be configured according to the requirement information of each target item to be configured, avoid omitting the information that the target item to be configured is not configured or is configured uselessly, increase the workload, and improve the test efficiency.
[0040] In a specific example, the use case header information file may be, but is not limited to, a JSON file. The requirement information of the target item to be configured may include, but is not limited to, AD domain information, LDAP domain information, number of clients, and load balancing domain name, etc. The above are only specific examples, and in actual applications, they are flexibly set according to user needs and are not limited here.
[0041] In a specific example, the header information of each test case to be executed in the test case group stored in the test case header information file is as follows:
[0042] case_id:1
[0043] ad_domain:noldap_domain:yesclient_number:1
[0044] ipv4_domain_name:yes ......
[0046] case_id:2
[0047] ad_domain:noldap_domain:noclient number:3
[0048] ipv4_domain_name:no ......
[0050] The above are only specific examples, which can be flexibly configured according to user needs in actual applications and are not limited here.
[0051] Step 202, in response to performing configuration operations on each target item to be configured, determining a configuration value of each target item to be configured, and determining a configuration result of the current test case to be executed according to the configuration value of each target item to be configured and the corresponding standard definition value of the target item to be configured.
[0052] The configuration result includes configuration success or configuration failure. Specifically, when the server 104 identifies that a configuration operation is performed on each target item to be configured, the server 104 can determine the configuration value of each target item to be configured according to the result of the configuration operation, and determine the configuration result of the current test case to be executed according to the configuration value of each target item to be configured and the standard definition value of the corresponding target item to be configured, thereby improving the configuration accuracy and efficiency of the test case, and also improving the efficiency and accuracy of the execution of the automated test case.
[0053] In one embodiment, if Figure 3 As shown, the configuration result of the current test case to be executed is determined according to the configuration value of each target to-be-configured item and the corresponding standard definition value of the target to-be-configured item, including steps 301 to 303.
[0054] Step 301, comparing the configuration value of each target item to be configured with the standard definition value of the corresponding target item to be configured, and obtaining a comparison result of each target item to be configured;
[0055] Step 302: If all comparison results are the same, the configuration result is determined to be successful.
[0056] Step 303: If the comparison result is that the values are different, the configuration result is determined to be configuration failure.
[0057] The comparison result includes the same value or different value. Specifically, the server 104 compares the configuration value of each target item to be configured with the standard definition value of the corresponding target item to be configured to obtain the comparison result of each target item to be configured; then, if the comparison results are all the same value, the configuration result is determined to be a successful configuration; at the same time, if there is a comparison result that the value is different, the configuration result is determined to be a failed configuration, thereby improving the configuration accuracy and efficiency of the test case, and also improving the efficiency and accuracy of the execution of the automated test case.
[0058] In this embodiment, the configuration value of each target item to be configured is compared with the standard definition value of the corresponding target item to be configured to obtain the comparison result of each target item to be configured; then, if the comparison results are all the same value, the configuration result is determined to be a successful configuration; at the same time, if there is a comparison result that the value is different, the configuration result is determined to be a failed configuration, thereby improving the configuration accuracy and efficiency of the test case, and also improving the efficiency and accuracy of the execution of the automated test case.
[0059] In one embodiment, if Figure 4 As shown, the method further includes step 401.
[0060] Step 401: In response to the configuration result being configuration failure, outputting configuration abnormality prompt information.
[0061] Among them, the configuration exception prompt information is used to indicate that there is a configuration exception in the target to-be-configured items whose comparison results are different values. Specifically, when the server 104 identifies that the configuration result is a configuration failure, it outputs the configuration exception prompt information, so that the staff can reconfigure the target to-be-configured items whose comparison results are different values according to the configuration exception prompt information, thereby improving the configuration accuracy and efficiency of the test case, and also improving the efficiency and accuracy of the execution of the automated test case.
[0062] In this embodiment, in response to the configuration result being a configuration failure, a configuration exception prompt message is output, so that the staff can reconfigure the target to-be-configured items whose comparison results are different values according to the configuration exception prompt message, thereby improving the configuration accuracy and efficiency of the test case, and thus improving the efficiency and accuracy of the execution of the automated test case.
[0063] Step 203: In response to the configuration result being successful, the current test case to be executed is executed.
[0064] Specifically, when the server 104 recognizes that the configuration result is successful, it can execute the current test case to be executed.
[0065] Step 204, in response to the case running mode being the debug mode and the execution status of the current test case to be executed being execution failure, interrupt the execution of the current test case to be executed and other test cases to be executed in the test case group, and output execution error information of the current test case to be executed.
[0066] Among them, the other test cases to be executed of the test case group are the test cases to be executed in the test case group except the current test case to be executed. Specifically, when the server 104 recognizes that the case operation mode is the debugging mode and the execution status of the current test case to be executed is execution failure, the execution of the current test case to be executed and other test cases to be executed in the test case group are interrupted, that is, the process of automated test case execution is completely stopped, so as to ensure the current test environment for troubleshooting, and output the execution error information of the current test case to be executed, thereby improving the test case configuration efficiency, the stability of the test environment and the reliability of the test process, enhancing the controllability and traceability of the test case in the test, facilitating the staff to analyze and solve problems according to the execution error information of the current test case to be executed, and improving the safety of the test process.
[0067] In one embodiment, the method further comprises:
[0068] When outputting the execution error information of the current test case to be executed, the execution error information of the current test case to be executed is recorded in the execution result log of the test case group, and an error prompt box is generated and displayed according to the execution error information of the current test case to be executed.
[0069] Specifically, when outputting the execution error information of the current test case to be executed, the server 104 can record the execution error information of the current test case to be executed to the execution result log of the test case group, and generate and display an error prompt box based on the execution error information of the current test case to be executed, thereby improving the convenience of testing, troubleshooting efficiency and error traceability.
[0070] In a specific example, based on the exception capture mechanism, the execution error information of the current test case to be executed is obtained. The above is only a specific example, and it is flexibly set according to user needs in actual applications and is not limited here.
[0071] In this embodiment, when the execution error information of the current test case to be executed is output, the execution error information of the current test case to be executed is recorded in the execution result log of the test case group, and an error prompt box is generated and displayed according to the execution error information of the current test case to be executed, thereby improving the convenience of testing, troubleshooting efficiency and error traceability.
[0072] In one embodiment, interrupting the execution of the current test case to be executed and other test cases to be executed in the test case group includes:
[0073] The current global flag variable is set to 1 to interrupt the execution of the current test case to be executed and other test cases to be executed in the test case group according to the current global flag variable.
[0074] Specifically, the initial value of the current global flag variable is 0. When the use case running mode is debug mode and the execution status of the current test case to be executed is execution failure, the server 104 sets the current global flag variable to 1 to interrupt the execution of the current test case to be executed and other test cases to be executed in the test case group according to the current global flag variable, thereby improving the test case configuration efficiency, the stability of the test environment and the reliability of the test process.
[0075] In this embodiment, the server 104 sets the current global flag variable to 1 to interrupt the execution of the current test case to be executed and other test cases to be executed in the test case group according to the current global flag variable, thereby improving the test case configuration efficiency, the test environment stability and the reliability of the test process.
[0076] In one embodiment, the execution error information includes one or more of the error type, error occurrence time, and error occurrence location of the current test case to be executed.
[0077] In the above-mentioned automated test case execution method, the target identity of the current test case to be executed is obtained, and the requirement information of each target to be configured item of the current test case to be executed and the standard definition value of the corresponding target to be configured item are obtained after querying in the test case header information file according to the target identity, and the requirement information of each target to be configured item is displayed; wherein the test case header information file is used to store the header information of each test case to be executed in the test case group; the header information includes the identity of the corresponding test case to be executed, the requirement information of each to be configured item and the standard definition value of the corresponding to be configured item; then, in response to the configuration operation on each target to be configured item, the configuration value of each target to be configured item is determined, and according to the configuration value of each target to be configured item and the standard definition value of the corresponding target to be configured item, the configuration value of each target to be configured item is determined, and the requirement information of each target to be configured item is displayed. The standard definition value of the setting item determines the configuration result of the current test case to be executed; the configuration result includes configuration success or configuration failure; then, in response to the configuration result being configuration success, the current test case to be executed is executed; finally, in response to the case running mode being the debugging mode and the execution status of the current test case to be executed being execution failure, the execution of the current test case to be executed and other test cases to be executed in the test case group are interrupted, and the execution error information of the current test case to be executed is output, which improves the test case configuration efficiency, the test environment stability and the reliability of the test process, enhances the controllability and traceability of the test case in the test, facilitates the staff to analyze and solve problems according to the execution error information of the current test case to be executed, and improves the safety of the test process.
[0078] In one embodiment, if Figure 5 As shown, the method further includes step 501 to step 502.
[0079] Step 501, in response to the case running mode being the full running mode and the execution status of the current test case to be executed being execution failure, interrupt the execution of the current test case to be executed, and record the execution error information and the execution status of the current test case to be executed to the execution result log of the test case group.
[0080] Step 502, updates the current test case to be executed according to the test case group, and returns to obtain the target identity of the current test case to be executed, obtains the requirement information of each target configuration item of the current test case to be executed and the standard definition value of the corresponding target configuration item after querying in the case header information file according to the target identity, and displays the requirement information of each target configuration item, until all the test cases to be executed in the test case group have been executed.
[0081] Specifically, in response to the case running mode being the full running mode and the execution status of the current test case to be executed being execution failure, the server 104 interrupts the execution of the current test case to be executed, and records the execution error information and the execution status of the current test case to be executed in the execution result log of the test case group; then, the current test case to be executed is updated according to the test case group, and returns to obtain the target identity of the current test case to be executed, and obtains the requirement information of each target to be configured item of the current test case to be executed and the standard definition value of the corresponding target to be configured item after querying in the case header information file according to the target identity, and displays the step of the requirement information of each target to be configured item, until all the test cases to be executed in the test case group have been executed, so that when the case running mode is the full running mode and the execution status of the current test case to be executed is execution failure, only the execution of the current test case to be executed is interrupted, while other test cases to be executed in the test case group can continue to be tested, and after all the test cases to be executed in the test case group have been executed, the execution status and corresponding information of all the test cases to be executed in the test case group are understood through the execution result log of the test case group, thereby improving the convenience and speed of testing.
[0082] In this embodiment, in response to the case running mode being the full running mode and the execution status of the current test case to be executed being execution failure, the execution of the current test case to be executed is interrupted, and the execution error information record and the execution status of the current test case to be executed are recorded in the execution result log of the test case group; then, the current test case to be executed is updated according to the test case group, and the target identity of the current test case to be executed is returned to obtain the target identity of the current test case to be executed, and the requirement information of each target to be configured item of the current test case to be executed and the standard definition value of the corresponding target to be configured item are obtained after querying in the case header information file according to the target identity, and the requirement information of each target to be configured item is displayed until all the test cases to be executed in the test case group have been executed, so that when the case running mode is the full running mode and the execution status of the current test case to be executed is execution failure, only the execution of the current test case to be executed is interrupted, while other test cases to be executed in the test case group can continue to be tested, and after all the test cases to be executed in the test case group have been executed, the execution status and corresponding information of all the test cases to be executed in the test case group are understood through the execution result log of the test case group, thereby improving the convenience and speed of testing.
[0083] In one embodiment, if Figure 6 As shown, the method further includes step 601 to step 602.
[0084] Step 601 , in response to the execution status of the current test case to be executed being successful, the execution status of the current test case to be executed is recorded in the execution result log of the test case group.
[0085] Step 602, updates the current test case to be executed according to the test case group, and returns to obtain the target identity of the current test case to be executed, obtains the requirement information of each target configuration item of the current test case to be executed and the standard definition value of the corresponding target configuration item after querying in the case header information file according to the target identity, and displays the requirement information of each target configuration item, until all the test cases to be executed in the test case group have been executed.
[0086] Specifically, in response to the execution status of the current test case to be executed being successful, server 104 records the execution status of the current test case to be executed in the execution result log of the test case group; then, the current test case to be executed is updated according to the test case group, and returns to obtain the target identity of the current test case to be executed, and obtains the requirement information of each target configuration item of the current test case to be executed and the standard definition value of the corresponding target configuration item after querying the case header information file according to the target identity, and displays the step of the requirement information of each target configuration item, until all the test cases to be executed in the test case group have been executed, thereby improving the convenience and efficiency of testing.
[0087] In this embodiment, in response to the execution status of the current test case to be executed being successful, the execution status of the current test case to be executed is recorded in the execution result log of the test case group; then, the current test case to be executed is updated according to the test case group, and the target identity of the current test case to be executed is obtained, and the requirement information of each target configuration item of the current test case to be executed and the standard definition value of the corresponding target configuration item are obtained after querying the case header information file according to the target identity, and the requirement information of each target configuration item is displayed until all the test cases to be executed in the test case group have been executed, thereby improving the convenience and efficiency of the test.
[0088] It should be understood that although Figure 2-6 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-6 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0089] Second, as Figure 7 As shown, an automated test case execution device is provided, the device comprising a data acquisition module 710 , a configuration item configuration module 720 , a test case execution module 730 and a test case interruption module 740 .
[0090] The data acquisition module 710 is used to obtain the target identity of the current test case to be executed, and obtain the requirement information of each target item to be configured and the standard definition value of the corresponding target item to be configured after querying the test case header information file according to the target identity, and display the requirement information of each target item to be configured; wherein the test case header information file is used to store the header information of each test case to be executed in the test case group; the header information includes the identity of the corresponding test case to be executed, the requirement information of each item to be configured and the standard definition value of the corresponding item to be configured; the configuration item configuration module 720 is used to respond to the requirements of each target item to be configured Perform configuration operations, determine the configuration values of each target item to be configured, and determine the configuration result of the current test case to be executed according to the configuration value of each target item to be configured and the standard definition value of the corresponding target item to be configured; the configuration result includes configuration success or configuration failure; the use case execution module 730 is used to execute the current test case to be executed in response to the configuration result being configuration success; the use case interruption module 740 is used to interrupt the execution of the current test case to be executed and other test cases to be executed in the test case group in response to the use case running mode being the debugging mode and the execution status of the current test case to be executed being execution failure, and output the execution error information of the current test case to be executed.
[0091] In one embodiment, the configuration item configuration module 720 includes a configuration item configuration unit.
[0092] Among them, the configuration item configuration unit is used to compare the configuration value of each target to-be-configured item with the corresponding standard definition value of the target to-be-configured item to obtain the comparison result of each target to-be-configured item; the comparison result includes the same value or the different value; the configuration item configuration unit is used to determine that the configuration result is a successful configuration if all comparison results are the same value; the configuration item configuration unit is used to determine that the configuration result is a configuration failure if there is a comparison result that the value is different.
[0093] In one of the embodiments, the method further includes configuring a failure prompt module.
[0094] The configuration failure prompt module is used to output configuration abnormality prompt information in response to the configuration result being configuration failure; the configuration abnormality prompt information is used to indicate that there is a configuration abnormality in the target to-be-configured items whose comparison results are different values.
[0095] In one embodiment, the use case interruption module 740 is used to interrupt the execution of the current test case to be executed in response to the use case operation mode being the full operation mode and the execution status of the current test case to be executed being execution failure, and record the execution error information and the execution status of the current test case to be executed in the execution result log of the test case group; the use case interruption module 740 is used to update the current test case to be executed according to the test case group, and return to obtain the target identity of the current test case to be executed, and obtain the requirement information of each target item to be configured of the current test case to be executed and the standard definition value of the corresponding target item to be configured after querying the use case header information file according to the target identity, and display the requirement information of each target item to be configured, until all test cases to be executed in the test case group have been executed.
[0096] In one embodiment, the use case execution module 730 is used to record the execution status of the current test case to be executed in the execution result log of the test case group in response to the execution status of the current test case to be executed successfully; the use case execution module 730 is used to update the current test case to be executed according to the test case group, and return to obtain the target identity of the current test case to be executed, and obtain the requirement information of each target configuration item of the current test case to be executed and the standard definition value of the corresponding target configuration item after querying the use case header information file according to the target identity, and display the requirement information of each target configuration item, until all the test cases to be executed in the test case group have been executed.
[0097] In one of the embodiments, interrupting the execution of the current test case to be executed and other test cases to be executed in the test case group includes: setting the current global flag variable to 1 to interrupt the execution of the current test case to be executed and other test cases to be executed in the test case group according to the current global flag variable.
[0098] In one embodiment, the execution error information includes one or more of the error type, error occurrence time, and error occurrence location of the current test case to be executed.
[0099] For the specific definition of the automated test case execution device, please refer to the definition of the automated test case execution method above, which will not be repeated here. Each module in the above-mentioned automated test case execution device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0100] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store a use case header information file. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an automated test case execution method is implemented.
[0101] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0102] In a third aspect, a computer device is provided. The computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the steps of any method in the above method embodiments are implemented.
[0103] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any method in the above method embodiments are implemented.
[0104] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0105] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0106] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for executing an automated test case, the method comprising: Obtain the target identity of the current test case to be executed, obtain the requirement information of each target item to be configured of the current test case to be executed and the standard definition value corresponding to the target item to be configured after querying in the test case header information file according to the target identity, and display the requirement information of each target item to be configured; wherein the test case header information file is used to store the header information of each test case to be executed in the test case group; the header information includes the identity of the corresponding test case to be executed, the requirement information of each item to be configured and the standard definition value corresponding to the item to be configured; In response to performing a configuration operation on each of the target items to be configured, determining a configuration value of each of the target items to be configured, and determining a configuration result of the current test case to be executed according to the configuration value of each of the target items to be configured and the corresponding standard definition value of the target items to be configured; the configuration result includes configuration success or configuration failure; In response to the configuration result being that the configuration is successful, executing the current test case to be executed; In response to the case running mode being the debug mode and the execution status of the current test case to be executed being execution failure, the execution of the current test case to be executed and other test cases to be executed in the test case group are interrupted, and execution error information of the current test case to be executed is output.
2. The method according to claim 1, characterized in that The determining the configuration result of the current test case to be executed according to the configuration value of each target to-be-configured item and the corresponding standard definition value of the target to-be-configured item includes: Comparing the configuration value of each target item to be configured with the corresponding standard definition value of the target item to be configured to obtain a comparison result of each target item to be configured; the comparison result includes the same value or the different value; If all the comparison results are the same as the values, determining that the configuration result is successful; If the comparison result is that the values are different, it is determined that the configuration result is the configuration failure.
3. The method according to claim 2, characterized in that The method further comprises: In response to the configuration result being the configuration failure, outputting configuration abnormality prompt information; the configuration abnormality prompt information is used to indicate that there is a configuration abnormality in the target to-be-configured items whose comparison results are different values.
4. The method according to claim 1, characterized in that: The method further comprises: In response to the case running mode being the full running mode and the execution status of the current test case to be executed being execution failure, interrupting the execution of the current test case to be executed, and recording the execution error information record and the execution status of the current test case to be executed in the execution result log of the test case group; The current test case to be executed is updated according to the test case group, and the target identity identifier of the current test case to be executed is returned to the step of obtaining the target identity identifier, querying the case header information file according to the target identity identifier to obtain the requirement information of each target configuration item of the current test case to be executed and the standard definition value corresponding to the target configuration item, and displaying the requirement information of each target configuration item, until all the test cases to be executed in the test case group have been executed.
5. The method according to claim 1, characterized in that The method further comprises: In response to the execution status of the current test case to be executed being successful, recording the execution status of the current test case to be executed in the execution result log of the test case group; The current test case to be executed is updated according to the test case group, and the target identity identifier of the current test case to be executed is returned to the step of obtaining the target identity identifier, querying the case header information file according to the target identity identifier to obtain the requirement information of each target configuration item of the current test case to be executed and the standard definition value corresponding to the target configuration item, and displaying the requirement information of each target configuration item, until all the test cases to be executed in the test case group have been executed.
6. The method according to claim 1, characterized in that The interrupting the execution of the current test case to be executed and other test cases to be executed in the test case group includes: The current global flag variable is set to 1, so as to interrupt the execution of the current test case to be executed and other test cases to be executed in the test case group according to the current global flag variable.
7. The method according to any one of claims 1 to 6, characterized in that: The execution error information includes one or more of the error type, error occurrence time, and error occurrence location of the current test case to be executed.
8. An automated test case execution device, characterized in that: The device comprises: A data acquisition module is used to obtain the target identity of the current test case to be executed, obtain the requirement information of each target item to be configured of the current test case to be executed and the standard definition value corresponding to the target item to be configured after querying in the test case header information file according to the target identity, and display the requirement information of each target item to be configured; wherein the test case header information file is used to store the header information of each test case to be executed in the test case group; the header information includes the identity of the corresponding test case to be executed, the requirement information of each item to be configured and the standard definition value corresponding to the item to be configured; a configuration item configuration module, configured to determine the configuration value of each target item to be configured in response to a configuration operation on each target item to be configured, and determine the configuration result of the current test case to be executed according to the configuration value of each target item to be configured and the corresponding standard definition value of the target item to be configured; the configuration result includes configuration success or configuration failure; A test case execution module, configured to execute the current test case to be executed in response to the configuration result being that the configuration is successful; A use case interruption module is used to interrupt the execution of the current test case to be executed and other test cases to be executed in the test case group in response to the use case running mode being the debugging mode and the execution status of the current test case to be executed being execution failure, and output the execution error information of the current test case to be executed.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
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 steps of the method according to any one of claims 1 to 7 are implemented.