Graphical interface automatic regression test method and system, electronic equipment, computer readable storage medium and computer program product

Through the automated regression testing method based on Tcl controls, the misjudgment problems caused by complex graphic interface recognition and resolution changes in the automation test of graphical interfaces in the prior art are solved, and accurate automated testing of graphical interfaces is achieved.

CN119690857AInactive Publication Date: 2025-03-25CHENGDU WEIDE QINGYUN ELECTRONICS CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510206484.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-03-25
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing graphical interface automation testing tools have misjudgment and accuracy problems when identifying complex graphics and handling resolution changes.

Method used

Using an automated regression testing method based on Tcl controls, the graphical interface is automatically tested by obtaining and executing Tcl commands in the test script. This method includes registering Tcl controls, recording and saving test scripts, and executing test scripts through the Tcl interpreter.

Benefits of technology

It realizes accurate reading and comparison of all attributes and program operation data of any Tcl control in the graphical interface, avoids misjudgment caused by changes in resolution and interface appearance, and improves the accuracy and efficiency of the test.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690857A_ABST
    Figure CN119690857A_ABST
Patent Text Reader

Abstract

The invention provides an automatic regression test method and system for a graphical interface, electronic equipment, a computer readable storage medium and a computer program product.The automatic regression test method for the graphical interface comprises the steps that a test script is obtained, and the test script records target operation of a user on a control on a software window in a script mode; the test script is executed, automatic regression testing is achieved, the test script comprises one or more Tcl commands, and each Tcl command corresponds to one target operation. According to the method and the device, automatic regression testing is realized, and the technical problems of result misjudgment and failed comparison of fine adjustment such as control appearance, color matching and the like caused by low resolution in the traditional technology can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of testing of graphical interface software, and in particular to a graphical interface automated regression testing method, system, electronic device, computer-readable storage medium and computer program product. Background Art

[0002] The testing content of graphical interface software mainly includes mouse and keyboard operations in the software interface, such as keyboard input and mouse clicks, and then judges the correctness of the operation response and text or graphic display. Due to the randomness, diversity and complexity of graphical interface operations and displays, these tests are mainly carried out by manual testing. Manual testing has many defects, such as: (1) There are many repeated steps in the test, and the efficiency of manual testing is low; (2) For interfaces with more graphic elements, manual judgment is easy to miss; (3) For occasional problems when the software combination has more operation steps, the operation steps are difficult to reproduce, and it is difficult for developers to locate the problem.

[0003] In the existing related technologies, the main test tools used are automated test tools based on image recognition or hook technology, but each has some shortcomings. The probability of error in the recognition result of automated test tools based on image recognition is relatively high. Automated test tools based on hook technology cannot accurately judge complex graphics such as waveforms and charts. In order to avoid the problems in the above two solutions, this technical solution adopts a technical solution that is completely different from image recognition and hook technology. Summary of the invention

[0004] The purpose of the present invention is to provide a graphical interface automated regression testing method, system, electronic device, computer-readable storage medium and computer program product, which can solve technical problems such as misjudgment caused by low resolution and image recognition failure due to comparison of control appearance, color matching and other fine-tuning.

[0005] Technical solution: According to the first aspect of the embodiment of the present application, a graphical interface automated regression testing method is provided, comprising: Obtain a test script, wherein the test script records the user's target operation on the control in the software window in a script manner; The test script is executed to implement automated regression testing, wherein the test script includes one or more Tcl commands, and each of the Tcl commands corresponds to a target operation.

[0006] In one embodiment, before obtaining the test script, the process includes: Register different categories of Tcl controls, and each category of Tcl controls registers one or more Tcl commands.

[0007] In one embodiment, before obtaining the test script, the method further includes: Register an identifier and an object pointer of a Tcl control, and bind the identifier of the Tcl control to the object pointer.

[0008] In one implementation, obtaining the test script includes: Enable the script recording function to monitor and record the user's target operations on the Tcl control in the software window, and record the target operations in the form of scripts; Converting the target operation into a custom Tcl command, and binding the custom Tcl command to the Tcl control through an identifier of the Tcl control; Turn off the script recording function and save the recorded Tcl commands as a test script.

[0009] In one implementation, obtaining the test script includes: Read the created test script.

[0010] In one embodiment, executing the test script to implement automated regression testing includes: The custom Tcl commands in the test script are interpreted, and the corresponding Tcl controls are located according to the interpreted custom Tcl commands.

[0011] In one embodiment, executing the test script to implement automated regression testing includes: Interpret the Tcl commands in the test script and locate the corresponding Tcl controls according to the interpreted Tcl commands.

[0012] In one embodiment, executing the test script to implement automated regression testing further includes: When executing the entire test script or executing a single test command, the test command input by the user is accepted and the test command is inserted into the command queue to complete the automated regression test.

[0013] In one embodiment, it further includes: The target operation is replayed by executing the test script, so that the user can confirm whether the recorded test script can correctly simulate the user's operation.

[0014] In one embodiment, executing the test script further includes: when there are multiple regression test threads, controlling each regression test thread to wait for one or more other threads to complete their corresponding execution tasks before executing the next Tcl command.

[0015] In one embodiment, after closing the script recording function and saving the recorded Tcl command as a test script, the method further includes: Use a text editor to modify the test script to obtain an updated test script.

[0016] According to a second aspect of an embodiment of the present application, there is provided a graphical interface automated regression testing system, the system comprising a Tcl interpreter and a Tcl control, the Tcl interpreter and the Tcl control being connected; The Tcl interpreter is used to obtain a test script, which records the user's target operations on controls in a software window in a script format; execute the test script to implement automated regression testing, and the test script includes one or more Tcl commands, each of which corresponds to a target operation.

[0017] In one embodiment, an object registration module is further included. The object registration module is connected to the Tcl control and is used to register the identifier and object pointer of the Tcl control and bind the identifier of the Tcl control with the object pointer.

[0018] In one embodiment, it also includes a command registration module, which is connected to the Tcl interpreter. The command registration module is used to register Tcl commands corresponding to read and write operations of different categories of Tcl controls in the Tcl interpreter. The Tcl interpreter registers one or more Tcl commands for each category of Tcl controls.

[0019] In one embodiment, it further includes an operation recording management module and a command execution module, wherein the operation recording management module is connected to the Tcl control and the Tcl interpreter respectively, and the command execution module is connected to the Tcl interpreter and the Tcl control respectively; The operation recording management module is used to enable the script recording function, monitor and record the user's target operation on the Tcl control in the software window, and record the target operation in the form of a script; convert the target operation into a custom Tcl command, and bind the custom Tcl command to the Tcl control through the identifier of the Tcl control; turn off the script recording function, and save the recorded Tcl command as a test script; The command execution module is used to interpret the custom Tcl commands in the test script, locate the corresponding Tcl control according to the interpreted custom Tcl commands, and accept the test commands input by the user when executing the entire test script or executing a single test command, and insert the test commands into the command queue to complete the automated regression test.

[0020] In one embodiment, it further comprises a script management module, wherein the script management module is connected to the Tcl interpreter; The script management module is used to read the created test script; The command execution module is used to interpret the Tcl commands in the test script and locate the corresponding Tcl controls according to the interpreted Tcl commands.

[0021] In one implementation, the script management module uses a text editor to modify the test script to obtain an updated test script.

[0022] In one embodiment, the Tcl interpreter is further used to replay the target operation by executing the test script, so that the user can confirm whether the test script generated by recording can correctly simulate the user's operation.

[0023] In one embodiment, a delay module is also included, which is connected to the command execution module and the Tcl control respectively. The delay module is used to control one or more regression test threads so that each regression test thread waits for one or more other threads to complete its corresponding execution task before executing the next Tcl command.

[0024] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory and a processor, wherein the memory is used to store a computer program executable by the processor; and the processor is used to execute the computer program in the memory to implement the above method.

[0025] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the executable computer program in the storage medium is executed by a processor, the above method can be implemented.

[0026] According to a fifth aspect of an embodiment of the present application, a computer program product includes a computer program, and the computer program implements the above method when executed by a processor.

[0027] The beneficial effects of the present invention are as follows: (1) The present invention obtains a test script, which records the user's target operation on the control in the software window in the form of a script; executes the test script to implement automated regression testing, wherein the test script includes one or more Tcl commands, and each Tcl command corresponds to a target operation. The user operation is converted into a Tcl command, and all properties of any Tcl control on the graphical interface, intermediate data of program running, etc. can be read, and compared with the expected value at the string level, without technical problems such as misjudgment caused by low resolution, and comparison failure of graphics recognition due to fine-tuning of control appearance and color matching. And the data compared by the present invention are all from the memory data of the Tcl control, which is independent of resolution and interface appearance, etc., thereby improving the accuracy of recognition.

[0028] (2) The present invention can also recognize complex graphics such as waveforms and charts by directly reading the waveform or chart data for data comparison to determine whether the waveform or chart data is consistent with the expected data, thereby avoiding misjudgment caused by slight changes in resolution and waveform in graphic recognition, reducing the complexity of result judgment, and greatly improving the accuracy of judgment. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 is a flow chart of a graphical interface automated regression testing method according to an exemplary embodiment; Figure 2 It is a block diagram of a graphical interface automated regression testing system according to an exemplary embodiment.

[0030] 1. Tcl interpreter; 2. Tcl control; 3. Object registration module; 4. Command registration module; 5. Operation recording management module; 6. Command execution module; 7. Script management module; 8. Delay module. DETAILED DESCRIPTION

[0031] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Unless otherwise defined, the technical terms or scientific terms used herein should be understood by people with general skills in the field to which the present invention belongs. "Including" and similar words used in this article mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects.

[0032] In the related art, the automated testing tool based on image recognition has the problem of graphic recognition accuracy. When there are slight changes in the color or image resolution of the interface elements, the image recognition accuracy decreases, and the probability of error in the recognition result is relatively large. Although the probability of recognition error can be reduced to a certain extent by adjusting parameters such as tolerance, in the recognition of graphic elements of complex graphics such as waveforms and tables, the change of waveform position or the alignment of text in the table will greatly increase the probability of image result judgment failure. The automated testing tool based on hook technology intercepts the target operation, records, modifies and replays it, and then judges some attributes of the element by obtaining the interface element information, thereby completing the verification of the interface function. However, the attributes obtained by hook technology are limited, and it is impossible to accurately judge complex graphics such as waveforms and charts. Therefore, in order to avoid the problems in the two solutions of automated testing tools based on image recognition or based on hook technology, the present invention adopts a technical solution that is completely different from image recognition and hook technology.

[0033] In order to solve the above technical problems, an embodiment of the present invention provides a graphical interface automated regression testing method, such as Figure 1 As shown, the graphical interface automated regression testing method comprises: S100: Initialize the regression test environment. S200: registering different types of Tcl controls, registering one or more Tcl commands for each type of Tcl control.

[0034] S300: registering the identifier and the object pointer of the Tcl control, and binding the identifier and the object pointer of the Tcl control.

[0035] There are two options for obtaining the test script corresponding to the target operation of the user on the window: creating a new test script or executing a test script.

[0036] S411: Start the script recording function to monitor and record the user's target operation on the control on the software window. At this time, all the user's operations on the software window will be recorded for subsequent playback operations. Get the test script, which records the user's target operation on the control on the software window in the form of a script.

[0037] Execute the test script to realize the automated regression test. The test script includes one or more Tcl commands, and each Tcl command corresponds to a target operation, such as single-click, double-click, drag and drop, etc.

[0038] S412: Convert the target operation into a custom Tcl command and parameters, and bind the custom Tcl command to the Tcl control through an identifier of the Tcl control.

[0039] S413: Turn off the script recording function and save the recorded Tcl commands as a test script.

[0040] S4131: Use a text editor to further modify the test script.

[0041] S414: Automatically save the test script or the modified test script into a system file.

[0042] As another embodiment of the present invention, the script recording function is turned off, the recorded Tcl commands are saved as test scripts, and the test scripts are automatically saved in system files; further comprising: For example, adjust the Tcl command sequence (i.e. adjust the position of the Tcl command corresponding to the target operation in the file), delay, parameters, etc. There is no need to repeat recording to modify parameters, saving time and power consumption.

[0043] S420: Read the test script.

[0044] S500: interpreting Tcl commands in the test script or user-defined Tcl commands.

[0045] S600: locate the corresponding Tcl control according to the interpreted Tcl command and complete the corresponding Tcl control operation. These operations will be displayed in real time in the console on the software window, and the execution command, progress and results will be displayed in real time.

[0046] After all the above test scripts are executed, you can choose to replay the target operation and perform automated regression testing.

[0047] The present invention is based on Tcl controls, and can read all properties of any Tcl control on a graphical interface, intermediate data of program operation, etc., and compare them with expected values ​​at the string level, without the technical problems of misjudgment caused by low resolution, comparison failure of control appearance and color matching, etc. The data compared by the present invention all come from the memory data of the Tcl control, which is independent of the resolution and interface appearance, etc., and improves the accuracy of recognition.

[0048] The present invention can also directly read the waveform or chart data for data comparison to determine whether the waveform or chart data is consistent with the expected data, thereby avoiding misjudgment caused by slight changes in resolution and waveform in graphic recognition, reducing the complexity of result judgment, and greatly improving the correctness of judgment. At the same time, the present invention can also set a tolerance range for the data during data comparison to avoid misjudgment caused by slight fluctuations in waveform and chart data, thereby improving the accuracy of judgment.

[0049] As another embodiment of the present invention, when there are multiple regression test threads in the system, each regression test thread is controlled to wait for one or more other threads to complete their corresponding execution tasks before executing the next Tcl command.

[0050] For example, when processing multiple Tcl commands at the same time, it is detected that the execution of command B depends on the background thread to complete the data loading operation; the main test thread will suspend the execution of command B and wait for the background thread to complete the data loading; after the data loading is completed, the background thread notifies the main test thread that the data loading is complete; the main test thread resumes the execution of command B and calls the callback function of the Tcl control corresponding to command B to perform the operation defined by command B; the main test thread continues to execute subsequent test commands until the entire test script is executed.

[0051] As another embodiment of the present invention, when executing the entire test script or executing a single test command, the user can manually input a test command and insert the command into the command queue to complete the automated regression test. This provides a channel for manual intervention, reduces the complexity and difficulty of script development, shortens development time, simplifies maintenance, and has strong adaptability.

[0052] An embodiment of the present invention provides a graphical interface automated regression testing system, such as Figure 2 As shown, the system includes a Tcl interpreter 1 and a Tcl control 2, and the Tcl interpreter 1 and the Tcl control 2 are connected; the Tcl interpreter 1 is used to obtain a test script, and the test script records the user's target operation on the control in a script form on the software window; execute the test script to realize automated regression testing, and the test script includes one or more Tcl commands, and each Tcl command corresponds to a target operation, such as single-click, double-click, drag and drop, etc.

[0053] In this embodiment, Figure 2 As shown, it also includes an object registration module 3, which is connected to the Tcl control 2 respectively. The object registration module 3 is used to register the identifier and object pointer of the Tcl control 2, and bind the identifier of the Tcl control 2 with the object pointer to facilitate finding the corresponding Tcl control 2 when executing the script.

[0054] In this embodiment, Figure 2 As shown, it also includes a command registration module 4, which is connected to the Tcl interpreter 1. The command registration module 4 is used to register the Tcl commands corresponding to the read and write operations of different categories of Tcl controls 2 in the Tcl interpreter 1. The Tcl interpreter 1 registers one or more Tcl commands for each category of Tcl controls 2.

[0055] In this embodiment, Figure 2As shown, it also includes an operation recording management module 5 and a command execution module 6. The operation recording management module 5 is connected to the Tcl control 2 and the Tcl interpreter 1 respectively, and the command execution module 6 is connected to the Tcl interpreter 1 and the Tcl control 2 respectively; the operation recording management module 5 is used to enable the script recording function, monitor and record the user's target operation on the Tcl control in the software window, and record the target operation in the form of a script; convert the target operation into a custom Tcl command, and bind the custom Tcl command to the Tcl control through the identifier of the Tcl control; turn off the script recording function, and save the recorded Tcl command as a test script; the command execution module 6 is used to interpret the custom Tcl command in the test script, and locate the corresponding Tcl control according to the interpreted custom Tcl command, and when executing the entire test script or executing a single test command, accept the test command input by the user, and insert the test command into the command queue to complete the automated regression test.

[0056] In this embodiment, Figure 2 As shown, it also includes a script management module 7, which is connected to the Tcl interpreter 1; the script management module 7 is used to read the created test script; the command execution module 6 is used to interpret the Tcl commands in the test script, and locate the corresponding Tcl control 2 according to the interpreted Tcl commands. In the process of executing the script test, the user can edit the recorded script at the same time through the script management module 7, and there is no restriction on the editing content, as long as the Tcl script syntax is met, and it has rich extensibility. Through this method, all properties of any control on the interface, the intermediate data of the program running, etc. can be read and judged, and compared with the expected value at the string level, which greatly improves the accuracy of the test.

[0057] In this embodiment, Figure 2 As shown, the script management module 7 is also used to modify the test script using a text editor to obtain an updated test script.

[0058] In this embodiment, Figure 2 As shown, the Tcl interpreter 1 is also used to replay the target operation by executing the test script, so that the user can confirm whether the test script generated by recording can correctly simulate the user's operation.

[0059] In this embodiment, Figure 2 As shown, a delay module 8 is also included, which is connected to the command execution module 6 and the Tcl control 2 respectively. The delay module 8 is used to control one or more regression test threads so that each regression test thread waits for one or more other threads to complete their corresponding execution tasks before executing the next Tcl command. The delay module 8 ensures that the threads in the test process work together in a predetermined order to maintain the accuracy and stability of the test.

[0060] When creating a regression test script for the first time (one test case or multiple test cases), first open the script recording function by operating the recording management module 5. At this time, the target operations of all Tcl controls 2 in the software window will be recorded in the form of a script, and the Tcl command corresponding to the user's current target operation will be displayed in the console. The user can edit the Tcl command corresponding to the current target operation, such as manually inserting a test point, specifying the target file for the result output, etc. When all the user operations are completed, turn off the recording function and stop recording all operations of the control. After the operation stops, the regression test system automatically saves the script to the file system through the script management module 7. If there is no need to modify any process, parameter or result judgment in the original operation, the recorded Tcl script can be directly run to complete the automation operation of the above interface. If the operation needs to be modified, the user can use any text editor to modify the recorded test script file, adjust the interface control operation sequence, operation delay and control parameters, etc., without having to repeat the recording. After the test script is created, the regression test system can run the test script regularly to complete the regular and timed execution of the test script. When the software function changes, the user only needs to view the corresponding test report to perform a quick regression test on the correctness of the new and changed functions.

[0061] In addition, users can load previously created or saved test scripts and implement automated testing by executing the test scripts. First, the test script file is read through the script management module 7, and then all Tcl commands in the test script are sent to the Tcl interpreter 1. The Tcl interpreter 1 is responsible for interpreting all Tcl commands. After interpretation, the corresponding Tcl control 2 operation is completed through the command execution module 6 to implement automated regression testing.

[0062] If there is a delay command, the delay module will control the corresponding Tcl command to pause, time and resume, etc. At the same time, the user can choose to execute the entire test script or execute a single test command, that is, during the running of the test script, the user can manually enter a test command in the software window console, and the command execution module 6 inserts the command into the command queue and sends it to the Tcl interpreter 1 to complete the subsequent process.

[0063] For interfaces with more interface elements, the number of Tcl commands and Tcl control 2 identification codes will become very large. In order to facilitate user use, this solution adopts fuzzy matching to provide users with convenient input, that is, when the user enters the test command or the identifier of Tcl control 2, the user only needs to enter part of the Tcl command or Tcl control 2 identification code, and the regression test system intelligently infers the complete Tcl command or Tcl control 2 identifier that the user wants to enter based on the partial content entered by the user, and automatically completes the Tcl command or Tcl control 2 identification code to achieve the purpose of quickly inserting commands. You can also use the regression test system to view the identification code of Tcl control 2 on the interface or the shortcut menu provided on the interface to insert the Tcl control 2 identification code into the command being edited with one click, quickly complete the editing of the command, such as control replacement and naming, and start regression testing.

[0064] In addition, if the user needs to know the identifier of a Tcl control 2 on the interface during use, he only needs to simply use commands in the interface or perform operations such as mouse movement. The regression test system will display the Tcl control 2 information through the interface console, and the user can quickly view or copy the Tcl control 2 identifier with one click. When the test script is executed, the current execution command, execution progress, execution results and other information will be displayed in real time in the console of the software window. At the same time, the user can control the playback process, such as pause, stop and other operations. The executed test script and the running results will be recorded in the test file. Later, the user can view the execution status of each command in real time and edit the Tcl command.

[0065] When the Tcl interpreter 1 is used in conjunction with the Tcl control 2, the Tcl script can operate Tcl objects through a specific interface or API (usually through a packaged library or module). This means that the Tcl script can use Qt's native object system to obtain the control objects in the Tcl interface through object identifiers or other identifiers, and then call the methods of these objects or modify their properties, thereby achieving dynamic control and interaction of the interface. This combination takes advantage of Tcl's flexibility and Tcl's powerful interface building capabilities, providing a powerful tool for scenarios such as automated testing and interface scripting control.

[0066] The present invention records the target operation in the form of a Tcl script, and after recording, the target operation is played back through script execution to realize automatic testing of the graphical interface. At the same time, the software running result and the expected value can be compared in a string manner through Tcl commands.

[0067] At the beginning of the implementation of the present invention, the Qt native control in the source code needs to be replaced with the Tcl control 2. Only the control declaration needs to be replaced without any modification to the code logic, and the impact on the source code is minimal.

[0068] At the same time, during data comparison, the present invention can also set a tolerance range for the data, thereby avoiding misjudgment caused by slight fluctuations in waveform and chart data and improving the accuracy of judgment.

[0069] Through these two steps, users can effectively create and execute regression test scripts, ensure that the functions of GUI software work as expected, and be able to quickly perform regression testing after the software is updated.

[0070] Although the embodiments of the present invention are described in detail above, it is obvious to those skilled in the art that various modifications and variations can be made to these embodiments. However, it should be understood that such modifications and variations are within the scope and spirit of the present invention as described in the claims. Moreover, the present invention described herein may have other embodiments and may be implemented or realized in a variety of ways.

Claims

1. A graphical interface automated regression testing method, characterized in that: include: Obtain a test script, wherein the test script records the user's target operation on the control in the software window in a script manner; The test script is executed to implement automated regression testing, wherein the test script includes one or more Tcl commands, and each of the Tcl commands corresponds to a target operation.

2. The testing method according to claim 1, characterized in that: Before obtaining the test script, the following steps are included: Register different categories of Tcl controls, and each category of Tcl controls registers one or more Tcl commands.

3. The testing method according to claim 2, characterized in that: Before obtaining the test script, the method further includes: Register an identifier and an object pointer of a Tcl control, and bind the identifier of the Tcl control to the object pointer.

4. The testing method according to claim 3, characterized in that: The obtaining of the test script comprises: Enable the script recording function to monitor and record the user's target operations on the Tcl control in the software window, and record the target operations in the form of scripts; Converting the target operation into a custom Tcl command, and binding the custom Tcl command to the Tcl control through an identifier of the Tcl control; Turn off the script recording function and save the recorded Tcl commands as a test script.

5. The testing method according to claim 3, characterized in that: The obtaining of the test script comprises: Read the created test script.

6. The testing method according to claim 4, characterized in that: The executing of the test script to realize automated regression testing includes: The custom Tcl commands in the test script are interpreted, and the corresponding Tcl controls are located according to the interpreted custom Tcl commands.

7. The testing method according to claim 5, characterized in that: The executing of the test script to realize automated regression testing includes: Interpret the Tcl commands in the test script and locate the corresponding Tcl controls according to the interpreted Tcl commands.

8. The testing method according to claim 6, characterized in that: Executing the test script to implement automated regression testing also includes: When executing the entire test script or executing a single test command, the test command input by the user is accepted and the test command is inserted into the command queue to complete the automated regression test.

9. The testing method according to claim 1, characterized in that: Also includes: The target operation is replayed by executing the test script, so that the user can confirm whether the recorded test script can correctly simulate the user's operation.

10. The testing method according to claim 1, characterized in that: The executing the test script further includes: when there are multiple regression test threads, controlling each of the regression test threads to wait for one or more other threads to complete their corresponding execution tasks before executing the next Tcl command.

11. The testing method according to claim 4, characterized in that: After closing the script recording function and saving the recorded Tcl commands as a test script, the method further includes: Use a text editor to modify the test script to obtain an updated test script.

12. A graphical interface automated regression testing system, characterized in that: The system comprises a Tcl interpreter and a Tcl control, wherein the Tcl interpreter and the Tcl control are connected; The Tcl interpreter is used to obtain a test script, which records the user's target operations on controls in a software window in a script format; execute the test script to implement automated regression testing, and the test script includes one or more Tcl commands, each of which corresponds to a target operation.

13. The test system according to claim 12, characterized in that: It also includes an object registration module, which is connected to the Tcl control and is used to register the identifier and object pointer of the Tcl control and bind the identifier of the Tcl control with the object pointer.

14. The test system according to claim 13, characterized in that: It also includes a command registration module, which is connected to the Tcl interpreter and is used to register Tcl commands corresponding to read and write operations of different categories of Tcl controls in the Tcl interpreter. The Tcl interpreter registers one or more Tcl commands for each category of Tcl controls.

15. The test system according to claim 14, characterized in that: It also includes an operation recording management module and a command execution module, wherein the operation recording management module is connected to the Tcl control and the Tcl interpreter respectively, and the command execution module is connected to the Tcl interpreter and the Tcl control respectively; The operation recording management module is used to enable the script recording function, monitor and record the user's target operation on the Tcl control in the software window, and record the target operation in the form of a script; convert the target operation into a custom Tcl command, and bind the custom Tcl command to the Tcl control through the identifier of the Tcl control; Turn off the script recording function and save the recorded Tcl commands as a test script; The command execution module is used to interpret the custom Tcl commands in the test script, locate the corresponding Tcl control according to the interpreted custom Tcl commands, and accept the test commands input by the user when executing the entire test script or executing a single test command, and insert the test commands into the command queue to complete the automated regression test.

16. The test system according to claim 15, characterized in that: It also includes a script management module, which is connected to the Tcl interpreter; The script management module is used to read the created test script; The command execution module is used to interpret the Tcl commands in the test script and locate the corresponding Tcl controls according to the interpreted Tcl commands.

17. The test system according to claim 16, characterized in that: The script management module is also used to modify the test script using a text editor to obtain an updated test script.

18. The test system according to claim 12, characterized in that: The Tcl interpreter is also used to replay the target operation by executing the test script, so that the user can confirm whether the test script generated by recording can correctly simulate the user's operation.

19. The test system according to claim 16, characterized in that: It also includes a delay module, which is connected to the command execution module and the Tcl control respectively. The delay module is used to control one or more regression test threads so that each regression test thread waits for one or more other threads to complete its corresponding execution task before executing the next Tcl command.

20. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory is used to store a computer program executable by the processor; and the processor is used to execute the computer program in the memory to implement the method according to any one of claims 1 to 11.

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

22. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Graphical interface automatic test method and device, storage medium and electronic equipment

    CN118277241A