Method and apparatus for processing user page, and device and medium

By processing natural language requests through machine learning models, standardized UI automation test code is generated, solving the problem of low code quality in existing technologies and achieving efficient and easy-to-maintain test code generation.

WO2026055946A1PCT designated stage Publication Date: 2026-03-19BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2026-03-19

AI Technical Summary

Technical Problem

Existing UI automation test code is of low quality, poor readability, and poor maintainability. Testers need to manually modify it, and the code is complex to write, resulting in high writing and maintenance costs.

Method used

It uses machine learning models to process natural language requests, generates standardized UI automation test code, improves code quality by building repositories and using tags, and lowers the coding threshold for testers.

Benefits of technology

It improves the readability and maintainability of the generated code, reduces the workload of testers in writing and maintaining the code, and enhances testing efficiency and application quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024118935_19032026_PF_FP_ABST
    Figure CN2024118935_19032026_PF_FP_ABST
Patent Text Reader

Abstract

Provided are a method and apparatus for processing a user page, and a device and a medium. The method comprises: receiving a processing request expressed in a natural language, wherein the processing request is used for executing a first action on a first page element among a set of page elements in a user page; acquiring a repository, wherein the repository comprises an association relationship between a set of actions to be executed on a set of interface elements and code data for executing the set of actions, and the set of actions includes the first action; and on the basis of the processing request and the repository, determining first code data for executing the first action on the first page element. In the example implementations of the present disclosure, a processing request expressed in a natural language is input, such that corresponding writing-standard-compliant code data for processing can be determined in a repository. In this way, the threshold for personnel to write test codes can be lowered, and the workload for personnel to write and maintain the test codes is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Method, device, apparatus and medium for processing user page TECHNICAL FIELD

[0001] Exemplary implementations of the present disclosure generally relate to computer technology, and in particular, to a method, device, apparatus and computer-readable storage medium for processing user page. BACKGROUND

[0002] Client user interface (UI) automation testing is an automated testing method that simulates manual operation of an application UI to achieve automatic operation and verification in code form. The page object (PO) pattern is a commonly used design pattern for UI automation testing, which functions to treat each page in an application as a page object class, treat control positioning information in the page as a variable of the object, and encapsulate UI operations of the page as a member method of the object, thereby separating the representation of the page (page object) from the test logic (test step code). However, the quality of the test code generated by the prior art solutions is not satisfactory.

[0003] SUMMARY

[0004] In a first aspect of the present disclosure, a method for processing a user page is provided. In the method, a processing request expressed in a natural language is received, the processing request being used to perform a first action on a first page element in a set of page elements in the user page; a repository is obtained, the repository including an association between a set of actions performed on a set of interface elements and code data used to perform the set of actions, the set of actions including the first action; and based on the processing request and the repository, first code data used to perform the first action on the first page element is determined.

[0005] In a second aspect of the present disclosure, an apparatus for processing a user request is provided. The apparatus includes a processing request receiving module configured to receive a processing request expressed in a natural language, the processing request being used to perform a first action on a first page element in a set of page elements in a user page; a repository obtaining module configured to obtain a repository, the repository including an association between a set of actions performed on a set of interface elements and code data used to perform the set of actions, the set of actions including the first action; and a first code data determining module configured to determine, based on the processing request and the repository, first code data used to perform the first action on the first page element.

[0006] In a third aspect of the disclosure, an electronic device is provided. The electronic device includes at least one processing unit; and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions, when executed by the at least one processing unit, cause the electronic device to perform the method according to the first aspect of the disclosure.

[0007] In a fourth aspect of the disclosure, a computer-readable storage medium is provided, having stored thereon a computer program which, when executed by a processor, causes the processor to implement the method according to the first aspect of the disclosure.

[0008] In a fifth aspect of the disclosure, a computer program product is provided, comprising a computer program, wherein the computer program, when executed by a processor, implements the method according to the first aspect of the disclosure.

[0009] It is to be understood that the details set forth herein are not intended to limit the key or critical features of the implementations of the disclosure, nor are they intended to limit the scope of the disclosure. Other features of the disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0010] The above and other features, aspects, and advantages of various implementations of the present disclosure will become more apparent from the following detailed description, taken in conjunction with the accompanying drawings, in which like reference numbers represent like elements throughout. In the drawings:

[0011] FIG. 1 shows a schematic diagram of an example environment in which implementations of the present disclosure can be implemented;

[0012] FIG. 2 shows a schematic diagram of a process for testing a user page, according to some example implementations of the present disclosure;

[0013] FIG. 3 shows a schematic diagram of a process for building a repository, according to some implementations of the present disclosure;

[0014] FIG. 4 shows a flowchart of a process for applying a set of labels to raw code data to obtain labeled code data, according to some implementations of the present disclosure;

[0015] FIG. 5 shows a schematic diagram of an example of canonical code data, according to some implementations of the present disclosure;

[0016] FIG. 6 shows a schematic diagram of a process for obtaining first code data from a repository, according to some implementations of the present disclosure;

[0017] FIG. 7 shows a flowchart of a method for testing a user page, according to some implementations of the present disclosure;

[0018] FIG. 8 shows a block diagram of an apparatus for testing a user page according to some implementations of the present disclosure; and

[0019] FIG. 9 shows a block diagram of a device capable of implementing a number of implementations of the present disclosure. DETAILED DESCRIPTION

[0020] Implementations of the present disclosure will be described below in detail with reference to the accompanying drawings. While certain implementations of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the implementations set forth herein; rather, these implementations are provided so that the present disclosure will be more thoroughly and completely understood. It should be understood that the drawings and implementations of the present disclosure are only for illustrative purposes and should not be construed as limiting the scope of protection of the present disclosure.

[0021] In the description of the implementations of the present disclosure, the term "comprising" and its conjugations should be understood to encompass the meanings of "consisting of" and "consisting essentially of". The term "based on" should be understood as "based at least in part on". The term "one implementation" or "the implementation" should be understood as "at least one implementation". The term "some implementations" should be understood as "at least some implementations". Other explicit and implicit definitions can also be included below. As used herein, the term "model" can represent the association between various data. For example, the above-mentioned association can be obtained based on various technical solutions known at present and / or to be developed in the future.

[0022] It can be understood that the data involved in the technical solutions of the present disclosure (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of relevant laws and regulations and relevant provisions.

[0023] It can be understood that before using the technical solutions disclosed in the implementations of the present disclosure, the type of personal information involved in the present disclosure, the scope of use, the scenario of use, etc. should be informed to the user and the authorization of the user should be obtained through appropriate means according to relevant laws and regulations.

[0024] For example, when responding to the active request of the user, prompt information is sent to the user to explicitly prompt the user that the operation requested to be performed will require the acquisition and use of the personal information of the user. Thus, the user can voluntarily choose whether to provide the personal information to the software or hardware such as electronic devices, application programs, servers or storage media, etc. that perform the operation of the technical solutions of the present disclosure according to the prompt information.

[0025] As an optional but non-limiting implementation, in response to receiving the active request of the user, the manner of sending the prompt information to the user can be, for example, a pop-up window manner, and the prompt information can be presented in the pop-up window in the form of text. In addition, the pop-up window can also carry a selection control for the user to select “agree” or “disagree” to provide personal information to the electronic device.

[0026] It can be understood that the above notification and user authorization obtaining process is only illustrative and does not limit the implementation of the present disclosure, and other manners meeting the relevant laws and regulations can also be applied to the implementation of the present disclosure.

[0027] The term “in response to” used herein indicates the state that the corresponding event occurs or the condition is met. It will be understood that the execution time of the subsequent action performed in response to the event or condition is not necessarily strongly associated with the time when the event occurs or the condition is met. For example, in some cases, the subsequent action can be performed immediately when the event occurs or the condition is met; in other cases, the subsequent action can be performed after a period of time after the event occurs or the condition is met.

[0028] Example environment

[0029] For the convenience of description, the UI automation test is described by taking the environment of FIG. 1 as an example. FIG. 1 shows a schematic diagram of an example environment 100 in which the implementation of the present disclosure can be implemented. In the example environment 100, a user page 110 includes a page element 120 (for example, a control for adding a photo), a page element 122 (for example, a control for adding text), a page element 124 (for example, a cancel button), and a page element 126 (for example, a publish button).

[0030] In order to test the function of the user page 110, an action needs to be performed on the corresponding page element in the user page 110. For example, in order to test the publish function of the user page 110, the page element 126 can be clicked to determine whether the publish function has defects. The conventional UI automation test tool can record the action performed on the page element in the user page 110, and the conventional UI automation test tool can generate test code based on the recorded action.

[0031] However, the generated test code has problems of low quality, poor readability, poor maintainability, etc., and usually needs to be manually modified by the tester. In addition, the test code is usually written according to the operation steps of the test case, and the tester needs to view and understand the page objects, elements and method codes involved in the case, and then call and assemble them into the required step code one by one. This requires the tester to have certain code writing and code understanding capabilities, and at the same time, it is also a time-consuming work. At this time, it is expected to test the user page in a simpler and more effective way.

[0032] Summary of testing a user page

[0033] In order to at least partially solve the deficiencies in the prior art, according to one example implementation of the present disclosure, a method for testing a user page is proposed. In the field of testing, the semantic understanding and code generation capabilities of machine learning models (such as language models) help the development of testing. The present disclosure proposes to apply machine learning models to generate UI automation test code, which on the one hand can quickly generate corresponding code according to input natural language, and on the other hand can improve the readability of the generated code.

[0034] Referring to FIG. 2, a summary according to one example implementation of the present disclosure is described, FIG. 2 shows a schematic diagram 200 for testing a user page according to some example implementations of the present disclosure. As shown in FIG. 2, a test request 210 expressed in natural language (e.g., clicking the “add photo” control) is received, and the test request 210 is used to perform a first action 230 (e.g., a click action) on a first page element 220 (e.g., the “add photo” control) in a set of page elements in a user page.

[0035] A repository 240 is obtained, the repository 240 including an association between a set of actions performed on a set of interface elements and code data for performing the set of actions, the set of actions including the first action 230. Based on the test request 210 and the repository 240, first code data 250 for performing the first action 230 on the first page element 220 is determined. The repository 240 can store the written specification code required to perform a plurality of actions, for example, the repository 240 stores code data 1 corresponding to the action of clicking the “add image” control and code data 2 corresponding to the action of clicking the “add text” control. Alternatively and / or additionally, the repository 240 can also store code data corresponding to the actions of clicking the page elements 124 and 126.

[0036] With the example implementation of the present disclosure, by inputting a test request expressed in natural language, corresponding code data for testing written specification can be determined in the repository. In this way, the threshold for a tester to code test code can be lowered, and the workload for a tester to write and maintain test code can be reduced.

[0037] Detailed process of testing user page

[0038] In some example implementations, the repository 240 can be constructed based on original code data generated by a conventional UI automation testing tool. The construction of the repository 240 will be described below with reference to FIG. 3, which shows a schematic diagram of a process 300 of constructing the repository 240 according to some implementations of the present disclosure. In the process 300, original code data 310 is first obtained, which is obtained by performing an action in a set of actions for a page element in a set of page elements.

[0039] The original code data 310 can include page element code 320 and action code 322. The actions performed for a page element can include actions such as single click, double click, input, swipe, long press, etc. In an example, the actions performed for a page element can be recorded by using a conventional UI automation testing tool, and the original code data can be generated based on the recorded actions. In the process of recording the actions, it is necessary to cover as many actions as possible performed for all page elements. For example, in a user page, there are 4 page elements, and there are 3 actions that can be performed, in the process of recording, 3 actions can be performed for each of the 4 page elements to ensure the completeness of the original code data.

[0040] After obtaining the original code data 310, a set of markers can be determined, a marker in the set of markers being used to indicate a code snippet in the original code data 310 associated with an action. By applying the set of markers to the original code data 310, annotated code data 330 can be obtained. In an example, the set of markers can be manually marked. Alternatively and / or additionally, the positions of the set of markers can be determined by searching for predetermined keywords in the code data 310, and then adding the corresponding markers.

[0041] The annotated code data 330 will be described below with reference to FIG. 4, which shows a flowchart of a process 400 of applying a set of annotations to the original code data 310 to obtain the annotated code data 330, according to some implementations of the present disclosure. As shown in the process 400, the original code data 310 can include multiple lines of code. Applying a set of annotations (e.g., the annotation 410 and the annotation 420) to the original code data 310 can obtain the annotated code data 330. The annotation 410 and the annotation 420 can be regarded as identifiers of code snippets of actions performed on page elements, for example, the code snippet between the annotation 410 and the annotation 420 corresponds to performing a click action on the “add photo” control. Taking the annotation 410 as an example, although the annotation 410 is named as ADDFLAG (“click to add photo”), it can also be set with other names, for example, SETANNOTATION (“click to add photo”), which is not limited in the present disclosure.

[0042] With reference back to FIG. 3, after obtaining the original code data 310 and the set of annotations, the code data can be generated based on the two. The original code data 310 can have problems such as being not concise, having redundant code, poor readability, and poor maintainability, and based on the set of annotations, the original code data 310 can be rewritten to eliminate the redundant code. With the example implementation of the present disclosure, based on the set of annotations, the original code data with low quality can be rewritten, so that code data for testing written in a standard manner can be generated.

[0043] In some example implementations, the first prompt 342 can be constructed, which can instruct the machine learning model 340 to process the original code data based on the set of annotations to generate the code data. The first prompt will be described below with reference to Table 1. Table 1 shows an example of the first prompt 342.

[0044] Example of prompt in Table 1

[0045] As shown in Table 1, the first prompt 342 is a piece of text described in natural language, which can be used as an input of the machine learning model 340 to guide the machine learning model to generate content.

[0046] After the first prompt 342 is constructed, the code data (which can also be referred to as standard code data) is determined based on the response of the machine learning model 340 to the first prompt 342. In an example, the input of the machine learning model 340 is the first prompt 342, the annotated code data 330, and the code related to the page elements, and the output of the machine learning model 340 is the standard page element code and the standard action code.

[0047] The specification code data will be described below with reference to FIG. 5, which shows a schematic diagram 500 of an example of the specification code data according to some implementations of the present disclosure. As shown in FIG. 5, the specification code data 510 includes a code snippet 520 and a code snippet 522. Taking the code snippet 520 as an example, the code snippet 520 starts with the tag 410, which indicates that the code snippet 520 corresponds to performing a click action on the “add photo” control, and the code snippet 520 removes the redundant code in the original code data 310, so that the original code data 310 is written in a more normative manner. In the case where it is confirmed that the specification code data 510 generated by the machine learning model 340 meets the predetermined standard, for example, passes the redundancy, readability, and maintainability tests, the specification code data 510 and its corresponding tags can be stored in the repository 240 to build the repository 240.

[0048] With the example implementations of the present disclosure, the first hint word provides explicit guidance for the machine learning model and indicates how the machine learning model generates code data that is written in a normative manner. In this way, the quality of the code data output by the machine learning model for testing can be improved, and the user page can be better tested.

[0049] In some example implementations, the first code data includes page element code for describing the user page 110 and action code for describing performing an action in a set of actions on a page element in a set of page elements. The page element code can include positioning information of the page element, UI operation method encapsulation, and the like. With the example implementations of the present disclosure, the first code data includes page element code and action code, so that the page object and the action of the test can be separated, thereby improving the reusability and maintainability of the action code.

[0050] In some example implementations, the page element code corresponding to the user page 110 can be determined, and the first code data matching the page element code and the action can be obtained from the repository 240. When the test request is received, the relevant page can be searched from the repository 240, and the page relationship can be understood according to the tag information to obtain the specification first code data matching the page element code and the action. With the example implementations of the present disclosure, the matched specification code data is obtained from the repository, which can reduce the cost of code writing by the tester.

[0051] The retrieval of the first code data from the repository 240 will be described below with reference to FIG. 6, which shows a schematic diagram of a process 600 of obtaining the first code data from the repository 240 according to some implementations of the present disclosure.

[0052] In the process 600, a second prompt 612 can be constructed, which instructs the machine learning model 610 to retrieve the code data matching the page element code and the action from the repository 240. The second prompt 612 will be described below with reference to Table 2. Table 2 shows one example of the second prompt 612.

[0053] Examples of prompt words

[0054] After the second prompt 612 is constructed, the first code data can be determined based on the response of the machine learning model 610 to the second prompt 612. The machine learning model 610 can retrieve the first code data 250 from the repository 240 based on the prompt.

[0055] With the example implementations of the present disclosure, the second prompt can enable the machine learning model to quickly identify and understand the intent of the task (i.e., retrieve the code data matching the page element code and the action), so that the matched and canonical code data can be retrieved, and the efficiency of the test can be improved.

[0056] Alternatively or additionally, in response to the mapping relationship between the page element code, the action (e.g., as a key) and the code data (e.g., as a value) being stored into the repository 240, the first code data 250 can be retrieved using the key-value pair retrieval manner.

[0057] In some example implementations, after the first code data 250 is determined, the first action can be performed for the first page element based on the first code data 250. With the example implementations of the present disclosure, by executing the generated first code data 250, the functionality and performance of the user page 110 can be tested, so as to ensure the quality of the application, reduce the maintenance cost and improve the user experience.

[0058] In some example implementations, the user page 110 includes a first user page and a second user page, the first user page includes a first page element, the second user page includes a second page element, and the first page element is used to trigger a jump from the first user page to the second user page. With the example implementations of the present disclosure, by executing the first code data 250, the page jump function can be tested, so as to ensure that the user can access between different pages smoothly in the application.

[0059] In some example implementations, in response to the first action performed on the first page element, the first user page is jumped to the second user page. After jumping to the second user page, in response to determining that the test request 210 further requests a second action performed on a second page element, the second code data for performing the second action on the second page element is determined based on the test request and the repository, and the second action is performed on the second page element based on the second code data.

[0060] For example, the first page element is an add photo control, after clicking the add photo control, a second user page is popped up, and a photo can be selected by clicking a select photo control (as an example of a second control) in the second user page (as an example of a second action). If the test request 210 further requests a click action performed on the select photo control, the second code data for performing the second action on the second page element can be determined, and the second code data is executed to test the second user page. With the example implementations of the present disclosure, the function and performance of the jumped page can be tested by executing the second code data, thereby ensuring the accessibility of the jumped page.

[0061] In some example implementations, the test request 210 is generated based on: determining a set of page elements in a user page to be tested in a set of user pages in an application; determining candidate actions to be performed on a page element to be tested in the set of page elements; and generating the test request based on the user page to be tested, the page element to be tested, and the candidate actions. After obtaining the user page to be tested, all the page elements to be tested in the user page to be tested can be traversed, the page elements with higher usage frequency can be traversed, or the page elements prone to errors can be traversed to determine which candidate actions can be performed on the page element to be tested.

[0062] For example, a determine button (as an example of a page element to be tested) is included in a user page 1 (as an example of a user page to be tested), and a click action (as an example of a candidate action) can be performed on the determine button. Based on the user page 1, the determine button, and the click action, the example test request generated can be “click the determine button in the user page 1”. With the example implementations of the present disclosure, by inputting the test request written in natural language, the test code corresponding to the test request can be output by using the semantic understanding and text generation capabilities of the machine learning model, thereby reducing the coding cost of the test code.

[0063] In some example implementations, to enable real-time interaction with the machine learning model, a model interaction webpage can be designed based on a mature code base. The annotated code data 330 can be selected on the model interaction webpage, and by clicking the send button, the annotated action code and the involved page element code can initiate a Hypertext Transfer Protocol (HTTP) request to the machine learning model, which can return the rewritten page element code and action code in real time. In an example, a model conversation input box can be designed, in which a test task represented in natural language can be input, and after clicking the send button, an HTTP request can be initiated to the large model, and the model can return the UI automation step code to complete the task in real time. With the example implementations of the present disclosure, by visualizing the webpage through interaction with the machine learning model, test code that is easy to read and maintain can be quickly generated.

[0064] Example process

[0065] FIG. 7 illustrates a flowchart of a method 700 for testing a user page, according to some implementations of the present disclosure. At block 710, a test request represented in natural language is received, the test request being for performing a first action on a first page element of a set of page elements in a user page. At block 720, a repository is obtained, the repository including associations between a set of actions performed on a set of interface elements and code data used to perform the set of actions, the set of actions including the first action. At block 730, based on the test request and the repository, first code data is determined for performing the first action on the first page element.

[0066] In some example implementations, obtaining the repository includes: obtaining original code data, the original code data being obtained by an action of a set of actions performed on a page element of the set of page elements; determining a set of tokens, a token of the set of tokens being used to indicate a code snippet of the original code data associated with the action; and based on the original code data and the set of tokens, generating the code data.

[0067] In some example implementations, the first code data includes: page element code used to describe the page elements of the user page; and action code used to describe performing an action of the set of actions on a page element of the set of page elements.

[0068] In some example implementations, generating the code data includes: constructing a first prompt, the first prompt indicating that the machine learning model processes the original code data based on the set of tokens so as to generate the code data; and based on a response of the machine learning model to the first prompt, determining the code data.

[0069] In some example implementations, determining the first code data includes: determining a page element code corresponding to the user page; and obtaining the first code data matching the page element code and the action from the repository.

[0070] In some example implementations, obtaining the first code data from the repository includes: constructing a second prompt, the second prompt indicating the machine learning model to retrieve the code data matching the page element code and the action from the repository; and determining the first code data based on a response of the machine learning model to the second prompt.

[0071] In some example implementations, the method 700 further includes: performing the first action for the first page element based on the first code data.

[0072] In some example implementations, the user page includes a first user page and a second user page, the first user page includes the first page element, the second user page includes a second page element, and the first page element is configured to trigger a jump from the first user page to the second user page.

[0073] In some example implementations, the method 700 further includes: in response to the first action performed for the first page element, jumping from the first user page to the second user page; in response to determining that the test request further requests to perform a second action for a second page element, determining second code data for performing the second action for the second page element based on the test request and the repository; and performing the second action for the second page element based on the second code data.

[0074] In some example implementations, the test request is generated based on: determining a set of page elements in a user page to be tested, for a set of user pages in the application; determining a candidate action to be performed for a page element to be tested in the set of page elements; and generating the test request based on the user page to be tested, the page element to be tested, and the candidate action.

[0075] Example apparatus and devices

[0076] FIG. 8 illustrates a block diagram of an apparatus 800 for processing a user request, according to some implementations of the present disclosure. The apparatus 800 includes a test request receiving module 810 configured to receive a test request expressed in a natural language, the test request being for performing a first action for a first page element of a set of page elements in a user page; a repository obtaining module 820 configured to obtain a repository, the repository including an association between a set of actions performed for a set of interface elements and code data for performing the set of actions, the set of actions including the first action; and a first code data determining module 830 configured to determine, based on the test request and the repository, first code data for performing the first action for the first page element.

[0077] In some example implementations, the repository obtaining module 820 is further configured to obtain original code data, the original code data being obtained by performing an action of a set of actions for a page element of the set of page elements; determine a set of tokens, a token of the set of tokens being for indicating a code snippet of the original code data associated with the action; and generate, based on the original code data and the set of tokens, the code data.

[0078] In some example implementations, the first code data includes: page element code for describing the user page; and action code for describing performing an action of a set of actions for a page element of the set of page elements.

[0079] In some example implementations, the repository obtaining module 820 is further configured to construct a first prompt, the first prompt indicating the machine learning model to process the original code data based on the set of tokens so as to generate the code data; and determine the code data based on a response of the machine learning model to the first prompt.

[0080] In some example implementations, the first code data determining module 830 is further configured to determine page element code corresponding to the user page; and obtain, from the repository, the first code data matching the page element code and the action.

[0081] In some example implementations, the first code data determining module 830 is further configured to construct a second prompt, the second prompt indicating the machine learning model to retrieve, from the repository, the code data matching the page element code and the action; and determine the first code data based on a response of the machine learning model to the second prompt.

[0082] In some example implementations, the apparatus 800 further includes a first action performing module configured to perform, based on the first code data, the first action for the first page element.

[0083] In some example implementations, the user pages include a first user page and a second user page, the first user page includes the first page element, the second user page includes the second page element, and the first page element is configured to trigger a jump from the first user page to the second user page.

[0084] In some example implementations, the apparatus 800 further includes a second action performing module configured to, in response to the first action performed for the first page element, jump from the first user page to the second user page; in response to determining that the test request further requests performing a second action for a second page element of the user pages, determine, based on the test request and the repository, second code data for performing the second action for the second page element; and perform, based on the second code data, the second action for the second page element.

[0085] In some example implementations, the test request is generated based on: determining, for a user page to be tested in a set of user pages in the application, a set of page elements in the user page; determining a candidate action to be performed for a page element to be tested in the set of page elements; and generating, based on the user page to be tested, the page element to be tested, and the candidate action, the test request.

[0086] FIG. 9 illustrates a block diagram of a device 900 that is capable of implementing the various implementations of the present disclosure. It should be understood that the computing device 900 illustrated in FIG. 9 is merely an example and should not be construed to limit the functionality and scope of the implementations described herein. The computing device 900 illustrated in FIG. 9 can be used to implement the methods described above.

[0087] As shown in FIG. 9, the computing device 900 is in the form of a general- purpose computing device. The components of the computing device 900 can include, but are not limited to, one or more processors or processing units 910, a memory 920, a storage device 930, one or more communication units 940, one or more input devices 950, and one or more output devices 960. The processing unit 910 can be a real or virtual processor and is capable of executing various processing in accordance with programs stored in the memory 920. In a multi-processor system, multiple processing units execute computer-executable instructions in parallel to improve the parallel processing capability of the computing device 900.

[0088] The computing device 900 typically includes a plurality of computer storage media. Such media can be removable computer storage media 930 and / or non-removable computer storage media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Storage media 930 can also be implemented as a single storage medium or as multiple storage media in storage virtualization

[0089] The computing device 900 can further include additional removable / non-removable, volatile / nonvolatile storage media. Although not shown, a floppy disk drive for reading from or writing to a removable, non-removable, and / or nonvolatile magnetic disk (e.g., a "hard drive"), and an optical disk drive for reading from or writing to a removable, non-removable, and / or nonvolatile optical disk (e.g., a CD-ROM, DVD, etc.) can be provided. In such instances, each can be connected to the bus by one or more data media interfaces. The memory 920 can include a computer program product 925 having one or more program modules configured to carry out the various methods or actions of the various implementations of the present disclosure.

[0090] The communication unit 940 enables communications with other computing devices over a communication media. Additionally, the functionality of the components of the computing device 900 can be implemented in a single computing cluster or a plurality of computer machines that are capable of communicating over a communication connection. Thus, the computing device 900 can operate in a networked environment using logical connections to one or more other servers, network personal computers (PCs), or another network nodes in the networking environment.

[0091] The input device(s) 950 can be one or more input device(s) such as a mouse, keyboard, trackball, etc. The output device(s) 960 can be one or more output device(s) such as a display, speakers, printer, etc. The computing device 900 can also contain communication connection(s) 940 that allow the device to communicate with one or more external devices not shown, such as a storage device, a display device, etc. Other external devices (not shown) can also be employed that were not mentioned above, such as a modem, a printer, a scanner, etc. The communication connection(s) 940 enable communication over a communication medium that carries data such as computer readable instructions, data structures, program modules or other data with other devices, such as from a storage device, a display device, etc. The communication medium conveys information such as computer readable instructions, data structures, program modules, or other data in a modulated data signal, including, but not limited to, carrier waves, wireless signals, and digital signals.

[0092] According to example implementations of the present disclosure, a computer-readable storage medium is provided having computer-executable instructions stored thereon, where the computer-executable instructions are executed by a processor to implement the method described above. According to example implementations of the present disclosure, a computer program product is also provided that is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, where the computer-executable instructions are executed by a processor to implement the method described above. According to example implementations of the present disclosure, a computer program product is provided having a computer program stored thereon, which when executed by a processor implements the method described above.

[0093] Various aspects of the disclosure are now described with reference to the drawings. In general, the drawings described below are diagrammatic and schematic representations of actual or conceptual structures and processes, and are not limiting of the scope of the present disclosure. In the drawings, the same reference numerals are used to represent similar or like items.

[0094] These computer readable program instructions can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer readable program instructions can also be stored in a computer readable storage medium that can include non- transitory computer-readable storage media that can direct a computer, a programmable data processing apparatus, and / or other devices to function in a particular manner, such that the computer readable storage medium having instructions stored therein comprises an article of manufacture including instructions which implement aspects of the function / act specified in the flowchart and / or block diagram block or blocks.

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

[0096] The computer program product of the present disclosure can have a signal including said computer program. This signal can be electronic, electromagnetic, optical, or any other suitable type of signal. Such a signal can be provided through a communication connection, such as electrical wiring, optical fiber, wireless interface, etc. Examples of computer program products include computer program implemented on a personal computer, server, or other networked device. A non-transitory computer readable medium, such as a floppy disk, CD-ROM, DVD-ROM, Blu-ray Disc, hard disk drive, or any other suitable non-transitory computer readable medium can store the computer program product.

[0097] Having described several implementations of the present disclosure, it is to be appreciated various alterations, modifications, and improvements will readily occur to those skilled in the art. Such alterations, modifications, and improvements are intended to be part of this disclosure. Accordingly, the foregoing description is by way of example only and is not intended to be limiting. The implementation described herein is implementations of the present disclosure. Other implementations of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the present disclosure. Therefore, this disclosure is intended to cover all such modifications and variations as fall within the scope of the implementations. It is intended that the specification and depicted embodiments are to be considered exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims

1.A method for processing a user page, comprising: receiving a processing request expressed in a natural language, the processing request being for performing a first action on a first page element of a set of page elements in the user page; obtaining a repository, the repository comprising an association between a set of actions performed on a set of interface elements and code data for performing the set of actions, the set of actions including the first action; and determining, based on the processing request and the repository, first code data for performing the first action on the first page element. 2.The method of claim 1, wherein obtaining the repository comprises: obtaining original code data, the original code data being obtained by an action of the set of actions performed on a page element of the set of page elements; determining a set of markers, a marker of the set of markers being for indicating a code snippet of the original code data associated with the action; and generating, based on the original code data and the set of markers, the code data. 3.The method of claim 2, wherein the first code data comprises: page element code for describing the user page; and action code for describing the action of the set of actions performed on a page element of the set of page elements. 4.The method of claim 2, wherein generating the code data comprises: constructing a first prompt, the first prompt instructing a machine learning model to process the original code data based on the set of markers so as to generate the code data; and determining the code data based on a response of the machine learning model to the first prompt. 5.The method of claim 3, wherein determining the first code data comprises: determining page element code corresponding to the user page; and obtaining, from the repository, the first code data matching the page element code and the action. 6.The method of claim 5, wherein obtaining the first code data from the repository comprises: constructing a second prompt, the second prompt instructing a machine learning model to retrieve, from the repository, code data matching the page element code and the action; and determining the first code data based on a response of the machine learning model to the second prompt. performing the first action on the first page element based on the first code data. 8.The method of claim 7, wherein the user page comprises a first user page and a second user page, the first user page including the first page element, the second user page including a second page element, and the first page element being for triggering a jump from the first user page to the second user page. 9.The method of claim 8, further comprising: jumping from the first user page to the second user page in response to the first action performed on the first page element. ​ 7. The method of claim 1, further comprising: ​ ​ ​ ​ in response to determining that the processing request further requests to perform a second action on the second page element, determining, based on the processing request and the repository, second code data for performing the second action on the second page element; and performing, based on the second code data, the second action on the second page element. 10.The method of claim 1, wherein the processing request is generated based on: determining, for a to-be-processed user page in a set of user pages in an application, a set of page elements in the user page; determining a candidate action to be performed on a to-be-processed page element in the set of page elements; and generating, based on the to-be-processed user page, the to-be-processed page element, and the candidate action, the processing request. 11.An apparatus for processing a user page, comprising: a processing request receiving module configured to receive a processing request expressed in a natural language, the processing request being for performing a first action on a first page element in a set of page elements in the user page; a repository obtaining module configured to obtain a repository, the repository comprising an association between a set of actions performed on the set of interface elements and code data for performing the set of actions, the set of actions including the first action; and a first code data determining module configured to determine, based on the processing request and the repository, first code data for performing the first action on the first page element. 12.An electronic device, comprising: a set of processing units; and a set of memories coupled to the set of processing units and storing instructions for execution by the set of processing units, the instructions, when executed by the set of processing units, cause the electronic device to perform the method of any one of claims 1-10. 13.A computer-readable storage medium having stored thereon a computer program, the computer program, when executed by a processor, causing the processor to implement the method of any one of claims 1-10. 14.A computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the method of any one of claims 1-10.

Citation Information

Patent Citations

  • An automated test method for the page of the open platform of the blogger cloud based on word segmentation retrieval

    CN109062813A

  • An intelligent agricultural internet of things monitoring system based on automatic test of internet of things page

    CN109508297A

  • Software testing method and device, electronic equipment and computer readable storage medium

    CN117435464A

  • Test case generation method and device, equipment, medium and product

    CN118012755A

  • Methods and systems for browser extension used to generate relative xpath, absolute xpath and / or CSS selectors

    US20200293592A1