Page test method of application program, computing device, storage medium and program product

By using big models to generate operation instructions in automated testing, the problem of non-technical background test users is solved, and the effect of performing application page testing without programming capabilities is achieved.

CN120066968APending Publication Date: 2025-05-30BEIJING 58 INFORMATION TTECH CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202510229758.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In the prior art, automated testing requires testing users to have programming capabilities, especially for testing users with non-technical backgrounds, it is difficult to write test scripts.

Method used

By sending test prompt information to the client, receiving and processing test tasks, obtaining the page configuration information of the application to be tested and the page operation information described by the user, and inputting it into a large model to generate semantic matching operation instructions, simulate executing operation instructions to jump to the page, and determining the similarity of the page configuration information to judge the test results.

Benefits of technology

Without writing complex script code, test users only need to describe the operation path through natural language to achieve testing of the application to be tested, reducing the technical requirements for test users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066968A_ABST
    Figure CN120066968A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a page testing method of an application program, computing equipment, a computer readable storage medium and a computer program product. The page testing method for the application program comprises the steps of obtaining first page configuration information of a first page of the application program to be tested; obtaining page operation information configured by a user; inputting the first page configuration information and the page operation information into a large model to generate an operation instruction matched with the semantics of the page operation information by utilizing the large model based on the first page configuration information; the operation instruction is executed on the first page in a simulation mode, and the first page jumps to a second page; obtaining second page configuration information of a second page and standard page configuration information of the second page; determining the similarity between the second page configuration information and the standard page configuration information; and determining a test result of the application program based on the similarity. According to the technical scheme provided by the embodiment of the invention, the technical requirements on the test user are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of computer technology, and in particular, to a page testing method for an application program, a computing device, a computer-readable storage medium, and a computer program product. Background Art

[0002] With the rapid development of the mobile Internet, application programs have become an indispensable part of people's daily lives. To ensure the functional stability and user experience of application programs, automated testing technology plays a crucial role in the software development process. Automated testing can significantly improve testing efficiency, reduce the workload of manual testing, and quickly verify the correctness of applications in multiple devices and scenarios.

[0003] In related technologies, automated testing technology usually requires testers to write test scripts in programming languages to use the test scripts to guide automated testing tools to simulate user operations and verify the functions of application programs.

[0004] The inventors found in the process of implementing the concept of the present application that test scripts usually need to be written in programming languages (such as Python, Java, JavaScript, etc.), which requires testers to have certain programming skills. For testers without a technical background, it is difficult to implement automated testing of application programs. Summary of the Invention

[0005] Embodiments of the present application provide a page testing method for an application program, a computing device, a computer-readable storage medium, and a computer program product.

[0006] In a first aspect, a page testing method for an application program provided in an embodiment of the present application includes:

[0007] Sending a test prompt message to the client;

[0008] Receiving a test task sent by the client based on the test prompt message;

[0009] In response to the test task, determining the application program to be tested corresponding to the test task;

[0010] Obtaining first page configuration information of the first page of the application program to be tested;

[0011] Obtaining page operation information configured by the user, where the page operation information is used to describe an operation path for jumping from the first page to the second page;

[0012] Inputting the first page configuration information and the page operation information into a large model to use the large model to generate an operation instruction that matches the semantics of the page operation information based on the first page configuration information;

[0013] Simulate the execution of the operation instruction on the first page, and jump the first page to the second page;

[0014] Obtain the second page configuration information of the second page and the standard page configuration information of the second page;

[0015] Determine the similarity between the second page configuration information and the standard page configuration information;

[0016] Based on the similarity, determine the test result of the application.

[0017] In a second aspect, an application page testing device provided in an embodiment of the present application includes:

[0018] An information sending module, configured to send test prompt information to a client;

[0019] A task receiving module, configured to receive a test task sent by the client based on the test prompt information;

[0020] An application determining module, configured to determine a to-be-tested application corresponding to the test task in response to the test task;

[0021] A first configuration information obtaining module, configured to obtain the first page configuration information of the first page of the to-be-tested application;

[0022] An operation information obtaining module, configured to obtain page operation information configured by a user, where the page operation information is used to describe an operation path for jumping from a first page to a second page;

[0023] An input module, configured to input the first page configuration information and the page operation information into a large model, so as to use the large model to generate an operation instruction that matches the semantics of the page operation information based on the first page configuration information;

[0024] An execution module, configured to simulate the execution of the operation instruction on the first page, and jump the first page to the second page;

[0025] A second configuration information obtaining module, configured to obtain the second page configuration information of the second page and the standard page configuration information of the second page;

[0026] A similarity determining module, configured to determine the similarity between the second page configuration information and the standard page configuration information;

[0027] A result generating module, configured to determine the test result of the application based on the similarity.

[0028] In a third aspect, an embodiment of the present application provides a computing device, including a processing component and a storage component;

[0029] The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement the page testing method provided by the embodiment of the present application

[0030] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by the processing component, the page testing method provided by the embodiment of the present application is implemented.

[0031] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program / instructions. When the computer program / instructions are executed by the processing component, the page testing method of the application program provided by the embodiment of the present application is implemented.

[0032] In the embodiment of the present application, after obtaining the first page configuration information of the application program to be tested, the first page configuration information and the obtained page operation information described in natural language are input into the large model, and the large model can output an operation instruction for the first page, so that the operation instruction can be directly executed to jump the first page to the second page to determine the similarity between the second page configuration information and the standard page configuration information; based on the similarity, the test result of the application program is determined. The test user does not need to write complex script codes and can realize the test of the application program to be tested only by describing it in natural language, which reduces the technical requirements for the test user.

[0033] These aspects or other aspects of the present application will be more clearly understood in the following description of the embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0035] Figure 1 Shows a system architecture diagram to which a technical solution of an embodiment of the present application can be applied;

[0036] Figure 2 Shows a flowchart of a page testing method for an application program provided by an embodiment of the present application;

[0037] Figure 3 Shows a schematic diagram of the first page provided by an embodiment of the present application;

[0038] Figure 4 Schematic diagram showing the second page with successful loading;

[0039] Figure 5 Schematic diagram showing the second page in case of failed loading;

[0040] Figure 6 Block diagram showing a page testing device for an application provided by an embodiment of the present application;

[0041] Figure 7 Block diagram showing a computing device provided by an embodiment of the present application. Detailed implementation manners

[0042] In order to enable those skilled in the art of the present technology to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application.

[0043] In some processes described in the specification and claims of the present application and the above-mentioned drawings, there are a plurality of operations that appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order in which they appear in this document or may be executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions such as "first" and "second" in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequence, nor do they limit that "first" and "second" are of different types.

[0044] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or fully authorized by all parties. And the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or refuse.

[0045] It should be noted that the technical solution of the embodiment of the present application is applicable to a network virtual environment. The users described generally refer to "virtual users". Real users can register user accounts on the server through the registration method to obtain user identities in the network environment. In the embodiment of the present application, the same user account can be used to log in to the server through different types of clients, so that the server can identify the same user. Of course, different user accounts can also be used to log in to the server through different types of clients. The server stores the binding relationships of different user accounts, so that different user accounts with binding relationships can be considered as the same user.

[0046] With the rapid development of the mobile Internet, applications have become an indispensable part of people's daily lives. To ensure the functional stability and user experience of applications, automated testing technology plays a crucial role in the software development process. Automated testing can significantly improve testing efficiency, reduce the workload of manual testing, and quickly verify the correctness of applications in multiple devices and scenarios.

[0047] In the related art, automated testing technology usually requires testers to write test scripts in programming languages to use the test scripts to guide automated testing tools to simulate user operations and verify the functions of applications.

[0048] The inventors found in the process of implementing the concept of the present application that test scripts usually need to be written in programming languages (such as Python, Java, JavaScript, etc.), which requires testers to have certain programming capabilities. For testers without a technical background, the cost of learning and mastering programming languages is relatively high.

[0049] To solve the technical problems existing in the related art, an embodiment of the present application provides a method for testing a page of an application program, including: sending a test prompt message to a client; receiving a test task sent by the client based on the test prompt message; in response to the test task, determining the application program to be tested corresponding to the test task; obtaining the first page configuration information of the first page of the application program to be tested; obtaining the page operation information configured by the user, where the page operation information is used to describe the operation path from the first page to the second page; inputting the first page configuration information and the page operation information into a large model, so as to use the large model to generate an operation instruction that matches the semantics of the page operation information based on the first page configuration information; simulating the execution of the operation instruction on the first page to jump the first page to the second page; obtaining the second page configuration information of the second page and the standard page configuration information of the second page; determining the similarity between the second page configuration information and the standard page configuration information; and determining the test result of the application program based on the similarity. Thus, after obtaining the first page configuration information of the application program to be tested, the first page configuration information and the obtained page operation information described in natural language are input into the large model, and the large model can output an operation instruction for the first page, so that the operation instruction can be directly executed to jump the first page to the second page to determine the similarity between the second page configuration information and the standard page configuration information; based on the similarity, the test result of the application program is determined. The test user does not need to write complex script codes and can realize the test of the application program to be tested only by describing it in natural language, which reduces the technical requirements for the test user.

[0050] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.

[0051] Figure 1 FIG. shows a system architecture diagram to which a technical solution of an embodiment of the present application can be applied. The system architecture may include a user terminal 101 and a server 102.

[0052] Among them, a connection is established between the user terminal 101 and the server 102 through a network. The network provides a medium for the communication link between the user terminal 101 and the server 102. The network may include various connection types, such as wired, wireless communication links or fiber optic cables, etc. Optionally, the server can communicate with the user terminal through a mobile network. Optionally, the user terminal can also establish a communication connection with the server through Bluetooth, WiFi, infrared, etc.

[0053] The client 101 can interact with the server 102 via the network to receive or send messages, etc.

[0054] Among them, the client 101 can be a browser, an APP (Application), or a web application such as an H5 (HyperText Markup Language 5) application, or a light application (also known as a mini-program, a lightweight application) or a cloud application, etc. The client 101 can be deployed in an electronic device and needs to rely on the device or certain apps in the device to run, etc. The electronic device can, for example, have a display screen and support information browsing, etc., such as a personal mobile terminal such as a mobile phone, a tablet computer, a personal computer, a desktop computer, a smart speaker, a smart watch, etc. For the sake of easy understanding, Figure 1 the client is mainly represented by the image of the device in this application. Various other types of applications can usually be configured in the electronic device, such as human-computer dialogue applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc. The electronic device can refer to a device used by the user and having functions such as computing, Internet access, and communication required by the user, such as a mobile phone, a tablet computer, a personal computer, a wearable device, etc. The electronic device usually can include at least one processing component and at least one storage component. The electronic device may also include basic configurations such as a network card chip, an IO bus, and audio-video components, which are not limited in this application. Optionally, according to the implementation form of the electronic device, some peripheral devices may also be included, such as a keyboard, a mouse, a stylus, a printer, etc., which are not limited in this application.

[0055] The server 102 can include servers that provide various services, such as a server for background training that provides support for the models used on the client 101, or a server that processes the interaction information sent by the client, etc.

[0056] It should be noted that the server 102 can be implemented as a distributed server cluster composed of multiple servers, or can be implemented as a single server. The server can also be a server of a distributed system, or a server combined with a blockchain. The server can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms, or an intelligent cloud computing server or an intelligent cloud host with artificial intelligence technology.

[0057] It should be noted that the page testing method of the application provided in the embodiments of the present application is generally executed by the server 102, and the corresponding page testing device of the application is generally set in the server 102.

[0058] It should be understood that Figure 1 the number of the client and the server in

[0059] is only illustrative. According to the implementation requirements, there can be any number of clients and servers.

[0060] Figure 2 The flowchart of a page testing method of an application provided in the embodiments of the present application is shown. This method can be executed by the server, as Figure 2 shown, this method may specifically include the following steps:

[0061] 201: Send a test prompt message to the client.

[0062] 202: Receive the test task sent by the client based on the test prompt message.

[0063] 203: In response to the test task, determine the application under test corresponding to the test task.

[0064] Before the start of the automated test, the server can send a test prompt message to the client, and the test prompt message can be used to guide the tester to provide test task information based on the client. In the embodiments of the present application, the test task information may include, for example, page operation information input in natural language form, the application name of the application under test, or application identification information, etc.

[0065] After receiving the test prompt message, the client can input test task information according to specific test requirements, and send the test task containing the test task information back to the server.

[0066] Since different test tasks may involve different applications, after receiving the test task sent back by the client, the server can first determine the application under test according to the test task information contained in the test task to clarify the target scope of the test. In one implementation, the server can determine the application under test specified by the client through the application name or application identification information contained in the test task information. In another possible implementation, the client can be pre-bound to the application with the server, so that, in the case where the application under test is not clearly specified in the test task, the server can use the pre-bound application under test as the default application under test.

[0067] After determining the application under test, the server can start the application under test through an automated testing tool.

[0068] 204: Obtain the first page configuration information of the first page of the application under test.

[0069] In some embodiments, the first page is the starting point of the automated test, which can be any page of the application under test. For example, the first page can be implemented as the initial page loaded and displayed after starting the application under test, or the page jumped to after performing limited operations on the initial page.

[0070] Among them, the first page configuration information can be implemented as the detailed description information of the page configuration items on the first page. The page configuration items can include, for example, controls, text content, hierarchical structure, status information, location information, etc. on the first page. Specifically, the hierarchical structure can include, for example, the nesting relationship between controls; the status information can include, for example, the current status of the page configuration item, such as whether it is visible, clickable, selectable, etc.; the location information can be the location of the page configuration item on the screen.

[0071] 205: Obtain the page operation information configured by the user, where the page operation information is used to describe the operation path from the first page to the second page.

[0072] Among them, the page operation information can include the specific operation steps provided by the tester for guiding how to jump the application under test from the first page to the second page. The page operation information can be described in the form of natural language so that the server can determine which operations need to be performed according to the page operation information.

[0073] Among them, the page operation information can include the operation type, operation object, and operation parameters. The operation type can include, for example, click, slide, input text, long press, etc.; the operation object can include the page identifier of any page configuration item on the first page; the operation parameters can include the parameters corresponding to the specific operation type. For example, for the slide operation, the operation parameters can include the slide direction and slide area, and for the operation of inputting text, the operation parameters can include the input text content.

[0074] In actual application scenarios, for some complex applications, the jump paths between pages may be diverse. By obtaining page operation information, it is possible to provide clear operation guidelines for the server side, ensuring that the testing process can proceed as expected. For example, if a test user wishes to jump from the login page (the first page) to the settings page (the second page), the page operation information can tell the server side that they need to first click the "Login" button and then click the "Settings" button. Moreover, different versions of the application may adjust the page layout or control positions, but the page operation information can help the server side dynamically adapt to these changes. For example, even if the position of the "My" control has changed, the server side can still find the correct control based on the description in the page operation information (such as the control ID or text content) and perform the operation. As a result, when testing different applications and different versions of applications, test users do not need to write complex script codes and can describe the operation path simply through natural language, reducing the technical requirements for test users.

[0075] 206: Input the first page configuration information and the page operation information into the large model to use the large model to generate operation instructions that match the semantics of the page operation information based on the first page configuration information.

[0076] Among them, the large model refers to a machine learning model with a large number of parameters and a complex structure, capable of processing massive amounts of data and completing various complex tasks, such as natural language processing, computer vision, speech recognition, etc. It is an AI (Artificial Intelligence) model. Among them, the large model can be implemented, for example, using a large language model (LLM) or a multimodal large model (MLM), etc. For example, it can use GPT-3 (Generative Pre-Trained Transformer-3, the third-generation generative pre-trained model), GPT-4 (Generative Pre-Trained Transformer-4, the fourth-generation generative pre-trained model), BERT (Bidirectional Encoder Representation from Transformers, a bidirectional encoder model based on Transformers), Turing NLG (Turing Natural language Generation), and so on. This application does not limit this. Such large models can perform excellently in various natural language processing tasks, such as text generation, text translation, question-and-answer systems, etc. Of course, in addition to large language models, there are many other types of large models.

[0077] After inputting the first page configuration information and page operation information into the large model, the large model can first analyze the page operation information, extract the operation type, operation object, and corresponding operation information. Then, the large model can combine the first page configuration information to find the actual control that matches the operation. For example, the page operation information can be "click on Settings in the first page". Thus, through semantic understanding of the page operation information, the large model can identify that it is desired to click on a control with the text "Settings". Then, the large model can match the page operation information with the first page configuration information. For example, if a control with the text content "Settings" and the position coordinates of [200, 200, 200, 50] is matched in the first page configuration information, the large model can identify it as the target control.

[0078] Then, the large model can generate specific operation instructions. In the above example, the operation instructions can be, for example: "Operation type: click; Operation position: [200, 200, 200, 50]".

[0079] 207: Simulate the execution of the operation instruction on the first page and jump the first page to the second page.

[0080] In the embodiments of the present application, the server can use an automated testing tool to interact with the application under test to convert the operation instruction into a specific operation on the application under test, thereby realizing the simulation execution of the operation instruction.

[0081] Among them, the second page can refer to a new page displayed after jumping from the first page through operations (such as clicking a button, swiping the screen, etc.). The second page can be the target page in the automated testing process, and the server needs to verify its content and status.

[0082] 208: Obtain the second page configuration information of the second page and the standard page configuration information of the second page.

[0083] The second page configuration information can refer to the detailed description information of all page configuration items on the second page after jumping from the first page to the second page during the testing process.

[0084] The standard page configuration information can refer to the ideal state information of the second page saved in advance, representing the "correct state" of the second page. The standard page configuration information can be used as a reference benchmark. By comparing the actually obtained second page configuration information with the standard page configuration information, it can be verified whether the second page is loaded correctly and whether there are any abnormalities.

[0085] 209: Determine the similarity between the second page configuration information and the standard page configuration information.

[0086] 2010: Determine the test result of the application based on the similarity.

[0087] Among them, the similarity can be used to represent the matching degree between the actually obtained second page configuration information and the pre-obtained standard page configuration information, and is used to measure whether the second page obtained by jumping from the first page meets the expected state. For example, if the similarity is high, it indicates that the second page is basically the same as the expected page, and the test can confirm that the test passes; if the similarity is low (for example, lower than the preset threshold), it indicates that there are significant differences between the second page and the expected page, and the test fails.

[0088] In the embodiment of the present application, after obtaining the first page configuration information of the application to be tested, the first page configuration information and the obtained page operation information described in natural language are input into the large model, and the large model can output the operation instruction for the first page, so that the operation instruction can be directly executed to jump the first page to the second page to determine the similarity between the second page configuration information and the standard page configuration information; based on the similarity, determine the test result of the application. The test user does not need to write complex script codes, and only needs to describe in natural language to implement the test of the application to be tested, reducing the technical requirements for the test user.

[0089] In some embodiments, when the test result indicates that the similarity between the second page configuration information and the standard page configuration information is less than the preset threshold, the method may further include: re-obtaining the third page configuration information of the second page at a preset polling interval; determining the similarity between the re-obtained third page configuration information and the standard page configuration information; when the similarity is greater than or equal to the preset threshold, terminate the polling, and determine the test result based on the re-obtained similarity; otherwise, return to the step of re-obtaining the page configuration information of the second page and continue to execute.

[0090] When the test result indicates that the similarity between the second page configuration information and the standard page configuration information is less than the preset threshold, the embodiment of the present application proposes a polling mechanism to cope with temporary problems caused by network latency, incomplete page loading, etc. When the similarity between the second page configuration information initially obtained by the server and the standard page configuration information is lower than the preset threshold, the server can use the polling mechanism to try to re-obtain the page configuration information multiple times to determine whether the page finally meets the expectations.

[0091] In the above polling mechanism, a preset polling interval and a preset polling count are configured. Among them, the preset polling interval represents the time interval between each polling, and the preset polling count represents the maximum allowable number of pollings. The preset polling count can be used to control the duration of polling and avoid resource waste or reduced test efficiency caused by infinite loops. The preset polling interval and the preset polling count can be flexibly set according to actual application requirements.

[0092] A possible implementation of the above polling mechanism can be: after determining that the similarity is less than the preset threshold, the server waits for the preset polling interval to leave time for the second page to load or update. After the waiting ends, the server can re-obtain the third page configuration information of the second page. In each polling, the server will recalculate the similarity between the re-obtained page configuration information and the standard page configuration information. If the re-obtained similarity is higher than or equal to the preset threshold, it indicates that the page has reached the expected state and the test is successful. If the similarity is still lower than the preset threshold, it means that the page has not been fully loaded or there are other problems. At this time, it can be judged whether the polling termination condition is met. If the polling termination condition is met, the polling can be ended and a test failure prompt message can be output. If the polling termination condition is not met, the polling can continue until the polling termination condition is met.

[0093] Among them, the polling termination condition can include: the similarity between the re-obtained page configuration information and the standard page configuration information is greater than or equal to the preset threshold, and the polling count reaches the preset polling count.

[0094] In some embodiments, the method may further include: when the polling count is greater than the preset count, rolling back the application under test to the first page and returning to the step of simulating the execution of the operation instruction on the first page to continue execution.

[0095] In some cases, the second page may not reach the expected state due to permanent problems (such as missing controls, abnormal functions). If polled infinitely, not only will resources be wasted, but the test process may also get stuck.

[0096] By rolling back when the polling count is greater than the preset count, the state of the application under test can be restored to the first page to restart the test process. Also, during the process of restarting the test process, data such as operation steps, interface states, and data changes during polling can be recorded for subsequent analysis and troubleshooting of the test failure reasons by the test user.

[0097] In some embodiments, determining the similarity between the second page configuration information and the standard page configuration information can be specifically implemented as:

[0098] Determine multiple configuration matching dimensions, where each configuration matching dimension is configured with a corresponding similarity coefficient;

[0099] For any standard configuration item included in the standard page configuration information, determine a second configuration item that matches the standard configuration item from the second page configuration information according to the target configuration matching dimension among multiple configuration matching dimensions;

[0100] Record the similarity coefficient corresponding to the target configuration matching dimension;

[0101] Summarize the similarity coefficients corresponding to multiple standard configuration items respectively;

[0102] Calculate the similarity based on the similarity coefficient.

[0103] Among them, the configuration matching dimension can represent multiple comparison angles or rules for comparing two page configuration information (such as standard page configuration information and second page configuration information). Each dimension represents a specific attribute or feature, such as the position, size, text content, etc. of a control. Through multiple configuration matching dimensions, the matching degree between the standard page configuration information and the second page configuration information can be comprehensively evaluated.

[0104] In a possible implementation manner of the present application, the configuration matching dimension may include, for example:

[0105] Same position and same size: The positions and sizes of two controls are exactly the same.

[0106] Same size and same height: The widths and heights of two controls are the same, but the positions may be different.

[0107] Same position: The positions of two controls are the same, but the sizes may be different.

[0108] Same size: The sizes of two controls are the same, but the positions may be different.

[0109] Same size and same text: The sizes and text contents of two controls are the same, but the positions may be different.

[0110] Among them, the similarity coefficient configured for each configuration matching dimension can be used to measure the importance of the corresponding dimension in the overall similarity calculation. For example, the similarity coefficient of same position and same size can be 1 (the highest weight); the similarity coefficient of same size and same height can be 0.7; the similarity coefficient of same position can be 0.5.

[0111] For any standard configuration item in the standard page configuration information, the server can find a second configuration item that matches the standard configuration item from the second page configuration information according to the target configuration matching dimension among multiple configuration matching dimensions. For example, if the position and size of a certain standard configuration item are exactly the same as those of a certain second configuration item, then select "same position and same size" as the target configuration matching dimension; if only the sizes are the same but the positions are different, then select "same size" as the target configuration matching dimension.

[0112] The server can record the similarity coefficients corresponding to the target configuration matching dimensions of each standard configuration item and summarize the similarity coefficients of all standard configuration items. For example, assume that the standard page configuration information contains two standard configuration items, the similarity coefficient of the first standard configuration item is 1, and the similarity coefficient of the second standard configuration item is 0.7. Then the total similarity coefficient is 1 + 0.7 = 1.7. To calculate the overall similarity, the server can divide the total similarity coefficient by the total number of standard configuration items to obtain the final similarity value. For example, if the total similarity coefficient is 1.7 and the total number of standard configuration items is 2, then the similarity is 1.7 / 2 = 0.85. This similarity value represents the matching degree between the actual page and the expected page, ranging from 0 to 1. The closer it is to 1, the higher the matching degree.

[0113] For example, in a certain test, the standard page configuration information is as follows: json [{"id": "account_security", "className": "TextView", "text": "Account and Security", "locations": [150, 150, 100, 50]}, {"id": "change_phone", "className": "Button", "text": "Modify Mobile Number", "locations": [250, 250, 100, 50]}], and the second page configuration information is as follows: json [{"id": "account_security", "className": "TextView", "text": "Account and Security", "locations": [150, 150, 100, 50]}, {"id": "change_phone", "className": "Button", "text": "Modify Mobile Number", "locations": [250, 250, 100, 50]}]. Among them, the id can represent the unique identifier of the control, used to distinguish different controls. For example, account_security is the ID of a text control. The className can represent the type or category of the control. For example, TextView represents a text control, and Button represents a button control. The text can represent the text content displayed on the control. For example, "Account and Security" and "Modify Mobile Number" are the text contents of the two controls respectively. The locations can represent the position and size information of the control, in the format of [x, y, width, height]. For example, [150, 150, 100, 50] means that the upper left corner coordinates of the control are (150, 150), the width is 100, and the height is 50. By comparison, the server finds that both standard configuration items exactly match the corresponding controls in the second page configuration information. Therefore, "same position and same size" is selected as the target configuration matching dimension respectively, and the similarity coefficients are both 1. The total similarity coefficient is 1 + 1 = 2, and the total number of standard configuration items is 2. The finally calculated similarity is 2 / 2 = 1. This indicates that the actual page is exactly the same as the expected page, and the test result is determined to pass.

[0114] In some embodiments, determining the second configuration item that matches the standard configuration item from the second page configuration information according to the target configuration matching dimension among multiple configuration matching dimensions can be specifically implemented as:

[0115] For any standard configuration item, determine the second configuration item from the second page configuration information in sequence according to multiple configuration matching dimensions;

[0116] Use the configuration matching dimension that successfully matches the second configuration item as the target configuration matching dimension.

[0117] In the embodiments of the present application, the server can sequentially attempt multiple configuration matching dimensions in a certain order and find the target configuration matching dimension that can be successfully matched. Specifically: the server can first select a standard configuration item from the standard configuration information, and then, the server can sequentially attempt to use each configuration matching dimension according to the preset priority order to check whether a second configuration item that matches the standard configuration item can be found in the second page configuration information. When the server successfully finds a matching second configuration item under a configuration matching dimension, this dimension is determined as the target configuration matching dimension. For example:

[0118] Step 1: Attempt the "same position and same size" dimension:

[0119] Check whether there is a control in the second page configuration information whose position and size are exactly the same as the standard configuration item.

[0120] If found, record this dimension as the "target configuration matching dimension" and end the matching process.

[0121] Step 2: If no matching item is found, then attempt the "same size and same height" dimension:

[0122] Check whether there is a control in the second page configuration information whose width and height are the same as the standard configuration item, but the position may be different.

[0123] If found, record this dimension as the "target configuration matching dimension" and end the matching process.

[0124] Step 3: If no matching item is still found, continue to attempt other dimensions (such as same position, same size, same size and same text, etc.) until a matching item is found or all dimensions have been attempted.

[0125] In some embodiments, inputting the first page configuration information and the page operation information into the large model to generate an operation instruction that matches the semantics of the page operation information based on the first page configuration information by the large model can be specifically implemented as:

[0126] Determine the task instruction and output requirement for the large model;

[0127] Generate a first prompt word based on the task instruction, output requirement, first page configuration information, and page operation information;

[0128] Input the first prompt word into the large model so that the large model processes the first page configuration information and the page operation information according to the task instruction and generates an operation instruction that meets the output requirement.

[0129] The server can first determine the task instructions and output requirements for the large model. The core goal of the task instructions is to generate an accurate operation instruction based on the page configuration information and page operation information provided by the user. The output requirements can, for example, specify the output format of the operation instruction and ensure that the description is refined and meets the word limit. For example, the operation instruction for clicking a certain button may be: ```json{"action":"tap","des":"Page with an input box, waiting for the search action","feature":{"x":"200","y":"50"},"reason":"Locate the center point of the search box based on UI data"}```.

[0130] Next, the server can generate a first prompt based on the task instructions, output requirements, first page configuration information, and page operation information. The content of the prompt includes the task purpose, input data format, output requirements, and key element descriptions.

[0131] After inputting the generated first prompt into the large model, the large model can process the first page configuration information and page operation information according to the task instructions. For example, when the user hopes to click a button named "Search" and enter the keyword "mobile phone", the page configuration information provided by the server is, for example: ```json{"center":[200,50],"size":[100,50],"text":"Search","children":[],"id":"search_button"}```, and the operation information is: click a button named "Search" and enter the keyword "mobile phone". The large model parses the task instructions and input data in the prompt, combines the center point coordinates and text labels in the page configuration information, and generates an operation instruction that meets the requirements: ```json{"action":"tap_input","des":"Page with an input box, mobile phone has been entered, waiting for the search action","feature":{"x":"200","y":"50","value":"mobile phone"},"reason":"Locate the center point of the search box based on UI data"}```.

[0132] In actual applications, the server realizes the automatic conversion from user needs to specific operation instructions through the above process. For example, in a test scenario of an e-commerce application, the user wants to swipe up the product list to view the details of the fifth product. The page configuration information provided by the server may include the center point coordinates of the product list `[300,400]`, the width `300` and the height `600`, and the operation information is "swipe up 1 / 4 of the screen". The operation instruction generated by the large model based on the prompt words can be: ```json{"action":"swipe","des":"Viewing the details of the fifth product titled xxx","feature":{"direction":"up","x":"300","y":"400","w":"300","h":"150"}}```. This can improve the intelligence level and efficiency of automated testing and ensure that the generated operation instructions are both accurate and meet actual needs.

[0133] In some embodiments, obtaining the first page configuration information of the first page of the application to be tested may be specifically implemented as follows:

[0134] Get multiple initial configuration items displayed on the first page;

[0135] According to a preset filtering rule, a plurality of initial page configuration items are filtered to obtain a plurality of first configuration items;

[0136] First page configuration information is generated according to the multiple first configuration items.

[0137] The initial configuration items may refer to the original description information of all visible and invisible page configuration items (controls) on the first page. These original description information can usually be extracted from the application to be tested by an automated testing tool, and include detailed properties of each control on the first page.

[0138] In actual applications, some page configuration items on the first page may be invisible, inoperable, or irrelevant to the current test task. If the initial configuration items are used directly for subsequent testing, the generated configuration information may be too complex, affecting the test efficiency.

[0139] The preset filtering rules may be implemented as a set of standards for filtering valid page configuration items. For example, the preset filtering rules may include:

[0140] Visibility filtering: only keep visible controls.

[0141] Actionability filtering: Only clickable or interactive controls are retained.

[0142] Text content filtering: remove empty text or meaningless placeholders.

[0143] Hierarchical relationship filtering: Ignore deeply nested child nodes and only retain top-level controls.

[0144] Dynamic content filtering: Remove temporarily generated dynamic controls (such as loading progress bars).

[0145] By filtering multiple obtained initial configuration items using preset filtering rules, multiple refined and effective first configuration items can be obtained.

[0146] The following provides a possible implementation of the page testing method of the application program provided in the embodiments of the present application in combination with specific application scenarios.

[0147] For example, a test user needs to test the "jump to settings page" function of an e-commerce application program. The test user hopes to click the "Settings" button on the home page (the first page) of the e-commerce application program and then jump to the settings page (the second page) to verify whether the settings page is correctly loaded.

[0148] Figure 3 Shows a schematic diagram of the first page.

[0149] Such as Figure 3 As shown, the first page can be the home page of the e-commerce application program. Multiple products can be displayed on the first page, such as Product 1 and Product 2. Also, in the bottom status bar, controls such as "Message", "Shopping Cart", and "Settings" can be displayed.

[0150] First, the server can send test prompt messages to the client to guide the user to input a test task. For example, "Click the 'Settings' button on the home page to enter the settings page." After the user inputs, the server can receive the test task and parse it into operation steps, that is, click the 'Settings' button. Subsequently, the server determines that the application under test is a certain e-commerce application and launches its home page (the first page). Then, the server obtains multiple initial configuration items of the first page through an automated testing tool, and then generates the first page configuration information by removing invisible or meaningless configuration items using a preset filtering rule. For example, the JSON format data {"id":"settings_button","className":"Button","text":"Settings","locations":[300,500,100,50]} containing the 'Settings' button. At the same time, the server receives the page operation information provided by the test user and integrates the first page configuration information with the operation information into a prompt word and inputs it into the large model. The large model can generate precise operation instructions based on the prompt word. The operation instructions can be implemented as, for example: {"action":"tap","des":"Click the settings button to enter the settings page","feature":{"x":"350","y":"525"}}. The server can simulate the execution of this operation instruction through an automated testing tool to complete the click operation and jump the page to the target page (the second page). Then, the server obtains the second configuration information of the second page and compares it with the pre-recorded standard page configuration information.

[0151] Figure 4 The figure shows a schematic diagram of the successfully loaded second page.

[0152] As Figure 4 shown, multiple setting options can be displayed on the second page, and each setting option can correspond to a configuration item.

[0153] After jumping to the second page, multiple configuration items displayed on the second page can be obtained to get the second page configuration information. Then, through multiple configuration matching dimensions (such as same position and same size, same size and same height, etc.), each item can be matched with the standard configuration items in the standard configuration information, and the similarity coefficient can be recorded. Finally, the similarity is calculated. If the similarity is greater than or equal to the preset threshold (such as 0.6), it is determined that the test passes.

[0154] Figure 5 The figure shows a schematic diagram of the second page in the case of loading failure.

[0155] As Figure 5 shown, in the case of loading failure, nothing can be displayed on the second page Figure 4A plurality of set options are shown, and only the loading prompt message 501 is displayed. In this case, the server can trigger a polling mechanism to re-obtain the third-page configuration information of the second page at a preset interval and recalculate the similarity. If the polling times exceed the preset number of times and the threshold is still not reached, it is determined as an abnormal situation and the application is rolled back to the first page to re-execute the operation instruction.

[0156] Figure 6 The block diagram of a page testing device for an application provided by an embodiment of the present application is shown. As Figure 6 shown, the device may specifically include:

[0157] An information sending module 601, configured to send a test prompt message to the client;

[0158] A task receiving module 602, configured to receive a test task sent by the client based on the test prompt message;

[0159] An application determining module 603, configured to determine a to-be-tested application corresponding to the test task in response to the test task;

[0160] A first configuration information obtaining module 604, configured to obtain the first-page configuration information of the to-be-tested application;

[0161] An operation information obtaining module 605, configured to obtain page operation information configured by the user, where the page operation information is used to describe an operation path for jumping from the first page to the second page;

[0162] An input module 606, configured to input the first-page configuration information and the page operation information into a large model, so as to use the large model to generate an operation instruction that matches the semantics of the page operation information based on the first-page configuration information;

[0163] An execution module 607, configured to simulate the execution of the operation instruction on the first page and jump the first page to the second page;

[0164] A second configuration information obtaining module 608, configured to obtain the second-page configuration information of the second page and the standard page configuration information of the second page;

[0165] A similarity determining module 609, configured to determine the similarity between the second-page configuration information and the standard page configuration information;

[0166] A result generating module 6010, configured to determine the test result of the application based on the similarity.

[0167] In some embodiments, in the case where the test result indicates that the similarity between the second-page configuration information and the standard page configuration information is less than a preset threshold, the device may further include:

[0168] A second configuration information acquisition module, configured to re-acquire the third page configuration information of the second page at a preset polling interval;

[0169] A re-detection module, configured to determine the similarity between the re-acquired third page configuration information and the standard page configuration information;

[0170] An iteration module, configured to terminate polling when the similarity is greater than or equal to a preset threshold, and determine a test result based on the re-acquired similarity; otherwise, return to the step of re-acquiring the page configuration information of the second page and continue execution.

[0171] In some embodiments, the apparatus may further include:

[0172] A fallback module, configured to, when the number of polling times is greater than a preset number, fallback the application under test to the first page, and return to the step of simulating the execution of the operation instruction on the first page and continue execution.

[0173] In some embodiments, the similarity determination module 609 is specifically configured to:

[0174] Determine multiple configuration matching dimensions, where each configuration matching dimension is configured with a corresponding similarity coefficient;

[0175] For any standard configuration item included in the standard page configuration information, determine a second configuration item that matches the standard configuration item from the second page configuration information according to the target configuration matching dimension among the multiple configuration matching dimensions;

[0176] Record the similarity coefficient corresponding to the target configuration matching dimension;

[0177] Summarize the similarity coefficients corresponding to the multiple standard configuration items respectively;

[0178] Calculate the similarity based on the similarity coefficients.

[0179] In some embodiments, the similarity determination module 609 is specifically configured to:

[0180] For any standard configuration item, sequentially determine the second configuration item from the second page configuration information according to the multiple configuration matching dimensions;

[0181] Take the configuration matching dimension corresponding to the successfully matched second configuration item as the target configuration matching dimension.

[0182] In some embodiments, the input module 606 is specifically configured to:

[0183] Determine a task instruction and an output requirement for the large model;

[0184] Generate a first prompt word based on the task instruction, the output requirement, the first page configuration information, and the page operation information;

[0185] Input the first prompt into the large model so that the large model processes the first page configuration information and page operation information according to the task instructions and generates operation instructions that meet the output requirements.

[0186] In some embodiments, the first configuration information acquisition module 604 is specifically configured to:

[0187] Obtain multiple initial configuration items displayed on the first page;

[0188] Filter the multiple initial page configuration items according to a preset filtering rule to obtain multiple first configuration items;

[0189] Generate first page configuration information based on the multiple first configuration items.

[0190] Figure 6 The page testing device of the application program as described can execute Figure 2 The page testing method of the application program described in the embodiments shown, and its implementation principle and technical effects will not be elaborated again. For the page testing device of the application program in the above embodiments, the specific ways for each module and unit to execute operations have been described in detail in the embodiments related to the method, and will not be elaborated here.

[0191] The embodiments of the present application also provide a computing device, as Figure 7 shown, the device may include a storage component and a processing component;

[0192] The storage component stores one or more computer instructions, and among them, the one or more computer instructions are called and executed by the processing component to implement the page testing of the application program provided by the embodiments of the present application.

[0193] Of course, the computing device may necessarily also include other components, such as input / output interfaces, display components, communication components, etc.

[0194] Among them, the processing component may include one or more processors to execute computer instructions to complete all or part of the steps in the above method. Of course, the processing component may also be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components for executing the above method.

[0195] The storage component is configured to store various types of data to support the operations of the terminal. The storage component can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.

[0196] The display component can be an electroluminescent (EL) element, a liquid crystal display, or a microdisplay with a similar structure, or a retina-direct display or a similar laser scanning display.

[0197] It should be noted that the above computing device can be a physical device or an elastic computing host provided by a cloud computing platform, etc. It can be implemented as a distributed cluster composed of multiple servers or terminal devices, or can be implemented as a single server or a single terminal device.

[0198] The embodiment of the present application also provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a computer, it can implement the Figure 2 page testing method of the application program shown in the above embodiments. This computer-readable medium can be included in the electronic device described in the above embodiments; or can exist alone without being assembled into the electronic device.

[0199] The embodiment of the present application also provides a computer program product, which includes a computer program carried on a computer-readable storage medium, and when the computer program is executed by a computer, it can implement the page testing method of the application program as shown in the above Figure 2 embodiments. In such an embodiment, the computer program can be downloaded and installed from the network and / or installed from a removable medium. When the computer program is executed by a processor, it executes various functions defined in the system of the present application.

[0200] It should be noted that the embodiment of the present application may involve the use of user data. In actual applications, it can be used in the solutions described herein within the scope permitted by applicable laws and regulations in compliance with the requirements of applicable laws and regulations in the country where it is located (for example, with the user's explicit consent, giving the user a practical notice, etc.).

[0201] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.

[0202] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative work.

[0203] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0204] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and are not intended to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments or perform equivalent replacements for some of the technical features. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A page testing method for an application, characterized in that: include: Send test prompt information to the client; Receiving a test task sent by the client based on the test prompt information; In response to the test task, determining an application to be tested corresponding to the test task; Obtaining first page configuration information of a first page of the application to be tested; Acquire page operation information configured by a user, where the page operation information is used to describe an operation path for jumping from a first page to a second page; Inputting the first page configuration information and the page operation information into a large model, so as to generate an operation instruction matching the semantics of the page operation information based on the first page configuration information by using the large model; Simulate executing the operation instruction on the first page to jump the first page to the second page; Acquire second page configuration information of the second page and standard page configuration information of the second page; Determining a similarity between the second page configuration information and the standard page configuration information; Based on the similarity, a test result of the application is determined.

2. The method according to claim 1, characterized in that When the test result indicates that the similarity between the second page configuration information and the standard page configuration information is less than a preset threshold, the method further includes: Re-acquiring the third page configuration information of the second page according to a preset polling interval; Determining the similarity between the re-acquired third page configuration information and the standard page configuration information; When the similarity is greater than or equal to the preset threshold, the polling is terminated, and the test result is determined based on the re-acquired similarity; otherwise, the step of re-acquiring the page configuration information of the second page is returned to continue.

3. The method according to claim 2, characterized in that The method further comprises: When the polling times are greater than the preset times, the application program to be tested is rolled back to the first page, and the step of simulating the execution of the operation instruction on the first page is returned to continue execution.

4. The method according to claim 1, characterized in that: Determining the similarity between the second page configuration information and the standard page configuration information includes: Determine a plurality of configuration matching dimensions, wherein each configuration matching dimension is configured with a corresponding similarity coefficient; For any standard configuration item included in the standard page configuration information, determining a second configuration item matching the standard configuration item from the second page configuration information according to a target configuration matching dimension among the multiple configuration matching dimensions; Recording the similarity coefficient corresponding to the target configuration matching dimension; Summarize the similarity coefficients corresponding to multiple standard configuration items; Based on the similarity coefficient, the similarity is calculated.

5. The method according to claim 4, characterized in that The determining, according to the target configuration matching dimension among the multiple configuration matching dimensions, from the second page configuration information, a second configuration item matching the standard configuration item comprises: For any of the standard configuration items, determining the second configuration item from the second page configuration information according to the multiple configuration matching dimensions in sequence; The configuration matching dimension corresponding to the second configuration item that is successfully matched is used as the target configuration matching dimension.

6. The method according to claim 1, characterized in that The step of inputting the first page configuration information and the page operation information into the large model, so as to generate an operation instruction matching the semantics of the page operation information based on the first page configuration information by using the large model, comprises: Determine task instructions and output requirements for the large model; Generate a first prompt word based on the task instruction, the output requirement, the first page configuration information and the page operation information; The first prompt word is input into the large model so that the large model processes the first page configuration information and the page operation information according to the task instruction and generates the operation instruction that meets the output requirement.

7. The method according to claim 1, characterized in that The step of obtaining the first page configuration information of the first page of the application to be tested includes: Obtaining multiple initial configuration items displayed on the first page; Filtering the multiple initial page elements according to a preset filtering rule to obtain multiple first configuration items; The first page configuration information is generated according to the multiple first configuration items.

8. A computing device, characterized in that including a processing component and a storage component; The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement the page testing method of the application program as described in claims 1 to 7.

9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by the processing component, the page testing method of the application program as claimed in claims 1 to 7 is implemented.

10. A computer program product, characterized in that The invention comprises a computer program / instruction, which implements the page testing method of the application program according to claims 1 to 7 when the computer program / instruction is executed by the processing component.

Citation Information

Cited By

  • Server parameter configuration method, electronic equipment, storage medium and program product

    CN120386764A

  • Program testing method and system, electronic equipment, storage medium and program product

    CN120892356A

  • Application interaction method and device and storage medium

    CN121029301A

  • Webpage testing method, electronic equipment and computer readable medium

    CN121233480A

  • A web page testing method, an electronic device, and a computer readable medium

    CN121233480B