User Interface Testing Method, Device, Storage Medium, and Electronic Device

By dividing user interface elements into static and dynamic page elements, a test workflow is generated for automated testing, which solves the problem of poor user interface testing and realizes an efficient and automated testing process.

CN113742240BActive Publication Date: 2025-08-05CHINA TELECOM CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111077602.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-14
Publication Date
2025-08-05
Estimated Expiration
2041-09-14

AI Technical Summary

Technical Problem

The existing user interface testing methods are not effective, the automated testing tools are low in reusability, and manual script expansion is required, which is highly complex.

Method used

By obtaining test preprocessing scripts, divide user interface elements into static and dynamic page elements, generate test workflows, and send them to the test terminal for automated testing. Dynamic page elements represent the interactive relationship between pages without manually extending the script.

Benefits of technology

Improve user interface testing efficiency, reduce manual participation, enhance the automation and accuracy of tests, and reduce labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113742240B_ABST
    Figure CN113742240B_ABST
Patent Text Reader

Abstract

The present disclosure provides a user interface testing method, device, storage medium and electronic device, which relate to the field of computer technology. The user interface testing method divides each page element in the user interface to be tested into multiple static page elements and multiple dynamic page elements through the obtained test preprocessing script, and then generates a test workflow for the user interface to be tested based on the multiple dynamic page elements. Finally, the test workflow is sent to the test terminal so that the test terminal can call at least one test program corresponding to the test workflow from the test program database to perform automated testing on the user interface to be tested. The method solves the technical problem that the current testing methods for user interfaces in the prior art are not effective. The method improves the testing efficiency of the user interface from two dimensions: no need for manual testing and no need for manual functional test script expansion, thereby achieving the technical effect of improving the testing effect of the user interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a user interface testing method, device, storage medium, and electronic device. Background Art

[0002] The user interface (UI) is one of the important ways for users to interact with electronic devices and is also one of the important factors affecting user experience. Therefore, before any product is launched, its UI must be rigorously tested to ensure the stability and smoothness of user interaction with the UI.

[0003] Currently, there are two main ways to test user interfaces: the first is to manually complete user interface page testing; the second is to use UI automation tools (such as QTP, Selenium, etc.). However, the page operations in most user interfaces are strongly related to page processes, resulting in low reusability of automated testing tools. Manual script expansion is still required for each test, which is very complex.

[0004] Therefore, current testing methods for user interfaces are ineffective. Summary of the Invention

[0005] The present disclosure provides a user interface testing method, device, storage medium and electronic device, thereby improving the testing effect on the user interface.

[0006] In a first aspect, an embodiment of the present disclosure provides a user interface testing method, the method comprising:

[0007] Get the test preprocessing script recorded for the user interface to be tested;

[0008] Based on the test preprocessing script, each page element in the user interface to be tested is divided into multiple static page elements and multiple dynamic page elements; wherein, static page elements refer to elements in the user interface used to display to the user; dynamic page elements refer to elements in the user interface used to respond to switching between different pages;

[0009] Generate a test workflow for the user interface to be tested based on multiple dynamic page elements;

[0010] The test workflow is sent to the test terminal, wherein the test workflow is used to instruct the test terminal to call at least one test program corresponding to the test workflow from a test program database to perform automated testing on the user interface to be tested.

[0011] In an optional embodiment of the present disclosure, obtaining a test preprocessing script recorded for a user interface to be tested includes:

[0012] Obtaining an initial test script for the initial user interface recorded by the test terminal;

[0013] Obtaining a new test script sent by the test terminal; wherein the new test script refers to a test script recorded for a new module added to the initial user interface;

[0014] Add the new test script to the initial test script to obtain a test preprocessing script.

[0015] In an optional embodiment of the present disclosure, each page element in the user interface to be tested is divided into multiple static page elements and multiple dynamic page elements based on a test pre-processing script, including:

[0016] Identify each page element in the user interface to be tested based on the page element identification script to obtain multiple page elements;

[0017] Based on the element division sub-script in the test preprocessing script, multiple page elements are divided into static page elements and dynamic page elements.

[0018] In an optional embodiment of the present disclosure, generating a test workflow for a user interface to be tested based on multiple dynamic page elements includes:

[0019] Determine the interaction relationship between multiple dynamic page elements based on the analysis sub-script in the test pre-processing script;

[0020] A test workflow for a user interface to be tested is generated based on multiple dynamic page elements and the interaction relationship between the multiple dynamic page elements.

[0021] In an optional embodiment of the present disclosure, before sending the test workflow to the test terminal, the method further includes:

[0022] Obtaining preset verification information corresponding to each test program; wherein the preset verification information refers to the verification parameters used by dynamic page elements when responding to switching between different pages;

[0023] Send the test workflow and various preset verification information to the test terminal.

[0024] In an optional embodiment of the present disclosure, sending the test workflow and each preset verification information to the test terminal includes:

[0025] The preset verification information is divided into global verification information and local verification information; wherein, global verification information refers to verification information that has been used more than a preset threshold number of times during the automated test process; local verification information refers to verification information that has been used less than a preset threshold number of times during the automated test process;

[0026] The global verification information and the local verification information are sent to the test terminal respectively.

[0027] In an optional embodiment of the present disclosure, performing automated testing on the user interface to be tested includes at least one of the following steps:

[0028] Automated testing of new product features for the user interface to be tested;

[0029] Automated testing of product modification functionality on the user interface to be tested;

[0030] Perform automated testing of the product viewing function on the user interface to be tested.

[0031] In a second aspect, an embodiment of the present disclosure provides a user interface testing device, the device comprising:

[0032] An acquisition module is used to obtain a test preprocessing script recorded for the user interface to be tested;

[0033] An element division module is used to divide each page element in the user interface to be tested into multiple static page elements and multiple dynamic page elements based on the test pre-processing script; wherein, static page elements refer to elements in the user interface used to be displayed to the user; dynamic page elements refer to elements in the user interface used to respond to switching between different pages;

[0034] A workflow generation module, used to generate a test workflow for the user interface to be tested based on multiple dynamic page elements;

[0035] The sending module is used to send the test workflow to the test terminal; wherein the test workflow is used to instruct the test terminal to call at least one test program corresponding to the test workflow from the test program database to perform automated testing on the user interface to be tested.

[0036] In a third aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which implements the above method when executed by a processor.

[0037] In a fourth aspect, an embodiment of the present disclosure provides an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the above method by executing the executable instructions.

[0038] The technical solution disclosed in this disclosure has the following beneficial effects:

[0039] The above-mentioned user interface testing method divides each page element in the user interface to be tested into multiple static page elements for displaying to the user and multiple dynamic page elements that respond to switching between different pages by obtaining a test preprocessing script. Then, based on the obtained multiple dynamic page elements, a test workflow for the user interface to be tested is generated and sent to the test terminal. The test terminal only needs to call at least one test program corresponding to the test workflow from the test program database according to the test workflow to realize automated testing of the user interface to be tested. No human intervention is required during the testing process. At the same time, the test workflow is formed based on the dynamic page elements, which can accurately represent the interaction relationship or switching state between each page. Therefore, during the testing process, there is no need to manually expand the corresponding functional test script every time a new function is added to the user interface. The embodiments of the present disclosure solve the technical problem that the current user interface testing methods in the prior art are not effective. The efficiency of user interface testing is improved from two dimensions: no manual testing is required and no manual expansion of functional test scripts is required, thereby achieving the technical effect of improving the effectiveness of user interface testing.

[0040] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification, serve to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and it is possible for a person skilled in the art to derive other drawings based on these drawings without inventive effort.

[0042] Figure 1 A schematic diagram showing an application scenario of a user interface testing method in this exemplary embodiment is shown;

[0043] Figure 2 A flowchart showing a user interface testing method in this exemplary embodiment is shown;

[0044] Figure 3 A flowchart showing a user interface testing method in this exemplary embodiment is shown;

[0045] Figure 4 A flowchart showing a user interface testing method in this exemplary embodiment is shown;

[0046] Figure 5 A flowchart showing a user interface testing method in this exemplary embodiment is shown;

[0047] Figure 6 A flowchart showing a user interface testing method in this exemplary embodiment is shown;

[0048] Figure 7 A flowchart showing a user interface testing method in this exemplary embodiment is shown;

[0049] Figure 8 A flowchart showing a user interface testing method in this exemplary embodiment is shown;

[0050] Figure 9 A schematic structural diagram of a user interface testing device in this exemplary embodiment is shown;

[0051] Figure 10 A schematic structural diagram of an electronic device in this exemplary embodiment is shown. DETAILED DESCRIPTION

[0052] The exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete and the concepts of the exemplary embodiments will be fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or that other methods, components, devices, steps, etc. may be employed. In other cases, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0053] In addition, the accompanying drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. Identical reference numerals in the figures denote identical or similar parts, and thus repetitive descriptions thereof will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0054] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all steps. For example, some steps may be decomposed, while some steps may be combined or partially combined, so the actual execution order may change according to actual circumstances.

[0055] In the relevant technology, the user interface (UI) is one of the important ways for users to interact with electronic devices, and it is also one of the important factors affecting user experience. Therefore, before any product goes online, its user interface must be strictly tested to ensure the stability and smoothness of the user's interaction with the user interface when using it. Currently, there are two main ways to test the user interface: the first way is to manually complete the page testing of the user interface; the second way is to test through UI automation tools (such as QTP, Selenium, etc.), but the page operations in most user interfaces are strongly related to the page flow, which leads to low reusability of the automated testing tools. Manual script expansion is still required for each test, which is relatively complex. Therefore, the current testing methods for user interfaces are not effective.

[0056] In view of the above problems, the embodiments of the present disclosure provide a user interface testing method. By obtaining a test preprocessing script, each page element in the user interface to be tested is divided into multiple static page elements for displaying to the user and multiple dynamic page elements that respond to switching between different pages. Then, based on the obtained multiple dynamic page elements, a test workflow for the user interface to be tested is generated and sent to a test terminal. The test terminal only needs to call at least one test program corresponding to the test workflow from a test program database according to the test workflow to achieve automated testing of the user interface to be tested. No human intervention is required during the testing process. At the same time, the test workflow is formed based on the dynamic page elements, which can accurately represent the interaction relationship or switching state between each page. Therefore, during the testing process, there is no need to manually expand the corresponding functional test script every time a new function is added to the user interface. The embodiments of the present disclosure solve the technical problem that the current user interface testing methods in the prior art are not effective. The efficiency of user interface testing is improved from two dimensions: no manual testing is required and no manual expansion of functional test scripts is required, thereby achieving the technical effect of improving the effectiveness of user interface testing.

[0057] The following briefly introduces the application environment of the user interface testing method provided by the embodiment of the present disclosure:

[0058] See Figure 1The user interface testing method provided by the embodiment of the present disclosure is applied to a user interface testing system 10, which includes at least: a development terminal 101, a test terminal 102, and a processing terminal 103. The development terminal 101 is used by developers to develop new product functions or modules, such as adding product information, promotional information, product codes, etc., to develop test programs for testing different page elements, such as text boxes, buttons, icons, menus, etc., and to record test pre-processing scripts for various functions. The processing terminal 103 is used to receive the test pre-processing script recorded by the development terminal 101, generate a test workflow for the user interface to be tested based on the test pre-processing script, and send the test workflow to the test terminal 102. The test terminal 102 is used to receive the target workflow sent by the processing terminal 103 and the test program database provided by the development terminal 101, and perform automated testing on the user interface to be tested based on the target workflow and the test programs in the test program database.

[0059] The following uses the above-mentioned processing terminal 103 as the execution subject, and applies the user interface testing method to the above-mentioned processing terminal 103 to test the user interface to be tested as an example. Figure 2 The user interface testing method provided by the embodiment of the present disclosure includes the following steps 201 to 204.

[0060] Step 201: The processing terminal obtains a test pre-processing script recorded for the user interface to be tested.

[0061] The test pre-processing script is recorded in advance by the developer or tester, stored in the test terminal, and then sent to the processing terminal. The test pre-processing script is used to pre-process the user interface to be tested, such as identifying and classifying page elements, determining the interactive relationships between different pages, etc. The embodiments of the present disclosure do not limit the specific content or form of the test pre-processing script. The developer or tester can write it according to the actual situation. It only needs to meet the functions of identifying, classifying, and determining the interactive relationships of each page element in the user interface to be tested.

[0062] Step 202: The processing terminal divides each page element in the user interface to be tested into a plurality of static page elements and a plurality of dynamic page elements based on the test pre-processing script.

[0063] Static page elements refer to elements in the user interface used to display information to users, such as text boxes and buttons used to represent information such as product name, product quantity, and user name. Dynamic page elements refer to elements in the user interface used to respond to switching between different pages, such as icons used to represent page switching actions such as "Exit," "Submit," "Login," "Add," "Complete," and "End."

[0064] Step 203: The processing terminal generates a test workflow for the user interface to be tested based on the multiple dynamic page elements.

[0065] For example, static page elements include: menu lists, product information display text boxes, etc.; dynamic page elements include: add button, save button and submit button, etc. It can be seen that static page elements are used to display the basic information of the current product. Once a dynamic page element is clicked, the page will switch from one page to another. For example, clicking the add button will switch from the first page currently displaying the basic information of the product to the second page containing multiple input text boxes for entering the text information to be added; after entering the corresponding text information, click the save button to lock the text box that can currently be entered into a state that cannot be modified, and then click the "submit" button, the current page will switch from the second page to the third page containing the newly added information.

[0066] In other words, the test workflow includes multiple interaction nodes, and each interaction node is essentially a correspondence between a dynamic page element and a page switch. For example, in the above step 203, the add button on the first page corresponds to switching from the first page to the second page; the save button on the second page corresponds to saving the newly added text information to the product menu list on the second page, and the submit button on the second page corresponds to switching from the second page to the third page.

[0067] As can be seen, dynamic page elements represent the current page elements and the interaction between the pages. Therefore, the interaction between the dynamic page elements is determined as the test workflow of the user interface to be tested. The test workflow is used to indicate the test flow sequence or test process of the user interface to be tested.

[0068] Step 204: The processing terminal sends the test workflow to the test terminal.

[0069] The test workflow is used to instruct the test terminal to call at least one test program corresponding to the test workflow from a test program database to perform automated testing on the user interface to be tested.

[0070] After the processing terminal obtains the test workflow based on step 203, it sends the test workflow to the test terminal. The test terminal then calls the test program corresponding to each dynamic page element or each interactive node in the test workflow from a pre-stored test program database. For example, for the Add button in step 203 above, the corresponding newly added text box for product information input should be a text box test program; the Save button and Submit button correspond to the new menu list formed after the newly added product information, and the corresponding test program is a menu test program. Accordingly, the processing terminal calls the text box test program and the menu list test program from the test program database to test them in sequence.

[0071] The disclosed embodiments provide a user interface testing method. By obtaining a test preprocessing script, each page element in the user interface to be tested is divided into multiple static page elements for displaying to the user and multiple dynamic page elements that respond to switching between different pages. A test workflow is then generated for the user interface to be tested based on the obtained multiple dynamic page elements, and the test workflow is sent to a test terminal. The test terminal only needs to call at least one test program corresponding to the test workflow from a test program database according to the test workflow to implement automated testing of the user interface to be tested. No human intervention is required during the testing process. Furthermore, the test workflow is formed based on dynamic page elements, which can accurately represent the interaction relationship or switching state between pages. Therefore, during the testing process, there is no need to manually expand the corresponding functional test script each time a new function is added to the user interface. The disclosed embodiments address the technical problem of poor performance of current user interface testing methods in the prior art. By eliminating the need for manual testing and eliminating the need for manual expansion of functional test scripts, the efficiency of user interface testing is improved, thereby achieving the technical effect of improving user interface testing effectiveness.

[0072] See Figure 3 In an optional embodiment of the present disclosure, the above step 201 processes the terminal to obtain a test pre-processing script recorded for the user interface to be tested, including the following steps 301 to 303:

[0073] Step 301: The processing terminal obtains an initial test script for an initial user interface recorded by a test terminal.

[0074] The initial user interface refers to the user interface before it is updated, and the initial test script refers to a pre-processing script recorded by a developer or tester for the initial user interface and stored in the test terminal. The pre-processing script is used to perform functions such as identifying and classifying page elements in the initial user interface, and determining the interactive relationships between different pages.

[0075] Step 302: The processing terminal obtains the newly added test script sent by the test terminal.

[0076] Among them, the newly added test script refers to the test script recorded for the newly added functional module of the initial user interface. For example, a "product barcode" text box is added to the initial user interface to form a new user interface, that is, the user interface to be tested is obtained; in the test terminal, corresponding to each newly added functional module, the corresponding test script of the functional module will be recorded, that is, the newly added test script in this embodiment.

[0077] Step 303: The processing terminal adds the new test script to the initial test script to obtain a test pre-processing script.

[0078] After obtaining the new test script for the new module through step 302, the processing device updates the new test script to the initial test script for the initial user interface, thereby obtaining a test preprocessing script for the updated new user interface.

[0079] The embodiment of the present disclosure records a new test script separately for each new functional module in the user interface, and then updates the obtained new test script to the initial test script in real time. The updated user interface can be preprocessed based on the obtained initial test script. There is no need for developers to participate in rewriting the entire test script every time some functional modules in the user interface are updated, thereby greatly improving the test efficiency and convenience of the user interface test, and also reducing labor costs to a certain extent.

[0080] See Figure 4 In an optional embodiment of the present disclosure, the terminal divides each page element in the user interface to be tested into multiple static page elements and multiple dynamic page elements based on the test pre-processing script in step 202, including the following steps 401-402:

[0081] Step 401: The processing terminal identifies each page element in the user interface to be tested based on a page element identification script to obtain multiple page elements.

[0082] The page element recognition script can directly use an existing page object recognition control, such as an OCR recognition program, a selenium recorder, etc., or can be independently designed by a developer according to actual conditions, etc., and this embodiment does not specifically limit this. The processing terminal identifies each page element in the user interface to be tested based on the page element recognition script and obtains a recognition result, that is, multiple page elements, such as text boxes, buttons, menu lists, icons, etc.

[0083] Step 402: The processing terminal divides the multiple page elements into static page elements and dynamic page elements based on the element division sub-scripts in the test pre-processing script.

[0084] The test preprocessing script includes at least two parts: an element division sub-script and an analysis sub-script. The element division sub-script separates the multiple page elements obtained in step 401 into static page elements and dynamic page elements, and further clusters and encapsulates them to facilitate subsequent analysis and processing of the interaction between dynamic page elements to form a test workflow.

[0085] The disclosed embodiment first identifies each page element in the user interface to be tested based on a page element recognition script to obtain multiple page elements. The multiple page elements are then divided into static page elements and dynamic page elements using an element division sub-script within a test preprocessing script. The disclosed embodiment first identifies all page elements in the user interface to be tested one by one using the element recognition script, thereby avoiding omissions caused by manual processing and further improving the reliability of the user interface test provided by the disclosed embodiment.

[0086] See Figure 5 In an optional embodiment of the present disclosure, the terminal generates a test workflow for the user interface to be tested based on multiple dynamic page elements in step 203, including the following steps 501-502:

[0087] Step 501: The processing terminal determines the interactive relationship between multiple dynamic page elements based on the analysis sub-script in the test pre-processing script.

[0088] As shown in step 402 above, the test preprocessing script includes at least two parts, an element division sub-script and an analysis sub-script. Among them, the analysis sub-script is used to determine the interactive relationship between different dynamic page elements. For example, as shown in step 203 above, the add button on the first page corresponds to switching from the first page to the second page; the save button corresponds to saving the newly added text information to the product menu list on the second page on the second page, and the submit button on the second page corresponds to switching from the second page to the third page. Then the interaction order between the three buttons, that is, the interactive relationship is: add button-save button-submit button. Among them, the interactive relationship between the add button-save button-submit button can be pre-set. For example, if multiple dynamic page elements include a add button and a submit button, then the two dynamic page elements are sorted according to the pre-set interactive relationship as: add button-submit button, that is, the interactive relationship between the multiple dynamic page elements identified.

[0089] Step 502: The processing terminal generates a test workflow for the user interface to be tested based on the multiple dynamic page elements and the interaction relationships between the multiple dynamic page elements.

[0090] The processing terminal obtains the interaction relationship between the dynamic page elements through step 501, and then generates a test workflow for the user interface to be tested according to the order of their interaction, so as to facilitate subsequent automated testing of the user interface to be tested.

[0091] The embodiment of the present disclosure first determines the interaction relationship between multiple dynamic page elements based on the analysis sub-script in the test preprocessing script, and then generates a test workflow for the user interface to be tested based on the interaction relationship between each dynamic page element. This can ensure the consistency of the generated test workflow and the interaction relationship between each dynamic page element, and further improve the reliability of the user interface test of the embodiment of the present disclosure.

[0092] See Figure 6 In an optional embodiment of the present disclosure, before the processing terminal sends the test workflow to the test terminal in step 204, the method further includes the following steps 601 and 602:

[0093] Step 601: The processing terminal obtains preset verification information corresponding to each test program.

[0094] The preset authentication information refers to authentication parameters used by dynamic page elements when responding to switching between different pages, such as user name, password, mobile phone number, birthday, web service address, GIF address, etc. The specific type of the preset authentication information is independently selected or set according to the actual user interface and is not specifically limited in this embodiment.

[0095] Step 602: The processing terminal sends the test workflow and various preset verification information to the test terminal.

[0096] After the processing terminal sends the test workflow and the preset verification information to the test terminal, the test terminal performs automated testing on the user interface to be tested based on the test workflow. When executing a test program during the test process, the preset verification information corresponding to the test program can be conveniently called. There is no need to carry all the verification information during the entire test process, thereby greatly improving the convenience of the test.

[0097] See Figure 7 In an optional embodiment of the present disclosure, the above step 602 processes the terminal sending the test workflow and each preset verification information to the test terminal, including the following steps 701-702:

[0098] Step 701: The processing terminal divides the preset verification information into global verification information and local verification information.

[0099] Global authentication information refers to authentication information used more than a preset threshold during automated testing, while local authentication information refers to authentication information used less than a preset threshold during automated testing. In other words, global authentication information refers to authentication information that is used multiple times throughout the test, such as a username, while local authentication information refers to authentication information that is used only a few times during testing, such as a password.

[0100] Step 702: The processing terminal sends the global verification information and the local verification information to the test terminal respectively.

[0101] The disclosed embodiment first divides the preset verification information into global verification information, which is used more than a preset threshold number of times during the automated test process, and local verification information, which is used more than a preset threshold number of times during the automated test process, so as to facilitate the selective carrying of verification information during subsequent automated tests. During the automated test process, only the global verification information needs to be carried, rather than all the verification information. When a certain local verification information is needed, only a targeted call is required. This can avoid the reduction in test efficiency caused by carrying a large amount of verification information during the test process, thereby greatly improving test efficiency and convenience.

[0102] In an optional embodiment of the present disclosure, in step 204, the processing terminal sends the test workflow to the test terminal, and the processing terminal performs automated testing on the user interface to be tested, including at least one of the following steps:

[0103] The processing terminal performs automated testing of product addition functions on the user interface under test; the processing terminal performs automated testing of product modification functions on the user interface under test; and the processing terminal performs automated testing of product viewing functions on the user interface under test. The disclosed embodiment can perform automated testing of product addition functions, product modification functions, and product viewing functions, providing a more comprehensive test.

[0104] See Figure 8, which is an overall flow chart of the user interface test provided in the embodiment of the present disclosure. The developer first develops the initial user interface in the development terminal, and then the tester records the initial test script for the initial user interface in the test terminal and sends it to the processing terminal. After the developer develops the new functional module for the initial user interface, the tester re-records the new test script for the new functional module in the test terminal and sends it to the processing terminal. After obtaining the new test script, the processing terminal first identifies the updated user interface, that is, each page element in the user interface to be tested that includes the new functional module, in combination with the initial test script. Then, the multiple page elements are divided into static page elements and dynamic page elements, and finally a test workflow for the user interface to be tested is generated, and the test workflow is sent to the test terminal for automated testing.

[0105] See Figure 9 In order to implement the above-mentioned business processing method, an embodiment of the present disclosure provides a user interface testing device 900. Figure 9 1 shows a schematic architecture diagram of a user interface testing device 900 , wherein the user interface testing device 900 includes: an acquisition module 910 , an element division module 920 , a workflow generation module 930 and a sending module 940 .

[0106] The acquisition module 910 is used to obtain a test pre-processing script recorded for the user interface to be tested;

[0107] The element division module 920 is used to divide each page element in the user interface to be tested into multiple static page elements and multiple dynamic page elements based on the test pre-processing script; wherein the static page elements are elements in the user interface used to be displayed to the user; the dynamic page elements are elements in the user interface used to respond to switching between different pages;

[0108] The workflow generation module 930 is used to generate a test workflow for the user interface to be tested based on multiple dynamic page elements;

[0109] The sending module 940 is used to send the test workflow to the test terminal. The test workflow is used to instruct the test terminal to call at least one test program corresponding to the test workflow from the test program database to perform automated testing on the user interface to be tested.

[0110] In an optional embodiment, the acquisition module 910 is specifically used to obtain the initial test script recorded by the test terminal for the initial user interface; obtain the newly added test script sent by the test terminal; wherein the newly added test script refers to the test script recorded for the newly added module of the initial user interface; add the newly added test script to the initial test script to obtain a test preprocessing script.

[0111] In an optional embodiment, the element division module 920 is specifically used to identify each page element in the user interface to be tested based on the page element identification script to obtain multiple page elements; based on the element division sub-script in the test preprocessing script, the multiple page elements are divided into static page elements and dynamic page elements.

[0112] In an optional embodiment, the workflow generation module 930 is specifically used to determine the interaction relationship between multiple dynamic page elements based on the analysis sub-script in the test preprocessing script; and generate a test workflow for the user interface to be tested based on multiple dynamic page elements and the interaction relationship between multiple dynamic page elements.

[0113] In an optional embodiment, the sending module 940 is also used to obtain preset verification information corresponding to each test program; wherein the preset verification information refers to the verification parameters used by the dynamic page element when responding to switching between different pages; and send the test workflow and each preset verification information to the test terminal.

[0114] In an optional embodiment, the sending module 940 is specifically used to divide the preset verification information into global verification information and local verification information; wherein, the global verification information refers to the verification information that is used more than a preset threshold number of times during the automated testing process; the local verification information refers to the verification information that is used less than a preset threshold number of times during the automated testing process; and the global verification information and the local verification information are sent to the test terminal respectively.

[0115] In an optional embodiment, the sending module 940 is specifically used to perform automated testing on the user interface to be tested for new product functions; automated testing on the user interface to be tested for product modification functions; and automated testing on the user interface to be tested for product viewing functions.

[0116] The exemplary embodiments of the present disclosure also provide a computer-readable storage medium that can be implemented in the form of a program product, which includes program code. When the program product is run on an electronic device, the program code is used to cause the electronic device to perform the steps described in the "Exemplary Method" section above of this specification according to the various exemplary embodiments of the present disclosure. In one embodiment, the program product can be implemented as a portable compact disc read-only memory (CD-ROM) and includes program code, and can be run on an electronic device, such as a personal computer. However, the program product of the present disclosure is not limited to this, and in this document, a readable storage medium can be any tangible medium that contains or stores a program that can be used by or in combination with an instruction execution system, apparatus, or device.

[0117] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0118] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0119] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0120] The program code for performing the operations of the present disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet). In an embodiment of the present disclosure, the program code stored in the computer-readable storage medium can implement any step of the user interface testing method described above when it is executed.

[0121] See Figure 10 The exemplary embodiment of the present disclosure further provides an electronic device 1000, which may be a background server of an information platform. Figure 10 The electronic device will be described. It should be understood that Figure 10 The electronic device 1000 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0122] like Figure 10 As shown, electronic device 1000 is implemented as a general-purpose computing device. Components of electronic device 1000 may include, but are not limited to, at least one processing unit 1010, at least one storage unit 1020, and a bus 1030 connecting various system components (including storage unit 1020 and processing unit 1010).

[0123] The storage unit stores program codes, which can be executed by the processing unit 1010, so that the processing unit 1010 performs the steps according to various exemplary embodiments of the present invention described in the "Exemplary Method" section above. For example, the processing unit 1010 can perform the following steps: Figure 2 The method steps shown, etc.

[0124] The storage unit 1020 may include a volatile storage unit, such as a random access memory unit (RAM) 1021 and / or a cache memory unit 1022 , and may further include a read-only memory unit (ROM) 1023 .

[0125] The storage unit 1020 may also include a program / utility 1024 having a set (at least one) of program modules 1025, such program modules 1025 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0126] The bus 1030 may include a data bus, an address bus, and a control bus.

[0127] The electronic device 1000 can also communicate with one or more external devices 1100 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), and such communication can be performed via an input / output (I / O) interface 1040. The electronic device 1000 can also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 1050. As shown, the network adapter 1050 communicates with other modules of the electronic device 1000 via a bus 1030. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0128] In the embodiment of the present disclosure, when the program code stored in the electronic device is executed, any step in the above user interface testing method can be implemented.

[0129] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.

[0130] It will be appreciated by those skilled in the art that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented as the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which may be collectively referred to herein as a "circuit", "module" or "system". Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to encompass any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and implementation are intended to be exemplary only, with the true scope and spirit of the present disclosure being indicated by the claims.

[0131] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A user interface testing method, characterized in that: The method comprises: Obtaining a test preprocessing script recorded for the user interface to be tested; the obtaining of the test preprocessing script recorded for the user interface to be tested includes: obtaining an initial test script recorded for the initial user interface by a test terminal; obtaining a newly added test script sent by the test terminal; wherein the newly added test script refers to a test script recorded for a newly added module of the initial user interface; adding the newly added test script to the initial test script to obtain the test preprocessing script; Based on the test preprocessing script, each page element in the user interface to be tested is divided into a plurality of static page elements and a plurality of dynamic page elements; wherein the static page elements refer to elements in the user interface for displaying to the user; and the dynamic page elements refer to elements in the user interface for responding to switching between different pages; Generating a test workflow for the user interface to be tested based on the multiple dynamic page elements; the test workflow includes multiple interaction nodes, each interaction node is a correspondence between a dynamic page element and a page switch; the test workflow is used to indicate a test flow sequence or test process for the user interface to be tested; The test workflow is sent to a test terminal, wherein the test workflow is used to instruct the test terminal to call at least one test program corresponding to the test workflow from a test program database to perform automated testing on the user interface to be tested.

2. The user interface testing method according to claim 1, wherein: The dividing each page element in the user interface to be tested into a plurality of static page elements and a plurality of dynamic page elements based on the test preprocessing script includes: Identify each page element in the user interface to be tested based on a page element identification script to obtain multiple page elements; Based on the element division sub-script in the test pre-processing script, the multiple page elements are divided into the static page elements and the dynamic page elements.

3. The user interface testing method according to claim 2, wherein: Generating a test workflow for the user interface to be tested based on the multiple dynamic page elements includes: Determining the interaction relationship between the plurality of dynamic page elements based on the analysis sub-script in the test pre-processing script; The test workflow for the user interface to be tested is generated based on the multiple dynamic page elements and the interaction relationships between the multiple dynamic page elements.

4. The user interface testing method according to claim 1, wherein: Before sending the test workflow to the test terminal, the method further includes: Obtaining preset verification information corresponding to each of the test programs; wherein the preset verification information refers to verification parameters used by the dynamic page element when responding to switching between different pages; The test workflow and each of the preset verification information are sent to the test terminal.

5. The user interface testing method according to claim 4, wherein: The sending the test workflow and each of the preset verification information to the test terminal includes: The preset verification information is divided into global verification information and local verification information; wherein the global verification information refers to the verification information used more than a preset threshold during the automated test process; the local verification information refers to the verification information used less than the preset threshold during the automated test process; The global verification information and the local verification information are respectively sent to the test terminal.

6. The user interface testing method according to claim 1, wherein: The automated testing of the user interface to be tested comprises at least one of the following steps: Performing automated testing of new product features on the user interface to be tested; Performing automated testing of the product modification function on the user interface to be tested; An automated test of the product viewing function is performed on the user interface to be tested.

7. A user interface testing device, characterized in that: The device comprises: An acquisition module is used to acquire a test preprocessing script recorded for the user interface to be tested; the acquisition of the test preprocessing script recorded for the user interface to be tested includes: acquiring an initial test script recorded for the initial user interface by a test terminal; acquiring a newly added test script sent by the test terminal; wherein the newly added test script refers to a test script recorded for a newly added module of the initial user interface; and adding the newly added test script to the initial test script to obtain the test preprocessing script; an element division module, configured to divide each page element in the user interface to be tested into a plurality of static page elements and a plurality of dynamic page elements based on the test preprocessing script; wherein the static page elements refer to elements in the user interface for display to the user; and the dynamic page elements refer to elements in the user interface for responding to switching between different pages; A workflow generation module is configured to generate a test workflow for the user interface to be tested based on the multiple dynamic page elements; the test workflow includes multiple interaction nodes, each interaction node is a correspondence between a dynamic page element and a page switch; the test workflow is used to indicate a test flow sequence or test process for the user interface to be tested; A sending module is used to send the test workflow to a test terminal; wherein the test workflow is used to instruct the test terminal to call at least one test program corresponding to the test workflow from a test program database to perform automated testing on the user interface to be tested.

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 method according to any one of claims 1 to 6 is implemented.

9. An electronic device, characterized in that: include: processor; as well as a memory for storing executable instructions of the processor; The processor is configured to perform the method according to any one of claims 1 to 6 by executing the executable instructions.

Citation Information

Patent Citations

  • Automatic testing method and device

    CN106776319A