Software system testing method and device, electronic equipment, and storage medium
By calling the object operation plug-in in the automation test tool, simulating the operation of external operating devices on the software system, the problem that the automation test tool cannot identify some UI objects during the recording script is solved, and the normal progress and efficiency of automation tests are achieved.
Patent Information
- Application Number
- CN202111487141.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-07
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2041-12-07
AI Technical Summary
The existing automation testing tools cannot recognize some UI objects during the recording of scripts, resulting in the automation testing being unable to proceed normally, and manual replacement of the test is required, which increases the workload.
Provides a test method for software systems. By analyzing whether the current recording script can recognize the menu tool for the specified software system, if it cannot be recognized, the object operation plug-in is called. The plug-in is pre-encapsulated with operation commands that simulate external operating devices on the software system, executes menu tool operation commands for the target test object, and combines the recorded test case results to generate an automated test report.
It realizes automatic identification of some unrecognized test objects, reduces manual testing actions, reduces workload, improves testing efficiency, and enables automated testing to proceed normally.
Smart Images

Figure CN114168470B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of system testing, and in particular to a testing method and device for a software system, an electronic device, and a storage medium. Background Art
[0002] As more and more software companies adopt tools for automated testing, in the process of writing and recording scripts for various automated testing tools based on GUI objects, it is found that there are always more or less UI objects that cannot be correctly recorded or recognized, resulting in the inability to carry out automated testing normally.
[0003] In the related art, GUI object-based automated testing tools are often based on object commands when performing script recording, such as the so-called "context mode" ordinary recording mode. In ordinary recording mode, right-click menus and secondary menus often fail to record successfully. For example, for the secondary and tertiary menus of PLM software, such right-click menus or right-click secondary and tertiary menus have a special point, and the menus are easy to disappear after the mouse moves. Such right-click option menus often cannot be recognized and recorded, which can easily lead to some functions of the product being unable to be covered by automated testing, requiring manual replacement testing, which increases the workload.
[0004] Therefore, it is necessary to solve the problem that some UI objects cannot be recognized when the automated testing tool is recording the script, and to add a mouse and keyboard event plug-in to generate the UI objects in the automated testing tool.
[0005] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0006] The embodiments of the present invention provide a testing method and device, an electronic device, and a storage medium for a software system, so as to at least solve the technical problem in the related art that the testing tool cannot recognize some test objects during the script recording process, and these test objects cannot perform automated testing and need manual replacement testing, which increases the workload.
[0007] According to one aspect of an embodiment of the present invention, a testing method for a software system is provided, comprising: analyzing whether a current recording script can identify a menu tool for each test object in a specified software system, wherein the recording script is used to record a process when each test case is executed, and the test case refers to a functional test of multiple test objects in the specified software system; in a case where the current recording script cannot identify a menu tool in a target test object in the specified software system, calling an object operation plug-in, wherein the object operation plug-in is pre-encapsulated with operation commands for simulating an external operation device on the specified software system; using the object operation plug-in to execute the operation commands for the menu tool in the target test object, and obtaining a system automation test report in combination with the test case test results of the recorded test cases.
[0008] Optionally, before analyzing whether the current recording script can identify the menu tools of each test object in the specified software system, the testing method also includes: obtaining multiple available operation commands of the specified software system; determining the operation function of the operating subject of the external operating device when completing each of the available operation commands on the system interface of the specified software system; and encapsulating the operation function corresponding to each of the available operation commands to obtain the object operation plug-in.
[0009] Optionally, when the current recording script cannot identify the menu tools in the target test object in the specified software system, the testing method further includes: obtaining a device path recording strategy, wherein the device path recording strategy is used to indicate the use of an external device to perform operations at a specified coordinate position in an interface in the software system; switching the script recording strategy using the current recording script to the device path recording strategy to identify the menu tools in the target test object in the specified software system.
[0010] Optionally, before analyzing whether the current recording script can identify the menu tool of each test object in the specified software system, the testing method also includes: obtaining product testing requirements and writing at least one test case based on the product testing requirements; recording the process of executing the test for each test case to generate the recording script.
[0011] Optionally, after generating the recording script, the testing method further includes: adding the test objects appearing in the specified software system to an object library; analyzing the number of occurrences of each test object in the object library in multiple recording scripts; and setting the test objects whose number of occurrences is greater than a first preset number threshold as shared objects.
[0012] Optionally, after generating the recording script, the testing method further includes: performing generalized encapsulation and functionalized encapsulation on the recording script, wherein the generalized encapsulation refers to encapsulating test cases whose occurrence times are greater than a second preset number threshold, and the functionalized encapsulation refers to functionally encapsulating serial test cases; analyzing the script type of the encapsulated recording script; and classifying the multiple recording scripts according to the script type.
[0013] Optionally, the menu tools included in the test object are classified into multiple menu levels and / or keyboard and mouse menu sets.
[0014] According to another aspect of an embodiment of the present invention, a testing device for a software system is also provided, comprising: an analyzing unit, used to analyze whether the current recording script can identify the menu tools of each test object in the specified software system, wherein the recording script is used to record the process of executing the test for each test case, and the test case refers to functional testing of multiple test objects in the specified software system; a calling unit, used to call an object operation plug-in when the current recording script cannot identify the menu tools in the target test object in the specified software system, wherein the object operation plug-in is pre-packaged with operation commands of a simulated external operation device on the specified software system; a determining unit, used to use the object operation plug-in to execute the operation commands on the menu tools in the target test object, and obtain a system automation test report in combination with the test case test results of the recorded test cases.
[0015] Optionally, the testing device of the software system also includes: a first acquisition unit, used to acquire multiple available operation commands of the specified software system before analyzing whether the current recording script can identify the menu tool of each test object in the specified software system; a first determination module, used to determine the operation function of the operating subject of the external operation device when completing each of the available operation commands on the system interface of the specified software system; a first encapsulation module, used to encapsulate the operation function corresponding to each of the available operation commands to obtain the object operation plug-in.
[0016] Optionally, the testing device of the software system also includes: a second acquisition unit, used to acquire a device path recording strategy when the current recording script cannot identify the menu tool in the target test object in the specified software system, wherein the device path recording strategy is used to indicate the use of an external device to operate at a specified coordinate position in the interface of the software system; a switching module, used to switch the script recording strategy using the current recording script to the device path recording strategy to identify the menu tool in the target test object in the specified software system.
[0017] Optionally, the testing device of the software system also includes: a third acquisition unit, used to obtain product testing requirements and write at least one test case based on the product testing requirements before analyzing whether the current recording script can identify the menu tool of each test object in the specified software system; a first generation module, used to record the process of executing the test for each test case and generate the recording script.
[0018] Optionally, the testing device of the software system also includes: an adding module, used to add the test objects appearing in the specified software system to the object library after generating the recording script; a first analysis module, used to analyze the number of occurrences of each test object in the object library in multiple recording scripts; and a setting module, used to set the test objects whose number of occurrences is greater than a first preset number threshold as shared objects.
[0019] Optionally, the testing device of the software system also includes: a second encapsulation module, which is used to perform general encapsulation and functional encapsulation on the recording script after generating the recording script, wherein the general encapsulation refers to encapsulating test cases whose number of occurrences is greater than a second preset number threshold, and the functional encapsulation refers to functional encapsulation of serial test cases; a second analysis module, which is used to analyze the script type of the encapsulated recording script; and a classification module, which is used to classify the multiple recording scripts according to the script type.
[0020] Optionally, the menu tools included in the test object are classified into multiple menu levels and / or keyboard and mouse menu sets.
[0021] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-described software system testing methods by executing the executable instructions.
[0022] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the software system testing methods described above.
[0023] In the present invention, an analysis is performed to determine whether the current recording script can identify the menu tool of each test object in the specified software system. When the current recording script cannot identify the menu tool in the target test object in the specified software system, an object operation plug-in is called, wherein the object operation plug-in is pre-encapsulated with an operation command of a simulated external operation device on the specified software system, and the object operation plug-in is used to execute the operation command of the menu tool in the target test object. Combined with the test results of the recorded test case, a system automation test report is obtained. In the present application, when the current recording script cannot identify the menu tool in the target test object in the specified software system, the menu tool in the test object can be operated by the object operation plug-in, so that the automation test can be carried out normally. The present application can realize the operation of a specific software system through the encapsulated object operation plug-in, realize the automatic identification of some test objects, reduce manual test actions, reduce manual workload, improve test work efficiency, enable the automation test to be carried out normally, and after execution, obtain an automation test report, thereby solving the technical problem that the test tool in the related art cannot identify some test objects during the script recording process, and the part of the test object cannot perform the automation test and needs manual replacement test, which increases the workload. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0025] Figure 1 is a flow chart of an optional software system testing method according to an embodiment of the present invention;
[0026] Figure 2 is a flowchart of another optional software system testing method according to an embodiment of the present invention;
[0027] Figure 3 is a schematic diagram of an optional software system testing device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only 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 should fall within the scope of protection of the present invention.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, 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 clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] The present invention can be applied to the automated testing of various software systems, including but not limited to: drawing software, product management systems (such as PLM systems), office software systems (for example, word operating systems), and can automatically identify menu tools (for example, secondary menus / right-click menus) of some test objects (for example, interface design UI objects), thereby improving the efficiency of automated testing.
[0031] The present invention is based on the testing method of the existing automated testing tool, and the testing method of the existing automated testing tool includes but is not limited to: a testing method based on object commands and a testing method based on the physical path of the mouse. In the prior art, when the testing method of the existing automated testing tool is adopted, the menu tools (e.g., secondary menu / right-click menu) of some test objects (e.g., interface design UI objects) may not be recorded successfully, resulting in that some functions of the product cannot be covered by automated testing, and manual replacement testing is required, which increases the workload. The present invention can provide an object operation plug-in, wherein the object operation plug-in is pre-encapsulated with operation commands for simulating external operation devices on a specified software system, and the operation commands for the menu tools in the target test object are executed by the object operation plug-in, so that the automated test can be carried out normally, and the test results of the recorded test cases are obtained in combination with the test method of the existing automated testing tool, and a system automated test report is obtained. The present invention is described below in conjunction with various embodiments.
[0032] Embodiment 1
[0033] According to an embodiment of the present invention, an embodiment of a testing method for a software system is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0034] Figure 1is a flowchart of an optional software system testing method according to an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:
[0035] Step S102, analyzing whether the current recording script can identify the menu tool of each test object in the specified software system, wherein the recording script is used to record the process of executing each test case, and the test case refers to functional testing of multiple test objects in the specified software system;
[0036] Step S104, when the current recording script cannot identify the menu tool in the target test object in the specified software system, calling the object operation plug-in, wherein the object operation plug-in is pre-encapsulated with the operation command of simulating the external operation device on the specified software system;
[0037] Step S106, using the object operation plug-in to execute the operation command of the menu tool in the target test object, combined with the test case test results of the recorded test case, to obtain a system automation test report.
[0038] Through the above steps, it is possible to analyze whether the current recording script can identify the menu tool of each test object in the specified software system. When the current recording script cannot identify the menu tool in the target test object in the specified software system, the object operation plug-in is called, wherein the object operation plug-in is pre-encapsulated with the operation command of the simulated external operation device on the specified software system, and the object operation plug-in is used to execute the operation command of the menu tool in the target test object, and the system automation test report is obtained in combination with the test case test results of the recorded test case. In this embodiment, when the current recording script cannot identify the menu tool in the target test object in the specified software system, the menu tool in the test object can be operated by the object operation plug-in, so that the automation test can be carried out normally. This embodiment can realize the operation of the specific software system through the encapsulated object operation plug-in, realize the automatic identification of some test objects, reduce manual test actions, reduce manual workload, improve test work efficiency, and enable the automation test to be carried out normally. After the execution is completed, an automation test report is obtained, thereby solving the technical problem that the test tool in the related art cannot recognize some test objects during the script recording process, and the part of the test object cannot perform the automation test and needs manual replacement test, which increases the workload.
[0039] The present invention is described below in conjunction with the above-mentioned implementation steps.
[0040] Optionally, before analyzing whether the current recording script can identify the menu tools of each test object in the specified software system, the testing method also includes: obtaining multiple available operation commands of the specified software system; determining the operation function of the operating subject of the external operating device when completing each available operation command on the system interface of the specified software system; encapsulating the operation function corresponding to each available operation command to obtain an object operation plug-in.
[0041] In this embodiment, a specific object operation plug-in can be developed for each type of software system. For example, for a specific drawing software (for example, CAD software) or PLM product life cycle management software, an autonomous command set function or an object operation plug-in can be set. In this embodiment, an object operation plug-in is used for schematic illustration, and the functions implemented by the autonomous command set function are the same as those of the object operation plug-in.
[0042] In this embodiment, the object operation plug-in is essentially an application program interface encapsulation function of the operating system, which simulates the working mode of an external operation device to cover the available operation commands in a specific software system. Optionally, the external operation device includes but is not limited to: a stylus, a mouse, and a keyboard; the available operation commands include but are not limited to: keyboard commands, control commands ctrl, shift commands, and Alt commands. The object operation plug-in can simulate the movement of an external operation device (such as a mouse) according to a relative position, simulate the operation of the left button, right button, and scroll wheel of the mouse, or simulate the mouse action operations such as pressing the mouse, double-clicking the mouse, lifting the mouse, and panning the mouse, and perform operations that cannot be achieved by the recorded script through encapsulated functions or object operation plug-ins.
[0043] For example, in the mapping software, the right-click menu WinKeyRight(Int Key, int Rightmenu1, intRightmenu2, int Rightmenu3, int Rmdeltx, int Rm1delty, int Rm2deltx, int Rm2delty, int Rm3deltx, int Rm3delty),
[0044] Key: ascii code;
[0045] Rightmenu1: right click first level menu;
[0046] Rightmenu2: right click secondary level menu;
[0047] Rightmenu3: right-click third-level menu;
[0048] Rm*deltx, Rm*delty: relative displacement to the first level menu, in pixels. In a system, the pixel height of a menu of the same level can be obtained by measurement. The number of times it needs to be moved is multiplied by the unit pixel height.
[0049] After the object operation plug-in is developed, it can be used in the automated testing process to complete operations such as clicking and moving object menus in certain systems.
[0050] Optionally, before analyzing whether the current recording script can identify the menu tool for each test object in the specified software system, the testing method also includes: obtaining product testing requirements and writing at least one test case based on the product testing requirements; recording the process of executing the test for each test case to generate a recording script.
[0051] In this embodiment, the product testing requirements can be analyzed, test cases can be written, and then the scripts can be recorded using an automated testing tool.
[0052] Test cases can refer to functional tests of multiple test objects in a specified software system. For example, for a word system, test cases can include but are not limited to: word creation test cases, word insertion test cases, word application layout test cases, and word view test cases. For different software systems, the test cases set and the way of repeated use are different.
[0053] Optionally, after generating the recording script, the testing method also includes: adding the test objects appearing in the specified software system to the object library; analyzing the number of occurrences of each test object in the object library in multiple recording scripts; and setting the test objects whose number of occurrences is greater than a first preset number threshold as shared objects.
[0054] After recording the script using the automated testing tool, it can be added to the object library. For example, the type of object library includes but is not limited to: graphical user interface GUI object library. Optionally, this embodiment can also formulate the naming rules of the test object (for example, UI object) object library and the naming rules of the encapsulated function while adding the test objects appearing in the specified software system to the object library.
[0055] After adding the test objects that appear in the specified software system to the object library, the object library can be classified and organized, and frequently used GUI objects can be set as shared objects (for the case of a large number of scripts), and infrequently used UI object libraries can be added to the local object library, so as to more efficiently manage the object library.
[0056] Optionally, after generating the recording script, the testing method also includes: generalizing and functionalizing the recording script, wherein generalizing refers to encapsulating test cases whose occurrence times are greater than a second preset number threshold, and functionalizing refers to functionalizing serial test cases; analyzing the script type of the encapsulated recording script; and classifying multiple recording scripts according to the script type.
[0057] In this embodiment, based on the test cases and recorded scripts, the scripts are generalized (generalization refers to encapsulation of general test functions, and general test functions refer to some test cases that are shared by multiple recorded scripts or have great similarity), packaged, and functionalized (functionalization refers to function encapsulation of serial test cases, and serial test cases refer to test cases that have a sequential execution relationship, for example, the action of opening a word includes a create word case, a file address confirmation case, and an open word case. These cases have a sequential execution relationship and need to be packaged for serial test cases), and the packaged scripts are subdivided and classified. The script types include but are not limited to: structured scripts and shared scripts.
[0058] Step S102, analyzing whether the current recording script can identify the menu tool of each test object in the specified software system, wherein the recording script is used to record the process of executing the test for each test case, and the test case refers to functional testing of multiple test objects in the specified software system.
[0059] Optionally, the menu tools included in the test object are classified into multiple menu levels and / or keyboard and mouse menu sets.
[0060] The menu hierarchy includes but is not limited to: main menu, first-level menu, second-level menu. The keyboard and mouse menu set includes but is not limited to: right-click menu. For some menu tools of UI objects such as second-level menus and right-click menus, many commonly used testing tools cannot recognize them. It is necessary to call the object operation plug-in pre-configured in this application to simulate the operation commands and implement the operation of these menu tools.
[0061] Step S104, when the current recording script cannot identify the menu tool in the target test object in the specified software system, call the object operation plug-in, wherein the object operation plug-in is pre-encapsulated with operation commands simulating an external operation device on the specified software system.
[0062] Step S106, using the object operation plug-in to execute the operation command of the menu tool in the target test object, combined with the test case test results of the recorded test case, to obtain a system automation test report.
[0063] In this embodiment, an object operation plug-in can be used to execute operation commands on the menu tools in the target test object to obtain object test results, which can be combined with the case test results of the recorded test cases to obtain the object test results, and the object test results and the case test results of the recorded test cases can be integrated.
[0064] Optionally, when the current recording script cannot identify the menu tools in the target test object in the specified software system, the testing method also includes: obtaining a device path recording strategy, wherein the device path recording strategy is used to indicate the use of an external device to perform operations at a specified coordinate position in the interface of the software system; switching the script recording strategy using the current recording script to a device path recording strategy to identify the menu tools in the target test object in the specified software system.
[0065] If some menu tools (for example, right-click menus, secondary menus, and tertiary menus) cannot be recorded during the recording process, you can first try to switch to other recording methods - device path recording strategies, to verify whether they can be correctly identified. The device path recording strategy can be understood as the physical path recording of the mouse. In this method, the fixed coordinates of the image pixel points are used to implement menu tool identification and self-testing at the specified position. After adopting the device path recording strategy, if it still cannot be correctly identified, you can call the OS autonomous command set function or the object operation plug-in to process and identify the object.
[0066] The device path recording strategy and the identification method of calling the object operation plug-in of this embodiment can be run in parallel, and both can identify the menu tool in the target test object in the specified software system.
[0067] In the automated testing tool, test objects that cannot be recorded can be added to the object library through external devices, and the manually added test objects can be classified and organized, and the internal functions of the software system can be called for universal settings and functional packaging. The script can be run to automatically perform tests without supervision, and the automated test cases and automated test scripts can be bound to each other to view the results of the automated test run and to see whether the unrecognizable test objects can be correctly identified during the run process.
[0068] The present invention is described below in conjunction with another optional implementation manner.
[0069] Figure 2 is a flowchart of another optional software system testing method according to an embodiment of the present invention, such as Figure 2 As shown, including:
[0070] (1) Analyze test requirements and write test cases;
[0071] (2) Use the automated testing tool to record the script (obtain the recorded script), add the GUI object library, and formulate the naming rules of the UI object functions;
[0072] (3) Categorize and organize the GUI object library. Frequently used GUI objects are set as shared objects (for a large number of scripts), and infrequently used UI object libraries are added to the local object library.
[0073] (4) Encapsulate scripts. Based on the test cases and recorded scripts, encapsulate the scripts in a generalized and functional manner. And further classify the encapsulated functions into structured scripts, shared scripts, and other categories.
[0074] (5) Identify the right-click menu, secondary menu, and tertiary menu.
[0075] (6) Determine whether the right-click menu, second-level menu, and third-level menu can be recognized. If the right-click menu, second-level menu, or third-level menu cannot be recorded during recording, try switching to other recording methods to verify whether they can be correctly recognized.
[0076] (7) If it still cannot be correctly identified, the autonomous command set function or object operation plug-in should be called for identification.
[0077] (8) Perform automated testing. Automatically run the recorded script, view the results of the automated test run by binding the recorded script and the object operation plug-in, and view the recognized UI objects.
[0078] Through the above embodiments, when performing automated testing on a software system, if an unrecognizable test object is encountered, an autonomous command set function or an object operation plug-in can be called to implement automated testing.
[0079] The present invention is described below in conjunction with another optional embodiment.
[0080] Embodiment 2
[0081] This embodiment provides a testing device for a software system. The various implementation units included in the testing device correspond to the various implementation steps in the above-mentioned first embodiment.
[0082] Figure 3 is a schematic diagram of an optional software system testing device according to an embodiment of the present invention, such as Figure 3 As shown, the test device may include: an analysis unit 31, a calling unit 33, and a determination unit 35, wherein:
[0083] An analyzing unit 31, used for analyzing whether the current recording script can identify the menu tool of each test object in the specified software system, wherein the recording script is used to record the process of executing each test case, and the test case refers to functional testing of multiple test objects in the specified software system;
[0084] The calling unit 33 is used to call the object operation plug-in when the current recording script cannot identify the menu tool in the target test object in the specified software system, wherein the object operation plug-in is pre-encapsulated with the operation command of simulating the external operation device on the specified software system;
[0085] The determination unit 35 is used to use the object operation plug-in to execute the operation command of the menu tool in the target test object, and obtain a system automation test report in combination with the test case test results of the recorded test cases.
[0086] The testing device of the above-mentioned software system can analyze whether the current recording script can identify the menu tools of each test object in the specified software system through the analysis unit 31, and call the object operation plug-in through the calling unit 33 when the current recording script cannot identify the menu tools in the target test object in the specified software system, wherein the object operation plug-in is pre-encapsulated with the operation commands of the simulated external operation device on the specified software system, and the object operation plug-in is used by the determination unit 35 to execute the operation commands of the menu tools in the target test object, and the system automation test report is obtained in combination with the test results of the recorded test cases. In this embodiment, when the current recording script cannot identify the menu tools in the target test object in the specified software system, the menu tools in the test object can be operated through the object operation plug-in, so that the automated test can proceed normally. This embodiment can implement operations on specific software systems through encapsulated object operation plug-ins, realize automatic identification of some test objects, reduce manual testing actions, reduce manual workload, improve testing work efficiency, and enable automated testing to proceed normally. After execution, an automated test report is obtained, thereby solving the technical problem in the related technology that the test tool cannot identify some test objects during the script recording process, and these test objects cannot perform automated testing and need manual replacement testing, which increases the workload.
[0087] Optionally, the testing device for the software system also includes: a first acquisition unit, used to acquire multiple available operation commands of the specified software system before analyzing whether the current recording script can identify the menu tool of each test object in the specified software system; a first determination module, used to determine the operation function of the operating subject of the external operation device when completing each available operation command on the system interface of the specified software system; a first encapsulation module, used to encapsulate the operation function corresponding to each available operation command to obtain an object operation plug-in.
[0088] Optionally, the testing device for the software system also includes: a second acquisition unit, used to acquire a device path recording strategy when the current recording script cannot identify the menu tool in the target test object in the specified software system, wherein the device path recording strategy is used to indicate the use of an external device to operate at a specified coordinate position in the interface of the software system; and a switching module, used to switch the script recording strategy using the current recording script to the device path recording strategy to identify the menu tool in the target test object in the specified software system.
[0089] Optionally, the testing device for the software system also includes: a third acquisition unit, used to obtain product testing requirements and write at least one test case based on the product testing requirements before analyzing whether the current recording script can identify the menu tool for each test object in the specified software system; a first generation module, used to record the process of executing the test for each test case and generate a recording script.
[0090] Optionally, the testing device for the software system also includes: an adding module, used to add the test objects appearing in the specified software system to the object library after generating the recording script; a first analysis module, used to analyze the number of occurrences of each test object in the object library in multiple recording scripts; and a setting module, used to set the test objects whose number of occurrences is greater than a first preset number threshold as shared objects.
[0091] Optionally, the testing device of the software system also includes: a second encapsulation module, which is used to perform general encapsulation and functional encapsulation on the recorded script after generating the recorded script, wherein general encapsulation refers to encapsulating test cases whose number of occurrences is greater than a second preset number threshold, and functional encapsulation refers to functional encapsulation of serial test cases; a second analysis module, which is used to analyze the script type of the encapsulated recorded script; and a classification module, which is used to classify multiple recorded scripts according to script type.
[0092] Optionally, the menu tools included in the test object are classified into multiple menu levels and / or keyboard and mouse menu sets.
[0093] The testing device of the above-mentioned software system may also include a processor and a memory. The above-mentioned analysis unit 31, calling unit 33, determination unit 35, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0094] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the object test results and the case test results of the recorded test cases are integrated by adjusting the kernel parameters to obtain a system automation test report.
[0095] The above-mentioned memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one storage chip.
[0096] According to another aspect of an embodiment of the present invention, a storage medium is provided, the storage medium including a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute any one of the above-mentioned software system testing methods.
[0097] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned software system testing methods by executing the executable instructions.
[0098] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium including a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute a method for testing a software system of any one of the above items.
[0099] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with the following method steps: analyzing whether the current recording script can identify the menu tools of each test object in the specified software system, wherein the recording script is used to record the process of executing each test case, and the test case refers to functional testing of multiple test objects in the specified software system; when the current recording script cannot identify the menu tools in the target test object in the specified software system, calling the object operation plug-in, wherein the object operation plug-in pre-encapsulates the operation commands of the simulated external operation device on the specified software system; using the object operation plug-in to execute the operation commands of the menu tools in the target test object, and combining the test results of the recorded test cases to obtain a system automation test report.
[0100] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0101] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0102] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0103] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0104] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0105] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0106] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A software system testing method, characterized in that: include: Analyze whether the current recording script can identify the menu tool of each test object in the specified software system, wherein the recording script is used to record the process of executing each test case, and the test case refers to functional testing of multiple test objects in the specified software system; In the case where the current recording script cannot identify the menu tool in the target test object in the specified software system, obtain a device path recording strategy, wherein the device path recording strategy is used to indicate the use of an external device to operate at a specified coordinate position in the interface of the software system; switch the script recording strategy using the current recording script to the device path recording strategy to identify the menu tool in the target test object in the specified software system; or, When the current recording script cannot identify the menu tool in the target test object in the specified software system, call the object operation plug-in, wherein the object operation plug-in pre-encapsulates the operation commands of the simulated external operation device on the specified software system; use the object operation plug-in to execute the operation commands on the menu tool in the target test object, and obtain a system automation test report in combination with the test case test results of the recorded test case.
2. The testing method according to claim 1, characterized in that: Before analyzing whether the current recording script can identify the menu tool of each test object in the specified software system, the testing method further includes: Obtaining multiple available operation commands of the specified software system; Determine an operation function when an operation subject of the external operation device completes each of the available operation commands on the system interface of the specified software system; The operation function corresponding to each of the available operation commands is encapsulated to obtain the object operation plug-in.
3. The testing method according to claim 1, characterized in that: Before analyzing whether the current recording script can identify the menu tool of each test object in the specified software system, the testing method further includes: Obtain product testing requirements, and write at least one test case based on the product testing requirements; The process of executing the test for each test case is recorded to generate the recording script.
4. The testing method according to claim 3, characterized in that: After generating the recording script, the testing method further includes: Adding the test objects appearing in the specified software system to the object library; Analyzing the number of occurrences of each test object in the object library in a plurality of recording scripts; The test object whose occurrence times is greater than a first preset times threshold is set as a shared object.
5. The testing method according to claim 3, characterized in that: After generating the recording script, the testing method further includes: The recording script is packaged in a generalized manner and in a functionalized manner, wherein the generalized packaging refers to packaging test cases whose occurrence times are greater than a second preset number threshold, and the functionalized packaging refers to functionally packaging serial test cases; Analyze the script type of the packaged recorded script; The plurality of recording scripts are classified according to the script type.
6. The testing method according to any one of claims 1 to 5, characterized in that: The menu tools included in the test object are classified into multiple menu levels and / or keyboard and mouse menu sets.
7. A testing device for a software system, characterized in that: include: An analyzing unit, used for analyzing whether the current recording script can identify the menu tool of each test object in the specified software system, wherein the recording script is used to record the process of executing the test for each test case, and the test case refers to functional testing of multiple test objects in the specified software system; A second acquisition unit is used to acquire a device path recording strategy when the current recording script cannot identify the menu tool in the target test object in the specified software system, wherein the device path recording strategy is used to indicate that an external device is used to operate at a specified coordinate position of the interface in the software system; a switching module is used to switch the script recording strategy using the current recording script to the device path recording strategy to identify the menu tool in the target test object in the specified software system; A calling unit, used for calling an object operation plug-in when the current recording script cannot identify the menu tool in the target test object in the specified software system, wherein the object operation plug-in is pre-encapsulated with an operation command simulating an external operation device on the specified software system; The determination unit is used to use the object operation plug-in to execute the operation command of the menu tool in the target test object, and obtain a system automation test report in combination with the test case test results of the recorded test case.
8. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the software system testing method according to any one of claims 1 to 6 by executing the executable instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the software system testing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Application system and method for creating component-based program development framework
CN108572813A
Webpage testing method and device, terminal equipment and medium
CN110377500A