Application program testing method and device, testing terminal and storage medium

By intercepting network requests to obtain page data and validation content, the target page elements are automatically validated, solving the problem of test results relying on human factors and improving the accuracy of application testing.

CN113971123BActive Publication Date: 2026-07-03TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2020-07-23
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

In existing technologies, application test results are affected by the subjective factors of testers, leading to inaccurate test results.

Method used

By intercepting network requests, obtaining page data and validation content, the system automatically validates target page elements and generates test results.

Benefits of technology

Application testing can be performed without the involvement of testers, improving testing accuracy and reducing the impact of subjective factors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113971123B_ABST
    Figure CN113971123B_ABST
Patent Text Reader

Abstract

This disclosure provides an application testing method, apparatus, testing terminal, and storage medium, relating to the field of application development technology. The method includes: intercepting a first network request; determining a test case corresponding to the first network request based on the first network request; obtaining page data of a first application page to be tested and first verification content of the first application page from the test case, wherein the first application page is the page corresponding to the first network request; obtaining at least one target page element in the first application page based on the page data; determining second verification content corresponding to the target page element from the first verification content based on the element identifier of the target page element; and verifying the target page element based on the second verification content to obtain a test result for the target page element. This eliminates the need for testers to compare the replayed screen with the recorded screen, thereby improving the accuracy of software testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of application development technology, and in particular to an application testing method, apparatus, testing terminal, and storage medium. Background Technology

[0002] In the application development process, application testing has become a crucial step. Especially after updating certain functions of the application, regression testing is often required to ensure that the updated functions do not affect the unchanged functions.

[0003] In related technologies, test cases are often obtained by recording user operations and the corresponding first display screen. Then, the test cases are played back, and testers judge whether the second display screen during the playback process is the same as the first display screen during recording, thereby completing the test of the application.

[0004] During the above testing process, testers need to compare the obtained second display screen with the first display screen during recording to obtain the test results. This makes the test results of the application subject to the subjective factors of the testers, resulting in inaccurate test results. Summary of the Invention

[0005] This disclosure provides an application testing method, apparatus, testing terminal, and storage medium, which can improve the accuracy of application testing. The technical solution is as follows:

[0006] On the one hand, an application testing method is provided, the method comprising:

[0007] Intercept the first network request;

[0008] Based on the first network request, determine the test case corresponding to the first network request;

[0009] Obtain the page data of the first application page to be tested and the first verification content of the first application page from the test cases. The first application page is the page corresponding to the first network request.

[0010] Based on the page data, obtain at least one target page element from the first application page;

[0011] Based on the element identifier of the target page element, determine the second verification content corresponding to the target page element from the first verification content;

[0012] Based on the second verification content, the target page element is verified to obtain the test result of the target page element.

[0013] In one possible implementation, the second verification content includes the first element content of the target page element; the step of verifying the target page element according to the second verification content to obtain the test result of the target page element includes:

[0014] Determine the element category of the target page element;

[0015] Based on the element category, identify the second element content of the target page element from the target page elements;

[0016] Based on the content of the first element and the content of the second element, the target page element is validated to obtain the test result.

[0017] In another possible implementation, identifying the second element content of the target page element from the target page element according to the element category includes at least one of the following methods:

[0018] In response to the target page element being of the text type, the second element content of the target page element is extracted from the target page element;

[0019] In response to the target page element being of the image type, the target page element is converted into binary data to obtain the second element content of the target page element;

[0020] In response to the fact that the element category of the page element is interactive, a page operation on the target page element is determined, and a response message corresponding to the page operation is obtained based on the page operation. The response message is then used as the second element content of the target page element.

[0021] In another possible implementation, the second verification content includes the first element parameter of the target page element;

[0022] The step of verifying the target page element based on the second verification content to obtain the test result of the target page element includes:

[0023] Obtain the second element parameter of the target page element in the first application page;

[0024] Determine the degree of matching between the first element parameter and the second element parameter;

[0025] The test result of the target page element is determined based on the degree of matching.

[0026] In another possible implementation, prior to intercepting the first network request, the method further includes:

[0027] Activate the test plugin to intercept the application's second network request;

[0028] Send the second network request to the business server corresponding to the application.

[0029] Receive page data of the second application page corresponding to the second network request returned by the service server;

[0030] The first verification content is generated based on the page data;

[0031] The second network request, the page data, and the first verification content constitute the test case.

[0032] In another possible implementation, generating the first verification content based on the page data includes:

[0033] Render the second application page based on the page data;

[0034] Identify at least one target page element in the second application page;

[0035] Identify the element content of the target page element and use the element content as the second verification content of the target page element;

[0036] The first verification content is generated based on the second verification content of at least one of the target page elements and the element identifier of at least one of the target page elements.

[0037] The step of generating the first verification content based on the second verification content of at least one of the target page elements and the element identifier of at least one of the target page elements includes:

[0038] The element identifier is bound to the second verification content to obtain the first verification content;

[0039] The step of determining the second verification content corresponding to the target page element from the first verification content based on the element identifier of the target page element includes:

[0040] Based on the element identifier, query the second verification content corresponding to the element identifier from the first verification content.

[0041] On the other hand, an application testing apparatus is provided, the apparatus comprising:

[0042] The interception module is used to intercept the first network request;

[0043] The first determining module is used to determine the test cases corresponding to the first network request based on the first network request.

[0044] The first acquisition module is used to acquire page data of the first application page to be tested and the first verification content of the first application page from the test case, wherein the first application page is the page corresponding to the first network request;

[0045] The second acquisition module is used to acquire at least one target page element in the first application page based on the page data.

[0046] The second determining module is used to determine the second verification content corresponding to the target page element from the first verification content based on the element identifier of the target page element.

[0047] The verification module is used to verify the target page element according to the second verification content and obtain the test result of the target page element.

[0048] In one possible implementation, the second verification content includes the content of the first element of the target page element; the verification module includes:

[0049] The first determining unit is used to determine the element category of the target page element;

[0050] The first identification unit is used to identify the second element content of the target page element from the target page elements according to the element category;

[0051] The verification unit is used to verify the target page element based on the content of the first element and the content of the second element, and obtain the test result.

[0052] In another possible implementation, the first identification unit is configured to extract the second element content of the target page element from the target page element in response to the element category of the target page element being text.

[0053] The first identification unit is configured to convert the target page element into binary data in response to the element category of the target page element being an image, thereby obtaining the second element content of the target page element;

[0054] The first identification unit is configured to, in response to the element category of the page element being interactive, determine a page operation on the target page element, obtain a response message corresponding to the page operation based on the page operation, and use the response message as the second element content of the target page element.

[0055] In another possible implementation, the second verification content includes the first element parameter of the target page element; the verification module includes:

[0056] The acquisition unit is used to acquire the second element parameter of the target page element in the first application page;

[0057] The second determining unit is used to determine the degree of matching between the first element parameter and the second element parameter;

[0058] The second determining unit is used to determine the test result of the target page element based on the matching degree.

[0059] In another possible implementation, the device further includes:

[0060] The startup module is used to launch the test plugin, which intercepts the application's second network request.

[0061] The sending module is used to send the second network request to the business server corresponding to the application.

[0062] The receiving module is used to receive page data of the second application page corresponding to the second network request returned by the business server;

[0063] The generation module is used to generate the first verification content based on the page data;

[0064] The component module is used to combine the second network request, the page data, and the first verification content into the test case.

[0065] In another possible implementation, the generation module includes:

[0066] A rendering unit is used to render the second application page based on the page data;

[0067] The third determining unit is used to determine at least one target page element in the second application page;

[0068] The second identification unit is used to identify the element content of the target page element and use the element content as the second verification content of the target page element.

[0069] The generation unit is configured to generate the first verification content based on the second verification content of at least one of the target page elements and the element identifier of at least one of the target page elements.

[0070] In another possible implementation, the generating unit is used to bind the element identifier with the second verification content to obtain the first verification content;

[0071] The second determining module is used to query the second verification content corresponding to the element identifier from the first verification content based on the element identifier.

[0072] On the other hand, a test terminal is provided, the test terminal including a processor and a memory, the memory storing at least one piece of program code, the program code being loaded and executed by the processor to implement the operations performed in the application testing method of the present invention.

[0073] On the other hand, a computer-readable storage medium is provided, wherein at least one piece of program code is stored in the computer-readable storage medium, the program code being loaded and executed by a processor to implement the operations performed in the application testing method of the embodiments of the present invention.

[0074] On the other hand, a computer program product or computer program is provided, the computer program product or computer program including computer program code stored in a computer-readable storage medium, a processor of a computer device reading the computer program code from the computer-readable storage medium, the processor executing the computer program code, causing the computer device to perform the operations performed in the above application testing method.

[0075] The beneficial effects of the technical solutions provided in this disclosure are:

[0076] In this embodiment of the disclosure, during application testing, a first network request is intercepted, and the page data and first verification content corresponding to the first network request are obtained from the test cases corresponding to the first network request. The target page element is verified by comparing it with the corresponding second verification content in the first verification content. Since the test terminal obtains the second verification content, it can automatically verify the target page element based on the second verification data. This allows for application testing without the involvement of testers, thus avoiding the influence of tester subjectivity on the test results and improving the accuracy of application testing. Attached Figure Description

[0077] To more clearly illustrate the technical solutions in the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0078] Figure 1This is a schematic diagram of the implementation environment involved in an application testing method provided according to an exemplary embodiment;

[0079] Figure 2 This is a flowchart of an application testing method provided according to an exemplary embodiment;

[0080] Figure 3 This is a flowchart of an application testing method provided according to an exemplary embodiment;

[0081] Figure 4 This is a flowchart of an application testing method provided according to an exemplary embodiment;

[0082] Figure 5 This is a schematic diagram of an application page provided according to an exemplary embodiment;

[0083] Figure 6 This is a flowchart of an application testing method provided according to an exemplary embodiment;

[0084] Figure 7 This is a schematic diagram of an application page provided according to an exemplary embodiment;

[0085] Figure 8 This is a flowchart of an application testing method provided according to an exemplary embodiment;

[0086] Figure 9 This is a schematic diagram of an application page provided according to an exemplary embodiment;

[0087] Figure 10 This is a flowchart of an application testing method provided according to an exemplary embodiment;

[0088] Figure 11 This is a flowchart of an application testing method provided according to an exemplary embodiment;

[0089] Figure 12 This is a schematic diagram of an application page provided according to an exemplary embodiment;

[0090] Figure 13 This is a flowchart of an application testing method provided according to an exemplary embodiment;

[0091] Figure 14 This is a block diagram of an application testing apparatus provided according to an exemplary embodiment;

[0092] Figure 15 This is a schematic diagram of the structure of a test terminal provided according to an exemplary embodiment. Detailed Implementation

[0093] To make the objectives, technical solutions, and advantages of this disclosure clearer, the embodiments of this disclosure will be described in further detail below with reference to the accompanying drawings.

[0094] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0095] Figure 1 This is a schematic diagram of the implementation environment involved in an application testing method according to an exemplary embodiment. See also Figure 1 The implementation environment includes a test terminal 101 and a business server 102. The test terminal 101 and the business server 102 interact via a network connection or data interface. The application to be tested is installed on the test terminal 101, and the business server 102 is the server corresponding to that application. Optionally, the application can be any type of application, such as a short video playback application, a social application, etc. In this embodiment, the type of application is not specifically limited. The test terminal also has a test plugin installed for test case management, test case distribution, and result reporting. The test plugin includes a kernel unit, a management unit, a user interaction unit, and a control unit. The kernel unit is used to generate test cases. The management unit is used to control the automatic restart of the test plugin and to locally store test cases. The user interaction unit is used to manage test cases through a test case tree and to determine the selection of page elements. The control unit is used for encoding and controlling test case playback. The test cases store verification content for validating page elements. Optionally, the verification content is mock data for page elements, which is generated during the recording process by intercepting data from network requests and data returned by the business server.

[0096] In one possible implementation, the environment further includes a test server 103. The test terminal 101 interacts with the test server 103 via a network connection or data interface. Accordingly, the test server 103 stores at least one test case, and the test terminal 101 can invoke the test cases in the test server 103 to test the application.

[0097] Optionally, the test terminal 101 can be a mobile phone, computer, tablet computer, or wearable device. Optionally, the operating system of the test terminal 101 can be an operating system such as iOS or Android. In this embodiment of the disclosure, the operating system of the test terminal 101 is not specifically limited.

[0098] The business server 102 and the test server 103 are different servers. Optionally, the business server 102 or the test server 103 can be an independent server, or a server cluster consisting of multiple servers, or a cloud server, etc. In this embodiment of the disclosure, no specific limitation is made in this regard.

[0099] Figure 2 This is a flowchart illustrating an application testing method according to an exemplary embodiment. In this disclosure, an example is used for explanation. Figure 2 As shown, the method includes the following steps:

[0100] Step 201: Intercept the first network request.

[0101] Step 202: Determine the test cases corresponding to the first network request based on the first network request.

[0102] Step 203: Obtain the page data of the first application page to be tested and the first verification content of the first application page from the test case. The first application page is the page corresponding to the first network request.

[0103] Step 204: Based on the page data, obtain at least one target page element from the first application page.

[0104] Step 205: Based on the element identifier of the target page element, determine the second verification content corresponding to the target page element from the first verification content.

[0105] Step 206: Based on the second verification content, verify the target page element to obtain the test result of the target page element.

[0106] In one possible implementation, the second verification content includes the first element content of the target page element; the target page element is verified based on the second verification content to obtain the test result of the target page element, including:

[0107] Determine the element category of the target page element;

[0108] Based on the element category, identify the second element content of the target page element from the target page element;

[0109] Based on the content of the first element and the content of the second element, the target page element is validated to obtain the test result.

[0110] In another possible implementation, identifying the second element content of the target page element based on the element category includes at least one of the following methods:

[0111] In response to the element category of the target page element being text, extract the content of the second element of the target page element;

[0112] In response to the fact that the element category of the target page element is an image, the target page element is converted into binary data to obtain the content of the second element of the target page element;

[0113] In response to the element category of the page element being interactive, determine the page operation on the target page element, obtain the corresponding response message based on the page operation, and use the response message as the second element content of the target page element.

[0114] In another possible implementation, the second verification content includes the first element parameter of the target page element;

[0115] Based on the second verification content, the target page element is verified to obtain the test result of the target page element, including:

[0116] Retrieve the second element parameter of the target page element in the first application page;

[0117] Determine the degree of matching between the first element parameter and the second element parameter;

[0118] The test result for the target page element is determined based on the degree of matching.

[0119] In another possible implementation, prior to intercepting the first network request, the method also includes:

[0120] Activate the test plugin to intercept the application's second network request;

[0121] Send the second network request to the business server corresponding to the application.

[0122] Receive page data of the second application page corresponding to the second network request returned by the service server;

[0123] Based on the data on this page, generate the first verification content;

[0124] The second network request, the page data, and the first verification content constitute this test case.

[0125] In another possible implementation, the first verification content is generated based on the page data, including:

[0126] Render the second application page based on the data on that page;

[0127] Identify at least one target page element in the second application page;

[0128] Identify the element content of the target page element and use that element content as the second verification content for the target page element;

[0129] The first verification content is generated based on the second verification content of at least one target page element and the element identifier of at least one target page element.

[0130] The first verification content is generated based on at least one second verification content of the target page element and at least one element identifier of the target page element, including:

[0131] Bind the element identifier to the second verification content to obtain the first verification content;

[0132] Based on the element identifier of the target page element, the second verification content corresponding to the target page element is determined from the first verification content, including:

[0133] Based on the element identifier, retrieve the second verification content corresponding to the element identifier from the first verification content.

[0134] In this embodiment of the disclosure, during application testing, a first network request is intercepted, and the page data and first verification content corresponding to the first network request are obtained from the test cases corresponding to the first network request. The target page element is verified by comparing it with the corresponding second verification content in the first verification content. Since the test terminal obtains the second verification content, it can automatically verify the target page element based on the second verification data. This allows for application testing without the involvement of testers, thus avoiding the influence of tester subjectivity on the test results and improving the accuracy of application testing.

[0135] Before testing the application using the embodiments of this disclosure, test cases are recorded using a test plugin so that the test terminal can call the test cases to test different versions of the application. Figure 3 This is a flowchart illustrating an application testing method according to an exemplary embodiment. In this embodiment, recording test cases is used as an example for explanation. Figure 3 As shown, the method includes the following steps:

[0136] Step 301: The test terminal starts the test plugin, which intercepts the application's second network request.

[0137] The test terminal is equipped with a test plugin. This test plugin is an application test plugin with functions such as recording and playback. Optionally, this test plugin can be developed using any development tool. For example, it can be developed using an SDK (Software Development Kit). This test plugin can be installed in any application. The second network request is a network request sent by the application to the business server during the recording of test cases. This second network request is a network request used by the application to obtain page data of the second application page. For example, if the application is a short video playback application, then the second network request is a request sent by the application to the business server to obtain the short video playback page.

[0138] Optionally, the test plugin includes a hook function. The test terminal uses the hook function in the test plugin to intercept the second network request sent by the application to the business server.

[0139] Additionally, see Figure 4 Optionally, after the test terminal intercepts the second network request, it records the second network request. See also... Figure 5 The test terminal generates a second network request through application 501 and sends it to the test server 103. Test plugin 502 intercepts this second network request and generates a second request identifier based on it. Optionally, the test terminal obtains feature data of the second network request, such as request parameters, and calculates the second request identifier using any algorithm. For example, the test terminal generates the second request identifier based on MD5 (Message Digest Algorithm 5). Accordingly, this second request identifier is determined based on the feature data of the second network request and the MD5 algorithm.

[0140] It should be noted that during the recording of test cases, the application may send multiple secondary network requests to the business server. For each secondary network request, the terminal intercepts the application's secondary network request through this test plugin. Optionally, see [link to relevant documentation]. Figure 5 The test terminal encodes the second request identifier in an incremental manner. Accordingly, the encoding of the first network request in the test case is set to MD5_0, and when a new second network request is received subsequently, the encoding of the new second network request is set to MD5_1.

[0141] In addition, the test terminal also records the timestamp of the second network request, so that when performing software testing based on the test case replay, the timestamp can be used to reconstruct the sending time of the second network request. Accordingly, in this step, see Figure 4 403: The test terminal records the second network request. The test terminal records the intercepted second network request, its corresponding response message, and the sending timestamp of the second network request in the test case. The test terminal slices the intercepted second network request, removing WNS (a type of wireless data packet) from it, so that the test terminal will not send the second network request to the business server when testing this test case later. Furthermore, it records the second network request, the corresponding page data, and the generation timestamp.

[0142] After the test plugin is started, the test terminal's display will show the corresponding test button 601. See also... Figure 6 A floating layer is displayed in the current display interface, on which the test button 601 is displayed. Optionally, the shape and position of the test button 601 can be set and changed as needed; in this embodiment of the disclosure, the shape and position of the test button 601 are not specifically limited. Optionally, the test terminal receives a movement operation input by the user and moves the test button 601 to the target position according to the movement operation.

[0143] In response to the terminal detecting that the test button 601 has been triggered, the terminal records test cases through the test plugin.

[0144] In one possible implementation, the test terminal detects that the test button 601 has been triggered on any application page of the application, and the test terminal directly intercepts the second network request on that application page. In this implementation, the test terminal starts recording test cases directly on the application page where the test button 601 is triggered, so that the generated test cases can be tested directly from the current second application page. This makes the application testing highly targeted, saves application testing time, and improves the efficiency of application testing.

[0145] In another possible implementation, see Figure 4The test terminal detects that the test button 601 has been triggered on any application page of the application. Steps 401: Initialize the recording environment for the test case; Step 402: Restart the current application. In the restarted application, the second network request is intercepted upon re-entering the application page. In this implementation, when the test button 601 is detected as being triggered, the application is restarted based on the triggered test button 601, and the second application page is re-entered from the application, thus allowing testing during the test to determine whether the second application page can start normally.

[0146] Step 302: The test terminal sends the second network request to the business server corresponding to the application.

[0147] See also Figure 5 The test terminal, based on the application, determines the corresponding business server for that application and sends the second network request to that business server. The business server then uses this second network request to send the page data of the first page to the test terminal.

[0148] Step 303: The test terminal receives the page data of the second application page corresponding to the second network request returned by the service server.

[0149] See also Figure 5 After receiving the second network request, the business server determines the page data corresponding to the second network request and returns the page data to the test terminal.

[0150] For example, if the application is a short video playback application, then the second network request is a network request for short video data. Accordingly, the server determines the short video data based on the page information carried in the second network request and returns the short video data to the test terminal.

[0151] Step 304: The test terminal generates the first verification content based on the data on this page.

[0152] See also Figure 5 In this step, the test terminal intercepts the page data during recording using a hook function in the test plugin, generating the first verification content corresponding to the second network request. This step is implemented through the following steps (A1)-(A4), including:

[0153] (A1) The test terminal renders the second application page based on the page data.

[0154] In this step, the test terminal renders the second application page corresponding to the received page data.

[0155] (A2) The test terminal identifies at least one target page element in the second application page.

[0156] This test plugin also includes an element extractor, see [link / reference]. Figure 4 This element extractor is used to extract at least one page element (404) from the second application page. See also Figure 7 The test terminal, displaying the second application page 701 and the test plugin page 702, scans the second application page to obtain at least one page element. For example, if the second application page is a short video playback page, then the page elements included on the second application page would be video frames, follow tags, recommendation tags, title tags, like tags, comment tags, and share tags. The test terminal uses this element extractor to record the position, content, binary data, and other element information of the scanned at least one page element within the second application page.

[0157] Optionally, the test terminal may use all of the at least one page element it scans as the target page element.

[0158] Optionally, the test terminal selects at least one page element as the target page element from the scanned at least one page element. Accordingly, the process is as follows: the test terminal traverses the page elements in the second application page to obtain at least one page element; displays at least one of the page elements; and retrieves at least one of the selected target page elements from the page.

[0159] The test terminal receives a selection instruction and determines at least one target page element to be selected based on the instruction. Optionally, the test terminal may annotate the at least one target page element, or display the at least one target page element in an element display page. See also Figure 7 The testing terminal displays at least one scanned page element on the second application page, and simultaneously displays at least one selected target page element on the element display page. In this implementation, the testing terminal displays different page elements in the testing plugin and marks them on the second application page, so that testers can more intuitively understand the currently scanned page elements and the page elements to be tested.

[0160] Accordingly, in one possible implementation, the testing terminal marks at least one page element detected. For example, the testing terminal marks at least one page element detected using a colored semi-transparent frame. Optionally, the color of the semi-transparent frame can be set and changed as needed; in this embodiment, the color of the semi-transparent frame is not specifically limited. In this implementation, the testing terminal marks at least one page element so that testers can visually see at least one page element in the second application page.

[0161] In another possible implementation, the test terminal displays at least one scanned page element on the element display page corresponding to the test plugin. In this implementation, the test terminal displays at least one scanned page element on the element display page corresponding to the test plugin, allowing testers to intuitively identify the page element from the element display page.

[0162] Additionally, page elements in the 702 test page of the plugin can be displayed according to their category. See also Figure 7 This will display page elements such as images and text separately.

[0163] In addition, the test terminal also generates an element identifier. This element identifier is used to mark the page element. Optionally, the test terminal encodes the element characteristics of the page element and uses the encoded identifier as the element identifier of the page element. Optionally, the encoding method can be any data encoding method, such as MD5 encoding.

[0164] (A3) The test terminal identifies the element content of the target page element and uses the element content as the second verification content of the target page element.

[0165] In this step, please continue to refer to Figure 4 The test terminal determines the element category of the target page element and generates the second verification content corresponding to the page element based on the element category.

[0166] The test terminal categorizes page elements based on their data type or function. For example, see [link to test case]. Figure 4 The test terminal categorizes target page elements based on their data type (text, image, etc.), their function (interactive, non-interactive), and their display conditions (dynamic, direct). In this embodiment, the classification method for target page elements is not specifically limited.

[0167] After the test terminal determines the element category of the target page element, it identifies the element content corresponding to the target element based on the element category and uses the element content as the second verification content of the target page element.

[0168] For example, if the element category of the page element is text, the test terminal extracts the text content of the target page element to obtain its element content. For instance, if the target page element is the title of a video file on a video playback page, the test terminal identifies the content of the title and uses that content as the element content of the target page element.

[0169] If the element category of the page element is an image, the test terminal converts the target page element into binary data to obtain the element content of the target page element. For example, if the page element is a user's avatar on a video playback page, the test terminal identifies the image corresponding to the avatar, converts the image into binary data, and uses the binary data as the element content of the page element.

[0170] In response to the element category being interactive, the test terminal determines the page operation on the target page element, obtains the corresponding response message based on the page operation, and uses this response message as the element content of the target page element. See also... Figure 4 405: The test terminal records operation logs. For interactive target page elements, the test terminal also records the generation timestamp of the page operation corresponding to the target page element, the page operation request generated by the page operation, etc., and records the timestamp and page operation request, etc., as the second verification content of the target page element. For example, if the page element is a share button in the second application page, the test terminal detects the trigger operation of the share button, generates a new share request based on the trigger operation, intercepts the share request, and encodes the share request according to the sequence number of the current network request. This process is similar to steps 301-302 and will not be described again here. The test terminal uses the response message corresponding to the received share request, the share request, and the target page element as the second verification content of the page element.

[0171] In response to the target page element being a dynamically displayed element, the test terminal detects a specific operation on the second application page. Upon receiving the specific operation, it displays the corresponding target page element based on that operation, and uses the specific operation and the corresponding icon of the target page element as the second verification content for that target page element. For example, if the target page element is a pause icon, in response to receiving a click operation on the playback screen on the second application page, the test terminal determines that the specified operation has been received, and uses the received specified operation and the pause icon generated after the screen is paused as the second verification content for that target page element.

[0172] It should be noted that the test terminal also records the position of each target page element, the timestamp of the request generation, the position and distance of the operation on the page, and other information. The position of each target page element, the timestamp of the request generation, and the position and distance of the operation on the page are also used as the verification content of the target page element.

[0173] Alternatively, the test terminal may record the second verification content corresponding to the target page element in the form of a script file. In this embodiment, the recording format of the verification content of the target page element is not specifically limited.

[0174] (A4) The test terminal generates the first verification content based on the second verification content of at least one target page element and the element identifier of at least one target page element.

[0175] The testing terminal combines the second verification content of at least one target page element and the element identifier of the target page element corresponding to the second verification content to form the first verification content. Accordingly, the testing terminal binds the element identifier to the second verification content to obtain the first verification content.

[0176] Step 305: The test terminal combines the second network request, the page data, and the first verification content into the test case.

[0177] In this step, please continue to refer to Figure 5 The test terminal matches the second network request, the page data of the second application page, and the first verification content to form the test case. Optionally, the test terminal generates a test case identifier for each test case, and this test case identifier corresponds one-to-one with the test case. Optionally, the test case identifier is the test case name filled in by the tester when generating the test case; or, it is a test case identifier automatically generated by an encoding algorithm. In this embodiment of the disclosure, the test case identifier is not specifically limited.

[0178] It should be noted that, optionally, after generating test cases, the test terminal stores the generated test cases locally; or, see [link to relevant documentation]. Figure 4 and 5 406: The test terminal sends the generated test cases to the test server, and the test server stores the test cases. In this embodiment of the disclosure, no specific limitation is made in this regard.

[0179] In this implementation, test cases are generated so that the software application can be tested directly by replaying the test cases during subsequent software testing, thereby improving the efficiency of software testing.

[0180] In this embodiment, during test case recording, a second network request sent by the test terminal and the corresponding page data are intercepted. At least one target page element in the page data is analyzed, and the first verification content of the at least one target page element is recorded to obtain test cases. This allows for the interception of the first network request during application testing, the acquisition of the corresponding page data and first verification content from the test cases, and the verification of the target page elements in the page data using the first verification content. Since the test terminal obtains the first verification content, it can automatically verify the target page elements based on the first verification data. This allows for application testing without the involvement of testers, thus avoiding the influence of tester subjectivity on test results and improving the accuracy of application testing.

[0181] After the test cases are recorded, the test terminal can test the application by selecting a test case for playback. The second verification content in the test case includes either the first element content of the target page element, or the second verification content includes the first element parameter of the target page element. Figure 8 This is a flowchart of an application testing method according to an exemplary embodiment. In this embodiment, the second verification content includes the content of the first element of the target page element as an example for illustration. Figure 8 As shown, the method includes the following steps:

[0182] Step 801: The test terminal intercepts the first network request.

[0183] The first network request is a network request sent by the test terminal to the business server during the replay of the test case, based on the network requests recorded in the test case. This step is similar to the process of the test terminal intercepting the second network request in step 301, and will not be described again here.

[0184] It's important to note that before this step, the test terminal needs to determine the test cases for the software testing. See [link / reference] Figure 9 The test terminal displays a list of test cases 901 for the test plugin. This list includes test case identifiers for multiple test cases. Correspondingly, the test terminal receives a selection operation from this list of test cases, determines the test case corresponding to this software test based on the selection operation, and replays the test case. Optionally, see [link to relevant documentation]. Figure 9The test case list displays a play button (902). In response to the terminal detecting that any play button is triggered, the test case corresponding to that button is selected. Additionally, the test terminal receives the number of test attempts input by the tester and replays the test case based on that number of attempts. Furthermore, the page includes options such as "Add" and "Download." The "Add" option directly triggers test case recording, while the "Download" option allows downloading other test cases from the test server.

[0185] Step 802: The test terminal determines the test case corresponding to the first network request based on the first network request.

[0186] See Figure 10 and Figure 11 After the test terminal intercepts the first network request, it determines the first request identifier of the first network request. 1101: Read the test case; During the test, 1102: Restart the application; Query the test case corresponding to the first network request according to the first request identifier, and replace the data obtained by the first network request from the business server with the data in the test case. This process is implemented through the following steps (1)-(2), including:

[0187] (1) The test terminal determines the first request identifier of the first network request.

[0188] The method for determining the first request identifier is similar to the process in step 302 where the test terminal determines the second request identifier of the second network request, and will not be repeated here.

[0189] (2) The test terminal determines the test case corresponding to the first request identifier from the request identifier and the test case identifier based on the first request identifier.

[0190] The request identifier corresponds one-to-one with the test case identifier. In this step, the test terminal determines the test case based on the first request identifier and the correspondence between the request identifier and the test case identifier.

[0191] The test terminal does not need to send the first network request to the business server. It can test the test cases corresponding to the first network request, thus preventing changes in the business content of the software after the software version is improved from affecting the test results.

[0192] Step 803: The test terminal obtains the page data of the first application page to be tested and the first verification content of the first application page from the test case. The first application page is the page corresponding to the first network request.

[0193] Optionally, the test case is a test case stored locally on the test terminal; or, the test case is a test case stored on the test server. Accordingly, in response to the test case being a test case stored on the test terminal for this instance, the test terminal, based on the first request identifier of the first network request and through the correspondence between the test case and the request identifier, calls the application page and verification content in the local test case according to the data interface. See also Figure 10 In response to the test case being a test case stored in the test server, the test terminal sends the first request identifier of the first network request to the test server. Based on the first request identifier, the test server determines the test case corresponding to the first request identifier and sends the page data of the first application page and the first verification content from that test case to the test terminal. See also... Figure 11 1103: The test terminal receives the page data and the first verification content of the first application page sent by the test server. The test terminal renders the page data on the display page to obtain the first application page.

[0194] Additionally, see Figure 10 In response to not receiving the returned page data, the test terminal reported an error.

[0195] Step 804: The test terminal obtains at least one target page element from the first application page based on the page data.

[0196] This step is similar to step (A2) in step 304, and will not be repeated here. See also Figure 11 1104: Extract at least one target page element from the first target page.

[0197] Step 805: The test terminal queries the second verification content corresponding to the element identifier from the first verification content based on the element identifier.

[0198] In response to the binding of the element identifier in the first verification content with the second verification content, the test terminal queries the second verification content corresponding to the element identifier from the first verification content based on the element identifier.

[0199] In this step, the test terminal determines the element identifier of the target page element. This process is similar to the process of generating the element identifier in step (A2) of step 304, and will not be described again here.

[0200] Step 806: The test terminal determines the element category of the target page element.

[0201] This step is similar to the process of the test terminal determining the element category of the target page element in step (A3) of step 304, and will not be described again here.

[0202] Step 807: The test terminal identifies the second element content of the target page element from the target page element according to the element category.

[0203] 1105: For different categories of page elements, the test terminal verifies the page element according to different test methods.

[0204] In one possible implementation, in response to the element category of the target page element being text, the content of the second element of the target page element is extracted from the target page element.

[0205] In another possible implementation, in response to the element category of the target page element being an image, the target page element is converted into binary data to obtain the second element content of the target page element.

[0206] In another possible implementation, in response to the element category of the page element being interactive, the page operation on the target page element is determined, and based on the page operation, the corresponding response message is obtained, and the response message is used as the second element content of the target page element.

[0207] Step 808: The test terminal verifies the target page element based on the content of the first element and the content of the second page, and obtains the test result.

[0208] The first page element is the content element included in the second verification content of the test case. If the content of the first element is the same as the content of the second element, the page element verification is considered successful; if the content of the first element is different from the content of the second element, the page element verification is considered unsuccessful. See also... Figure 12 The test terminal displays the test results through the test plugin's display page. In response to successful page element verification, the page element is marked with a first marker 1201; in response to failed page element verification, the page element is marked with a second marker. The first marker 1201 and the second marker 1202 are different markers, and can be set and changed as needed. In this embodiment, the first marker 1201 and the second marker 1202 are not specifically limited. For example, the first marker 1201 could be a green checkmark, and the second marker 1202 could be a red cross, etc.

[0209] It should be noted that in one possible implementation, during testing, the test terminal records each page element individually, marks completed page elements, and processes multiple page elements serially, moving from one page element to the next only after the previous one has been tested. In this implementation, the test terminal tests each page element serially, ensuring that each page element completes the test according to its element identifier, preventing test errors and improving the accuracy of software testing. In another possible implementation, the test terminal tests multiple page elements simultaneously, processing them in parallel. By testing multiple test software programs concurrently, the efficiency of software testing is improved.

[0210] Another point to note is, see [link / reference] Figure 11 1106: After completing the test, the test terminal will report the test results to the testers, who will then perform further operations on the test results.

[0211] Another point to note is that during the process of testing the application based on test cases on the test terminal, see [link / reference needed]. Figure 10 The application also establishes a communication connection with the business server to report heartbeats, informing the business server that the application is working properly.

[0212] In this embodiment of the disclosure, during application testing, a first network request is intercepted, and the page data and first verification content corresponding to the first network request are obtained from the test cases corresponding to the first network request. The target page element is verified by comparing it with the corresponding second verification content in the first verification content. Since the test terminal obtains the second verification content, it can automatically verify the target page element based on the second verification data. This allows for application testing without the involvement of testers, thus avoiding the influence of tester subjectivity on the test results and improving the accuracy of application testing.

[0213] Figure 13 This is a flowchart of an application testing method according to an exemplary embodiment. In this embodiment, the second verification content includes the first element parameter of the target page element as an example for illustration. Figure 13 As shown, the method includes the following steps:

[0214] Step 1301: The test terminal intercepts the first network request.

[0215] This step is similar to step 801, and will not be repeated here.

[0216] Step 1302: The test terminal determines the test case corresponding to the first network request based on the first network request.

[0217] This step is similar to step 802, and will not be repeated here.

[0218] Step 1303: The test terminal obtains the page data of the first application page to be tested and the first verification content of the first application page from the test case. The first application page is the page corresponding to the first network request.

[0219] This step is similar to step 803, and will not be repeated here.

[0220] Step 1304: The test terminal obtains at least one target page element from the first application page based on the page data.

[0221] This step is similar to step 804, and will not be repeated here.

[0222] Step 1305: The test terminal obtains the second element parameter of the target page element in the first application page.

[0223] The element parameters include parameters such as the position or size of the target page element. Accordingly, in this step, the test terminal determines information such as the position and size parameters of the target page element within the first application page.

[0224] Step 1306: The test terminal determines the degree of matching between the first element parameter and the second element parameter.

[0225] In this step, the test terminal determines the range of difference between the position or size indicated by the second element parameter and the preset position or size in the first element parameter. The smaller the range of difference, the higher the degree of matching; the larger the range of difference, the lower the degree of matching.

[0226] Step 1307: The test terminal determines the test result of the target page element based on the matching degree.

[0227] This step is similar to step 808. Therefore, it will not be repeated here.

[0228] In this embodiment of the disclosure, during application testing, a first network request is intercepted, and the page data and first verification content corresponding to the first network request are obtained from the test cases corresponding to the first network request. The target page element is verified by comparing it with the corresponding second verification content in the first verification content. Since the test terminal obtains the second verification content, it can automatically verify the target page element based on the second verification data. This allows for application testing without the involvement of testers, thus avoiding the influence of tester subjectivity on the test results and improving the accuracy of application testing.

[0229] Figure 14 A block diagram of an application testing apparatus provided according to an exemplary embodiment. See also Figure 14 The device includes:

[0230] Interception module 1401 is used to intercept the first network request;

[0231] The first determining module 1402 is used to determine the test cases corresponding to the first network request based on the first network request.

[0232] The first acquisition module 1403 is used to acquire the page data of the first application page to be tested and the first verification content of the first application page from the test case. The first application page is the page corresponding to the first network request.

[0233] The second acquisition module 1404 is used to acquire at least one target page element in the first application page based on the page data.

[0234] The second determining module 1405 is used to determine the second verification content corresponding to the target page element from the first verification content based on the element identifier of the target page element.

[0235] The verification module 1406 is used to verify the target page element according to the second verification content and obtain the test result of the target page element.

[0236] In one possible implementation, the second verification content includes the content of the first element of the target page element; the verification module 1406 includes:

[0237] The first determining unit is used to determine the element category of the target page element;

[0238] The first identification unit is used to identify the second element content of the target page element from the target page element according to the element category;

[0239] The verification unit is used to verify the target page element based on the content of the first element and the content of the second element, and obtain the test result.

[0240] In another possible implementation, the first identification unit is used to extract the second element content of the target page element in response to the element category of the target page element being text.

[0241] The first identification unit is used to convert the target page element into binary data in response to the element category of the target page element being an image, thereby obtaining the second element content of the target page element;

[0242] The first identification unit is used to determine the page operation on the target page element in response to the element category being interactive, obtain the response message corresponding to the page operation based on the page operation, and use the response message as the second element content of the target page element.

[0243] In another possible implementation, the second verification content includes the first element parameter of the target page element; the verification module 1406 includes:

[0244] The acquisition unit is used to acquire the second element parameter of the target page element in the first application page;

[0245] The second determining unit is used to determine the degree of matching between the first element parameter and the second element parameter;

[0246] The second determining unit is used to determine the test result of the target page element based on the degree of matching.

[0247] In another possible implementation, the device further includes:

[0248] The startup module is used to launch the test plugin, which intercepts the application's second network request.

[0249] The sending module is used to send the second network request to the business server corresponding to the application.

[0250] The receiving module is used to receive the page data of the second application page corresponding to the second network request returned by the service server;

[0251] The generation module is used to generate the first verification content based on the data on this page;

[0252] The component module is used to assemble the second network request, the page data, and the first verification content into the test case.

[0253] In another possible implementation, the generation module includes:

[0254] A rendering unit is used to render the second application page based on the page data.

[0255] The third determining unit is used to determine at least one target page element in the second application page;

[0256] The second identification unit is used to identify the element content of the target page element and use the element content as the second verification content of the target page element.

[0257] The generation unit is configured to generate the first verification content based on at least one second verification content of the target page element and at least one element identifier of the target page element.

[0258] In another possible implementation, the generation unit is used to bind the element identifier with the second verification content to obtain the first verification content;

[0259] The second determining module 1405 is used to query the second verification content corresponding to the element identifier from the first verification content based on the element identifier.

[0260] In this embodiment of the disclosure, during application testing, a first network request is intercepted, and the page data and first verification content corresponding to the first network request are obtained from the test cases corresponding to the first network request. The target page element is verified by comparing it with the corresponding second verification content in the first verification content. Since the test terminal obtains the second verification content, it can automatically verify the target page element based on the second verification data. This allows for application testing without the involvement of testers, thus avoiding the influence of tester subjectivity on the test results and improving the accuracy of application testing.

[0261] It should be noted that the application testing device provided in the above embodiments is only illustrated by the division of the above functional modules during application testing. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the application testing device and the application testing method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0262] Figure 15A structural block diagram of a test terminal 101 provided in an exemplary embodiment of this application is shown. The test terminal 101 can be a portable mobile terminal, such as a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. The test terminal 101 may also be referred to as a user device, portable terminal, laptop terminal, desktop terminal, or other names.

[0263] Typically, the test terminal 101 includes a processor 10101 and a memory 10102.

[0264] Processor 10101 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 10101 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 10101 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 10101 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 10101 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0265] The memory 10102 may include one or more computer-readable storage media, which may be non-transitory. The memory 10102 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 10102 are used to store at least one program code, which is executed by the processor 10101 to implement the application testing method provided in the method embodiments of this application.

[0266] In some embodiments, the test terminal 101 may also optionally include: a peripheral device interface 10103 and at least one peripheral device. The processor 10101, memory 10102, and peripheral device interface 10103 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 10103 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of: a radio frequency circuit 10104, a display screen 10105, a camera assembly 10106, an audio circuit 10107, and a power supply 10109.

[0267] Peripheral interface 10103 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 10101 and memory 10102. In some embodiments, processor 10101, memory 10102 and peripheral interface 10103 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 10101, memory 10102 and peripheral interface 10103 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.

[0268] The radio frequency (RF) circuit 10104 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 10104 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 10104 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 10104 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 10104 can communicate with other terminals through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 10104 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.

[0269] Display screen 10105 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 10105 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 10101 for processing. In this case, display screen 10105 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 10105, disposed on the front panel of test terminal 101; in other embodiments, there may be at least two display screens, disposed on different surfaces of test terminal 101 or in a folded design; in still other embodiments, display screen 10105 may be a flexible display screen, disposed on a curved or folded surface of test terminal 101. Furthermore, display screen 10105 may also be configured as a non-rectangular irregular shape, i.e., a non-rectangular screen. The display screen 10105 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

[0270] The camera assembly 10106 is used to acquire images or videos. Optionally, the camera assembly 10106 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal, and the rear-facing camera is located on the back of the terminal. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 10106 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm-light flash and a cool-light flash, which can be used for light compensation at different color temperatures.

[0271] The audio circuit 10107 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting the sound waves into electrical signals that are input to the processor 10101 for processing, or input to the radio frequency circuit 10104 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each positioned at a different location on the test terminal 101. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert the electrical signals from the processor 10101 or the radio frequency circuit 10104 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 10107 may also include a headphone jack.

[0272] Power supply 10109 is used to power the various components in test terminal 101. Power supply 10109 can be AC ​​power, DC power, a disposable battery, or a rechargeable battery. When power supply 10109 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, and a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0273] In some embodiments, the test terminal 101 further includes one or more sensors 10110. The one or more sensors 10110 include, but are not limited to: an acceleration sensor 10111, a gyroscope sensor 10112, a pressure sensor 10113, an optical sensor 10115, and a proximity sensor 10116.

[0274] Accelerometer 10111 can detect the magnitude of acceleration on the three coordinate axes of a coordinate system established by test terminal 101. For example, accelerometer 10111 can be used to detect the components of gravitational acceleration on the three coordinate axes. Processor 10101 can control display screen 10105 to display the user interface in either a landscape or portrait view based on the gravitational acceleration signal acquired by accelerometer 10111. Accelerometer 10111 can also be used for games or for acquiring user motion data.

[0275] The gyroscope sensor 10112 can detect the orientation and rotation angle of the test terminal 101. The gyroscope sensor 10112 can work in conjunction with the accelerometer sensor 10111 to acquire the user's 3D movements on the test terminal 101. Based on the data acquired by the gyroscope sensor 10112, the processor 10101 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.

[0276] The pressure sensor 10113 can be disposed on the side frame of the test terminal 101 and / or on the lower layer of the display screen 10105. When the pressure sensor 10113 is disposed on the side frame of the test terminal 101, it can detect the user's grip signal on the test terminal 101, and the processor 10101 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor 10113. When the pressure sensor 10113 is disposed on the lower layer of the display screen 10105, the processor 10101 can control the operable controls on the UI interface based on the user's pressure operation on the display screen 10105. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.

[0277] An optical sensor 10115 is used to collect ambient light intensity. In one embodiment, a processor 10101 can control the display brightness of a display screen 10105 based on the ambient light intensity collected by the optical sensor 10115. Specifically, when the ambient light intensity is high, the display brightness of the display screen 10105 is increased; when the ambient light intensity is low, the display brightness of the display screen 10105 is decreased. In another embodiment, the processor 10101 can also dynamically adjust the shooting parameters of a camera assembly 10106 based on the ambient light intensity collected by the optical sensor 10115.

[0278] The proximity sensor 10116, also known as a distance sensor, is typically installed on the front panel of the test terminal 101. The proximity sensor 10116 is used to detect the distance between the user and the front of the test terminal 101. In one embodiment, when the proximity sensor 10116 detects that the distance between the user and the front of the test terminal 101 is gradually decreasing, the processor 10101 controls the display screen 10105 to switch from a screen-on state to a screen-off state; when the proximity sensor 10116 detects that the distance between the user and the front of the test terminal 101 is gradually increasing, the processor 10101 controls the display screen 10105 to switch from a screen-off state to a screen-on state.

[0279] Those skilled in the art will understand that Figure 15 The structure shown does not constitute a limitation on the test terminal 101, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0280] In an exemplary embodiment, a computer-readable storage medium is also provided, storing at least one piece of program code. This at least one piece of program code is loaded and executed by a server to implement the application testing method described in the above embodiments. The computer-readable storage medium can be a memory. For example, it can be a ROM (Read-Only Memory), RAM (Random Access Memory), CD-ROM (Compact Disc Read-Only Memory), magnetic tape, floppy disk, and optical data storage device, etc.

[0281] In an exemplary embodiment, a computer program product or computer program is also provided, which includes computer program code stored in a computer-readable storage medium. A processor of a computer device reads the computer program code from the computer-readable storage medium and executes the computer program code, causing the computer device to perform the operations performed in the application testing method described above.

[0282] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program related to program code. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0283] The above are merely optional embodiments of this disclosure and are not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the protection scope of this disclosure.

Claims

1. An application testing method, characterized in that, The method includes: The recording process is executed to obtain recorded test cases that can be used to test the application. The recording process includes: activating a test plugin to intercept a second network request from an application; receiving page data of a second application page corresponding to the second network request returned by the business server corresponding to the application; using the test plugin to intercept the page data of the second application page during the recording process, generating first verification content corresponding to the second network request, specifically including: rendering the second application page based on the page data of the second application page; determining at least one target page element in the second application page; identifying the element content of the target page element and using the element content as the second verification content of the target page element; generating the first verification content based on the second verification content of at least one target page element and the element identifier of at least one target page element; and combining the second network request, the page data of the second application page, and the first verification content into a test case. After the test cases are recorded, the recorded test cases are called to execute the test process to test the application. The testing process includes: intercepting a first network request; determining a test case corresponding to the first network request based on the first network request; obtaining page data of a first application page to be tested and first verification content of the first application page from the test case, wherein the first application page is the page corresponding to the first network request; obtaining at least one target page element in the first application page based on the page data of the first application page; determining second verification content corresponding to the target page element from the first verification content based on the element identifier of the target page element; and verifying the target page element based on the second verification content to obtain a test result for the target page element. The second verification content includes the first element content of the target page element; the step of verifying the target page element according to the second verification content to obtain the test result of the target page element includes: Determine the element category of the target page element; based on the element category, identify the second element content of the target page element from the target page element; verify the target page element based on the first element content and the second element content to obtain the test result.

2. The method according to claim 1, characterized in that, The step of identifying the second element content of the target page element from the target page element according to the element category includes at least one of the following methods: In response to the target page element being of the text type, the second element content of the target page element is extracted from the target page element; In response to the target page element being of the image type, the target page element is converted into binary data to obtain the second element content of the target page element; In response to the fact that the element category of the page element is interactive, a page operation on the target page element is determined, and a response message corresponding to the page operation is obtained based on the page operation. The response message is then used as the second element content of the target page element.

3. The method according to claim 1, characterized in that, The second verification content includes the first element parameter of the target page element; the step of verifying the target page element according to the second verification content to obtain the test result of the target page element includes: Obtain the second element parameter of the target page element in the first application page; Determine the degree of matching between the first element parameter and the second element parameter; The test result of the target page element is determined based on the degree of matching.

4. The method according to claim 1, characterized in that, Before receiving the page data of the second application page corresponding to the second network request returned by the business server corresponding to the application, the method further includes: The second network request is sent to the business server corresponding to the application.

5. The method according to claim 1, characterized in that, The step of generating the first verification content based on the second verification content of at least one of the target page elements and the element identifier of at least one of the target page elements includes: The element identifier is bound to the second verification content to obtain the first verification content; The step of determining the second verification content corresponding to the target page element from the first verification content based on the element identifier of the target page element includes: Based on the element identifier, query the second verification content corresponding to the element identifier from the first verification content.

6. An application testing device, characterized in that, The device includes: The following modules are used to execute the recording process and obtain recorded test cases that can be used to test the application: The startup module is used to launch the test plugin, which intercepts the application's second network request. The receiving module is used to receive page data of the second application page corresponding to the second network request returned by the business server corresponding to the application. The generation module is used to capture the page data of the second application page during the recording process through the test plugin and generate the first verification content corresponding to the second network request; The generation module specifically includes: A rendering unit is used to render the second application page based on the page data of the second application page; The third determining unit is used to determine at least one target page element in the second application page; The second identification unit is used to identify the element content of the target page element and use the element content as the second verification content of the target page element. The generation unit is configured to generate the first verification content based on the second verification content of at least one target page element and the element identifier of at least one target page element; The component module is used to combine the second network request, the page data of the second application page, and the first verification content into test cases; The following modules are used to execute the test process by calling the recorded test cases after the test cases have been recorded, in order to test the application: The interception module is used to intercept the first network request; The first determining module is used to determine the test cases corresponding to the first network request based on the first network request. The first acquisition module is used to acquire page data of the first application page to be tested and the first verification content of the first application page from the test case, wherein the first application page is the page corresponding to the first network request; The second acquisition module is used to acquire at least one target page element in the first application page based on the page data of the first application page. The second determining module is used to determine the second verification content corresponding to the target page element from the first verification content based on the element identifier of the target page element. The verification module is used to verify the target page element according to the second verification content and obtain the test result of the target page element; The second verification content includes the content of the first element of the target page element; the verification module includes: The first determining unit is used to determine the element category of the target page element; The first identification unit is used to identify the second element content of the target page element from the target page elements according to the element category; The verification unit is used to verify the target page element based on the content of the first element and the content of the second element, and obtain the test result.

7. The apparatus according to claim 6, characterized in that, The first identification unit is configured to perform at least one of the following: In response to the target page element being of the text type, the second element content of the target page element is extracted from the target page element; In response to the target page element being of the image type, the target page element is converted into binary data to obtain the second element content of the target page element; In response to the fact that the element category of the page element is interactive, a page operation on the target page element is determined, and a response message corresponding to the page operation is obtained based on the page operation. The response message is then used as the second element content of the target page element.

8. The apparatus according to claim 6, characterized in that, The second verification content includes the first element parameter of the target page element; the verification module includes: The acquisition unit is used to acquire the second element parameter of the target page element in the first application page; The second determining unit is used to determine the degree of matching between the first element parameter and the second element parameter; and to determine the test result of the target page element based on the degree of matching.

9. The apparatus according to claim 6, characterized in that, The device further includes a transmitting module for: The second network request is sent to the business server corresponding to the application.

10. The apparatus according to claim 6, characterized in that, The generation unit is used to bind the element identifier with the second verification content to obtain the first verification content; The second determining module is used to query the second verification content corresponding to the element identifier from the first verification content based on the element identifier.

11. A test terminal, characterized in that, The test terminal includes a processor and a memory, the memory storing at least one piece of program code, which is loaded and executed by the processor to implement the application testing method as described in any one of claims 1-5.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one piece of program code, which is loaded and executed by a processor to implement the application testing method as described in any one of claims 1-5.

13. A computer program product comprising computer program code stored in a computer-readable storage medium, wherein a processor of a computer device reads the computer program code from the computer-readable storage medium and executes the computer program code, causing the computer device to perform the application testing method as described in any one of claims 1-5.