PC client interface test system and application method thereof
Through screenshots, packet capture and data storage modules of the PC client interface test system, combined with the association of interface pictures and network data, two-way traceability of the PC client interface and interface is realized, solving the time-consuming and labor-intensive interface testing in the existing technology and the problem of not being able to match the interface improves the testing efficiency.
Patent Information
- Application Number
- CN202411552067.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-01-10
AI Technical Summary
The existing PC client interface testing method is time-consuming and labor-intensive, unable to match the interface with the interface, and difficult to match the actual business functions.
Provide a PC client interface test system, including screenshot module, packet capture module, data storage module and test platform, through screenshot module, interface pictures are captured and time stamps and service process ID are marked, packet capture module captures network data and marks time Stamp and service process ID, data storage modules associate interface pictures and network data, and the test platform obtains and executes interface test cases based on interface pictures or interface name matching.
It reduces the workload and time of manual operation, establishes a two-way traceability of the PC client interface and interface, solves the problem of interface and interface correspondence, and improves testing efficiency.
Smart Images

Figure CN119292945A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software testing, and in particular to a PC client interface testing system and an application method thereof. Background Art
[0002] A PC (Personal Computer) client is an application that can be installed on a personal computer.
[0003] In daily software testing work, interface testing is an indispensable part. It mainly tests the interfaces between various modules in the software system to ensure that the software can interact and collaborate correctly. In the existing PC client interface test, there are two testing methods: the first is that according to the interface documents of the project developers, the testers perform forward and reverse test cases of the manual portable interface on the interface test platform; the second is to install a packet capture tool on the PC, manually operate the PC client interface function, use the packet capture tool for network monitoring, and the tester manually selects the required interface and the corresponding request parameters, and manually writes test cases on the interface test platform. However, the first method requires more manpower to construct test data and test scenarios, and it is impossible to know which interface on the PC client the interface is used by, and it cannot match the actual business function; the second method requires manual search for the target interface after capturing a large amount of network data, and the search range is large, time-consuming and labor-intensive, and there is also a situation where it is impossible to know which interface on the PC client the interface is used by. Therefore, how to solve the technical defects of the existing PC client interface test is a technical problem that needs to be solved by those skilled in the art. Summary of the invention
[0004] The present invention provides a PC client interface testing system and an application method thereof, which are used to solve the technical problems that the existing PC client interface and testing method are time-consuming and labor-intensive to test, and the interface cannot be matched with the interface and is difficult to match with the actual business function.
[0005] In view of this, a first aspect of the present invention provides a PC client interface testing system, including a screenshot module, a packet capture module, a data storage module and a testing platform;
[0006] The screenshot module is used to take a screenshot of the function operation occurring on the PC client interface, mark a timestamp and a service process ID of the PC client on the interface image of the PC client obtained by the screenshot, and transmit the screenshot to the data storage module;
[0007] The packet capture module is used to obtain the service process ID of the PC client through the PC task manager after the PC client is started, capture network data according to the service process ID, mark the captured network data with a timestamp and associate it with the service process ID before transmitting it to the data storage module, wherein the network data includes an interface name;
[0008] The data storage module is used to receive and save the interface image, the service process ID and the network data, the interface image and the network data are associated through the service process ID and the timestamp, the data storage module is also used to store interface test cases and interface test case execution results, the interface test case includes the interface name, the interface test case execution result is associated with the interface test case, and the interface test case execution result includes the execution time;
[0009] The testing platform is used to obtain the corresponding interface test case from the data storage module based on the interface image matching method or the interface name matching method, execute the interface test case selected by the user and generate the interface test case execution result, and store the interface test case execution result in the data storage module.
[0010] Optionally, the interface image matching method is:
[0011] A screenshot of the functional operation occurring on the PC client interface is taken, the screenshot image is matched with all the interface images in the data storage module for similarity, and the interface images are sorted according to the similarity.
[0012] Optionally, the interface name matching method is:
[0013] The interface to be tested is fuzzily matched to obtain an interface list from the data storage module according to the interface name, and each interface in the interface list is respectively associated with the corresponding interface image and the interface test case.
[0014] Optionally, the test platform is also used for:
[0015] All the interface images in the data storage module are displayed, the interface image selected by the user is obtained, and an interface list comparison display is performed on the interface image selected by the user.
[0016] Optionally, the test platform is also used for:
[0017] Receive and execute the user's instructions to add, modify or delete the interface test case.
[0018] Optionally, the network data includes an interface path, the interface name, an interface request method, interface parameters, an interface request header parameter, an interface response status code and a response result.
[0019] Optionally, the interface test case includes the interface name, interface path, interface parameters, interface request method and interface request header parameters.
[0020] A second aspect of the present invention provides an application method of any one of the PC client interface test systems provided in the first aspect, comprising:
[0021] After the PC client is started, the packet capture module obtains the service process ID of the PC client through the PC task manager, captures network data according to the service process ID, marks the captured network data with a timestamp and associates it with the service process ID before transmitting it to the data storage module, wherein the network data includes an interface name;
[0022] The screenshot module takes a screenshot of the interface of the PC client when an interface function operation occurs on the PC client, marks a timestamp and a service process ID of the PC client on the interface image of the PC client obtained by the screenshot, and transmits the screenshot to the data storage module;
[0023] The data storage module receives and saves the interface image, the service process ID and the network data, associates the interface image and the network data through the service process ID and the timestamp, and associates the interface image and the network data with corresponding interface test cases;
[0024] The test platform responds to the user's search instruction, obtains the corresponding interface test case from the data storage module based on the interface image matching method or the interface name matching method, executes the interface test case selected by the user and generates the interface test case execution result, and sends the interface test case execution result to the data storage module;
[0025] The data storage module stores the interface test case execution result and associates the interface test case execution result with the interface test case.
[0026] Optionally, it also includes:
[0027] The test platform displays all the interface images in the data storage module in response to the user's interface image query request;
[0028] The test platform obtains the interface image selected by the user, and performs an interface list comparison display on the interface image selected by the user.
[0029] Optionally, it also includes:
[0030] When the test platform receives the user's instruction to add an interface test case, the added interface test case is associated with the interface name and stored in the data storage module;
[0031] When the test platform receives the user's instruction to modify the interface test case, the interface test case modified by the user is stored in the data storage module;
[0032] When the test platform receives an instruction from a user to delete an interface test case, the interface test case deleted by the user is deleted from the data storage module.
[0033] It can be seen from the above technical solutions that the PC client interface test system provided by the present invention has the following advantages:
[0034] The PC client interface test system provided by the present invention is configured with a screenshot module, a packet capture module, a data storage module and a test platform, wherein the screenshot module captures the interface image of the PC client, and performs timestamp marking and PC client service process ID processing on the interface image, the packet capture module captures the corresponding network data according to the service process ID of the PC client, and performs timestamp marking and PC client service process ID processing on the network data, the data storage module stores the interface image, network data, interface test case and interface test case result, and the test platform matches the interface test case from the data storage module according to the interface image matching method or the interface name matching method, and then executes the interface test case selected by the user and generates the interface test case execution result and stores it in the data storage module. Not only the workload and time of manual operation are reduced, but also the relationship between the interface and the interface of the PC client is established, and the two-way tracing of the interface and the interface of the PC client is realized, and the technical problems that the existing PC client interface and test method testing is time-consuming and labor-intensive, and the interface cannot be matched with the interface, and it is difficult to match with the actual business function are solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 A schematic diagram of the structure of a PC client interface testing system provided in an embodiment of the present invention;
[0037] Figure 2 A functional block diagram of a PC client interface test system provided in an embodiment of the present invention;
[0038] Figure 3 The present invention provides a flow chart of an application method of a PC client interface testing system provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0039] 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 are within the scope of protection of the present invention.
[0040] For easier understanding, see Figure 1 and Figure 2 ,The present invention provides an embodiment of a PC client interface test system, including a screenshot module, a packet capture module, a data storage module and a test platform;
[0041] A screenshot module is used to take screenshots of the function operations occurring on the PC client interface, mark the timestamp and the service process ID of the PC client on the screenshot of the PC client interface image, and transmit the screenshot to the data storage module;
[0042] The packet capture module is used to obtain the service process ID of the PC client through the PC task manager after the PC client is started, capture network data according to the service process ID, mark the captured network data with a timestamp and associate it with the service process ID before transmitting it to the data storage module. The network data includes the interface name;
[0043] The data storage module is used to receive and save interface images, service process IDs and network data. The interface images and network data are associated through the service process ID and timestamp. The data storage module is also used to store interface test cases and interface test case execution results. The interface test cases include interface names. The interface test case execution results are associated with the interface test cases. The interface test case execution results include execution time.
[0044] The testing platform is used to obtain the corresponding interface test cases from the data storage module based on the interface image matching method or the interface name matching method, execute the interface test cases selected by the user and generate the interface test case execution results, and store the interface test case execution results in the data storage module.
[0045] It should be noted that when the user performs a function operation on the PC client interface, the screenshot module is triggered, and a screenshot of the PC client interface is taken to obtain an interface image, and then a timestamp and the service process ID (Process Identifier, PID) of the PC client are added to the interface image to make it unique. The interface image is then transmitted to the data storage module.
[0046] After the PC client is started, the packet capture module obtains the service process ID of the PC client through the task manager, and captures the network data under the service process ID of the PC client when performing functional operations in the PC client interface. Specifically, the service process ID of the PC client can be configured in the packet capture module, so that the packet capture module only captures the network data of the service process ID, which plays a pre-filtering role. The network data includes the request content and response content of the interface, such as the interface path (URL path), the interface name, the interface request method (such as Get or POST), the interface parameters (such as key-value pair parameters in JSON string format or Form format), the interface request header parameters (such as cookies), the interface response status code and the response result (such as text in JSON string format), etc. The captured network data is timestamped and associated with the service process ID, and transmitted to the data storage module. Different PC clients can be distinguished by the service process ID, which can meet the needs of multiple testers to test at the same time and avoid the problem of data confusion when multiple people use it.
[0047] The data stored in the data storage module include the interface images sent by the screenshot module, the network data transmitted by the packet capture module, the interface test cases preconfigured by the tester, and the interface test case execution results. In the data storage module, the network data is associated with the interface images through the service process ID and timestamp. The interface test cases and the interface test case execution results contain the interface name. The network data of the PC client can be associated with the interface images and interface test cases of the PC client, and the interface test cases can be associated with the interface test case execution results. The interface images of the PC client can also be associated with the network data of the PC client, and then associated with the interface test cases from the network data of the PC client. The interface test case execution results stored in the data storage module include execution time, interface list, interface response success or failure status, etc. In the daily testing process of the PC client, sufficient interface images and interface data sets are collected to form a reliable data storage warehouse, namely the data storage module, and a complete mapping relationship between the PC client interface images and interfaces is established. When the functional module of the PC client changes, the differences in calling interfaces between different interface images can be compared, which helps to analyze the impact of interface changes on functions during the testing process.
[0048] The test platform supports two methods, interface image matching and interface name matching, to match the corresponding interface test cases from the data storage module. For the interface image matching method, the user can take a screenshot of the functional operation occurring on the PC client interface to obtain a screenshot image. The test platform will perform similarity matching between the screenshot image and all the interface images in the data storage module, and sort the matched interface images by similarity. They can be sorted from high to low or from low to high. Generally, a high to low sorting method is selected to prioritize the interface images with the highest similarity. The user can click on any interface image from the matching results to view the interface list associated with the interface image. Click on any interface name in the interface list to view and select an interface test case. After the user selects the interface test case and confirms execution, the test platform executes the interface test case selected by the user and generates the interface test case execution result, and stores the interface test case execution result in the data storage module. For the interface name matching method, the user can enter the interface name to be tested on the test platform, and the test platform will fuzzily match the interface to be tested from the data storage module according to the interface name to obtain an interface list. Each interface in the interface list is associated with a corresponding interface image and interface test case. The user can click on any interface name in the interface list to view and select the corresponding interface image and interface test case. After the user selects the interface test case and confirms the execution, the test platform executes the interface test case selected by the user and generates the interface test case execution result, and stores the interface test case execution result in the data storage module. Therefore, when the tester performs page function testing on the PC client, the test platform automatically generates interface test cases. In the absence of interface documents, the tester can also quickly create interface test cases based on page function testing. The tester can choose to directly use the interface test case for testing, or when the interface test case needs to be modified, it can be modified directly on the basis of the interface test case without rebuilding the interface test case, which helps the tester at least build a basic interface test case framework, which helps the tester to optimize the test case on this basis, which is more convenient and quick.
[0049] The PC client interface test system provided by the present invention is configured with a screenshot module, a packet capture module, a data storage module and a test platform, wherein the screenshot module captures the interface image of the PC client, and performs timestamp marking and PC client service process ID processing on the interface image, the packet capture module captures the corresponding network data according to the service process ID of the PC client, and performs timestamp marking and PC client service process ID processing on the network data, the data storage module stores the interface image, network data, interface test case and interface test case result, and the test platform matches the interface test case from the data storage module according to the interface image matching method or the interface name matching method, and then executes the interface test case selected by the user and generates the interface test case execution result and stores it in the data storage module. Not only the workload and time of manual operation are reduced, but also the relationship between the interface and the interface of the PC client is established, and the two-way tracing of the interface and the interface of the PC client is realized, and the technical problems that the existing PC client interface and test method testing is time-consuming and labor-intensive, and the interface cannot be matched with the interface, and it is difficult to match with the actual business function are solved.
[0050] In one embodiment, the test platform is also used to display all interface images in the data storage module to the user. The user can check one or more interface images in the test platform, and the test platform obtains the interface image selected by the user and compares and displays the corresponding interface list under the interface image. The user can also manually add, modify and delete interface test cases through the test platform, and the test platform receives and executes the user's instructions to add, modify or delete interface test cases.
[0051] In order to more specifically demonstrate the effect of the PC client interface test system provided in the present invention, the present invention provides the following specific application examples for illustration:
[0052] Application Example 1: In the PC client test project, the R&D personnel proposed the notification announcement requirements and required the testing of page functions and interface functions. The tester performs page function testing according to the notification announcement requirements, starts the packet capture module in the present invention, and the packet capture module obtains the service process ID of the PC client from the task manager and sets it in the packet capture module. Start the screenshot module, open the notification announcement new interface, click the screenshot and enter the service process ID, save the current interface picture to the data storage module, and perform page forward and reverse function tests on the notification announcement new interface, for example: fill in the required items normally, do not fill in the required items, do not fill in the optional items, fill in all the optional items, illegal digital format, overlong string, type is not in range, etc., and the interface request and response triggered by the tester each time he clicks to save the notification announcement is collected through the packet capture module. Save the interface content to the data storage module, and associate the screenshot with the interface content through the service process ID and timestamp. The tester repeats the above steps and continues to test the modification, deletion, and release of notification announcements on the page. After the tester has completed the notification function test, he can view the corresponding list of cross-section images and interfaces in the test platform, and perform interface testing after simply modifying the interface use case according to the situation. Finally, the test result of the requirement is quickly given.
[0053] Application Example 2: In the PC client test project, the PC client version is upgraded, and the tester needs to return to whether the interface functions of each functional module are normal. In the daily test process, the tester uses the PC client interface test system provided in the present invention to collect interface pictures and interface data, and establishes a complete data storage warehouse for picture and interface mapping. According to the interface of each functional module, the tester searches for the interface pictures of the functional modules one by one on the test platform, and matches the picture data in the data storage module according to the picture recognition comparison, finds the pictures with high similarity, and the corresponding interface list, and performs interface testing after simply modifying the interface use case according to the situation. Finally, the test results are given quickly.
[0054] Application Example 3: In the PC client test project, the R&D personnel modified multiple interface logics, but it is not clear on which pages these interfaces are used, and the testers need to sort out which pages use these interfaces. In the daily test process, the testers use the PC client interface test system provided in the present invention to collect interface pictures and interface data, and establish a complete data storage warehouse for picture and interface mapping. When the interface list is obtained from the R&D personnel, the interface path, interface name and other information can be known. On the test platform of the PC client interface test system provided in the present invention, the interface name is searched one by one, and the interface picture corresponding to the interface is obtained from the complete interface data storage warehouse. The interface list and page list are counted and fed back to the R&D personnel, and the test task is completed quickly.
[0055] For easier understanding, see Figure 3 The present invention provides an application method of a PC client interface test system, and the application method is applied to any PC client interface test system provided in the present invention, and the application method includes:
[0056] Step 101, after the PC client is started, the packet capture module obtains the service process ID of the PC client through the PC task manager, captures network data according to the service process ID, marks the captured network data with a timestamp and associates it with the service process ID before transmitting it to the data storage module, where the network data includes the interface name.
[0057] Step 102: When the PC client performs an interface function operation, the screenshot module takes a screenshot of the interface of the PC client, marks a timestamp and a service process ID of the PC client on the screenshot of the interface of the PC client, and transmits the screenshot to the data storage module.
[0058] Step 103, the data storage module receives and saves the interface image, service process ID and network data, associates the interface image and network data through the service process ID and timestamp, and associates the interface image and network data with corresponding interface test cases.
[0059] Step 104, the test platform responds to the user's search instructions, obtains the corresponding interface test case from the data storage module based on the interface image matching method or the interface name matching method, executes the interface test case selected by the user and generates the interface test case execution result, and sends the interface test case execution result to the data storage module.
[0060] Step 105: The data storage module stores the interface test case execution result and associates the interface test case execution result with the interface test case.
[0061] In one embodiment, the application method further comprises:
[0062] Step 106: The test platform responds to the user's interface image query request and displays all interface images in the data storage module.
[0063] Step 107: The test platform obtains the interface image selected by the user, and performs an interface list comparison display on the interface image selected by the user.
[0064] In one embodiment, the application method further comprises:
[0065] Step 108: When the test platform receives the user's instruction to add an interface test case, the added interface test case is associated with the interface name and stored in the data storage module.
[0066] Step 109: When the test platform receives the user's instruction to modify the interface test case, the interface test case modified by the user is stored in the data storage module.
[0067] Step 110: When the test platform receives the user's instruction to delete the interface test case, the interface test case deleted by the user is deleted from the data storage module.
[0068] The application method of the PC client interface test system provided in the present invention is applied to the PC client interface test system provided in the present invention. Its principle and technical effects are the same as those of the PC client interface test system provided in the present invention, and will not be repeated here.
[0069] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A PC client interface testing system, characterized in that: Including screenshot module, packet capture module, data storage module and test platform; The screenshot module is used to take a screenshot of the function operation occurring on the PC client interface, mark a timestamp and a service process ID of the PC client on the interface image of the PC client obtained by the screenshot, and transmit the screenshot to the data storage module; The packet capture module is used to obtain the service process ID of the PC client through the PC task manager after the PC client is started, capture network data according to the service process ID, mark the captured network data with a timestamp and associate it with the service process ID before transmitting it to the data storage module, wherein the network data includes an interface name; The data storage module is used to receive and save the interface image, the service process ID and the network data, the interface image and the network data are associated through the service process ID and the timestamp, the data storage module is also used to store interface test cases and interface test case execution results, the interface test case includes the interface name, the interface test case execution result is associated with the interface test case, and the interface test case execution result includes the execution time; The testing platform is used to obtain the corresponding interface test case from the data storage module based on an interface image matching method or an interface name matching method, execute the interface test case selected by the user and generate the interface test case execution result, and store the interface test case execution result in the data storage module.
2. The PC client interface testing system according to claim 1, characterized in that: The interface image matching method is: A screenshot is taken of the functional operation occurring in the PC client interface, the screenshot image is matched with all the interface images in the data storage module for similarity, and the interface images are sorted according to the similarity.
3. The PC client interface testing system according to claim 1, characterized in that: The interface name matching method is: An interface list is fuzzily matched from the data storage module according to the interface name of the interface to be tested, and each interface in the interface list is respectively associated with the corresponding interface image and the interface test case.
4. The PC client interface testing system according to claim 1, characterized in that: The test platform is also used to: All the interface images in the data storage module are displayed, the interface image selected by the user is obtained, and an interface list comparison display is performed on the interface image selected by the user.
5. The PC client interface testing system according to any one of claims 1 to 4, characterized in that: The test platform is also used to: Receive and execute the user's instructions to add, modify or delete the interface test case.
6. The PC client interface testing system according to claim 1, characterized in that: The network data includes the interface path, the interface name, the interface request method, the interface parameters, the interface request header parameters, the interface response status code and the response result.
7. The PC client interface testing system according to claim 1, characterized in that: The interface test case includes the interface name, interface path, interface parameters, interface request method and interface request header parameters.
8. An application method of the PC client interface test system according to any one of claims 1 to 7, characterized in that: include: After the PC client is started, the packet capture module obtains the service process ID of the PC client through the PC task manager, captures network data according to the service process ID, marks the captured network data with a timestamp and associates it with the service process ID before transmitting it to the data storage module, wherein the network data includes an interface name; The screenshot module takes a screenshot of the interface of the PC client when an interface function operation occurs on the PC client, marks a timestamp and a service process ID of the PC client on the interface image of the PC client obtained by the screenshot, and transmits the screenshot to the data storage module; The data storage module receives and saves the interface image, the service process ID and the network data, associates the interface image and the network data through the service process ID and the timestamp, and associates the interface image and the network data with corresponding interface test cases; The test platform responds to the user's search instruction, obtains the corresponding interface test case from the data storage module based on the interface image matching method or the interface name matching method, executes the interface test case selected by the user and generates the interface test case execution result, and sends the interface test case execution result to the data storage module; The data storage module stores the interface test case execution result and associates the interface test case execution result with the interface test case.
9. The application method of the PC client interface test system according to claim 8, characterized in that: Also includes: The test platform displays all the interface images in the data storage module in response to the user's interface image query request; The test platform obtains the interface image selected by the user, and performs an interface list comparison display on the interface image selected by the user.
10. The application method of the PC client interface test system according to any one of claims 8-9, characterized in that: Also includes: When the test platform receives the user's instruction to add an interface test case, the added interface test case is associated with the interface name and stored in the data storage module; When the test platform receives the user's instruction to modify the interface test case, the interface test case modified by the user is stored in the data storage module; When the test platform receives an instruction from a user to delete an interface test case, the interface test case deleted by the user is deleted from the data storage module.