Test evidence collection methods and devices, equipment, and storage media

By marking evidence collection point information in software testing and using RPA and artificial intelligence to automatically take screenshots, it solves the problems of low manual efficiency and difficulty in capturing intermediate output in software testing, realizes fully automated test evidence collection, and improves efficiency and accuracy.

CN113806208BActive Publication Date: 2024-10-25CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202010546714.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-15
Publication Date
2024-10-25
Estimated Expiration
2040-06-15

AI Technical Summary

Technical Problem

The purely manual method of existing software testing is inefficient and cannot accurately capture intermediate output. The application of RPA technology is limited in complex scenarios, resulting in high error rates and frequent rework.

Method used

By marking evidence collection point information in test cases, artificial intelligence and RPA are used to automatically identify and take screenshots of relevant interfaces to achieve fully automatic test evidence collection and reduce manual intervention and rework.

Benefits of technology

It improves testing efficiency, reduces manpower investment and error rate, and meets the automation needs of all software testing scenarios, including the capture of intermediate output.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113806208B_ABST
    Figure CN113806208B_ABST
Patent Text Reader

Abstract

The present application discloses a test evidence collection method, including: obtaining and executing a test case to be collected; in the process of executing the test case, when it is detected that evidence point information is marked in the test case, saving an interface related to the evidence point information as a forensic image; thus, fully automatic screenshots are achieved without manual intervention or rework, greatly improving efficiency and reducing manpower investment. The present application also provides a test evidence collection device, equipment and storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to software testing technology, and is related to but not limited to testing evidence collection methods and devices, equipment, and storage media. Background Art

[0002] In software use, due to application scenarios, people usually need to repeatedly perform monotonous and repetitive operations, which is inefficient. In such scenarios, such as the financial field, there are very clear and fixed processes and steps, and there are no complex tasks in the process, and there is no integration of online and offline. In order to solve this pain point, Robotic Process Automation (RPA) technology came into being. RPA is a software robot whose function is to automate the process and free people from monotonous and repetitive operations.

[0003] Software testing is usually a monotonous and repetitive operation, but in the software testing scenario, although the process and steps are strictly in accordance with the test case, this test case is not consistent with that test case. In addition, software testing usually requires before-and-after comparisons and capturing special results, which makes the task very complicated.

[0004] During software testing, you need to take screenshots as proof and attach them to the software testing system (such as Testrail) or software testing report. The traditional testing method is for testers to manually take screenshots, rename, save and upload them to a specified location, which is very inefficient. Moreover, since most tests need to be conducted overnight, people are prone to making mistakes at night. In addition, once a screenshot is missed, the test work needs to be repeated.

[0005] In summary, the existing test evidence retention methods have the following significant disadvantages: 1) Pure manual methods are inefficient, have high error rates, high testing costs, and often require rework; 2) RPA methods can only solve simple and repetitive test scenarios, which account for less than 5% of normal software testing work; 3) For situations where intermediate outputs need to be captured, since the screen is always outputting code, manual operations are difficult to capture accurately and can easily interrupt the test process. Summary of the invention

[0006] In view of this, in order to solve the problems of low efficiency and inability to capture intermediate outputs in pure manual methods, as well as the limitations of RPA application scenarios, this application provides a test evidence collection method and device, equipment, and storage medium, which can realize the output and important test processes in the entire test process forensics, realize automated test evidence collection, and eliminate the need for manual intervention throughout the process, thereby improving test efficiency.

[0007] The technical solution of this application is implemented as follows:

[0008] In a first aspect, the present application provides a test evidence collection method, the method comprising:

[0009] Obtain and execute the test cases to be collected;

[0010] During the execution of the test case, when it is detected that evidence point information is marked in the test case, an interface related to the evidence point information is saved as a evidence map.

[0011] In a second aspect, the present application provides a test evidence collection device, the device comprising an acquisition module and an evidence collection module, wherein:

[0012] The acquisition module is used to acquire and execute the test case to be collected;

[0013] The evidence collection module is used to save the interface related to the evidence collection point information as a evidence collection diagram when it is detected that the evidence collection point information is marked in the test case during the execution of the test case.

[0014] In a third aspect, the present application provides a testing and forensics device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the steps in the above-mentioned testing and forensics method are implemented.

[0015] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps in the above-mentioned testing and forensics method when executed by a processor.

[0016] The beneficial effects of the technical solution provided by this application include at least:

[0017] In the present application, first, the test case to be collected is obtained and executed; then, in the process of executing the test case, when it is detected that evidence point information is marked in the test case, the interface related to the evidence point information is saved as a forensic diagram; in this way, by marking the evidence point information of the test case and identifying and saving the interface related to the evidence point information, it is possible to collect evidence of the output and important test processes in the entire test process, realize automated test evidence collection, and eliminate the need for manual intervention throughout the process, thereby improving test efficiency.

[0018] In some embodiments, when it is detected that the test case is marked with evidence point information, the interface displayed on the screen is monitored; then the interfaces displayed on the screen are identified separately to determine the current frame interface related to the evidence point information, and the current frame interface is automatically captured to obtain the evidence image and save it; in this way, in the process of executing the test case, intelligent evidence collection is achieved by monitoring the screen changes, and fully automatic screenshots are achieved to meet the needs of all software testing scenarios and to cope with the capture needs of intermediate outputs.

[0019] In some embodiments, by marking the evidence point information for the test case, during the execution of the test case, the interface related to the evidence point information is intelligently identified and a screenshot is automatically taken as an evidence image; and by docking with the test system, the evidence image can be intelligently named in the form of an intelligent summary based on the test case description, and automatically uploaded to a designated location; in this way, it is possible to collect evidence of the output and important test processes throughout the entire test process, realize full automation of testing and evidence collection, and thus improve test efficiency.

[0020] In some embodiments, artificial intelligence is used to mark test case evidence points and train evidence content; and in the process of using RPA to execute test cases, the content to be collected is monitored and screenshots are saved to achieve fully automatic evidence collection, without manual intervention or rework, greatly improving efficiency and reducing manpower investment; finally, it can intelligently name the screen recording video and screenshots based on the test case description, and automatically upload or save them to a specified location; by combining the above method with an automated testing framework such as Jenkins, manual intervention is no longer required during the test process, and full automation of testing and evidence collection can be achieved. It can meet the needs of all software testing scenarios and meet the needs of capturing intermediate outputs. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work, among which:

[0022] Figure 1 An optional flowchart of the test evidence collection method provided in the embodiment of the present application;

[0023] Figure 2 An optional flowchart of the test evidence collection method provided in the embodiment of the present application;

[0024] Figure 3 An optional flowchart of the test evidence collection method provided in the embodiment of the present application;

[0025] Figure 4 An optional flowchart of the test evidence collection method provided in the embodiment of the present application;

[0026] Figure 5 A logical flow chart of the test evidence collection method provided in the embodiment of the present application;

[0027] Figure 6 A schematic diagram of the structure of the test evidence collection device provided in the embodiment of the present application;

[0028] Figure 7 A schematic diagram of the hardware entity of the test evidence collection device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] To make the purpose, technical scheme and advantages of the present application clearer, the specific technical scheme of the present application will be described in further detail below in conjunction with the accompanying drawings in the present application. The following examples are used to illustrate the present application, but are not intended to limit the scope of the present application. In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent the elements are used only to facilitate the description of the present application, and there is no specific meaning in itself. Therefore, "module", "component" or "unit" can be used in a mixed manner.

[0030] The embodiments of the present application provide a test evidence collection method and apparatus, equipment, and storage medium. By marking the evidence point information of the test case and identifying the interface related to the evidence point information for saving, it is possible to collect evidence of the output and important test processes in the entire test process, realize automated test evidence collection, and eliminate the need for manual intervention throughout the process, thereby improving test efficiency.

[0031] Figure 1 An optional flow chart of the test evidence collection method provided in the embodiment of the present application is as follows: Figure 1 As shown, the method includes:

[0032] Step S110, obtaining and executing the test case to be evidenced.

[0033] Here, the test case to be collected created by the user is obtained, and the test steps included in the test case are automatically executed step by step on the terminal.

[0034] Here, the test case to be collected for evidence may be a test case that implements any function or a test item created according to any test specification. In the embodiment of the present application, the test case to be collected for evidence may include one or more test cases.

[0035] During the implementation process, in order to determine whether a certain feature of the application is working normally, it is necessary to retain corresponding screenshots as proof. Testers are required to combine the corresponding software requirement documents and, based on mastering certain test case design methods, design and create relatively comprehensive and reasonable test cases. For example, descriptions of input, actions, or time and an expected result may include the following basic elements: test case number, test title, importance level, test input, operation steps and expected results, etc.

[0036] Step S120, during the execution of the test case, when it is detected that evidence point information is marked in the test case, an interface related to the evidence point information is saved as a evidence map.

[0037] Here, the evidence point information can be keywords preset by the tester, such as "connection failure", "cluster status", etc., or it can be preset screenshots, such as test screenshots in historical test reports, or it can be evidence location information, such as the location to be collected can be preset as the output of intermediate variables in the test case, etc., any other information to be collected.

[0038] Here, when the test case begins to be executed, it is monitored whether the test case is marked with evidence point information. If the evidence point information is marked, the interface related to the evidence point information is saved as a evidence map.

[0039] When it is identified that the current interface includes content related to the evidence point information, it is necessary to collect evidence for the current interface. In an embodiment of the present application, the current interface can be captured by taking a screenshot to obtain an evidence image, and the evidence image is further saved in a preset module so that the test process or test results can be evaluated based on the evidence image.

[0040] In some embodiments, a test evidence collection system for implementing the test evidence collection method of an embodiment of the present application includes a process automation robot and a capturer, wherein the process automation robot is a software robot used to execute the test process of the test case, and the capturer is a trained identifier that can realize intelligent screenshots. Finally, the process automation robot obtains the screenshot and saves it to a specified location.

[0041] In an embodiment of the present application, first, the test case to be collected is obtained and executed; then, in the process of executing the test case, when it is detected that evidence point information is marked in the test case, the interface related to the evidence point information is saved as a forensic diagram; in this way, by marking the evidence point information of the test case and identifying and saving the interface related to the evidence point information, it is possible to collect evidence of the output and important test processes during the entire test process, realize automated test evidence collection, and eliminate the need for manual intervention throughout the process, thereby improving test efficiency.

[0042] Figure 2 An optional flow chart of the test evidence collection method provided in the embodiment of the present application is as follows: Figure 2 As shown, the method comprises at least some steps:

[0043] Step S210, obtaining and executing the test case to be evidenced.

[0044] Step S220, when it is detected that the test case is marked with evidence point information, monitor the interface displayed on the screen.

[0045] Here, the evidence collection point information includes preset keywords, or the evidence collection point information includes preset screenshots.

[0046] Here, in the process of executing the test cases in the order of use cases, it is detected whether the test cases are marked with evidence point information. In the implementation process, combined with the actual test case management system, such as the automated testing framework (Jenkins), in the process of executing the test case, it is detected that the 32nd test case is marked with evidence point information, and the identifier is turned on to monitor the interface displayed on the screen; if it is detected that the evidence point information is not marked in the test case to be executed, the next test case is executed in the order of the use cases.

[0047] In some embodiments, when the evidence point information includes preset keywords, the following steps S230 and S240 can be used to implement "taking a screenshot of the interface related to the evidence point information, obtaining and saving the evidence image":

[0048] Step S230, performing text recognition on the current frame interface displayed on the screen to obtain keywords in the current frame interface.

[0049] Here, the text recognition technology in the artificial intelligence technology can be used to recognize the text in the current frame interface to obtain the keywords in the current frame interface.

[0050] Step S240: If the similarity between the keyword in the current frame interface and the preset keyword is greater than or equal to the similarity threshold, it is determined that the current frame interface is related to the evidence point information.

[0051] Here, the first word vector corresponding to the keyword and the second word vector corresponding to the preset keyword can be queried in the word vector library respectively. Then the distance between the first word vector and the second word vector is calculated, and the distance is determined as the similarity between the keyword and the preset keyword. When the distance is large, it indicates that the similarity between the keyword and the preset keyword is small; when the distance is small, it indicates that the similarity between the keyword and the preset keyword is large.

[0052] Here, the similarity threshold can be a threshold set in advance by the tester in the test forensic system. After determining the similarity between the keyword and the preset keyword, the similarity is compared with the first similarity threshold. When the similarity is greater than or equal to the similarity threshold, it is determined that the current frame interface is related to the forensic point information.

[0053] In some embodiments, when the evidence point information includes a preset screenshot, the following steps S250 and S260 can be used to implement "taking a screenshot of the interface related to the evidence point information, obtaining and saving the evidence image":

[0054] Step S250, matching the current frame interface displayed on the screen with the preset screenshot.

[0055] Here, part of the graphics in the current frame interface can be matched with the preset screenshot, or the entire graphics in the current frame interface can be matched with the preset screenshot. The preset screenshot can be a test screenshot in a historical test report, and the recognizer can be trained by machine learning to intelligently monitor the screen.

[0056] Step S260: If all or part of the graphics of the current frame interface matches the preset screenshot, it is determined that the current frame interface is related to the evidence point information.

[0057] Here, you can determine whether the current frame interface matches the preset screenshot to determine whether the current frame interface is related to the evidence point information. It can intelligently determine the screenshot point without taking multiple pictures. The saved picture is the required picture, and no manual secondary screening is required.

[0058] Step S270, automatically taking a screenshot of the current frame interface to obtain and save the forensic image.

[0059] Here, you can automatically call the Windows system screenshot function to take a screenshot, or use other screenshot tools to take a screenshot.

[0060] In an embodiment of the present application, first, when it is detected that the test case is marked with evidence point information, the interface displayed on the screen is monitored; then, based on the evidence point information including preset keywords or preset screenshots, the interfaces displayed on the screen are respectively identified to determine the current frame interface related to the evidence point information, and the current frame interface is automatically screenshoted to obtain the evidence image and save it; in this way, in the process of executing the test case, intelligent evidence collection is achieved by monitoring the screen changes, and fully automatic screenshots are realized to meet the needs of all software testing scenarios and to cope with the capture needs of intermediate outputs.

[0061] Figure 3 An optional flow chart of the test evidence collection method provided in the embodiment of the present application is as follows: Figure 3 As shown, the method includes:

[0062] Step S310, obtaining and executing the test case to be collected.

[0063] Step S320: marking the evidence point information for the test case according to the evidence material.

[0064] Here, the forensic material is a forensic screenshot of a test case of the same type as the test case in a historical test report.

[0065] Here, the way to mark the evidence point information in the test case can be to mark the location where evidence is needed in the test case, that is, to add a breakpoint at the corresponding running position of the test case, or to add an evidence description to indicate the content that needs to be collected. For example, it is necessary to test whether the number of objects in the cluster is stored according to the preset strategy. The corresponding test case includes test steps such as monitoring the cluster status, writing an object, and deleting the object just written. The evidence description "cluster status" can be added to indicate that the interface of "when the number of objects changes and stabilizes and no longer changes" is intercepted as the evidence point information.

[0066] Step S330, during the execution of the test case, when it is detected that evidence point information is marked in the test case, an interface related to the evidence point information is saved as a evidence map.

[0067] Step S340, obtaining keywords of the forensic graph by extracting information from the test case description associated with the forensic point information, or by extracting text information from the forensic graph.

[0068] Here, the test case description associated with the evidence point information refers to the test case description of the test case marked with the evidence point information.

[0069] Here, information extraction can be performed on the test case description by using artificial intelligence automatic text summarization technology, such as summarizing "write an object: call the script to write an object, the object size is 4KB, the cluster state should change at this time, and the number of objects increases by 3" as "the object increases after writing the object"; text information can also be extracted from the forensic image by using text recognition technology, such as extracting keywords such as "no service" and "connection failure" in the forensic image.

[0070] Step S350: naming the forensic graph according to the keywords of the forensic graph.

[0071] Here, for example, the forensic image may be named "write-object-added.jpg".

[0072] Step S360, saving the evidence image to a specific local path; or, calling an upload script to upload the evidence image to a test management system.

[0073] Here, the specific local path is a saving path pre-specified by the user.

[0074] Here, in the process of executing the test case, the test management system is not directly connected, and only the specified script is called.

[0075] In the embodiment of the present application, by marking the evidence point information for the test case, during the execution of the test case, the interface related to the evidence point information is intelligently identified and a screenshot is automatically taken as an evidence image; and by docking with the test system, the evidence image can be intelligently named in the form of an intelligent summary based on the test case description and automatically uploaded to a specified location; in this way, it is possible to collect evidence of the output and important test processes throughout the entire test process, realize full automation of testing and evidence collection, and thus improve test efficiency.

[0076] The following is an explanation of an exemplary application of the embodiments of the present application in a practical application scenario.

[0077] The embodiment of the present application provides a method for automating the software testing forensics process, which can realize screenshots fully automatically without manual intervention and rework; and, by docking with the test system, it can intelligently name the screenshots according to the test case description and automatically upload the screenshots to the specified location; at the same time, it meets the needs of all software testing scenarios and can cope with the capture needs of intermediate outputs without omissions and the need for rework.

[0078] Figure 4 An optional flow chart of the test evidence collection method provided in the embodiment of the present application is as follows: Figure 4 As shown, the following steps are included:

[0079] S410: Create a test case.

[0080] S420: Mark evidence collection points for the test case.

[0081] Here, it can be a tester who creates a test case based on the software requirements and marks the evidence points; it can also be a trained process automation robot, in which the process automation robot is trained through machine learning, that is, using the evidence point marking method in historical similar test cases.

[0082] Here, marking the evidence points for the test case means adding evidence records or evidence descriptions to the test case, which can be defined by preset keywords or preset screenshots.

[0083] S430: The process automation robot reads the test cases and executes the test cases in the order of the test cases.

[0084] S440: When the process automation robot detects that there is a evidence collection point ahead, the capture device is turned on.

[0085] Here, the capturer can be the recognizer in the process automation robot.

[0086] S450: The capture device monitors the changes of the screen and automatically takes a screenshot when content that needs to be collected for evidence appears.

[0087] Here, the content that needs to be forensically collected can be defined by keywords or trained by machine learning. Training the capturer by machine learning means training the capturer with screenshots of similar use cases in previous test reports.

[0088] S460: The process automation robot obtains the screenshot in the capturer, extracts keywords as the screenshot file name according to the test case description associated with the evidence collection point, and saves it to the local specified path according to the preset, or calls the upload script to upload it to the test management system.

[0089] The method of the embodiment of the present application is further described in detail below with reference to the logic flow chart.

[0090] Figure 5 The following is a logical flow chart of the test evidence collection method provided in the embodiment of the present application. Figure 5 As mentioned above, the entire test process is divided into a pre-preparation phase and a test phase, which is completed by testers, test RPA (process automation robot) and capturers. In the pre-preparation phase, the following steps are included:

[0091] S501, the tester provides evidence collection training materials.

[0092] Here, the tester may be a person who executes the software testing process or an intelligent testing terminal.

[0093] Here, the forensic training materials provided can be screenshots of similar use cases in previous test reports.

[0094] S502, the tester trains the capturer using the forensic training material.

[0095] Here, the capturer is trained through machine learning, using screenshots of similar use cases in previous test reports.

[0096] S503, the tester creates a test case.

[0097] S504, process automation robot reading use case.

[0098] Here, the process automation robot is a virtual robot, which is the executor or execution unit in the process, where the process corresponds to the business logic, which is the software testing process.

[0099] S505, the tester marks the evidence collection points for the test case and adds the evidence collection description.

[0100] Here, the evidence collection point is usually one or more records, and the content that needs to be collected can be reflected by adding a forensic description. It can be defined by preset keywords or by preset screenshots.

[0101] S506, the process automation robot obtains the evidence collection point.

[0102] During the testing phase, the following steps are included:

[0103] S507, start testing.

[0104] S508, the process automation robot executes the test cases in the order of the test cases.

[0105] S509, the process automation robot determines whether there is a forensic point in the test case.

[0106] Here, when the process automation robot detects that a test case has a forensic point, it goes to step S510 to start the capturer, otherwise it returns to step S508 to continue executing the next test case.

[0107] S510, start the capturer.

[0108] S511, the capturer monitors the screen and obtains the required output.

[0109] Here, the capturer can be real-time screen capture software or a recognizer in a process automation robot, which can monitor changes in the screen during the execution of test cases and automatically take screenshots when content that requires evidence collection appears.

[0110] It should be noted that the content that needs to be collected can be defined by keywords or trained by machine learning; among them, training the capturer by machine learning means training the capturer with screenshots of similar use cases in previous test reports.

[0111] S512, screenshot of process automation robot naming based on test case summary.

[0112] Here, the process automation robot obtains the screenshots in the capturer, and extracts keywords as the screenshot file name based on the test case description associated with the evidence collection point; among them, the test case description can be used to extract keywords using artificial intelligence automatic text summarization technology.

[0113] S513, the process automation robot calls the script to upload or save it in a specified location.

[0114] Here, the process automation robot saves the screenshot to a specified local path according to the preset settings, or calls the upload script to upload it to the test management system.

[0115] It should be noted that the process automation robot does not directly connect to the test management system, but only calls the specified script.

[0116] S514, the process automation robot determines whether the test is completed.

[0117] Here, if the test is completed, the tester outputs the test results and evidence materials in step S515, otherwise the process goes to step S508 to continue executing the next test case.

[0118] S515, the tester outputs the test results and evidence materials.

[0119] Here, the evidence materials include the screenshots saved this time and the historical test screenshots.

[0120] In order to better understand the embodiments of the present application, an example is given below. Now it is necessary to test the distributed storage cluster (Ceph cluster) to prove that the three-copy strategy is effective, that is, put a file in the Ceph cluster, and then prove that there are three copies of the file with the same content in the Ceph cluster. A possible test case is shown in Table 1 below, including four test steps: "Cluster initial state", "Monitor cluster state", "Write an object" and "Delete the object just written", among which the tester manually marked the test case with the evidence points "Cluster state" and "Cluster resource pool setting".

[0121] Table 1 Test cases for testing Ceph cluster

[0122]

[0123] In an embodiment of the present application, a test case is created in a test set management software (Testrail), and the test case is exported to a character separated value (CSV, Comma Separated Values) format, such as ceph.csv.

[0124] First, the tester executes the automated testing framework and starts the test. At this time, RPA automatically executes the test steps step by step. For example, to monitor the initial status of the Ceph cluster, RPA automatically calls the following command: "watch ceph-s".

[0125] Then, when encountering a pre-marked forensic point, the trained capturer can automatically take a screenshot and save the screenshot. For example, when the capturer "sees" that the number of objects in the cluster status has changed and does not change for 1 second after the change, it automatically calls the Windows system screenshot function to take a screenshot, copies the screenshot from the system cache, and sends it to the RPA.

[0126] Finally, RPA automatically summarizes the use case description. For example, it summarizes "Write an object: call the script to write an object. The object size is 4 KB. At this time, the cluster status should change and the number of objects increases by 3" as "The object increases after writing the object" and names the screenshot "Increase after writing the object.jpg" and saves it in the local specified directory "D:\190801Test".

[0127] It is obvious that through the above method, the efficiency of testing and forensics no longer requires manual intervention in the process. Combined with automated testing frameworks such as Jenkins, full automation of testing and forensics can be achieved, which is a major innovation.

[0128] This application realizes the automation of test evidence collection by combining RPA with artificial intelligence. The core innovations of this application are: the marking of test case evidence points and the training of evidence content are a core combination of artificial intelligence and RPA in this application, and are the key points that distinguish it from existing RPA technology; the capturer collects evidence intelligently by monitoring screen changes, which is the embodiment of the combination of artificial intelligence and RPA in this application; RPA uses intelligent summarization to automatically name test screenshots, which is another core combination and embodiment of artificial intelligence and RPA.

[0129] The test evidence collection method provided in the embodiment of the present application monitors the content to be collected and saves screenshots during the process of executing test cases using RPA, thereby realizing fully automatic evidence collection without the need for manual intervention or rework, greatly improving efficiency and reducing manpower investment; and, based on the test case description, it can intelligently name the screen recording video and screenshots, and automatically upload or save them to a specified location; at the same time, it meets the needs of all software testing scenarios and can cope with the evidence collection needs of complex scenarios such as intermediate output.

[0130] An embodiment of the present application provides a testing and evidence collection device, which includes various modules and various units included in each module, and can be implemented by a processor in a computer device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.

[0131] Figure 6 A schematic diagram of the structure of a test evidence collection device provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the device 600 includes an acquisition module 610 and a forensics module 620, wherein:

[0132] The acquisition module 610 is used to acquire and execute the test case to be collected;

[0133] The evidence collection module 620 is used to save the interface related to the evidence collection point information as a evidence collection diagram when it is detected that the evidence collection point information is marked in the test case during the execution of the test case.

[0134] In some embodiments, the evidence collection module 620 also includes a monitoring submodule 6201 and a screenshot submodule 6202, wherein the monitoring submodule 6201 is used to monitor the interface displayed on the screen when it is detected that the evidence point information is marked in the test case; the screenshot submodule 6202 is used to take a screenshot of the interface related to the evidence point information, obtain the evidence image and save it.

[0135] In some embodiments, the evidence point information includes preset keywords, and the screenshot submodule 6202 includes an identification unit, a first determination unit and a first screenshot unit, wherein the identification unit is used to perform text recognition on the current frame interface displayed on the screen to obtain the keywords in the current frame interface; the first determination unit is used to determine that the current frame interface is related to the evidence point information if the similarity between the keywords in the current frame interface and the preset keywords is greater than or equal to a similarity threshold; the screenshot unit is used to automatically take a screenshot of the current frame interface to obtain and save the evidence image.

[0136] In some embodiments, the evidence point information includes a preset screenshot, and the screenshot submodule 6202 includes a matching unit, a second determination unit and a second screenshot unit, wherein the matching unit is used to match the current frame interface displayed on the screen with the preset screenshot; the second determination unit is used to determine that the current frame interface is related to the evidence point information if all or part of the graphics of the current frame interface matches the preset screenshot; the second screenshot unit is used to automatically take a screenshot of the current frame interface to obtain and save the evidence image.

[0137] In some embodiments, the device 600 further includes a marking module for marking the evidence point information for the test case based on evidence material, wherein the evidence material is a test screenshot of the test case described in the historical test report.

[0138] In some embodiments, the device 600 also includes an information extraction module and a naming module, wherein the information extraction module is used to obtain keywords of the forensic diagram by extracting information from the test case description associated with the forensic point information, or by extracting text information from the forensic diagram; and the naming module is used to name the forensic diagram according to the keywords of the forensic diagram.

[0139] In some embodiments, the device 600 further includes a saving module for saving the forensic image to a specific local path; or, calling an upload script to upload the forensic image to a test management system.

[0140] It should be noted that the description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.

[0141] It should be noted that in the embodiments of the present application, if the above-mentioned test evidence collection method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including several instructions to enable the automatic test line of the device containing the storage medium to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk.

[0142] Correspondingly, the embodiment of the present application provides a test evidence collection device, Figure 7 A hardware entity diagram of a test evidence collection device provided in an embodiment of the present application, such as Figure 7 As shown, the hardware entity of the device 700 includes: a processor 710, a communication interface 720 and a memory 730, wherein

[0143] Processor 710 generally controls the overall operation of device 700 .

[0144] The communication interface 720 may enable the device 700 to communicate with other terminals or servers through a network.

[0145] The memory 730 is configured to store instructions and applications executable by the processor 710, and can also cache data to be processed or processed by the processor 710 and various modules in the device 700 (for example, image data, audio data, voice communication data, and video communication data), which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM).

[0146] Correspondingly, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the test and evidence collection method provided in the above embodiment are implemented.

[0147] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0148] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.

[0149] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0150] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0151] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment of the present application.

[0152] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0153] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for the automatic test line of the device to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks or optical disks.

[0154] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0155] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0156] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A test evidence collection method, characterized in that: The method comprises: Obtain and execute the test cases to be collected; During the execution of the test case, when it is detected that evidence point information is marked in the test case, the interface displayed on the screen is monitored; the evidence point information includes at least preset keywords; the evidence point is obtained by marking the test case by a process automation robot trained by machine learning using the evidence point marking method in historical similar test cases; Taking a screenshot of the interface related to the evidence point information to obtain and save the evidence map; The step of taking a screenshot of the interface related to the evidence point information to obtain and save the evidence image includes: Performing text recognition on the current frame interface displayed on the screen to obtain keywords in the current frame interface; If the similarity between the keyword in the current frame interface and the preset keyword is greater than or equal to the similarity threshold, it is determined that the current frame interface is related to the evidence point information; Automatically take a screenshot of the current frame interface to obtain and save the forensic image.

2. The method according to claim 1, characterized in that The evidence point information also includes a preset screenshot, and the screenshot of the interface related to the evidence point information is taken to obtain and save the evidence image, and further includes: Matching the current frame interface displayed on the screen with the preset screenshot; If all or part of the graphics of the current frame interface matches the preset screenshot, it is determined that the current frame interface is related to the evidence point information; Automatically take a screenshot of the current frame interface to obtain and save the forensic image.

3. The method according to claim 1, characterized in that The method further comprises: The evidence point information is marked for the test case according to the evidence material, wherein the evidence material is a test screenshot of the test case described in the historical test report.

4. The method according to claim 1, characterized in that The method further comprises: By extracting information from a test case description associated with the evidence point information, or by extracting text information from the evidence graph, keywords of the evidence graph are obtained; The forensic graph is named according to the keywords of the forensic graph.

5. The method according to claim 1, characterized in that The method further comprises: Save the forensic image to a specific local path; or, Call the upload script to upload the evidence image to the test management system.

6. A test evidence collection device, characterized in that: The device comprises an acquisition module and a forensics module, wherein: The acquisition module is used to acquire and execute the test case to be collected; The evidence collection module is used to monitor the interface displayed on the screen when it is detected that the test case is marked with evidence point information during the execution of the test case; take a screenshot of the interface related to the evidence point information to obtain and save the evidence image; the evidence point information at least includes preset keywords; the evidence points are obtained by marking the test case through machine learning, using a process automation robot trained by the evidence point marking method in historical similar test cases; wherein the evidence collection module is specifically used to: perform text recognition on the current frame interface displayed on the screen to obtain the keywords in the current frame interface; if the similarity between the keywords in the current frame interface and the preset keywords is greater than or equal to the similarity threshold, it is determined that the current frame interface is related to the evidence point information; automatically take a screenshot of the current frame interface to obtain and save the evidence image.

7. A test evidence collection device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the program, the steps in the method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Mobile terminal control method, mobile terminal and computer readable storage medium

    CN108762631A

  • Position prediction method, apparatus, device, and readable storage medium

    CN109410275A

  • H5 page testing method and device, electronic equipment and storage medium

    CN109784369A

  • Real-time evidence obtaining method and device for Android application and electronic device

    CN110674491A

  • Forensic marking apparatus and method for realtime contents service

    KR1020130125706A