A graphical interface automatic testing method, device and storage medium
By using a graphical interface-based automated testing method, the problem of low efficiency in traditional interface testing is solved, achieving automation and visualization of interface testing, and improving testing efficiency and accuracy.
Patent Information
- Application Number
- CN202210851568.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-19
- Publication Date
- 2026-06-23
- Estimated Expiration
- 2042-07-19
AI Technical Summary
Traditional interface testing relies on manual coding, which is time-consuming and labor-intensive, prone to oversights, and difficult to complete large-scale interface testing in a short period of time.
This paper provides a graphical interface automatic testing method that generates test processes through drag-and-drop, visualizes interface testing using the graphical test process, reuses parameter nodes, and automates the interface testing process.
It improves the efficiency and accuracy of interface testing, reduces manpower input, optimizes test case data, and realizes the automation and visualization of interface testing.
Smart Images

Figure CN115269390B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a graphical interface automatic testing method, apparatus and storage medium. Background Technology
[0002] With the development of technology, software development has become increasingly important, and low-code development platforms and related models are becoming more and more common, such as methods for automated testing of interfaces.
[0003] Traditional API testing relies on manual processes such as writing API requests one by one, which is time-consuming, labor-intensive, and prone to oversights. It also fails to leverage time and manpower to accumulate business experience and improve efficiency. Furthermore, current API testing technologies struggle to complete a large number of APIs in a short time through manual testing. Summary of the Invention
[0004] To address the problems in the prior art, embodiments of this application provide a graphical interface automatic testing method, apparatus, and storage medium, which visualizes and automates the testing of interfaces through the graphical interface automatic testing method.
[0005] In a first aspect, embodiments of this application provide an automated testing method for a graphical interface, the method comprising:
[0006] In response to the user's interface node selection operation, the target interface node in the panel area selected by the user is determined, and the graphical test process corresponding to the target interface node is added to the display area;
[0007] Based on the original interface definition data included in the target interface node, at least one parameter node is added to the graphical test process from the parameter template in the panel area; wherein, the parameter node includes test case data for testing the target interface node;
[0008] In response to a user-triggered operation to run the graphical test process, the target interface node is tested based on the test case data.
[0009] The above method responds to the user's interface node selection operation, determines the target interface node in the panel area selected by the user, and adds the corresponding graphical test process to the display area. Based on the original interface definition data included in the target interface node, at least one parameter node is added to the graphical test process from the parameter template in the panel area. Responding to the user's triggering of the graphical test process, the target interface node is tested based on the test case data. This visualizes the entire interface testing process, allowing graphical test processes to be generated through drag-and-drop, simplifying large-scale complex business logic. Furthermore, the parameter nodes in the panel area can be reused for different target interfaces, improving efficiency in the interface testing process.
[0010] In one possible implementation, adding at least one parameter node from the parameter template in the panel area to the graphical testing process based on the original interface definition data included in the target interface node includes:
[0011] Based on the original interface definition data included in the target interface node, at least one parameter node selected by the user is added to the graphical test process from multiple node types of parameter nodes in the parameter template of the panel area.
[0012] In one possible implementation, the node type includes component type, logical indicator type, and data experience type;
[0013] The parameter nodes of the component type include parameter assembly nodes;
[0014] The parameter nodes of the logical indication type include response judgment nodes and format judgment nodes;
[0015] The parameter nodes of the data experience type include interface refinement nodes.
[0016] In one possible implementation, the parameter template further includes non-parameter nodes; the method further includes:
[0017] From the parameter template in the panel area, the non-parameter node selected by the user is added to the graphical test process. In the graphical test process, the output of the test report parsing node in the non-parameter node is connected to at least one of the parameter nodes to adjust the test case data in the parameter node according to the output of the test report parsing node through at least one of the parameter nodes.
[0018] In one possible implementation, the non-parameter node further includes a target interface parsing node, a test case generation node, and a test report node.
[0019] In one possible implementation, the operation of running the graphical test process in response to a user-triggered event, testing the target interface node based on the test case data, includes:
[0020] In response to the user's operation of running the graphical test process, the target interface node is parsed, and at least one test case data corresponding to the interface in the target interface node is obtained from the parameter node;
[0021] Based on at least one test case data corresponding to the interface in the target interface node, generate test case results and obtain a test report.
[0022] In one possible implementation, the target interface node includes an interface;
[0023] After generating test case results and obtaining a test report based on at least one test case data corresponding to the interface in the target interface node, the method further includes:
[0024] Analyze the test report. If it is determined that the results of at least one test case include successful test case results, then add tags to the test case data corresponding to the successful test case results and save them.
[0025] If it is determined that the at least one test case result includes a failed test case result, the test case data corresponding to the failed test case result is adjusted according to the execution status of the test case data in the test report, and a first updated test case data and a first updated parameter node are obtained. The step of testing the target interface node is then returned until the test case result generated based on the first updated test case data is a successful test case result.
[0026] The above method can analyze test reports obtained from interface testing, add tags and save successful test case results, recalculate failed test case results, and streamline a large number of test cases in a graphical testing process, making the process smaller and more refined. The test case data corresponding to the failed test case results is stored, and the interface is automatically tested again based on this data to ultimately obtain successful test case results.
[0027] In one possible implementation, the target interface node includes multiple interfaces;
[0028] After generating test case results and obtaining a test report based on at least one test case data corresponding to the interface in the target interface node, the method further includes:
[0029] Determine the test case results for each of the multiple interfaces, and determine the success rate of the test case results for each interface.
[0030] The interfaces whose success rate of the test case results is greater than a set threshold are tagged to obtain tagged interfaces, and the tagged interfaces are removed from the target interface node to obtain the updated target interface node;
[0031] Interfaces with a success rate of less than a set threshold are selected as candidate interfaces. Based on the execution status of the test case data in the test report, the test case data for the candidate interfaces is adjusted to obtain second updated test case data and second updated parameter nodes. The updated target interface node is selected as the target interface node, and the step of testing the target interface node is returned until the success rate of the test case results corresponding to the candidate interface is greater than the set threshold.
[0032] The above method, when performing automated testing on multiple interfaces, can collect interfaces with low pass rates and tag interfaces with high pass rates. By continuously iterating through these low-pass-rate interfaces, the graphical testing process can ultimately obtain as many high-pass-rate interfaces as possible. During the automated testing process, test case data is used to optimize the interfaces, achieving the goal of automated interface testing and optimization. The graphical testing process described in this application can thus obtain interfaces with high pass rates.
[0033] In one possible implementation, the tag interface is deleted from the target interface node to obtain an updated target interface node;
[0034] Save the use case data corresponding to the tag interface, and delete the tag interface from the target interface node to obtain the updated target interface node.
[0035] Secondly, embodiments of this application provide an automated testing device for a graphical interface, the device comprising:
[0036] The selection unit is used to respond to the user's interface node selection operation, determine the target interface node in the panel area selected by the user, and add the graphical test process corresponding to the target interface node in the display area.
[0037] The addition unit is used to add at least one parameter node from the parameter template in the panel area to the graphical test process based on the original interface definition data included in the target interface node; wherein, the parameter node includes test case data for testing the target interface node;
[0038] The testing unit is used to respond to the user-triggered operation of running the graphical testing process and to test the target interface node based on the test case data.
[0039] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory stores a computer program that can run on the processor, and when the computer program is executed by the processor, it implements the steps of any of the methods in the first aspect described above.
[0040] Fourthly, embodiments of this application provide a graphical interface automatic testing system, including an interface management module, a testing module, and a report generation module;
[0041] The interface management module is used to input and store the original interface definition data; wherein, the original interface definition data is structured data converted from unstructured data by the interface management module during the input of the original interface definition data;
[0042] The test module is used to perform the steps described in any one of the first aspects;
[0043] The report generation module is used to receive control instructions from the test module and generate a test report.
[0044] Fifthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of any of the methods in the first aspect described above.
[0045] In a sixth aspect, embodiments of this application provide a computer program product including computer-executable instructions, which are used to cause a computer to perform the steps of any of the methods in the first aspect.
[0046] The technical effects of any of the implementation methods in aspects two through six can be found in the technical effects of the corresponding implementation methods in aspect one, and will not be repeated here. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1 This application provides a schematic diagram of the structure of an automated testing system with a graphical interface.
[0049] Figure 2 A flowchart illustrating an automated graphical interface testing method provided in an embodiment of this application;
[0050] Figure 3 A schematic diagram of a test process provided in an embodiment of this application;
[0051] Figure 4 A schematic diagram of an interface for adding an interface node is provided for an embodiment of this application;
[0052] Figure 5 A schematic diagram of a graphical testing process provided in an embodiment of this application;
[0053] Figure 6 This is a schematic diagram of the structure of an automated testing device with a graphical interface provided in an embodiment of this application;
[0054] Figure 7 A schematic diagram of another graphical interface automatic testing device provided in an embodiment of this application;
[0055] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0057] It should be noted that the terms "comprising" and "having" and their variations used in this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or device.
[0058] In existing technologies, traditional interface testing relies on manual processes such as writing interface requests one by one, which is time-consuming, labor-intensive, and prone to oversights. Furthermore, it fails to leverage time and manpower to accumulate business experience and improve efficiency. Additionally, if the number of interfaces to be tested is large, manual testing is insufficient to complete the testing quickly.
[0059] To address the aforementioned issues, this application provides a graphical interface automatic testing method. In response to a user's interface node selection operation, the method determines the target interface node in the selected panel area and adds a graphical test process corresponding to the target interface node to the display area. Based on the original interface definition data included in the target interface node, at least one parameter node is added to the graphical test process from the parameter template in the panel area. In response to a user-triggered operation to run the graphical test process, the target interface node is tested based on test case data. This visualizes the entire interface testing process, allowing graphical test processes to be generated through drag-and-drop, simplifying large-scale complex business logic. Furthermore, the parameter nodes in the panel area can be reused for different target interfaces, improving efficiency in the interface testing process.
[0060] Figure 1 This application illustrates an application scenario of an automated graphical interface testing method provided in an embodiment of this application. See [link to relevant documentation]. Figure 1 As shown, a graphical interface automatic testing system 10 in this application scenario includes an interface management module 11, a testing module 12, and a report generation module 13.
[0061] The interface management module 11 is used to input and store the original interface definition data. This original interface definition data is structured data converted from unstructured data during the input process by the interface management module.
[0062] The testing module 12 is used to perform automated testing on interfaces based on the original interface definition data entered and stored in the interface management module 11. In response to the user's interface node selection operation, it determines the target interface node in the panel area selected by the user, and adds the corresponding graphical test process to the display area. Based on the original interface definition data included in the target interface node, it adds at least one parameter node from the parameter template in the panel area to the graphical test process. In response to the user-triggered operation to run the graphical test process, it tests the target interface node based on the test case data.
[0063] The test module 12 includes a panel area and a display area. The panel area contains various types of parameter nodes needed during the interface testing process. The display area is used to show the graphical test process, making the test process visual.
[0064] The report generation module 13 is used to receive control commands from the test module 12 and generate a test report.
[0065] To further illustrate the technical solutions provided in the embodiments of this application, a detailed description is provided below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiments of this application provide method operation steps as shown in the following embodiments or drawings, the method may include more or fewer operation steps based on conventional or non-inventive methods. In steps where there is no logically necessary causal relationship, the execution order of these steps is not limited to the execution order provided in the embodiments of this application.
[0066] See Figure 2 This is a flowchart illustrating an automated graphical interface testing method provided in an embodiment of this application, applied to an electronic device, which can be a test module. The method includes the following steps:
[0067] Step S201: In response to the user's interface node selection operation, determine the target interface node in the panel area selected by the user, and add the graphical test process corresponding to the target interface node in the displayed area.
[0068] In one possible embodiment, to enable automated testing of the interface, the interface management module is used to input and store the original interface definition data before testing. During the data input process, a large amount of unstructured data exists; the interface management module can structure all of this data during input, ensuring that the original interface definition data can be directly used by the testing module. Figure 3 A schematic diagram of a test process interface is shown. Figure 4 This diagram illustrates how to add a target interface node to the display area. The target interface node is API (Application Programming Interface)-1, as an example.
[0069] Step S202: Based on the original interface definition data included in the target interface node, add at least one parameter node from the parameter template in the panel area to the graphical test process.
[0070] The parameter node includes test case data for testing the target interface node.
[0071] In one possible embodiment, parameter nodes and non-parameter nodes are added to the graphical test process from the parameter template in the panel area according to the original interface definition data corresponding to API-1.
[0072] Based on the original interface definition data included in the target interface node, at least one parameter node selected by the user is added to the graphical test process from multiple node types of parameter nodes in the parameter template of the panel area. Then, non-parameter nodes selected by the user are added to the graphical test process from the parameter template of the panel area. In the graphical test process, the output of the test report parsing node in the non-parameter node is connected to at least one of the parameter nodes to adjust the test case data in the parameter node according to the output of the test report parsing node through at least one of the parameter nodes.
[0073] Among them, node types include component types, logical indicator types, and data experience types.
[0074] Specifically, component type nodes can be understood as a component library used for testing interfaces, which includes various child nodes. Parameter nodes for component types include parameter assembly nodes, function nodes, package nodes, etc.
[0075] Parameter nodes of logical indicator types can be understood as an assertion library for testing interfaces. This includes various assertion sub-nodes, such as response judgment nodes, format judgment nodes, equality nodes, containment nodes, similarity calculation nodes, and custom nodes.
[0076] Data-experience type parameter nodes can be understood as a knowledge base for testing interfaces. These include interface refinement nodes, parameter component algorithm refinement nodes, and network model module refinement nodes.
[0077] Non-parameter nodes include interface parsing nodes, test case generation nodes, test report nodes, and test report parsing nodes.
[0078] For example, after adding the API-1 interface node to the display area, a parsing node for the API-1 interface node also needs to be added from the non-parameter nodes in the parameter template. The output of the API-1 interface node is connected to the input of the parsing node, indicating that the original interface definition data in the API-1 interface node is parsed. During the execution of the graphical testing process, the parsing node can automatically parse the original definition data in the interface and transfer it to the parameter node to obtain test case data and automatically generate test cases.
[0079] For example, parameter nodes of component type include parameter assembly nodes, parameter nodes of logical indication type include response judgment nodes and format judgment nodes, and parameter nodes of data experience type include interface refinement nodes.
[0080] like Figure 5As shown, in response to the user adding parameter assembly nodes from the component-type parameter nodes in the panel area, adding response judgment nodes and format judgment nodes from the logic indicator-type parameter nodes, and adding interface refinement nodes from the data experience-type parameter nodes to the display area, these nodes are placed in parallel in the display area. The parameter assembly nodes may also include specific methods. Figure 5 Taking the pairing combination method as an example.
[0081] Among them, the response judgment node can be understood as the response code being normal, and the format judgment node can be understood as the format verification being normal. Figure 5 Taking the example of a normal response code and normal format verification.
[0082] Connect the output of the interface parsing node in parallel with the inputs of the four parameter nodes mentioned above, such as... Figure 5 As shown, this indicates that the interface is tested using the test case data from the four parameter nodes mentioned above.
[0083] In the non-parameter nodes, add the test case production node to the display area, and connect the outputs of the four parameter nodes mentioned above to the inputs of the test case production node in parallel. Then connect the input of the test report node to the output of the test case production node, and connect the output of the test report node to the input of the test report parsing node, indicating that the test report is being analyzed.
[0084] Optionally, by pre-setting the test case data required for each interface, in response to the user adding the target interface node to the display area, the testing module extracts the interfaces from the target interface node and automatically adds the corresponding parameter nodes from the panel area to the display area based on the pre-set test case data required for each interface. This method intelligently adds parameter nodes to the display area when the interface requires a small amount of test case data and a small number of parameter nodes, eliminating the need for the user to manually drag and drop parameter nodes. It is more convenient, faster, and more intelligent.
[0085] For example, connecting the output of the test report parsing node to the input of the interface refinement node in the parameter node indicates that the interface refinement node optimizes certain test case data in the test report or retests certain interfaces.
[0086] Step S203: In response to the user-triggered operation of running the graphical test process, test the target interface node based on the test case data.
[0087] In one possible embodiment, in response to the user's operation of running a graphical test process, the target interface node is parsed, and at least one test case data corresponding to the interface in the target interface node is obtained from the parameter node. Based on the at least one test case data corresponding to the interface in the target interface node, test case results are generated, and a test report is obtained.
[0088] The test case data corresponding to the parameter node can include a lot of test case data. If the interface node only includes one interface, the testing of the interface also includes multiple methods, which also require a lot of test case data.
[0089] The test report in this application is also output in a visual way for easy viewing by users. The test report will mark the test cases that failed during the interface testing process based on the test case data. When parsing the test report through the test report parsing node, the analysis speed can be effectively improved, which facilitates further optimization of the test case data or interfaces with low pass rates.
[0090] Specifically, a graphical testing process is established through the steps described above, allowing for visual testing of the interfaces. In response to the user's action of saving and running the graphical testing process, the target interface nodes are tested. After parsing the target interface nodes through the interface parsing node, test cases are generated through the parameter node and test case generation node, ultimately resulting in a test report.
[0091] When testing interfaces in an interface node, you can test only one interface at a time, or you can test interfaces in batches. There are two specific scenarios.
[0092] Scenario 1: Testing only one interface. This involves testing a single interface using multiple test cases, utilizing data from multiple test cases.
[0093] Specifically, the test report is analyzed. If it is determined that at least one test case result includes a successful test case result, the test case data corresponding to the successful test case result is tagged and saved. If it is determined that at least one test case result includes a failed test case result, the test case data corresponding to the failed test case result is adjusted according to the execution status of the test case data in the test report, and the first updated test case data and the first updated parameter node are obtained. The steps to test the target interface node are then returned until the test case result generated based on the first updated test case data is a successful test case result.
[0094] Scenario 2: Batch testing of multiple interfaces, with each interface using multiple test case data.
[0095] Specifically, the steps are as follows: First, determine the test case results for each of the multiple interfaces and the success rate of each test case result. Second, add tags to interfaces with a success rate greater than a set threshold to obtain tagged interfaces. Third, remove tagged interfaces from the target interface node to obtain an updated target interface node. Fourth, designate interfaces with a success rate less than the set threshold as candidate interfaces. Fifth, adjust the test case data for the candidate interfaces based on the execution status of the test case data in the test report to obtain second updated test case data and second updated parameter nodes. Sixth, designate the updated target interface node as the target interface node and return to execute the steps for testing the target interface node until the success rate of the test case results for the candidate interfaces exceeds the set threshold.
[0096] After testing the interface using the two methods described above, the test case data can be automatically collected and optimized, and the interface can be tested again. The entire process of testing the interface and backtracking is a closed loop, which can effectively reduce manpower input. Manpower is only added to adjust the program or algorithm when necessary. All interface testing is carried out using test modules, which improves testing efficiency and can also improve testing accuracy to a certain extent.
[0097] Furthermore, compared to traditional interface testing, this application establishes a test process through a graphical interface, generating and writing test cases. Furthermore, structured processing is incorporated into the initial data entry of the original interface definition, with pre-assembled data for various types of parameter nodes. When testing the interface, simply adding the nodes to the graphical test process achieves full automation and intelligence, enabling data traceability, analysis, and optimization.
[0098] Based on the same inventive concept, embodiments of this application also provide a graphical interface automatic testing device, such as... Figure 6 As shown, the device includes:
[0099] Selection unit 601 is used to respond to the user's interface node selection operation, determine the target interface node in the panel area selected by the user, and add the graphical test process corresponding to the target interface node in the display area.
[0100] The addition unit 602 is used to add at least one parameter node from the parameter template in the panel area to the graphical test process based on the original interface definition data included in the target interface node; wherein, the parameter node includes test case data for testing the target interface node;
[0101] Test unit 603 is used to respond to user-triggered operations to run a graphical test process and to test the target interface nodes based on test case data.
[0102] In one possible implementation, Figure 7 This application illustrates another graphical interface automatic testing apparatus provided in an embodiment of the present application, which further includes:
[0103] The parsing unit 701 is used to analyze the test report. If it is determined that at least one test case result includes a successful test case result, the test case data corresponding to the successful test case result is tagged and saved.
[0104] If it is determined that at least one test case result includes a failed test case result, the test case data corresponding to the failed test case result is adjusted according to the execution status of the test case data in the test report, and the first updated test case data and the first updated parameter node are obtained. Then, the steps to test the target interface node are returned until the test case result generated based on the first updated test case data is a successful test case result.
[0105] In one possible implementation, the parsing unit 701 is further configured to:
[0106] Determine the test case results for each of the multiple interfaces, and determine the success rate of the test case results for each interface.
[0107] Add a label to the interface whose test case result success rate is greater than a set threshold to obtain the labeled interface, and remove the labeled interface from the target interface node to obtain the updated target interface node;
[0108] Interfaces with a test case success rate less than a set threshold are selected as candidate interfaces. Based on the execution status of the test case data in the test report, the test case data for the candidate interfaces is adjusted to obtain the second updated test case data and the second updated parameter node. The updated target interface node is selected as the target interface node, and the steps to test the target interface node are returned until the success rate of the test case results for the candidate interface is greater than the set threshold.
[0109] This application also provides an electronic device, which includes at least a memory for storing data and a processor. The processor for data processing can be implemented using a microprocessor, CPU, GPU (Graphics Processing Unit), DSP, or FPGA. The memory stores operation instructions, which can be computer-executable code, to implement the various steps in the graphical interface automatic testing method described in this application.
[0110] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 8As shown, the electronic device 800 includes a memory 801, a processor 802, a data acquisition module 803, and a bus 804. The memory 801, processor 802, and data acquisition module 803 are all connected via the bus 804, which is used for data transmission between the memory 801, processor 802, and data acquisition module 803.
[0111] The memory 801 can be used to store software programs and modules. The processor 802 executes various functional applications and data processing of the electronic device 800 by running the software programs and modules stored in the memory 801, such as the graphical interface automatic testing method provided in this application embodiment. The memory 801 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs of at least one application, etc.; the data storage area may store data created according to the use of the electronic device 800, etc. In addition, the memory 801 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0112] The processor 802 is the control center of the electronic device 800. It connects various parts of the electronic device 800 via the bus 804 and various interfaces and lines. It executes various functions and processes data of the electronic device 800 by running or executing software programs and / or modules stored in the memory 801, and by calling data stored in the memory 801. Optionally, the processor 802 may include one or more processing units, such as a CPU, GPU (Graphics Processing Unit), or digital processing unit.
[0113] This application also provides a computer-readable storage medium storing computer-executable instructions. When the computer program is executed by a processor, it can be used to implement the graphical interface automatic testing method described in any embodiment of this application.
[0114] This application also provides a computer program product. Various aspects of the graphical interface automatic testing method provided in this application can also be implemented as a program product, which includes program code. When the program product is run on a computer device, the program code is used to cause the computer device to execute the steps of the graphical interface automatic testing method according to the various exemplary embodiments of this application described above. For example, the computer device can execute... Figure 2 The flowchart of the graphical interface automatic testing method shown in steps S201 to S203 is as follows.
[0115] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0116] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0117] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0118] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0119] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A graphical interface automatic testing method, characterized in that, The method includes: In response to the user's interface node selection operation, the target interface node in the panel area selected by the user is determined, and the graphical test process corresponding to the target interface node is added to the display area. Based on the original interface definition data included in the target interface node, at least one parameter node selected by the user is added to the graphical testing process from multiple node types of parameter nodes in the parameter template of the panel area; wherein, the parameter node includes test case data for testing the target interface node; the node types include component type, logic indication type, and data experience type; the component type parameter node includes parameter assembly node; the logic indication type parameter node includes response judgment node and format judgment node; the data experience type parameter node includes interface refinement node; From the parameter templates in the panel area, user-selected non-parameter nodes are added to the graphical test process. In the graphical test process, the output of the test report parsing node in the non-parameter nodes is connected to at least one of the parameter nodes to adjust the test case data in the parameter nodes based on the output of the test report parsing node. The non-parameter nodes include interface parsing nodes, test case generation nodes, test report nodes, and test report parsing nodes. In response to a user-triggered operation to run the graphical test process, the target interface node is tested based on the test case data.
2. The method according to claim 1, characterized in that, The operation of running the graphical test process in response to user triggering includes testing the target interface node based on the test case data, including: In response to the user's operation of running the graphical test process, the target interface node is parsed, and at least one test case data corresponding to the interface in the target interface node is obtained from the parameter node; Based on at least one test case data corresponding to the interface in the target interface node, generate test case results and obtain a test report.
3. The method according to claim 2, characterized in that, The target interface node includes one interface; After generating test case results and obtaining a test report based on at least one test case data corresponding to the interface in the target interface node, the method further includes: Analyze the test report. If it is determined that the results of at least one test case include successful test case results, then add tags to the test case data corresponding to the successful test case results and save them. If it is determined that the at least one test case result includes a failed test case result, the test case data corresponding to the failed test case result is adjusted according to the execution status of the test case data in the test report, and a first updated test case data and a first updated parameter node are obtained. The step of testing the target interface node is then returned until the test case result generated based on the first updated test case data is a successful test case result.
4. The method according to claim 2, characterized in that, The target interface node includes multiple interfaces; After generating test case results and obtaining a test report based on at least one test case data corresponding to the interface in the target interface node, the method further includes: Determine the test case results for each of the multiple interfaces, and determine the success rate of the test case results for each interface. The interfaces whose success rate of the test case results is greater than a set threshold are tagged to obtain tagged interfaces, and the tagged interfaces are removed from the target interface node to obtain the updated target interface node; Interfaces with a success rate of less than a set threshold are selected as candidate interfaces. Based on the execution status of the test case data in the test report, the test case data for the candidate interfaces is adjusted to obtain second updated test case data and second updated parameter nodes. The updated target interface node is selected as the target interface node, and the step of testing the target interface node is returned until the success rate of the test case results corresponding to the candidate interface is greater than the set threshold.
5. A graphical interface automatic testing device, characterized in that, The device includes: The selection unit is used to respond to the user's interface node selection operation, determine the target interface node in the panel area selected by the user, and add the graphical test process corresponding to the target interface node in the display area. An adding unit is used to add at least one parameter node selected by the user from multiple node types of parameter nodes in the parameter template of the panel area to the graphical test process, based on the original interface definition data included in the target interface node; wherein, the parameter node includes test case data for testing the target interface node; the node types include component type, logic indication type, and data experience type; the component type parameter node includes parameter assembly node; the logic indication type parameter node includes response judgment node and format judgment node; the data experience type parameter node includes interface refinement node; from the parameter template of the panel area, non-parameter nodes selected by the user are added to the graphical test process, and in the graphical test process, the output of the test report parsing node in the non-parameter node is connected to at least one of the parameter nodes, so as to adjust the test case data in the parameter node according to the output of the test report parsing node through at least one of the parameter nodes; wherein, the non-parameter nodes include interface parsing node, test case generation node, test report node, and test report parsing node; The testing unit is used to respond to the user-triggered operation of running the graphical testing process and to test the target interface node based on the test case data.
6. A graphical interface automatic testing system, characterized in that, It includes an interface management module, a testing module, and a report generation module; The interface management module is used to input and store the original interface definition data; wherein, the original interface definition data is structured data converted from unstructured data by the interface management module during the input of the original interface definition data; The test module is used to perform the method described in any one of claims 1 to 4; The report generation module is used to receive control instructions from the test module and generate a test report.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the method of any one of claims 1 to 4.
Citation Information
Patent Citations
Method and device for testing parameter rule of interface parameter and storage medium
CN110704317A
Test method and test device based on protocol interface
CN114153665A