User interface automatic test method and device, equipment and storage medium

By analyzing the intent of manual user operation cases and determining the operable elements, automated testing instructions are generated, which solves the problem that user interface automated testing methods cannot understand user behavior and goals, and improves the accuracy and efficiency of testing.

CN120803933APending Publication Date: 2025-10-17CHINA MERCHANTS BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510916871.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-03
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

The user interface automation testing methods in the existing technology cannot understand user behavior and goals, resulting in low test accuracy.

Method used

By analyzing the intentions of manual user operation cases, obtaining user behavior data, determining the operable elements in the user interface to be tested, and generating automated test instructions based on this data, automated testing of the user interface is achieved.

Benefits of technology

It improves the accuracy and efficiency of user interface automated testing, enables a better understanding of user behavior and goals, and improves test accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120803933A_ABST
    Figure CN120803933A_ABST
Patent Text Reader

Abstract

The invention discloses a user interface automatic test method and device, equipment and a storage medium, and relates to the technical field of artificial intelligence, the method comprises the following steps: carrying out intention analysis on a user operation manual case, and obtaining user behavior data in the user operation manual case; determining all operable elements in the user interface to be tested; determining a target page element corresponding to the user behavior based on the user behavior data and the operable element; and generating and executing an automatic test instruction based on the user behavior data and the target page element to obtain an automatic test result. The page element corresponding to the user behavior can be determined based on the user behavior data in the user operation manual case, and the automatic test is performed based on the user behavior data and the page element, so that the problem that a user interface automatic test method in the prior art cannot understand the behavior and target of a user is solved; and meanwhile, the test efficiency is improved, so that the test accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, and in particular to a user interface automatic testing method and device, equipment and a storage medium. BACKGROUND

[0002] With the rapid development of financial technology, the user interfaces (UI) of various financial software and services have become increasingly complex and diversified. Financial institutions rely on efficient software systems to provide customer service, process transactions, manage risks, and other key business functions, so it is crucial to ensure the stability and reliability of these software systems. Among them, UI automation testing, as an important means of software quality assurance, plays an indispensable role in the financial field.

[0003] In the process of developing and maintaining financial software, traditional UI automation testing methods mainly rely on manually marking page elements and writing test scripts. Testers locate page elements by recording element attributes (such as XPath, CSS selector, etc.) in code or configuration files, and read these attributes through code to achieve automated testing. However, financial software often involves a large number of user interactions, such as login, transfer, account balance inquiry, transaction confirmation, etc., and this automation testing method mainly analyzes page structure and element attributes from a technical perspective, and cannot truly understand user behavior and goals, resulting in low accuracy of user page automation testing. SUMMARY

[0004] The main purpose of the present application is to provide a user interface automatic testing method, device, equipment and storage medium, which aims to solve the technical problem that the user interface automatic testing method in the prior art cannot understand user behavior and goals, resulting in low accuracy of testing.

[0005] To achieve the above purpose, the present application provides a user interface automatic testing method, which comprises:

[0006] Intention analysis is performed on user operation manual cases to obtain user behavior data in the user operation manual cases, wherein the user behavior data is data for representing user behavior;

[0007] All operable elements in the user interface to be tested are determined;

[0008] Based on the user behavior data and the operable elements, the target page element corresponding to the user behavior is determined;

[0009] Based on the user behavior data and the target page element, an automatic testing instruction is generated and executed to obtain an automatic testing result corresponding to the user interface to be tested.

[0010] In an embodiment, the step of performing intent analysis on the user operation manual case and obtaining user behavior data in the user operation manual case comprises:

[0011] Obtaining manual case text in the user operation manual case;

[0012] Performing analysis on the manual case text through a preset user behavior analysis model to obtain a user intent analysis result;

[0013] Determining whether the user intent analysis result meets a preset user intent analysis standard;

[0014] According to the determination result, obtaining user behavior data in the user operation manual case.

[0015] In an embodiment, before the step of determining the target page element corresponding to the user behavior based on the user behavior data and the operable element, the method further comprises:

[0016] Converting the format of the user behavior data to obtain target user behavior data, wherein the target user behavior data is user behavior data in an input format meeting a preset user intent speculation model;

[0017] The step of determining the target page element corresponding to the user behavior based on the user behavior data and the operable element comprises:

[0018] Determining the target page element corresponding to the user behavior based on the target user behavior data and the operable element through the preset user intent speculation model.

[0019] In an embodiment, the step of determining the target page element corresponding to the user behavior based on the target user behavior data and the operable element through the preset user intent speculation model comprises:

[0020] Matching the target user behavior data with the operable element through the preset user intent speculation model;

[0021] If there is a target operable element matching the target user behavior data in the operable element, performing structure detection on the user interface to be tested;

[0022] According to the detection result, determining whether the page structure of the user interface to be tested has changed;

[0023] If not, determining the target operable element as the target page element corresponding to the user behavior.

[0024] In an embodiment, after the step of judging whether the page structure of the user interface to be tested changes according to the detection result, the method further comprises:

[0025] If yes, determining a current page structure of the user interface to be tested;

[0026] Obtaining a current operable element corresponding to the user interface to be tested based on the current page structure;

[0027] Updating the operable element according to the current operable element, and returning to the step of matching the target user behavior data with the operable element by using the preset user intention inference model.

[0028] In an embodiment, the step of generating and executing an automated test instruction based on the user behavior data and the target page element, and obtaining an automated test result corresponding to the user interface to be tested comprises:

[0029] Generating an automated test instruction based on the user behavior data and the target page element;

[0030] Obtaining an automated test interface matched with the user interface to be tested;

[0031] Executing the automated test instruction through the automated test interface, and obtaining an automated test result corresponding to the user interface to be tested.

[0032] In an embodiment, the step of obtaining an automated test interface matched with the user interface to be tested comprises:

[0033] Loading an automated test tool package corresponding to the user interface to be tested;

[0034] Determining a page function operation type corresponding to the user interface to be tested according to function description information of the user interface to be tested;

[0035] Judging whether there is an automated test interface matched with the user interface to be tested in the automated test tool package based on the page function operation type;

[0036] If yes, returning the automated test interface.

[0037] In addition, to achieve the above-mentioned purpose, the application further provides a user interface automated test device, which comprises:

[0038] An intention analysis module is configured to analyze the intention of a user operation manual case, and obtain user behavior data in the user operation manual case, wherein the user behavior data is data used for representing user behavior.

[0039] an interface analysis module configured to determine all operable elements in a user interface to be tested;

[0040] a page element determination module configured to determine a target page element corresponding to the user behavior based on the user behavior data and the operable elements;

[0041] an automated test module configured to generate and execute an automated test instruction based on the user behavior data and the target page element, and obtain an automated test result corresponding to the user interface to be tested.

[0042] In addition, to achieve the above object, the present application further provides a user interface automated test device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the user interface automated test method as described above.

[0043] In addition, to achieve the above object, the present application further provides a storage medium, which is a computer readable storage medium, and the storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the user interface automated test method as described above.

[0044] The present application provides a user interface automated test method, which discloses that the intention of a user operation manual case is analyzed, user behavior data in the user operation manual case is obtained, the user behavior data is data for representing user behavior, all operable elements in a user interface to be tested are determined, a target page element corresponding to the user behavior is determined based on the user behavior data and the operable elements, an automated test instruction is generated and executed based on the user behavior data and the target page element, and an automated test result corresponding to the user interface to be tested is obtained. Compared with the user interface automated test method in the prior art, which mainly analyzes the page structure and element attributes from the technical level, the user behavior and target cannot be truly understood. Since the present application can determine the page element corresponding to the user behavior based on the user behavior data in the user operation manual case and all operable elements in the user interface to be tested, and perform automated test based on the user behavior data and the page element, the technical problem that the user behavior and target cannot be understood in the user interface automated test method in the prior art, resulting in low test accuracy, is solved, and the test efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS

[0045] The accompanying drawings, which are incorporated herein and form part of the specification, illustrate embodiments consistent with the present application and, together with the description, further serve to explain the principles of the application.

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, the drawings are only for the purpose of illustrating the embodiments of the present application, and for the person of ordinary skill in the art, other drawings can also be obtained without creative labor.

[0047] Figure 1 The flowchart provided for the user interface automation testing method embodiment one of the present application;

[0048] Figure 2 The flowchart for user intention analysis in the user interface automation testing method of the present application;

[0049] Figure 3 The flowchart provided for the user interface automation testing method embodiment two of the present application;

[0050] Figure 4 The flowchart for user intention speculation in the user interface automation testing method of the present application;

[0051] Figure 5 The flowchart provided for the user interface automation testing method embodiment three of the present application;

[0052] Figure 6 The flowchart for cross-platform compatibility in the user interface automation testing method of the present application;

[0053] Figure 7 The module structure diagram of the user interface automation testing device of the present application embodiment;

[0054] Figure 8 The device structure diagram of the hardware running environment involved in the user interface automation testing method of the present application embodiment.

[0055] The purpose of the present application, the function characteristics and the advantages will be further explained in combination with the embodiments, with reference to the accompanying drawings. DETAILED DESCRIPTION

[0056] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application, and are not used to limit the present application.

[0057] In order to better understand the technical solutions of the present application, the present application will be described in detail in combination with the drawings of the specification and the specific embodiments.

[0058] The main solution of the embodiment of the present application is: to perform intent analysis on manual user operation cases, obtain user behavior data in the manual user operation cases, and the user behavior data is data used to characterize user behavior; determine all operable elements in the user interface to be tested; determine the target page elements corresponding to the user behavior based on the user behavior data and the operable elements; generate and execute automated test instructions based on the user behavior data and the target page elements, and obtain automated test results corresponding to the user interface to be tested.

[0059] Since the user interface automation testing methods in the existing technology mainly analyze the page structure and element attributes from a technical level, they are unable to truly understand the user's behavior and goals.

[0060] The present application provides a solution that can determine the page elements corresponding to user behavior based on user behavior data in manual user operation cases and all operable elements in the user interface to be tested, and perform automated testing based on the user behavior data and page elements, thereby solving the technical problem that the user interface automation testing method in the existing technology cannot understand user behavior and goals, resulting in low test accuracy, and at the same time improves testing efficiency.

[0061] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, mobile phone, etc., or an electronic device capable of implementing the above functions, user interface automation testing equipment, a user interface automation testing system including a user interface automation testing equipment, etc. The following uses the user interface automation testing system as an example (hereinafter referred to as the system) to illustrate this embodiment and the following embodiments.

[0062] Based on this, the present application embodiment provides a user interface automation testing method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the user interface automated testing method of this application.

[0063] In this embodiment, the user interface automated testing method includes steps S10 to S40:

[0064] Step S10: performing intent analysis on the manual user operation case to obtain user behavior data in the manual user operation case, where the user behavior data is data used to characterize user behavior.

[0065] It should be noted that the above user operation manual case can be a test script or test case manually written by a test personnel, which describes a series of operation steps of the user in the software system in detail. In actual application, the user operation manual case usually records the behavior and expected result of the user in natural language or semi-structured manner, such as logging into the system, filling in the form, submitting the transaction, etc., which is not limited in the embodiment. In the embodiment, the system can directly export the test case document from the test management system, or download the test case document from the document management system, or use the API interface to obtain the test case data from the test management system.

[0066] It should be noted that the above user behavior data can be information describing the operation of the user in the software system extracted from the manual case, which can include operation type (such as click, input, verification, swipe, etc.), operation object (such as button, input box, menu item, etc.), operation content (such as username, password, text information, etc.), etc., which is not limited in the embodiment.

[0067] In actual application, the system can use NLP (Natural Language Processing) tools (such as NLTK, SpaCy, etc.) to preprocess the text in the user operation manual case, convert the natural language description into structured text data, and extract the key information of the user behavior in the text data, such as operation type, target element and operation content, etc., and then use semantic analysis algorithm (such as dependency syntax analysis, named entity recognition, etc.) to analyze the semantic relationship in the text, and extract the user behavior data.

[0068] Specifically, the step S10 comprises: obtaining manual case text in the user operation manual case; analyzing the manual case text by a preset user behavior analysis model to obtain a user intention analysis result; judging whether the user intention analysis result meets a preset user intention analysis standard; and obtaining user behavior data in the user operation manual case according to the judgment result.

[0069] It should be understood that the above manual case text can be text data in the user operation manual case.

[0070] It should be noted that the above preset user behavior analysis model can be constructed based on neural network or other machine learning technology, which is used to understand the behavior of the user from the semantic level. In the embodiment, the preset user behavior analysis model can analyze the manual case text in the user operation manual case, determine the intention of the user to perform the operation in the software system (such as performing "login", "query balance", "submit form" and other operations), and convert these intentions into structured user behavior data.

[0071] In actual applications, the system can first collect manual case text from sources such as test documents, development documents, and user feedback, and clean the manual case text, including removing irrelevant characters, word segmentation, part-of-speech tagging, and removing stop words. The preprocessed manual case text is then input into the trained user behavior analysis model. At this time, the user behavior analysis model can process the input text through its internal neural network structure, extract key information and generate parsing results, and finally output structured data of user intentions to obtain user intention parsing results.

[0072] It should be noted that the above-mentioned preset user intention analysis standard may be a standard for evaluating whether the user behavior intention analyzed from the user operation manual case is complete.

[0073] In the specific implementation, refer to Figure 2 , Figure 2 This is a flow chart of user intent analysis in the user interface automation testing method of this application. Figure 2 As shown, first, the system can read the original data of user manual cases from the outside and pre-clean the data in these cases, including removing irrelevant characters, word segmentation, part-of-speech tagging, removing stop words, etc., and then input the pre-cleaned manual case data into the trained user behavior analysis model, and parse the user intention and user behavior through the user behavior analysis model to obtain the user intention parsing result. Then, the system can determine whether the user intention parsing result meets the preset user intention parsing standard, that is, whether the user behavior and user intention in the user intention parsing result are complete. If complete, the user intention parsing result can be output at this time; if incomplete, it means that the parsing failed.

[0074] Step S20: Determine all operable elements in the user interface to be tested.

[0075] It should be understood that the above-mentioned user interface to be tested can be any user interface that requires automated testing. It can be the main interface of the entire software or a specific functional module interface, such as a login page, user registration page, transaction page, account management page, product details page, etc. This embodiment does not limit this.

[0076] It can be understood that the above operable elements can be elements in the user interface to be tested that the user can interact with the interface, which are objects that the user can directly operate when using the software, for example, buttons, input boxes, links, menu items, sliders, etc. In actual application, when the user interface is tested automatically, the system needs to identify and operate the operable elements in the user interface to be tested. In the embodiment, the system can use an automated testing tool (such as Selenium, Appium, etc.) to scan the user interface to be tested to identify all the operable elements in the user interface to be tested, wherein these automated testing tools usually provide APIs to obtain all the elements and their attributes in the user interface to be tested.

[0077] Step S30: determining the target page element corresponding to the user behavior based on the user behavior data and the operable elements.

[0078] It should be noted that the above target page element can be a specific interface element that the user intends to operate when performing an operation in the user interface to be tested, for example, in a login page, if the user intends to input a username, the target page element is the username input box; if the user intends to click the login button, the target page element is the login button.

[0079] In the embodiment, the system can first extract the operation type, target element description, and operation content and other key information of the user from the user behavior data, and then match these key information with all the operable elements in the user interface to be tested to determine the target page element corresponding to the user behavior.

[0080] Step S40: generating and executing an automated testing instruction based on the user behavior data and the target page element, and obtaining an automated testing result corresponding to the user interface to be tested.

[0081] It should be noted that the above automated testing instruction can be a specific operation command generated according to the user behavior data and the target page element, which can be directly executed by an automated testing tool (such as Selenium, Appium, etc.). In actual application, the automated testing instruction can include the operation type, the identifier of the target page element (such as the ID, XPath, CSS selector, etc. of the element), the operation content, etc., which is not limited in the embodiment.

[0082] It can be understood that the above automated testing result can be a testing result obtained after executing the automated testing instruction, which can include: whether the operation is successful, verification result, error information, etc.

[0083] In this embodiment, the system can convert user behavior data and information about target page elements into instructions that can be recognized by the automated testing tool, obtain automated testing instructions, and then execute the generated automated testing instructions through the automated testing tool, and record detailed information during the execution process, and finally obtain automated testing results corresponding to the user interface to be tested.

[0084] The present embodiment provides a user interface automation testing method, which discloses performing intent analysis on manual user operation cases, obtaining user behavior data in the manual user operation cases, where the user behavior data is data used to characterize user behavior; determining all operable elements in the user interface to be tested; determining the target page elements corresponding to the user behavior based on the user behavior data and the operable elements; generating and executing automation testing instructions based on the user behavior data and the target page elements, and obtaining automation testing results corresponding to the user interface to be tested; compared with the user interface automation testing method in the prior art, which mainly analyzes the page structure and element attributes from a technical level and cannot truly understand the user's behavior and goals, the present embodiment can determine the page elements corresponding to the user behavior based on the user behavior data in the manual user operation cases and all operable elements in the user interface to be tested, and perform automation testing based on the user behavior data and the page elements, thereby solving the technical problem that the user interface automation testing method in the prior art cannot understand the user's behavior and goals, resulting in low test accuracy, and at the same time improves test efficiency.

[0085] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 3 , Figure 3 This is a flow chart of the second embodiment of the user interface automated testing method of this application.

[0086] In this embodiment, before step S30, the method further includes step S301:

[0087] Step S301: converting the format of the user behavior data to obtain target user behavior data, where the target user behavior data is user behavior data in an input format that satisfies a preset user intention inference model.

[0088] It should be noted that the above-mentioned preset user intention speculation model can be constructed based on a neural network or other machine learning techniques, and is a model for speculating the real intention of the user in a specific operation. In the present embodiment, the preset user intention speculation model can be constructed based on a neural network architecture (such as a multi-layer perception, a recurrent neural network, a Transformer architecture, etc.), which can process natural language description of user behavior data, extract key information, and understand the intention of user operation. In actual application, the system can extract key information from the user behavior data through the preset user intention speculation model, and match it with the target page element, so as to determine the operation corresponding to the user intention.

[0089] It should be noted that the input of the preset user intention speculation model usually needs to be structured or semi-structured data, which can clearly describe the behavior and intention of the user. Therefore, the present embodiment can first convert the user behavior data into structured or semi-structured target user behavior data, and then input the target user behavior data into the preset user intention speculation model for user intention speculation.

[0090] Correspondingly, the step S30 comprises:

[0091] Step S302: determining the target page element corresponding to the user behavior based on the target user behavior data and the operable element through the preset user intention speculation model.

[0092] In the present embodiment, the preset user intention speculation model can read the user interface to be tested, automatically analyze the page structure of the user interface to be tested, parse all elements that can be operated in the user interface to be tested, and filter these operable elements in combination with the input target user behavior data to speculate the target page element that best matches the user behavior.

[0093] Further, the step S302 comprises:

[0094] Step S302a: matching the target user behavior data with the operable element through the preset user intention speculation model.

[0095] Step S302b: if there is a target operable element in the operable element that matches the target user behavior data, performing structure detection on the user interface to be tested.

[0096] It should be understood that the above target operable element can be the element that is most consistent with the user's intention among all operable elements of the user interface to be tested. In actual application, after the preset user intention speculation model analyzes all elements that can be operated in the user interface to be tested, it can generate a candidate element list based on these operable elements. For example, if the user intention is "input a username", all input box elements in the user interface to be tested can be filtered out. Then, for each candidate element in the candidate element list, the user intention speculation model can calculate the matching degree of the candidate element with the user behavior data, such as by calculating the similarity between the target element description in the user behavior data and the text content, ID, class name and other attributes of the candidate element to determine the matching degree of the candidate element with the user behavior data, obtaining a matching degree score, and then selecting the element with the highest matching degree score from all candidate elements as the target operable element.

[0097] Step S302c: judging whether the page structure of the user interface to be tested changes according to the detection result.

[0098] In actual application, before the structure detection of the user interface to be tested, the system can define a standard page structure in advance. Specifically, first, a comprehensive scan can be performed on the user interface to record the positions, attributes (such as ID, class name, text content, etc.) of all operable elements in the user interface and the overall layout of the page, and manually annotate the key elements and structures in the page to obtain the standard page structure. When the structure detection of the user interface to be tested is performed, the system can use an automated testing tool to scan the user interface to be tested, obtain the structural features of the user interface to be tested, and compare them with the standard page structure to determine whether the page structure of the user interface to be tested changes.

[0099] Step S302d: if not, determining the target operable element as the target page element corresponding to the user behavior.

[0100] In this embodiment, if the page structure of the user interface to be tested does not change, the system can directly determine the target operable element as the target page element corresponding to the user behavior and output it.

[0101] Further, after the step S302c, it further includes: if yes, determining the current page structure of the user interface to be tested; obtaining the current operable element corresponding to the user interface to be tested based on the current page structure; updating the operable element according to the current operable element, and returning to the step of matching the target user behavior data with the operable element by using the preset user intention speculation model.

[0102] It can be understood that the current page structure described above can be the current page structure of the to-be-tested user interface after the structure change. Correspondingly, the current operable element described above can be the operable element in the to-be-tested user interface after the structure change. In this embodiment, if the to-be-tested user interface has a structure change during the automated testing, at this time, the model can reanalyze the page structure of the to-be-tested user interface, obtain the current page structure of the to-be-tested user interface, parse all elements that can be operated from the current page structure to obtain the current operable element, then replace the operable element in the to-be-tested user interface before the structure change through the current operable element, and return to the step of matching the target user behavior data with the operable element through the preset user intent inference model, so as to match the elements in the to-be-tested user interface after the structure change with the user behavior data again and infer the most matched interface element.

[0103] In a specific implementation, refer to Figure 4 , Figure 4 The figure is a flowchart of user intent inference in the user interface automated testing method. As shown in Figure 4 , first, the system can read the page structure of the to-be-tested user interface, pre-process the to-be-tested user interface, input the pre-processed to-be-tested user interface into the user intent inference model, so that the user intent inference model can infer the page function of the to-be-tested user interface, then match the target page element corresponding to the user behavior from all operable elements in the to-be-tested user interface in combination with the target user behavior data, if the matching is successful, perform page structure detection on the to-be-tested user interface to determine whether the page structure of the to-be-tested user interface has a change, if not, output the information and operation parameters of the component; if there is a change, reanalyze and record the structure of the to-be-tested interface.

[0104] In this embodiment, the user behavior data is converted to obtain target user behavior data, and the target user behavior data is user behavior data in an input format that meets a preset user intent inference model. The target page element corresponding to the user behavior is determined based on the target user behavior data and the operable element through the preset user intent inference model. Since this embodiment can accurately determine the target page element that is most matched with the user behavior based on the target user behavior data through the preset user intent inference model, the page element is automatically identified, which is beneficial to improving the efficiency and accuracy of the automated testing.

[0105] Based on the first embodiment and / or the second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as the above embodiments can refer to the above description, and will not be described hereinafter. On this basis, refer to Figure 5 , Figure 5A flowchart is provided for the third embodiment of the user interface automatic testing method of the present application.

[0106] In this embodiment, step S40 includes steps S401-S403:

[0107] Step S401: generating an automatic testing instruction based on the user behavior data and the target page element.

[0108] Step S402: obtaining an automatic testing interface matching the user interface to be tested.

[0109] It should be noted that the automatic testing interface can be an interface for interacting with the user interface to be tested. In actual applications, the automatic testing interface allows the automatic testing tool to communicate with the software system to be tested and perform various operations (such as clicking a button, inputting text, verifying page content, etc.). In this embodiment, the system can select a suitable automatic testing tool according to the platform of the user interface to be tested, and obtain the automatic testing interface matching the user interface to be tested through the API provided by the automatic testing tool.

[0110] Specifically, step S402 includes: loading an automatic testing tool package corresponding to the user interface to be tested; determining a page function operation type corresponding to the user interface to be tested according to the function description information of the user interface to be tested; judging whether there is an automatic testing interface matching the user interface to be tested in the automatic testing tool package based on the page function operation type; if so, returning the automatic testing interface.

[0111] It should be noted that the automatic testing tool package can be a collection of automatic testing tools and their related libraries, frameworks, and plug-ins selected and configured according to the platform and characteristics of the user interface to be tested, which can provide necessary interfaces and functions for automatic testing.

[0112] It should be understood that the function description information can be information such as test cases, user manuals, or content of the user interface to be tested described in natural language; and the page function operation type can be a kind of operation performed by a user on the user interface to be tested, for example, an input operation, a click operation, a swipe operation, etc. In this embodiment, the system can extract key information including user intent and operation target from the function description of the user interface to be tested, and map the user intent to a specific page function operation type according to the function description information, for example, mapping inputting a user name to "input operation"; mapping clicking a login button to "click operation", etc.

[0113] In actual application, the system can first extract all possible operation types in the to-be-tested user interface from the function description information of the to-be-tested user interface, and analyze the operation types supported by the selected automation test tool package, for example, Selenium supports input, click, verification, selection, submission, waiting and other operations of a web application. Then, the system can compare the function operation types of the to-be-tested user interface with the operation types supported by the selected automation test tool package, ensure that the tool package can support all necessary operation types, and verify whether the automation test tool package can interact with the to-be-tested user interface and perform the required operations. If the automation test tool package can perform the operations, it is detected whether the automation test tool package provides an interface for returning a result. If yes, the automation test interface is obtained.

[0114] Step S403: executing the automation test instruction through the automation test interface to obtain the automation test result corresponding to the to-be-tested user interface.

[0115] In specific implementation, referring to Figure 6 , Figure 6 is a flowchart of the cross-platform compatible process in the user interface automation test method of the present application. As shown in Figure 6 , the system can first load the UI automation solution SDK, the compatible automation tool and the function description of the to-be-tested interface, analyze the operation types of the page function, and identify the operations to be performed, such as clicking, inputting text, sliding and the like. Then, the system can match the API in the UI automation solution SDK. If the matching is successful, the matched API is returned, and the automation test instruction is executed through the API.

[0116] In the embodiment, the automation test instruction is generated based on user behavior data and target page elements; the automation test interface matching the to-be-tested user interface is obtained; the automation test instruction is executed through the automation test interface to obtain the automation test result corresponding to the to-be-tested user interface. Since the automation test instruction is executed through the automation test interface matching the to-be-tested user interface to perform the automation test, efficient, accurate and comprehensive automation test can be realized, which is conducive to enhancing the adaptability and reliability of the automation test.

[0117] It should be noted that the above examples are only used for understanding the present application and do not constitute a limitation on the user interface automation test method of the present application. More forms of simple transformation based on this technical concept are within the protection scope of the present application.

[0118] The present application also provides a user interface automation test device, please refer to Figure 7 , the user interface automation test device comprises:

[0119] An intention analysis module 10 is configured to analyze the user operation manual case, and obtain user behavior data in the user operation manual case, wherein the user behavior data is data used to represent user behavior.

[0120] An interface analysis module 20 is configured to determine all operable elements in the user interface to be tested.

[0121] A page element determination module 30 is configured to determine a target page element corresponding to the user behavior based on the user behavior data and the operable elements.

[0122] An automated test module 40 is configured to generate and execute an automated test instruction based on the user behavior data and the target page element, and obtain an automated test result corresponding to the user interface to be tested.

[0123] The user interface automated test device provided in the present application adopts the user interface automated test method in the above embodiments, and can solve the technical problem that the user interface automated test method in the prior art cannot understand user behavior and targets, and thus the precision of the test is not high. Compared with the prior art, the user interface automated test device provided in the present application has the same beneficial effects as the user interface automated test method provided in the above embodiments, and other technical features in the user interface automated test device are the same as the features disclosed in the above embodiments, and thus will not be described herein.

[0124] The present application provides a user interface automated test device, which comprises at least one processor and a memory in communication connection with the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the user interface automated test method in the above embodiment one.

[0125] Reference will be made to the following description Figure 8 which shows a structural schematic diagram of a user interface automated test device suitable for implementing the embodiments of the present application. The user interface automated test device in the embodiments of the present application can include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistant), PADs (Portable Application Description), PMPs (Portable Media Player), vehicle-mounted terminals (for example, vehicle-mounted navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. Figure 8The illustrated user interface automation testing device is merely an example and should not impose any limitation on the function and scope of use of the embodiments of the present application.

[0126] As shown in Figure 8 The user interface automation testing device can include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes according to programs stored in a read-only memory 1002 or loaded from a storage device 1003 into a random access memory 1004. Various programs and data required for operation of the user interface automation testing device are also stored in the random access memory 1004. The processing device 1001, the read-only memory 1002, and the random access memory 1004 are connected to each other by a bus 1005. An input / output interface 1006 is also connected to the bus. Generally, the following systems can be connected to the input / output interface 1006: input devices 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; the storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the user interface automation testing device to communicate wirelessly or by wire with other devices to exchange data. Although the user interface automation testing device is illustrated as having various systems, it should be understood that all of the illustrated systems are not required to be implemented or possessed. More or fewer systems can be alternatively implemented or possessed.

[0127] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to the embodiments disclosed herein. For example, the embodiments disclosed herein include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program code for performing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by the communication device, or installed from the storage device 1003, or installed from the read-only memory 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the methods of the embodiments disclosed herein are performed.

[0128] The user interface automation testing device provided by the present application adopts the user interface automation testing method in the above-mentioned embodiments, and can solve the technical problem of user interface automation testing. Compared with the prior art, the user interface automation testing device provided by the present application has the same beneficial effects as the user interface automation testing method provided by the above-mentioned embodiments, and other technical features in the user interface automation testing device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.

[0129] It should be understood that various parts of the present disclosure can be implemented in hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0130] The above description is merely illustrative of the application and not restrictive.

[0131] The present application provides a computer readable storage medium having stored thereon computer readable program instructions (i.e., a computer program) for performing the user interface automation testing method in the above embodiments.

[0132] The computer readable storage medium provided by the present application may, for example, be a U disk, but is not limited to an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system or device, or any combination thereof. More specific examples of the computer readable storage medium can include, but are not limited to, an electric connection with one or more conductive wires, a portable computer 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. In the present embodiment, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer readable storage medium can be transmitted by any suitable medium, including but not limited to an electric wire, an optical cable, an RF (Radio Frequency), etc., or any suitable combination thereof.

[0133] The above computer readable storage medium can be contained in the user interface automation testing device; or can exist separately and not be assembled into the user interface automation testing device.

[0134] The computer readable storage medium carries one or more programs, when the one or more programs are executed by the user interface automation testing device, the user interface automation testing device is caused to: perform intent analysis on a user operation manual case, obtain user behavior data in the user operation manual case, the user behavior data being data for representing user behavior; determine all operable elements in a user interface to be tested; determine a target page element corresponding to the user behavior based on the user behavior data and the operable elements; generate and execute an automation testing instruction based on the user behavior data and the target page element, and obtain an automation testing result corresponding to the user interface to be tested.

[0135] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0136] The computer program instructions can also be loaded onto a computer or other programmable information processing apparatus to cause a series of operations to be performed on the computer or other programmable information processing apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable information processing apparatus implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0137] The modules described in the embodiments of the present application can be implemented in the form of software or in the form of hardware. In some cases, the name of the module does not constitute a limitation on the module itself.

[0138] The computer readable storage medium provided by the present application is a computer readable storage medium, which stores computer readable program instructions (i.e. computer programs) for executing the user interface automation testing method described above, and can solve the technical problem that the user interface automation testing method in the prior art cannot understand the behavior and target of the user, resulting in low accuracy of the test. Compared with the prior art, the beneficial effects of the computer readable storage medium provided by the present application are the same as those of the user interface automation testing method provided by the above-mentioned embodiments, and will not be repeated here.

[0139] The above only describes some embodiments of the present application, and does not limit the patent scope of the present application, and any equivalent structural transformation made by using the content of the present application specification and drawings, or direct / indirect application in other related technical fields is included in the patent protection scope of the present application.

Claims

1. A user interface automated testing method, characterized in that: The method includes: Performing intent analysis on a user manual operation case to obtain user behavior data in the user manual operation case, where the user behavior data is data used to characterize user behavior; Identify all actionable elements in the user interface to be tested; Determine a target page element corresponding to the user behavior based on the user behavior data and the operable element; An automated test instruction is generated and executed based on the user behavior data and the target page element to obtain an automated test result corresponding to the user interface to be tested.

2. The method according to claim 1, wherein The step of performing intent analysis on the user manual operation case and obtaining user behavior data in the user manual operation case includes: Get the manual case text in the user's manual operation case; Analyze the manual case text using a preset user behavior analysis model to obtain a user intent analysis result; Determining whether the user intent analysis result meets the preset user intent analysis standard; The user behavior data in the user operation manual case is obtained according to the judgment result.

3. The method according to claim 2, wherein Before the step of determining the target page element corresponding to the user behavior based on the user behavior data and the operable element, the method further includes: Performing format conversion on the user behavior data to obtain target user behavior data, where the target user behavior data is user behavior data in an input format that satisfies a preset user intention inference model; The step of determining the target page element corresponding to the user behavior based on the user behavior data and the operable element includes: The target page element corresponding to the user behavior is determined based on the target user behavior data and the operable elements through the preset user intention inference model.

4. The method according to claim 3, wherein The step of determining the target page element corresponding to the user behavior based on the target user behavior data and the operable elements by using the preset user intention inference model includes: Matching the target user behavior data with the operable elements through the preset user intention inference model; If there is a target operable element matching the target user behavior data among the operable elements, performing a structural detection on the user interface to be tested; Determine whether there is a change in the page structure of the user interface to be tested according to the detection result; If not, the target operable element is determined as the target page element corresponding to the user behavior.

5. The method according to claim 4, wherein After the step of determining whether the page structure of the user interface to be tested has changed according to the detection result, the method further includes: If so, determining the current page structure of the user interface to be tested; Acquire a current operable element corresponding to the user interface to be tested based on the current page structure; The operable element is updated according to the current operable element, and the process returns to the step of matching the target user behavior data with the operable element through the preset user intention inference model.

6. The method according to any one of claims 1 to 5, characterized in that The step of generating and executing automated test instructions based on the user behavior data and the target page elements to obtain automated test results corresponding to the user interface to be tested includes: Generate automated testing instructions based on the user behavior data and the target page elements; Obtaining an automated test interface that matches the user interface to be tested; The automated test instruction is executed through the automated test interface to obtain the automated test result corresponding to the user interface to be tested.

7. The method according to claim 6, wherein The step of obtaining an automated test interface that matches the user interface to be tested includes: Loading the automated testing toolkit corresponding to the user interface to be tested; Determine the page function operation type corresponding to the user interface to be tested according to the function description information of the user interface to be tested; Determining whether there is an automated testing interface in the automated testing toolkit that matches the user interface to be tested based on the page function operation type; If it exists, the automated test interface is returned.

8. A user interface automated testing device, characterized in that: The device comprises: An intent analysis module is used to analyze the intent of a user manual operation case and obtain user behavior data from the user manual operation case, wherein the user behavior data is data used to characterize user behavior; The interface parsing module is used to determine all operable elements in the user interface to be tested; A page element determination module, configured to determine a target page element corresponding to the user behavior based on the user behavior data and the operable elements; The automated testing module is used to generate and execute automated testing instructions based on the user behavior data and the target page elements to obtain automated testing results corresponding to the user interface to be tested.

9. A user interface automated testing device, characterized in that: The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the user interface automated testing method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the user interface automation testing method according to any one of claims 1 to 7 are implemented.