UI-based automatic test result display implementation method

By recording and displaying failed screenshots, logs and videos during the test process in the UI automated test, the problem of unintuitive display of test results in the existing technology is solved, the traceability and transparency of the test process are achieved, and the test efficiency and Quality assessment.

CN118733439APending Publication Date: 2024-10-01SICHUAN HONGMEI INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410722052.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-05
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing UI automated testing frameworks and tools have unintuitive information and lack of graphical display in displaying test results, making it difficult to quickly locate problems and evaluate software quality, affecting the analysis efficiency of developers and testers.

Method used

By recording failure screenshots, failure logs and operation videos during the test process, the web platform is used to configure and execute test tasks, automatically obtain and store test results, and display them visually in the form of a dashboard on the web interface, including use case names, execution results, Exception information, failure screenshots, videos and logs ensure the traceability and transparency of the testing process.

Benefits of technology

It realizes the intuitive display and detailed recording of test results, facilitates problem troubleshooting and auditing, improves testing efficiency and quality assessment, discovers potential improvement points, and continuously optimizes the testing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733439A_ABST
    Figure CN118733439A_ABST
Patent Text Reader

Abstract

The invention discloses a UI-based automatic test result display implementation method, and relates to the technical field of software testing, the test process can be completely recorded by recording failure screenshots, failure logs and operation videos in the test process, the traceability and transparency of the test can be ensured, and troubleshooting and test process auditing are facilitated; through analysis of operation logs and videos, teams can evaluate the test process and execution quality, discover potential improvement points, continuously optimize the test process and improve the test efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software testing, and in particular to an implementation method based on UI automated test result display. Background Art

[0002] With the rapid development of software development, the complexity and diversity of user interfaces (UIs) continue to increase, making UI automated testing an important part of ensuring software quality. UI automated testing can simulate user operations, effectively monitor the correctness of interface functions, layouts, and interaction logic, and significantly improve test efficiency. However, in existing UI automated testing frameworks and tools, the display of test results still faces some shortcomings: information display is not intuitive. Most existing solutions only provide basic test reports and display test results in text or table form. Test result data often only provides a simple pass / fail status. No specific screenshots, videos, and related logs are provided for related information of failures. It is difficult to quickly locate problems and evaluate software quality, which affects the efficiency of developers and testers in analyzing problems and the speed of problem response. With the increasing complexity of software applications, the demand for efficient, graphical, and intuitive display of test results is becoming increasingly urgent. Therefore, a new method for displaying UI automated test results is needed. This method can not only display test results intuitively, but also provide a complete video test process based on the test process log provided, which helps to ensure the traceability and transparency of the test process and facilitates troubleshooting and auditing the test process. Through the analysis of operation logs and videos, potential improvement points can be found, the test process can be continuously optimized, and the test efficiency can be improved.

[0003] Prior art 202010322405.2 discloses a test result display method, apparatus, device and storage medium, the method comprising: obtaining input key characters through a method name management interface; displaying at least one method name matching the key characters in the code file of the application through the method name management interface, the code file comprising at least one method function and at least one method function method name; in response to a test result acquisition instruction for a first method name in the method name management interface, displaying a first test result display interface, the first test result display interface comprising the test result of the first method function corresponding to the first method name. The above scheme speeds up the search for method functions by providing a method name management interface, thereby speeding up the verification of whether there are problems with method functions, and thereby improving the efficiency of finding method functions with problems. This method is not suitable for testers' daily UI automation test case execution and result display. Summary of the invention

[0004] The purpose of the present invention is to provide an implementation method based on UI automated test result display in order to solve the above problems. The present invention can record the test process completely by recording the failed screenshots, failure logs and operation videos during the test process, which helps to ensure the traceability and transparency of the test, and facilitates troubleshooting and auditing the test process. By analyzing the operation logs and videos, potential improvement points can be found, the test process can be continuously optimized, and the test efficiency can be improved.

[0005] The present invention achieves the above-mentioned purpose through the following technical solutions:

[0006] A method for displaying test results based on UI automation includes the following steps:

[0007] Step 1: Configure the test task of the test suite in the web platform to test multiple test cases;

[0008] Step 2: Start executing the test task, triggering the execution of the test suite on the test server;

[0009] Step 3: During the test task execution, the test case execution results are automatically obtained and written into the database;

[0010] Step 4: Monitor whether the test suite has been executed through the web service. If it has been executed, obtain the test case execution data in the database through the web interface.

[0011] Step 5: The test results are displayed on the constructed web interface, including the use case name, execution result, use case execution time, and exception information;

[0012] Step 6: Analyze the test results and display the test results from the dimensions of use case execution results, test tasks, and test time in the form of a dashboard.

[0013] Furthermore, in step 1, the test task of the test suite (a collection of test cases) to be tested is configured in the web platform. It is necessary to add the project task name, APP test version, test terminal, task description, and the test suite and save it in the database MySQL (a relational database management system that stores data in different tables).

[0014] Furthermore, in step 2, the test task is executed on the web platform, and the shell command is triggered remotely to execute the test suite. The test suite here is composed of UI automation test cases written using the Airtest tool.

[0015] Furthermore, in step 3, the test case execution results are automatically obtained. When each test case is executed, if the running result of the test case is successful, the task name, test case name, running result (PASS), and running time (from the start of the test case to the end of the test case) of the test case execution will be submitted to the MySQL database for storage through the storage interface provided by the server; if the running result of the test case is failed, the task name, test case name, running result (FAIL), running time, failed screenshot URL, failed video URL, and failed APP log URL of the test case execution will be submitted to the MySQL database for storage through the storage interface provided by the server.

[0016] When the test case fails to run, the terminal (including Android and IOS, the same below) takes a screenshot of the failure through the snapshot provided by Airtest and stores it on the server; then uploads the screenshot file to the cloud server through the upload interface provided by the server, and obtains the URL of the failure screenshot returned by the cloud server.

[0017] When the test case fails to run, the terminal starts recording the video before the test case runs through the recoding method provided by Airtest. Once the run fails, the recording stops and the video is stored on the server. Then, the video file is uploaded to the cloud server through the upload interface provided by the server, and the URL of the failed video returned by the cloud server is obtained.

[0018] When the use case fails to run, the terminal captures the APP's running log through adb logcat. Once the operation fails, it stops capturing the log and stores the video on the server; then upload the log file to the cloud server through the upload interface provided by the server, and obtains the URL of the failed APP log returned by the cloud server.

[0019] Furthermore, in step 4, the web service will monitor whether the test suite has completed execution. If the monitored status is not completed, it will continue to execute the operation of storing the test results in the database in step 3; if the monitored status is completed, the stored test case execution data corresponding to the task will be extracted from the database through the server interface.

[0020] Furthermore, in step 5, the test case execution data obtained in step 4 is displayed in a visual form on the constructed web interface. This includes the test case name, execution result, test case execution time, and exception information (failure reason, failure screenshot, failure video, and failure APP log). The failure screenshot is displayed in a graphical form and can be downloaded and saved locally; the failure reason will display the specific text reason for the failure based on the actual operation situation; the failure video can be previewed online or downloaded and saved locally; the APP-side log can be previewed online or downloaded and saved locally. The failure video and failure log record the execution path of the test and provide a comprehensive execution record. Such a complete record helps to ensure the traceability and transparency of the test process, and facilitates troubleshooting and auditing the test process.

[0021] Furthermore, in step 6, the tested cases are analyzed based on the test case execution results, test tasks, and test time dimensions, and displayed in the form of a dashboard, allowing testers to see at a glance the test case execution results of a certain task in a certain time period.

[0022] The present invention also provides an implementation system based on UI automated test result display, including an execution platform, a test engine, and data storage; the execution platform includes test task configuration, test tasks, test execution results, and test result analysis diagrams; the test engine includes test suite execution and test result acquisition; the data storage includes: storage of test task configuration and storage of test results;

[0023] The test task configuration is used to configure the test task of the suite to be tested in the web platform;

[0024] The test task is used to distribute tests to multiple test cases;

[0025] The test execution result is used to extract the stored test case execution data from the database through the interface;

[0026] The test result analysis chart is used to be displayed in a visual form on the constructed web interface;

[0027] The storage of the test task configuration and the storage of the test results are used to store corresponding data.

[0028] The beneficial effects of the present invention are:

[0029] The present invention provides an implementation method based on UI automated test result display, which can completely record the test process by recording failure screenshots, failure logs and operation videos during the test process, helping to ensure the traceability and transparency of the test, and facilitating problem troubleshooting and auditing the test process; through the analysis of operation logs and videos, the team can evaluate the test process and the quality of execution, discover potential improvement points, continuously optimize the test process, and improve test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, 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 drawings can be obtained based on these drawings without paying creative work.

[0031] Figure 1 It is a flow chart of the present invention.

[0032] Figure 2 This is a flowchart for implementing the test result storage of the present invention.

[0033] Figure 3 The flowchart is a display of the UI automation test results of the present invention.

[0034] Figure 4 This is a system structure diagram of the present invention. DETAILED DESCRIPTION

[0035] To make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described in detail below. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.

[0036] In any embodiment, if Figure 1As shown, an implementation method based on UI automated test result display of the present invention configures the test task of the test suite to be tested in the web platform, and can test multiple test cases to be tested; executes the test task on the web platform, and executes the test suite by remotely triggering the shell instruction; automatically obtains the test case execution result, and if the test case execution result is successful, the task name, the test case name, the running result (PASS), and the running time (from the start of the test case execution to the end of the execution) of the test case execution will be submitted to the MySQL database for storage through the storage interface provided by the server; if the test case execution result is failed, the task name, the test case name, the running result (FAIL), the running time, the failed screenshot URL, the failed video URL, the failed APP log URL, Submit to the MySQL database for storage through the storage interface provided by the server; during the execution process, the web service will monitor whether the test suite execution is completed. If the monitored status is not completed, it will continue to perform the operation of storing the test results in the database; if the monitored status is completed, the stored test case execution data will be extracted from the database through the interface; the acquired test case execution data will be displayed in a visual form on the constructed web interface, and click on the failure reason page to view the failure reason (text description), failure screenshot (previewable and downloadable), failed APP log (previewable and downloadable), and failure video (previewable and downloadable); analyze the tested cases according to the execution results of the cases, test tasks, and test time dimensions, and display them in the form of a dashboard;

[0037] By recording the failure screenshots, failure logs and operation videos during the test, the test process can be fully recorded, which helps to ensure the traceability and transparency of the test, and facilitates troubleshooting and auditing the test process. Through the visual display of test result data, it can quickly locate and solve the problem of the failed case, and through result analysis, it can show the trend of the case operation results in a certain period of time, evaluate the quality of the test process and execution, find potential improvement points, continuously optimize the test process, and improve test efficiency.

[0038] like Figure 2As shown in the figure, when the test suite is triggered, the screenshot, APP log capture, and video recording functions are called first when executing each use case. If the use case execution result is successful, the screenshot, APP log, and video recording files will not be stored. Only the name of the task, the use case name, the running result (PASS), and the running time will be directly stored in the database by calling the storage interface provided by the cloud service; if the use case execution result is failed, the failed screenshot file and APP log will be automatically stored, the video recording will be stopped to obtain the video file, and the upload interface will be called to transfer it to the cloud server. At the same time, the cloud server will return the URL of the failed screenshot, APP log, and video (so that it can access the failed screenshot, APP log, and video through the URL address). After obtaining the URL, the task name, use case name, running result (FAIL), and running time will be stored in the database together by calling the storage interface provided by the cloud service. The corresponding execution result data is stored in the database, which can not only ensure the security and integrity of the data, but also support sharing and collaboration, allowing multiple users or applications to access it at the same time.

[0039] like Figure 3 As shown, during the execution of the test task, the web service will always monitor the status of the test task. When the web service receives the status of the test suite reporting the completion of execution, it will stop monitoring and change the status of the test task to completed; the web server will start the interface to obtain the execution result, running time, failure screenshot URL, failure APP log URL, and failure video URL of each use case of the currently running test task from the test result database according to the test task name, and display them on the constructed test result page; on the test result page, we can intuitively see the running status of each use case: success or failure. If it is a failure, we can click on the failure reason page to view the failure reason (text description), failure screenshot (previewable and downloadable), failure APP log (previewable and downloadable), and failure video (previewable and downloadable); if the execution completion status is not monitored, the data result storage process will continue to be executed; according to the provided test process logs, videos, etc., the results are deeply analyzed to enhance the user interaction experience and improve the efficiency of testers and developers in analyzing and locating problems.

[0040] In a specific embodiment, Figure 4 As shown, a realization system based on UI automated test result display of the present invention includes an execution platform, a test engine, and data storage; the execution platform includes test task configuration, test task, test execution result, and test result analysis chart; the test engine includes test suite execution and test result acquisition; the data storage includes: storage of test task configuration and storage of test results;

[0041] The test task configuration is used to configure the test task of the suite to be tested in the web platform;

[0042] The test task is used to distribute tests to multiple test cases;

[0043] The test execution result is used to extract the stored test case execution data from the database through the interface;

[0044] The test result analysis chart is used to be displayed in a visual form on the constructed web interface;

[0045] The storage of the test task configuration and the storage of the test results are used to store corresponding data.

[0046] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims. It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present invention will not further explain various possible combinations. In addition, the various different embodiments of the present invention can also be combined arbitrarily, as long as they do not violate the concept of the present invention, they should also be regarded as the contents disclosed by the present invention.

Claims

1. A method for displaying test results based on UI automation, characterized in that: The following steps are involved: Step 1: Configure the test task of the test suite in the web platform to test multiple test cases; Step 2: Start executing the test task, triggering the execution of the test suite on the test server; Step 3: During the test task execution, the test case execution results are automatically obtained and written into the database; Step 4: Monitor whether the test suite has been executed through the web service. If it has been executed, obtain the test case execution data in the database through the web interface. Step 5: The test results are displayed on the constructed web interface, including the use case name, execution result, use case execution time, and exception information; Step 6: Analyze the test results and display the test results from the dimensions of use case execution results, test tasks, and test time in the form of a dashboard.

2. A method for displaying test results based on UI automation as described in claim 1, characterized in that: In step 1, the test task of the test suite to be tested is configured in the web platform. The project task name, APP test version, test terminal, task description, and test suite need to be added and saved in the database MySQL.

3. The method for displaying test results based on UI automation as described in claim 1, characterized in that: In step 2, the test task is executed on the web platform, and the test suite is executed by remotely triggering the shell command.

4. The method for implementing UI automated test result display according to claim 1, characterized in that: In the step 3, the test case execution results are automatically obtained. When each test case is executed, if the running result of the test case is successful, the task name, test case name, running result, and running time of the test case execution will be submitted to the MySQL database for storage through the storage interface provided by the server; if the running result of the test case is failed, the task name, test case name, running result, running time, failed screenshot URL, failed video URL, and failed APP log URL of the test case execution will be submitted to the MySQL database for storage through the storage interface provided by the server.

5. The method for displaying test results based on UI automation as claimed in claim 1, characterized in that: In step 3, when the use case fails to run, the terminal takes a screenshot of the failure through the snapshot provided by Airtest and stores it on the server; then the screenshot file is uploaded to the cloud server through the upload interface provided by the server, and the URL of the failure screenshot returned by the cloud server is obtained.

6. A method for displaying test results based on UI automation as described in claim 1, characterized in that: In step 3, when the use case fails to run, the terminal starts recording the video before the use case runs through the recoding method provided by Airtest. Once the run fails, the recording is stopped and the video is stored on the server; then the video file is uploaded to the cloud server through the upload interface provided by the server, and the URL of the failed video returned by the cloud server is obtained.

7. The method for displaying test results based on UI automation as claimed in claim 1, characterized in that: In step 3, when the use case fails to run, the terminal captures the APP's running log through adb logcat. Once the operation fails, it stops capturing the log and stores the video on the server; then upload the log file to the cloud server through the upload interface provided by the server, and obtains the URL of the failed APP log returned by the cloud server.

8. The method for displaying test results based on UI automation as claimed in claim 1, characterized in that: In step 4, the web service will monitor the status of whether the test suite execution has been completed. If the monitored status is not completed, it will continue to execute the operation of storing the test results in the database in step 3; if the monitored status is completed, the stored test case execution data will be extracted from the database through the interface.

9. The method for implementing UI automated test result display according to claim 1, characterized in that: In step 5, the test case execution data obtained in step 4 is displayed in a visual form on the constructed web interface; Including use case name, execution results, use case execution time, and exception information.

10. A system for displaying UI automated test results, characterized in that: It includes an execution platform, a test engine, and data storage; the execution platform includes test task configuration, test tasks, test execution results, and test result analysis diagrams; The test engine includes test suite execution and test result acquisition; the data storage includes: storage of test task configuration and storage of test results; The test task configuration is used to configure the test task of the suite to be tested in the web platform; The test task is used to distribute tests to multiple test cases; The test execution result is used to extract the stored test case execution data from the database through an interface; The test result analysis chart is used to be displayed in a visual form on the constructed web interface; The storage of the test task configuration and the storage of the test results are used to store corresponding data.