A user interface restoration automatic testing system and method

By designing an automated user interface restore test system, simulating user operations and comparing screenshots and original design drawings, the efficiency and accuracy problems of manually detecting UI design differences in the existing technology are solved, and more efficient and accurate UI design testing is achieved.

CN114756448BActive Publication Date: 2025-03-25SHANGHAI JIDOU TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210211556.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-04
Publication Date
2025-03-25
Estimated Expiration
2042-03-04

AI Technical Summary

Technical Problem

In the prior art, the detection of UI design differences relies on manual naked eye comparison, resulting in high cost, low efficiency and low accuracy.

Method used

Design an automatic test system for the restore degree of user interface, execute test files through the test terminal, simulate user operations, take screenshots and perform differential comparisons with the original design drawings, and generate test reports.

Benefits of technology

It improves the accuracy of UI design testing, reduces labor and time costs, and improves testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114756448B_ABST
    Figure CN114756448B_ABST
Patent Text Reader

Abstract

The present invention provides a user interface restoration automatic test system and method, which is executed by a test terminal and includes: a first configuration module, which is used to configure a test file of the tested software according to the application scenario of the tested software in the application client; a test running module, which is connected to the first configuration module and is used to: run the test file, simulate the user's operation on the interface control in the user interface of the tested software according to the test file, compare the user interface jumped with each operation with the corresponding original design drawing to form a comparison result, and form a final test report according to all the comparison results after the test is completed. By designing the test file to run automatically to test the UI interface of the tested software installed on the application client, the test accuracy is improved, the labor cost and time cost are reduced, and the test efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of UI design testing, and in particular to a system and method for automatically testing the degree of restoration of a user interface. Background Art

[0002] Android applications undergo multiple rounds of testing after development and before delivery to customers, including human-computer interaction testing (HMI testing) and UI walkthrough testing. Often, UI walkthrough testing will reveal that there are major problems with the UI restoration of the application, but this difference is sometimes a pixel-level deviation that cannot be recognized by the naked eye. Currently, the only way to find the pixel-level difference in UI restoration is to manually overlap and compare the design draft with the actual implementation draft. Currently, the industry's HMI testing and UI walkthrough testing for applications basically rely on UI designers and testers to manually take screenshots and manually identify and compare the position of the page layout and the style, position and size of the controls. However, this consumes a lot of human resources and time resources and cannot accurately restore. Summary of the invention

[0003] Based on the above problems, the present invention provides a system and method for automatic testing of user interface restoration, aiming to solve the technical problems of labor cost and time cost, low efficiency and low precision in manual detection of UI design differences in the prior art.

[0004] A user interface restoration automatic testing system, executed by a test terminal, comprises:

[0005] A first configuration module is used to configure the test file of the software under test according to the application scenario of the software under test on the application client;

[0006] The test running module is connected to the first configuration module and is used to:

[0007] Run the test file, simulate the user's operation on the interface controls in the user interface of the software under test according to the test file, compare the user interface that jumps to each operation with the corresponding original design drawing to form a comparison result, and after the test is completed, form a final test report based on all the comparison results.

[0008] Furthermore, it also includes:

[0009] A storage module, used for storing the original design drawings of the user interface designed in the software under test;

[0010] A second configuration module, connected to the storage module, is used to configure the actual runtime activity name of the user interface to be tested and the name of the corresponding original design drawing in the form of a key-value pair to form a configuration file;

[0011] The test running module is also connected to the second configuration module and the storage module respectively, including:

[0012] Startup unit, used to run the test file;

[0013] An operation unit, connected to the start unit, for simulating the user's operation on the interface controls in the user interface of the software under test according to the test file;

[0014] A name acquisition unit, connected to the operation unit, is used to acquire the activity name of the current user interface after the jump according to the operation;

[0015] A first judgment unit, connected to the name acquisition unit, is used to judge whether the activity name of the currently running user interface has a corresponding name of the original design drawing in the configuration file, and output a first judgment result;

[0016] a recording unit, connected to the first judgment unit, and configured to record the first judgment result when the first judgment result is not present;

[0017] A screenshot unit, connected to the first judgment unit, is used to take a screenshot of the currently running user interface to obtain an actual effect diagram of the user interface when the first judgment result is yes;

[0018] A comparison unit, connected to the screenshot unit, is used to compare the actual effect drawing with the corresponding original design drawing to obtain a comparison result;

[0019] The report generation unit is connected to the comparison unit and is used to generate a test report based on all the obtained comparison results and actual effect diagrams after the test is completed.

[0020] Furthermore, the test run module also includes:

[0021] A second judgment unit, connected to the comparison unit, is used to judge whether there is a difference between the actual effect drawing and the corresponding original design drawing according to the comparison result, and output a second judgment result;

[0022] A creating unit, connected to the second judging unit, for creating a bug record according to the difference when the second judging result indicates that there is a difference;

[0023] The sending module is connected to the test running module and is used to submit bug records to the quality monitoring management platform.

[0024] Furthermore, the test run module also includes:

[0025] a marking unit, connected to the second judgment unit, for marking the difference between the actual effect drawing and the corresponding original design drawing when the second judgment result is that there is a difference;

[0026] Create unit, connect the marking unit, and use it to create bug records based on the differences.

[0027] Furthermore, the comparison unit includes:

[0028] The conversion subunit is used to convert the actual effect image and the corresponding original design image into grayscale respectively;

[0029] The difference calculation subunit is connected to the conversion subunit and is used to calculate the similarity index between the actual effect picture converted into the grayscale picture and the corresponding original design picture to form a comparison result;

[0030] The second judgment unit is used to judge whether the similarity index is lower than a preset value. When the similarity index is lower than the preset value, it is determined that there is a difference between the actual effect drawing and the corresponding original design drawing.

[0031] Furthermore, the operation is a click on an interface control; the test running module uses the uiautomator tool to obtain the coordinates of the interface control to jump to the corresponding user interface.

[0032] Furthermore, the activity name of the user interface is the Activity name, and the Activity name of the homepage of the software under test and the Activity name of the current user interface are obtained through the adb tool.

[0033] Furthermore, the configuration file is a yml file.

[0034] Furthermore, the application client is a vehicle computer.

[0035] A user interface restoration degree automatic testing method, using the aforementioned user interface restoration degree automatic testing system, comprises:

[0036] Step A1, connecting the test terminal and the application client, where the software under test is installed;

[0037] Step A2, the test terminal runs a test file, and the test file is pre-configured according to the application scenario of the software under test on the application client;

[0038] Step A3, according to the test file, simulate the user's operation on the interface control in the user interface of the tested software, and compare the difference between the user interface jumped by each operation and the corresponding original design drawing to form a comparison result;

[0039] Step A4: After the test file is run, a final test report is generated based on all comparison results.

[0040] The beneficial technical effect of the present invention is that the present invention tests the UI interface of the tested software installed on the application client by designing the test file to run automatically, thereby improving the test accuracy, reducing the labor cost and time cost, and improving the test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 A schematic diagram of a module of an automatic testing system for the restoration degree of a user interface according to the present invention;

[0042] Figure 2 A schematic diagram of a module of an implementation of a test running module of a user interface restoration automatic testing system of the present invention;

[0043] Figure 3 A schematic diagram of a module of another embodiment of a test running module of a user interface restoration automatic testing system of the present invention;

[0044] Figure 4 A schematic diagram of a module of a comparison unit of an automatic test system for the restoration degree of a user interface according to the present invention;

[0045] Figure 5 The present invention is a flowchart of the steps of a method for automatically testing the degree of restoration of a user interface. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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.

[0047] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0048] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, but they are not intended to limit the present invention.

[0049] See also Figure 1 , a user interface restoration degree automatic testing system, characterized by being executed by a test terminal, comprising:

[0050] The first configuration module 1 is used to configure the test file of the software under test according to the application scenario of the software under test in the application client;

[0051] The test running module 2 is connected to the first configuration module 1 and is used for:

[0052] Run the test file, simulate the user's operation on the interface controls in the user interface of the software under test according to the test file, compare the user interface that jumps to each operation with the corresponding original design drawing to form a comparison result, and after the test is completed, form a final test report based on all the comparison results.

[0053] For further information, see Figure 2 , also includes:

[0054] Storage module 3, used to store the original design drawings of the user interface designed in the tested software;

[0055] The second configuration module 4 is connected to the storage module 3 and is used to configure the actual runtime activity name of the user interface to be tested and the name of the corresponding original design drawing in the form of a key-value pair to form a configuration file;

[0056] The test running module 2 is also connected to the second configuration module 4 and the storage module 3 respectively, including:

[0057] A startup unit 201 is used to run a test file;

[0058] The operation unit 202 is connected to the start unit 201 and is used to simulate the user's operation on the interface controls in the user interface of the tested software according to the test file;

[0059] A name acquisition unit 203, connected to the operation unit 202, is used to acquire the activity name of the current user interface after the operation jump;

[0060] The first judgment unit 204 is connected to the name acquisition unit 203, and is used to judge whether the activity name of the currently running user interface has a corresponding name of the original design drawing in the configuration file, and output a first judgment result;

[0061] The recording unit 205 is connected to the first judging unit 204 and is used to record the first judging result when the first judging result is not present;

[0062] The screenshot unit 206 is connected to the first judgment unit 204 and is used to take a screenshot of the currently running user interface to obtain an actual effect diagram of the user interface when the first judgment result is yes;

[0063] The comparison unit 207 is connected to the screenshot unit 206 and is used to compare the actual effect drawing with the corresponding original design drawing to obtain a comparison result;

[0064] The report generating unit 208 is connected to the comparing unit 207 and is used to generate a test report according to all the obtained comparing results and the actual effect diagram after the test is completed.

[0065] The test file is an excel file.

[0066] Configure the business logic of the software under test according to the actual scenario. In the test case Excel file, configure and write the different business logic sequences as needed. The Excel file contains event name, event type, input parameters, assertion standard, and page element positioning information. At runtime, read the contents of the Excel file through program code and convert it into execution steps. Use the adb shell input swipe, adb shell input, and adb shell tap commands in the adb shell command to simulate the user's operation on the user interface of the software under test. After each step is executed, the Activity name of the current user interface is obtained through adb shell, and it is determined whether the Activity name exists in desig.xml. If it exists, it means that there is a corresponding original design drawing. If it exists, the screen is captured through the adb shell command, and the captured image is pulled from the application client to the test terminal through adb shell pull.

[0067] After forming the test file, connect the application client to the test terminal through the adb shell connect command, start the software under test in the application client, and enter the homepage of the software under test. When running the test file, automatically simulate the user's operation in the user interface of the software under test according to the execution order of the business logic in the test file, such as clicking the interface control. Each operation jumps to the corresponding user interface, takes a screenshot, and then compares it.

[0068] Specifically, first use the UIAutomator in the tools that come with the Android SDK to obtain the location (X, Y coordinates) of each interface control in the user interface, supplement the test file, and when running the test file, identify the interface control by identifying the user's operation coordinates, so as to perform the corresponding jump.

[0069] For further information, see Figure 3 , the test running module 2 also includes:

[0070] The second judgment unit 209 is connected to the comparison unit 207 and is used to judge whether there is a difference between the actual effect drawing and the corresponding original design drawing according to the comparison result, and output a second judgment result;

[0071] A creating unit 211, connected to the second judging unit 209, for creating a bug record according to the difference when the second judging result is that there is a difference;

[0072] The sending module 5 is connected to the test running module 2 and is used to submit the bug record to the quality monitoring management platform.

[0073] During the testing process, for each comparison result, if any difference is found between the actual rendering and the corresponding original design drawing, a bug record will be created in time and the quality management system interface will be called to actively report the problem.

[0074] Furthermore, the test running module 2 also includes:

[0075] The marking unit 210 is connected to the second judging unit 209 and is used to mark the difference between the actual effect drawing and the corresponding original design drawing when the second judging result is that there is a difference;

[0076] The creation unit 211 is connected to the marking unit 210 and is used to create a bug record according to the difference points.

[0077] Specifically, Python's open-vc2 library is used to compare images. If the images are inconsistent, the difference points between the two images are drawn on the images with red lines through canvas, and the results are automatically created as bugs and submitted to the quality control management platform.

[0078] Specifically, after all user interface comparisons are completed, all comparison results are output in Html format to form a UI walkthrough test report.

[0079] For further information, see Figure 4 , the comparison unit 207 includes:

[0080] The conversion subunit 2071 is used to convert the actual effect image and the corresponding original design image into grayscale respectively;

[0081] The difference calculation subunit 2072 is connected to the conversion subunit 2071 and is used to calculate the similarity index (SSIM) between the actual effect image after conversion into the grayscale image and the corresponding original design image to form a comparison result;

[0082] The second judgment unit 209 is used to judge whether the similarity index is lower than a preset value. When the similarity index is lower than the preset value, it is determined that there is a difference between the actual effect drawing and the corresponding original design drawing.

[0083] Specifically, the open-vc2 python library is used to perform grayscale conversion of the image. Furthermore, the operation is to click on the interface control; the test running module 2 uses the uiautomator tool to obtain the coordinates of the interface control to jump to the corresponding user interface.

[0084] Furthermore, the activity name of the user interface is the Activity name, and the Activity name of the homepage of the software under test and the Activity name of the current user interface are obtained through the adb tool.

[0085] Furthermore, the configuration file is a yml file.

[0086] Specifically, the design draft provided by the UI designer is uploaded and stored. The design draft includes the original design drawing of the designed user interface. In the desig.yml configuration file, the user interface to be tested is manually configured in the form of a key-value pair, combining the original design drawing with the name of the actual running effect diagram during the test, so that the corresponding relationship can be automatically identified for comparison during the user interface comparison stage during the test.

[0087] Furthermore, the application client is a vehicle computer.

[0088] See also Figure 5 The present invention also provides a method for automatically testing the restoration degree of a user interface, using the aforementioned automatic testing system for the restoration degree of a user interface, comprising:

[0089] Step A1, connecting the test terminal and the application client, where the software under test is installed;

[0090] Step A2, the test terminal runs a test file, and the test file is pre-configured according to the application scenario of the software under test on the application client;

[0091] Step A3, according to the test file, simulate the user's operation on the interface control in the user interface of the tested software, and compare the difference between the user interface jumped by each operation and the corresponding original design drawing to form a comparison result;

[0092] Step A4: After the test file is run, a final test report is generated based on all comparison results.

[0093] The present invention automatically tests the UI design of the tested software of the application client by designing and running scripts, simulates user click operations, executes screenshot operations after jumping to the page, and compares the captured screen with the original design draft using a computer program. Manual visual comparison is no longer used, thereby achieving precise UI matching and improving the efficiency and accuracy of UI design restoration testing.

[0094] The above are only preferred embodiments of the present invention, and are not intended to limit the implementation methods and protection scope of the present invention. Those skilled in the art should be aware that all solutions obtained by equivalent substitutions and obvious changes made using the description and illustrations of the present invention should be included in the protection scope of the present invention.

Claims

1. A user interface restoration automatic testing system, characterized in that: Executed by the test terminal, including: A first configuration module, configured to configure a test file of the software under test according to an application scenario of the software under test on an application client; A test running module, connected to the first configuration module, is used to: Run the test file, simulate the user's operation on the interface controls in the user interface of the tested software according to the test file, compare the user interface jumped with the corresponding original design drawing for each operation to form a comparison result, and after the test is completed, form a final test report according to all the comparison results; Also includes: A storage module, used for storing the original design drawing for designing the user interface in the software under test; A second configuration module, connected to the storage module, configured to configure the activity name of the actual runtime of the user interface to be tested and the name of the corresponding original design drawing in the form of a key-value pair to form a configuration file; The test running module is also connected to the second configuration module and the storage module respectively, including: A startup unit, used for running the test file; An operating unit, connected to the starting unit, for simulating the user's operation on the interface controls in the user interface of the software under test according to the test file; A name acquisition unit, connected to the operation unit, for acquiring the activity name of the current user interface after the jump according to the operation; A first judgment unit, connected to the name acquisition unit, is used to judge whether the activity name of the currently running user interface corresponds to the name of the original design drawing in the configuration file, and output a first judgment result; a recording unit, connected to the first judgment unit, and configured to record the first judgment result when the first judgment result is not present; A screenshot unit, connected to the first judgment unit, and configured to, when the first judgment result is yes, take a screenshot of the currently running user interface to obtain an actual effect diagram of the user interface; A comparison unit, connected to the screenshot unit, for comparing the actual effect drawing with the corresponding original design drawing to obtain a comparison result; A report generating unit, connected to the comparison unit, for generating the test report according to all the obtained comparison results and the actual effect diagram after the test is completed; The test running module also includes: A second judgment unit, connected to the comparison unit, is used to judge whether there is a difference between the actual effect drawing and the corresponding original design drawing according to the comparison result, and output a second judgment result; a creating unit, connected to the second judging unit, configured to create a bug record according to the difference when the second judging result is that there is a difference; A sending module, connected to the test running module, for submitting the bug record to the quality monitoring management platform; The test running module also includes: a marking unit, connected to the second judgment unit, and configured to mark the difference between the actual effect drawing and the corresponding original design drawing when the second judgment result is that there is a difference; A creating unit, connected to the marking unit, is used to create the bug record according to the difference point.

2. The automatic test system for the restoration degree of a user interface as claimed in claim 1, characterized in that: The comparison unit comprises: A conversion subunit, used for performing grayscale conversion on the actual effect drawing and the corresponding original design drawing respectively; A difference calculation subunit, connected to the conversion subunit, for calculating a similarity index between the actual effect image converted into a grayscale image and the corresponding original design image, to form the comparison result; The second judgment unit is used to judge whether the similarity index is lower than a preset value. When the similarity index is lower than the preset value, it is determined that there is a difference between the actual effect diagram and the corresponding original design diagram.

3. The automatic test system for the restoration degree of a user interface as claimed in claim 1, characterized in that: The operation is clicking on the interface control; the test running module uses the uiautomator tool to obtain the coordinates of the interface control to jump to the corresponding user interface.

4. The automatic test system for the restoration degree of a user interface as claimed in claim 1, characterized in that: The activity name of the user interface is the Activity name, and the Activity name of the homepage of the software under test and the Activity name of the current user interface are obtained through the adb tool.

5. The automatic test system for the restoration degree of a user interface as claimed in claim 1, characterized in that: The configuration file is a yml file.

6. The automatic test system for the restoration degree of a user interface as claimed in claim 1, characterized in that: The application client is a vehicle computer.

7. An automatic testing method for user interface restoration, characterized in that: An automatic test system for the restoration degree of a user interface according to any one of claims 1 to 6 comprises: Step A1, connecting a test terminal and an application client, wherein the application client has the software under test installed thereon; Step A2, the test terminal runs a test file, and the test file is pre-configured according to the application scenario of the software under test in the application client; Step A3, according to the test file, simulating the user's operation on the interface controls in the user interface of the tested software, and performing a difference comparison between the user interface jumped with each operation and the corresponding original design drawing to form a comparison result; Step A4: After the test file is run, a final test report is generated based on all the comparison results.

Citation Information

Patent Citations

  • An automatic test method and system for man-machine graphic interaction interfaces

    CN105808416A