Software testing tool and use method thereof
Through the element positioning, process provision and data processing modules of the software testing tool, the problem of difficulty in maintaining UI automated test cases is solved, flexible maintenance and efficient testing are achieved, and maintenance costs are reduced.
Patent Information
- Application Number
- CN202410694780.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-09-20
AI Technical Summary
It is difficult to maintain UI automated test cases, which leads to frequent changes in interface elements and layout, causing test failure and increasing maintenance costs.
Provides a software testing tool, including an element positioning module, a process providing module and a data processing module. By calling instructions to find and process target elements, processes and data, it reduces the need to modify test cases and achieves flexible maintenance of UI automated test cases. .
It improves the maintenance efficiency and accuracy of UI automated test cases, avoids test failures caused by changes in interface elements and layout, and reduces maintenance costs.
Smart Images

Figure CN118672901A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a software testing tool and a method for using the same. Background Art
[0002] With the continuous development of computer technology, more and more functions are developed based on software. Among the numerous functions, a lot of manpower is needed to perform manual testing. At this time, in order to save manpower and improve efficiency, automated testing is proposed, which executes the function flow through code-written test cases to input whether the function is available. In order to be closer to user operations, UI automated testing is proposed, that is, using code to simulate the user's use process to test whether the interface process is available.
[0003] However, a problem that often arises in the process of writing UI automation is that the elements and layout of the interface will frequently change with changes in functionality, which places very high demands and difficulties on the maintenance of UI automation test cases.
[0004] Therefore, how to maintain UI automation test cases has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] In view of this, the present invention provides a software testing tool and a method for using the same to solve the problem of how to maintain UI automation test cases, which has become a technical problem that needs to be solved urgently.
[0006] In a first aspect, the present invention provides a software testing tool, the software testing tool comprising:
[0007] An element locating module, used to find a target element based on the first calling instruction, so that the target test case calls the target element to complete the target UI test;
[0008] A process providing module, used for providing a target process for a target test case based on a second calling instruction, so that the target test case completes a target UI test based on the target process;
[0009] The data processing module is used to complete the processing of the target data based on the third calling instruction, so that the target test case completes the target UI test based on the target data.
[0010] The software testing tool provided by the embodiment of the present application, the element positioning module can search for the target element based on the first call instruction, ensure the accuracy of the target element found, and enable the target test case to call the target element to complete the target UI test, so there is no need to write code in the target test case to find the target element. In addition, when the target element in the target test case changes, it is not necessary to modify the target test case, only the element positioning module in the software testing tool needs to be modified, so it is convenient to maintain the target test case of UI automation, and the elements and layout of the interface will not change frequently with the change of function. In addition, the process providing module can provide the target process for the target test case based on the second call instruction, ensuring the accuracy of the target process provided. The target test case can complete the target UI test based on the target process, so there is no need to write the target process in the target test case. Then, when the target process needs to be modified, it is not necessary to modify the target test case, but only the process providing module in the software testing tool needs to be modified, so it is convenient to maintain the target test case of UI automation, and the elements and layout of the interface will not change frequently with the change of function. The data processing module can complete the processing of the target data based on the third call instruction, thereby ensuring the accuracy of the processing of the target data, and there is no need to write the code for processing the target data in the target test case, and the target test case completes the target UI test based on the target data. When the process of processing the target data changes, there is no need to modify the target test case, only the software testing tool needs to be modified. Therefore, it is convenient to maintain the target test case of UI automation.
[0011] In an optional implementation of the present application, the process providing module includes a process aggregation module, wherein:
[0012] The process aggregation module is used to obtain the test process corresponding to the test function; aggregate the test process corresponding to the test function to generate a test process package corresponding to the test function; according to the second calling instruction, provide a test process package for the target test case so that the target test case completes the target UI test based on the test process package.
[0013] In the software testing tool provided in the embodiment of the present application, the process aggregation module obtains the test process corresponding to the test function; the test process corresponding to the test function is aggregated to generate a test process package corresponding to the test function, thereby ensuring the accuracy of the test process package corresponding to the generated test function. According to the second call instruction, a test process package is provided for the target test case, so that the target test case completes the target UI test based on the test process package, thereby ensuring the accuracy of the provided test process package. The target test case can complete the target UI test based on the test process package, so there is no need to write a test process package in the target test case. Furthermore, when the target process needs to be modified, there is no need to modify the target test case, but only to modify the test process package in the process providing module in the software testing tool. Therefore, it is convenient to maintain the target test case of UI automation, and the elements and layout of the interface will not change frequently with the change of functions.
[0014] In an optional embodiment of the present application, a process aggregation module is used to identify the second calling instruction, determine the target test function included in the second calling instruction, and based on the target test function, obtain the target test process package corresponding to the target test function; and provide the target test process package to the target test case so that the target test case completes the target UI test based on the target test process package.
[0015] In the software testing tool provided by the embodiment of the present application, the process aggregation module identifies the second call instruction, determines the target test function included in the second call instruction, and ensures the accuracy of the target test function included in the determined second call instruction. Based on the target test function, the target test process package corresponding to the target test function is obtained, and the accuracy of the target test process package corresponding to the obtained target test function is ensured. The target test process package is provided to the target test case, so that the target test case completes the target UI test based on the target test process package, thereby eliminating the need to write a test process package in the target test case. As a result, when the target process needs to be modified, there is no need to modify the target test case, but only to modify the test process package in the process providing module in the software testing tool. Therefore, it is convenient to maintain the target test case of UI automation, and the elements and layout of the interface will not change frequently with the change of functions.
[0016] In an optional implementation of the present application, the process providing module includes a process splitting module, wherein:
[0017] The process splitting module is used to obtain the test process corresponding to the test function, split the test process corresponding to the test function, and generate sub-test process packages based on each test process; according to the second calling instruction, provide at least one sub-test process package for the target test case, so that the target test case completes the target UI test based on each sub-test process package.
[0018] The software testing tool provided in the embodiment of the present application, the process splitting module obtains the test process corresponding to the test function, splits the test process corresponding to the test function, generates sub-test process packages based on each test process, and ensures the accuracy of the generated sub-test process packages. According to the second calling instruction, at least one sub-test process package is provided for the target test case, so that the target test case completes the target UI test based on each sub-test process package, which ensures the accuracy of providing at least one sub-test process package for the target test case, and facilitates the target test case to call each sub-test process package, and facilitates the maintenance of the target test case.
[0019] In an optional embodiment of the present application, a process splitting module is used to identify the second calling instruction, determine the target test function included in the second calling instruction and the target sub-test process corresponding to the target test function; based on the target test function, determine the target test process corresponding to the target test function; obtain the second identification information corresponding to the target sub-test process; based on the second identification information corresponding to the target sub-test process, search for the target sub-test process package corresponding to the target sub-test process from the target test process; and provide the target sub-test process package corresponding to the target sub-test process to the target test case, so that the target test case completes the target UI test based on the target sub-test process package.
[0020] In the software testing tool provided in the embodiment of the present application, the process splitting module identifies the second call instruction, determines the target test function included in the second call instruction and the target sub-test process corresponding to the target test function, thereby ensuring the accuracy of the determined target sub-test process. Based on the target test function, determine the target test process corresponding to the target test function; obtain the second identification information corresponding to the target sub-test process; based on the second identification information corresponding to the target sub-test process, search the target sub-test process package corresponding to the target sub-test process from the target test process, thereby ensuring the accuracy of the target sub-test process package corresponding to the determined target sub-test process. Provide the target sub-test process package corresponding to the target sub-test process to the target test case, so that the target test case completes the target UI test based on the target sub-test process package, thereby ensuring the accuracy of providing at least one sub-test process package for the target test case, and facilitating the target test case to call each sub-test process package, thereby facilitating the maintenance of the target test case.
[0021] In an optional embodiment of the present application, an element locating module is used to identify a first calling instruction, determine second identification information corresponding to a target element included in the calling instruction, search for the target element based on the second identification information, and provide the target element to a target test case so that the target test case calls the target element target UI test.
[0022] In the software testing tool provided in the embodiment of the present application, the element positioning module identifies the first call instruction, determines the second identification information corresponding to the target element included in the call instruction, and ensures the accuracy of the determined second identification information. The target element is searched based on the second identification information, and the target element is provided to the target test case so that the target test case calls the target element target UI test, which ensures the accuracy of the found target element, thereby facilitating the maintenance of the target test case based on the software testing tool.
[0023] In an optional implementation of the present application, a data processing module is used to identify a third calling instruction, determine target data included in the third calling instruction and a target operation corresponding to the target data; and process the target data according to the target operation so that the target test case completes the target UI test based on the target data.
[0024] In the software testing tool provided by the embodiment of the present application, the data processing module identifies the third call instruction, determines the target data included in the third call instruction and the target operation corresponding to the target data, and ensures the accuracy of the determined target data and the target operation corresponding to the target data. The target data is processed according to the target operation so that the target test case completes the target UI test based on the target data, ensuring the accuracy of the target operation on the target data, and thus there is no need to perform the target operation on the target data based on the target test case.
[0025] In an optional implementation of the present application, the target operation is a read operation, and the data processing module is used to obtain second identification information corresponding to the target data, search the target data from the database according to the second identification information, and provide the target data to the target test case, so that the target test case completes the target UI test based on the target data.
[0026] In the software testing tool provided in the embodiment of the present application, the data processing module obtains second identification information corresponding to the target data, searches for the target data from the database according to the second identification information, and provides the target data to the target test case so that the target test case completes the target UI test based on the target data, thereby ensuring the accuracy of reading the target data. As a result, there is no need for the target test case to search for the target data, which facilitates the maintenance of the target test case.
[0027] In an optional implementation of the present application, the target operation is a write operation, and the data processing module is used to obtain the target data and the target address corresponding to the target data, and write the target data to the target address according to the target address.
[0028] In the software testing tool provided in the embodiment of the present application, the data processing module obtains the target data and the target address corresponding to the target data, and writes the target data to the target address according to the target address, thereby ensuring the accuracy of the write operation on the target data.
[0029] In a second aspect, the present application provides a method for using a software testing tool, the method comprising:
[0030] Get the target UI test;
[0031] Based on the target UI test, determine the target elements, target processes, and target data corresponding to the target UI test;
[0032] Sending a first calling instruction to a software testing tool to call a target element based on the software testing tool; wherein the software testing tool is a software testing tool of the first aspect and any corresponding implementation manner thereof;
[0033] Sending a second calling instruction to the software testing tool to call the target process based on the software testing tool;
[0034] Sending a third call instruction to the software testing tool to complete processing of the target data based on the software testing tool;
[0035] Generate target test cases based on target elements, target processes and target data;
[0036] Complete target UI testing based on target test cases.
[0037] The method for using the software testing tool provided in the embodiment of the present application obtains the target UI test; based on the target UI test, the target element, target process and target data corresponding to the target UI test are determined to be completed, thereby ensuring the accuracy of the target element, target process and target data corresponding to the target UI test. A first call instruction is sent to the software testing tool to call the target element based on the software testing tool, thereby ensuring the accuracy of calling the target element. A second call instruction is sent to the software testing tool to call the target process based on the software testing tool, thereby ensuring the accuracy of calling the target process. A third call instruction is sent to the software testing tool to complete the processing of the target data based on the software testing tool, thereby ensuring the accuracy of processing the target data. Based on the target element, target process and target data, a target test case is generated, thereby ensuring the accuracy of the generated target test case, and there is no need to write the code for calling the target element, target process and target data in the target test case, thereby facilitating the maintenance of the target test case. Then, based on the target test case, the target UI test is completed, thereby ensuring the accuracy of completing the target UI test. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 is a schematic diagram of the structure of a software testing tool according to an embodiment of the present invention;
[0040] Figure 2 is a schematic diagram of the structure of another software testing tool according to an embodiment of the present invention;
[0041] Figure 3 is a structural diagram of another software testing tool according to an embodiment of the present invention;
[0042] Figure 4 It is a flowchart of a method for using a software testing tool according to an embodiment of the present invention. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution 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 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0044] With the continuous development of computer technology, more and more functions are developed based on software. Among the numerous functions, a lot of manpower is needed to perform manual testing. At this time, in order to save manpower and improve efficiency, automated testing is proposed, which executes the function flow through code-written test cases to input whether the function is available. In order to be closer to user operations, UI automated testing is proposed, that is, using code to simulate the user's use process to test whether the interface process is available.
[0045] However, a problem that often arises in the process of writing UI automation is that the elements and layout of the interface will frequently change with changes in functionality, which places very high demands and difficulties on the maintenance of UI automation test cases.
[0046] Specifically, the hyper-converged web system is developed based on the front-end VUE framework. The software testing tools for the system functions need to write use cases. If the UI test case process only relies on automation tools to write use cases, the uncontrollability will be greatly increased. Because the interface elements often change during the development process, the use cases written by the UI automation tools will become invalid after the interface elements are changed, which greatly increases the maintenance cost.
[0047] Therefore, how to maintain UI automation test cases has become a technical problem that needs to be solved urgently.
[0048] Based on the above problems, this application proposes to provide a set of SDK (Software Development Kit) for software testing tools to call in the process of front-end engineering development based on VUE. The writing of UI automation test cases only needs to consider the process without considering the interface elements and layout changes. The writing of UI automation test cases can be easily completed by directly calling the methods and interfaces in the SDK. At the same time, both the SDK and the VUE project are maintained by R&D personnel, ensuring a high degree of unity.
[0049] like Figure 1 As shown, the embodiment of the present application provides a software testing tool, the software testing tool includes:
[0050] An element locating module, used to find a target element based on the first calling instruction, so that the target test case calls the target element to complete the target UI test;
[0051] A process providing module, used for providing a target process for a target test case based on a second calling instruction, so that the target test case completes a target UI test based on the target process;
[0052] The data processing module is used to complete the processing of the target data based on the third calling instruction, so that the target test case completes the target UI test based on the target data.
[0053] Specifically, when the electronic device generates a target test case corresponding to the target UI test, it can call the element positioning module in the software testing tool. The element positioning module then searches for the target element required to generate the target test case based on the first calling instruction of the electronic device, so that the target test case can call the target element to complete the target UI test. This eliminates the need to write code instructions for calling the target element in the target test case, thereby facilitating the maintenance of the target test case.
[0054] For example, the target test case wants to obtain a certain input element for assignment. This function can be directly written in this unit, similar to document.querySelect("input").value=param, where param is the parameter of the unit function. The software testing tool only needs to call the function of the element positioning module to pass in the value.
[0055] In addition, when the electronic device generates a target test case corresponding to the target UI test, it can call the process providing module in the software testing tool. Then, the process providing module searches for the target process required to generate the target test case based on the second calling instruction of the electronic device, so that the target test case can call the target process to complete the target UI test, thereby eliminating the need to write code instructions for calling the target process in the target test case, thereby facilitating the maintenance of the target test case.
[0056] Similarly, when the electronic device generates a target test case corresponding to the target UI test, it can call the data processing module in the software testing tool. Then, the data processing module completes the processing of the target data based on the third calling instruction of the electronic device, so that the target test case can complete the target UI test based on the target data, thereby eliminating the need to write code instructions for processing the target data in the target test case, thereby facilitating the maintenance of the target test case.
[0057] The software testing tool provided by the embodiment of the present application, the element positioning module can search for the target element based on the first call instruction, ensure the accuracy of the target element found, and enable the target test case to call the target element to complete the target UI test, so there is no need to write code in the target test case to find the target element. In addition, when the target element in the target test case changes, it is not necessary to modify the target test case, only the element positioning module in the software testing tool needs to be modified, so it is convenient to maintain the target test case of UI automation, and the elements and layout of the interface will not change frequently with the change of function. In addition, the process providing module can provide the target process for the target test case based on the second call instruction, ensuring the accuracy of the target process provided. The target test case can complete the target UI test based on the target process, so there is no need to write the target process in the target test case. Then, when the target process needs to be modified, it is not necessary to modify the target test case, but only the process providing module in the software testing tool needs to be modified, so it is convenient to maintain the target test case of UI automation, and the elements and layout of the interface will not change frequently with the change of function. The data processing module can complete the processing of the target data based on the third call instruction, thereby ensuring the accuracy of the processing of the target data, and there is no need to write the code for processing the target data in the target test case, and the target test case completes the target UI test based on the target data. When the process of processing the target data changes, there is no need to modify the target test case, only the software testing tool needs to be modified. Therefore, it is convenient to maintain the target test case of UI automation.
[0058] In an optional embodiment of the present application, Figure 2 As shown, the process providing module includes a process aggregation module, wherein:
[0059] The process aggregation module is used to obtain the test process corresponding to the test function; aggregate the test process corresponding to the test function to generate a test process package corresponding to the test function; according to the second calling instruction, provide a test process package for the target test case so that the target test case completes the target UI test based on the test process package.
[0060] Specifically, the process aggregation module can obtain each test process corresponding to the test function, and then aggregate the test processes corresponding to the test function to generate a test process package corresponding to the test function. Then, when the electronic device generates a target test case corresponding to the target UI test, it can call the process aggregation module in the software testing tool. Then, based on the second call instruction, the process aggregation module first searches for the test process package required for the target test case, and provides the target test case with the test process package required for the target test case, so that the target test case completes the target UI test based on the test process package.
[0061] Exemplarily, the process of creating a virtual machine in the target test case includes the operations of next step, previous step, cancel and finish. If only the software development tools in the current technology are used to write the target test case, it is necessary to find the specific button element through the software development tool to obtain the element and then trigger the click event. The software testing tool provided in the embodiment of the present application can package the previous step, next step, finish and cancel in the process of creating a virtual machine into a process of creating a virtual machine. In this way, the software testing tool does not need to find the element and trigger the click, but directly calls the test process package to perform the previous step, next step, finish or cancel.
[0062] In an optional implementation of the present application, the process aggregation module can also obtain the number of times the test process package corresponding to each test function is called, and then determine the priority corresponding to each test process package according to the number of times the test process package corresponding to each test function is called, and sort each test process package according to the priority corresponding to each test process package, so as to facilitate the search and call of the test process package.
[0063] In an optional embodiment of the present application, a process aggregation module is used to identify the second calling instruction, determine the target test function included in the second calling instruction, and based on the target test function, obtain the target test process package corresponding to the target test function; and provide the target test process package to the target test case so that the target test case completes the target UI test based on the target test process package.
[0064] Specifically, the process aggregation module can identify the second calling instruction, determine the target test function included in the second calling instruction, and based on the target test function, search for the target test process package corresponding to the target test function; provide the target test process package to the target test case so that the target test case completes the target UI test based on the target test process package.
[0065] The software testing tool provided by the embodiment of the present application, the process aggregation module obtains the test process corresponding to the test function; the test process corresponding to the test function is aggregated and processed to generate the test process package corresponding to the test function, thereby ensuring the accuracy of the test process package corresponding to the generated test function. The process aggregation module identifies the second call instruction, determines the target test function included in the second call instruction, and ensures the accuracy of the target test function included in the determined second call instruction. Based on the target test function, the target test process package corresponding to the target test function is obtained, thereby ensuring the accuracy of the target test process package corresponding to the acquired target test function. The target test process package is provided to the target test case, so that the target test case completes the target UI test based on the target test process package, thereby eliminating the need to write the test process package in the target test case. As a result, when the target process needs to be modified, the target test case does not need to be modified, and only the test process package in the process providing module in the software testing tool needs to be modified. Therefore, it is convenient to maintain the target test case of UI automation, and the elements and layout of the interface will not change frequently with the change of functions.
[0066] In an optional embodiment of the present application, Figure 3 As shown, the process provides a module, including a process splitting module, in which:
[0067] The process splitting module is used to obtain the test process corresponding to the test function, split the test process corresponding to the test function, and generate sub-test process packages based on each test process; according to the second calling instruction, provide at least one sub-test process package for the target test case, so that the target test case completes the target UI test based on each sub-test process package.
[0068] Specifically, the process splitting module can obtain the test process corresponding to the test function, split each test process corresponding to the test function, and generate a sub-test process package based on each test process. Then, the process splitting module can provide at least one sub-test process package for the target test case according to the second calling instruction, so that the target test case completes the target UI test based on each sub-test process package.
[0069] For example, the process splitting module can split a virtual machine creation process into several sub-test processes, so that a use case for creating a virtual machine needs to be called step by step, and it is also convenient to write some abnormal operations within the process. However, for some normal flow operations, there is no need to further call the written API, and it can be directly encapsulated into a process function, so that it can be directly called when writing a normal virtual machine creation process test, which greatly improves efficiency.
[0070] In an optional embodiment of the present application, a process splitting module is used to identify the second calling instruction, determine the target test function included in the second calling instruction and the target sub-test process corresponding to the target test function; based on the target test function, determine the target test process corresponding to the target test function; obtain the second identification information corresponding to the target sub-test process; based on the second identification information corresponding to the target sub-test process, search for the target sub-test process package corresponding to the target sub-test process from the target test process; and provide the target sub-test process package corresponding to the target sub-test process to the target test case, so that the target test case completes the target UI test based on the target sub-test process package.
[0071] Specifically, the process splitting module can identify the second call instruction, determine the target test function included in the second call instruction and the target sub-test process corresponding to the target test function. Then, based on the target test function, determine the target test process corresponding to the target test function; based on the target sub-test process, determine the target sub-test process from the target test process corresponding to the target test function, and provide the target sub-test process package corresponding to the target sub-test process to the target test case, so that the target test case completes the target UI test based on the target sub-test process package.
[0072] The software testing tool provided in the embodiment of the present application, the process splitting module obtains the test process corresponding to the test function, splits the test process corresponding to the test function, generates sub-test process packages based on each test process, and ensures the accuracy of the generated sub-test process packages. According to the second calling instruction, at least one sub-test process package is provided for the target test case, so that the target test case completes the target UI test based on each sub-test process package, which ensures the accuracy of providing at least one sub-test process package for the target test case, and facilitates the target test case to call each sub-test process package, and facilitates the maintenance of the target test case.
[0073] Then, the process splitting module identifies the second call instruction, determines the target test function included in the second call instruction and the target sub-test process corresponding to the target test function, thereby ensuring the accuracy of the determined target sub-test process. Based on the target test function, determine the target test process corresponding to the target test function; obtain the second identification information corresponding to the target sub-test process; based on the second identification information corresponding to the target sub-test process, search the target sub-test process package corresponding to the target sub-test process from the target test process, thereby ensuring the accuracy of the target sub-test process package corresponding to the determined target sub-test process. Provide the target sub-test process package corresponding to the target sub-test process to the target test case, so that the target test case completes the target UI test based on the target sub-test process package, thereby ensuring the accuracy of providing at least one sub-test process package for the target test case, and facilitating the target test case to call each sub-test process package, thereby facilitating the maintenance of the target test case.
[0074] In an optional embodiment of the present application, an element locating module is used to identify a first calling instruction, determine second identification information corresponding to a target element included in the calling instruction, search for the target element based on the second identification information, and provide the target element to a target test case so that the target test case calls the target element target UI test.
[0075] Specifically, the element locating module can identify the first calling instruction, determine the second identification information corresponding to the target element included in the calling instruction, then search for the target element in the browser or database based on the second identification information, and provide the target element to the target test case so that the target test case calls the target element target UI test.
[0076] In the software testing tool provided in the embodiment of the present application, the element positioning module identifies the first call instruction, determines the second identification information corresponding to the target element included in the call instruction, and ensures the accuracy of the determined second identification information. The target element is searched based on the second identification information, and the target element is provided to the target test case so that the target test case calls the target element target UI test, which ensures the accuracy of the found target element, thereby facilitating the maintenance of the target test case based on the software testing tool.
[0077] In an optional implementation of the present application, a data processing module is used to identify a third calling instruction, determine target data included in the third calling instruction and a target operation corresponding to the target data; and process the target data according to the target operation so that the target test case completes the target UI test based on the target data.
[0078] Specifically, the data processing module can identify the third calling instruction, determine the target data included in the third calling instruction and the target operation corresponding to the target data; process the target data according to the target operation so that the target test case completes the target UI test based on the target data.
[0079] In an optional implementation of the present application, the target operation is a read operation, and the data processing module is used to obtain second identification information corresponding to the target data, search the target data from the database according to the second identification information, and provide the target data to the target test case, so that the target test case completes the target UI test based on the target data.
[0080] In an optional implementation of the present application, the target operation is a write operation, and the data processing module is used to obtain the target data and the target address corresponding to the target data, and write the target data to the target address according to the target address.
[0081] For example, in previous development, for the operation of table data on the interface, whether it is to obtain or fill, developers need to trace back its tr and td elements layer by layer for cumbersome processing. In the Vue framework, this process has been greatly simplified: only need to call the data processing module provided in the embodiment of the present application to realize the reading or writing of the target data.
[0082] In the software testing tool provided by the embodiment of the present application, the data processing module identifies the third call instruction, determines the target data included in the third call instruction and the target operation corresponding to the target data, and ensures the accuracy of the determined target data and the target operation corresponding to the target data. The target data is processed according to the target operation so that the target test case completes the target UI test based on the target data, ensuring the accuracy of the target operation on the target data, and thus there is no need to perform the target operation on the target data based on the target test case.
[0083] Optionally, the data processing module obtains second identification information corresponding to the target data, searches for the target data from the database according to the second identification information, and provides the target data to the target test case so that the target test case completes the target UI test based on the target data, thereby ensuring the accuracy of reading the target data. As a result, there is no need for the target test case to search for the target data, which facilitates the maintenance of the target test case.
[0084] Optionally, the data processing module obtains the target data and the target address corresponding to the target data, and writes the target data to the target address according to the target address, thereby ensuring the accuracy of the write operation on the target data.
[0085] In order to better introduce the software testing tool provided in the embodiment of the present application, Figure 4As shown, the embodiment of the present application provides a method for using a software testing tool, the method comprising:
[0086] Step S101, obtaining a target UI test.
[0087] Step S102: Based on the target UI test, determine the target elements, target processes and target data corresponding to the target UI test.
[0088] Step S103: Send a first calling instruction to the software testing tool to call the target element based on the software testing tool.
[0089] The software testing tool is any one of the software testing tools in the above implementations.
[0090] Step S104: Send a second calling instruction to the software testing tool to call the target process based on the software testing tool.
[0091] Step S105: Send a third calling instruction to the software testing tool to complete the processing of the target data based on the software testing tool.
[0092] Step S106, generating a target test case based on the target element, target process and target data.
[0093] Step S107, completing the target UI test based on the target test case.
[0094] Specifically, the electronic device may receive a target UI test input by a user, or may receive a target UI test sent by other devices. The embodiment of the present application does not specifically limit the manner in which the electronic device obtains the target UI test.
[0095] After the target UI test is acquired, the electronic device can determine the target element, target process, and target data corresponding to the target UI test according to the requirements of the target UI test. Then, the electronic device sends a first call instruction to the software testing tool. The software testing tool searches for the target element in the database based on the first call instruction so that the target element can be called when the electronic device generates a target test case.
[0096] The electronic device may also send a second calling instruction to the software testing tool, and the software testing tool may find the test process package corresponding to the target process based on the second calling instruction, so that the electronic device may call the test process package when generating a target test case.
[0097] The electronic device may also send a third calling instruction to the software testing tool, and the software testing tool may read or write the target data based on the third calling instruction.
[0098] After calling the target element and the target process and processing the target data, the electronic device can generate a target test case, and then complete the target UI test based on the target test case.
[0099] According to an embodiment of the present invention, an embodiment of a method for using a software testing tool 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 call 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.
[0100] The method for using the software testing tool provided in the embodiment of the present application obtains the target UI test; based on the target UI test, the target element, target process and target data corresponding to the target UI test are determined to be completed, thereby ensuring the accuracy of the target element, target process and target data corresponding to the target UI test. A first call instruction is sent to the software testing tool to call the target element based on the software testing tool, thereby ensuring the accuracy of calling the target element. A second call instruction is sent to the software testing tool to call the target process based on the software testing tool, thereby ensuring the accuracy of calling the target process. A third call instruction is sent to the software testing tool to complete the processing of the target data based on the software testing tool, thereby ensuring the accuracy of processing the target data. Based on the target element, target process and target data, a target test case is generated, thereby ensuring the accuracy of the generated target test case, and there is no need to write the code for calling the target element, target process and target data in the target test case, thereby facilitating the maintenance of the target test case. Then, based on the target test case, the target UI test is completed, thereby ensuring the accuracy of completing the target UI test.
[0101] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A software testing tool, characterized in that: The software testing tools include: An element locating module, used to find a target element based on the first calling instruction, so that the target test case calls the target element to complete the target UI test; A process providing module, configured to provide a target process for the target test case based on a second calling instruction, so that the target test case completes the target UI test based on the target process; The data processing module is used to complete the processing of the target data based on the third calling instruction, so that the target test case completes the target UI test based on the target data.
2. The software testing tool according to claim 1, characterized in that: The process providing module includes a process aggregation module, wherein: The process aggregation module is used to obtain the test process corresponding to the test function; aggregate the test process corresponding to the test function to generate a test process package corresponding to the test function; and provide the test process package for the target test case according to the second calling instruction, so that the target test case completes the target UI test based on the test process package.
3. The software testing tool according to claim 2, characterized in that: The process aggregation module is used to: Identifying the second calling instruction and determining a target test function included in the second calling instruction; Based on the target test function, obtaining a target test process package corresponding to the target test function; The target test process package is provided to the target test case, so that the target test case completes the target UI test based on the target test process package.
4. The software testing tool according to claim 1 or 2, characterized in that: The process providing module includes a process splitting module, wherein: The process splitting module is used to obtain the test process corresponding to the test function, split the test process corresponding to the test function, and generate sub-test process packages based on each test process; according to the second calling instruction, provide at least one sub-test process package for the target test case, so that the target test case completes the target UI test based on each sub-test process package.
5. The software testing tool according to claim 4, characterized in that: The process splitting module is used to: Identify the second calling instruction, and determine a target test function included in the second calling instruction and a target sub-test process corresponding to the target test function; Based on the target test function, determining a target test process corresponding to the target test function; Acquire second identification information corresponding to the target sub-test process; Based on the second identification information corresponding to the target sub-test process, searching the target sub-test process package corresponding to the target sub-test process from the target test process; The target sub-test process package corresponding to the target sub-test process is provided to the target test case, so that the target test case completes the target UI test based on the target sub-test process package.
6. The software testing tool according to claim 1, characterized in that: The element positioning module is used to: Identify the first calling instruction and determine second identification information corresponding to the target element included in the calling instruction; The target element is searched based on the second identification information, and the target element is provided to the target test case, so that the target test case calls the target UI test of the target element.
7. The software testing tool according to claim 1, characterized in that: The data processing module is used to: Identify the third call instruction, and determine the target data included in the third call instruction and the target operation corresponding to the target data; The target data is processed according to the target operation so that the target test case completes the target UI test based on the target data.
8. The software testing tool according to claim 7, characterized in that: The target operation is a read operation, and the data processing module is used to: Acquire second identification information corresponding to the target data, and search for the target data from a database according to the second identification information; The target data is provided to the target test case, so that the target test case completes the target UI test based on the target data.
9. The software testing tool according to claim 7, characterized in that: The target operation is a write operation, and the data processing module is used to obtain the target data and the target address corresponding to the target data, and write the target data into the target address according to the target address.
10. A method for using a software testing tool, characterized in that: The method comprises: Get the target UI test; Based on the target UI test, determine the target elements, target processes and target data corresponding to completing the target UI test; Sending a first calling instruction to the software testing tool to call the target element based on the software testing tool; wherein the software testing tool is the software testing tool according to any one of claims 1 to 9; Sending a second calling instruction to the software testing tool to call a target process based on the software testing tool; Sending a third calling instruction to the software testing tool to complete processing of the target data based on the software testing tool; Generate a target test case based on the target element, the target process and the target data; Based on the target test case, the target UI test is completed.
