Page testing method and device, storage medium, electronic equipment and program product

By constructing test cases and automatically controlling the network status switching of the device under test, combined with page images and network status data, the problems of low efficiency and insufficient reliability in traditional weak network testing are solved, and efficient and reliable automated testing is achieved.

CN122152683APending Publication Date: 2026-06-05HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD
Filing Date
2026-01-15
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Traditional weak network testing solutions rely on manual operation, resulting in low testing efficiency and unreliable results, and cannot achieve automation and continuous integration.

Method used

By constructing test operation sequences in test cases, the system automatically controls the device under test to perform interactive operations during network state switching, and determines the test results based on the current page image and network state data, reducing manual intervention.

Benefits of technology

It automates application page testing in weak network environments, improves testing efficiency, and reduces reliance on manual operation by supporting the credibility of test results with data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122152683A_ABST
    Figure CN122152683A_ABST
Patent Text Reader

Abstract

The application discloses a page test method, a page test device, a computer readable storage medium, an electronic device and a computer program product. The method comprises the following steps: obtaining target test case data of an application page to be tested; in response to switching a network state of a device under test from a first network state to a second network state, controlling the device under test to perform at least one interactive operation according to a test operation sequence; obtaining a current page image of the application page to be tested during or after the process of controlling the device under test to perform the at least one interactive operation; and determining a first test result corresponding to the application page to be tested according to the current page image, and / or obtaining target network state data of the device under test during the network state switching process and determining a second test result corresponding to the device under test according to the target network state data. Thus, the application can realize automatic testing of the device under test loading and displaying the application page to be tested under the second network state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of game technology, specifically to a page testing method, a page testing device, a computer-readable storage medium, an electronic device, and a computer program product. Background Technology

[0002] In traditional weak network testing methods, testers often need to manually control the device's application (App) to enter a designated page after configuring the device's network environment, and then manually verify whether the page loads correctly to complete the test. However, because this testing method relies on manual operation, the testing efficiency is difficult to guarantee, and the test results are obtained from the tester's subjective judgment, making it difficult to guarantee their reliability. Summary of the Invention

[0003] This application provides a page testing method, page testing device, computer-readable storage medium, electronic device, and computer program product. By constructing a test operation sequence for displaying the page of the application under test in the test cases, the dependence of the display of the application under test page on manual operation is reduced. Furthermore, the test results can be determined by the page image of the application under test page in a second network state and / or the target network state of the device under test, so that the test results can be obtained without the subjective judgment of the tester, thereby ensuring the reliability of the test results.

[0004] On one hand, embodiments of this application provide a page testing method, the method comprising: Obtain target test case data for the application page under test, wherein the test cases include a test operation sequence, the test operation sequence being used to instruct the device under test to perform at least one interactive operation related to displaying the application page under test; In response to switching the network state of the device under test from a first network state to a second network state, the device under test is controlled to perform the at least one interactive operation according to the test operation sequence, wherein the network quality of the first network state is higher than the network quality of the second network state; During or after controlling the device under test to perform the at least one interactive operation, the current page image of the application page under test is acquired, and a first test result corresponding to the application page under test is determined based on the current page image; and / or, The target network status data of the device under test during the network state switching process is obtained, and the second test result corresponding to the device under test is determined based on the target network status data.

[0005] On the other hand, embodiments of this application provide a page testing apparatus, the apparatus comprising: The acquisition module is used to acquire target test case data of the application page under test, wherein the test case includes a test operation sequence, and the test operation sequence is used to instruct the device under test to perform at least one interactive operation related to displaying the application page under test; A control module is configured to respond to switching the network state of the device under test from a first network state to a second network state, and to control the device under test to perform the at least one interactive operation according to the test operation sequence, wherein the network quality of the first network state is higher than the network quality of the second network state; The test result determination module is used to acquire the current page image of the application page under test during or after controlling the device under test to perform the at least one interactive operation, and determine the first test result corresponding to the application page under test based on the current page image; and / or, acquire the target network state data of the device under test during the network state switching process, and determine the second test result corresponding to the device under test based on the target network state data.

[0006] On the other hand, embodiments of this application provide a computer-readable storage medium storing a computer program adapted for loading by a processor to execute the page testing method as described in any of the above embodiments.

[0007] On the other hand, embodiments of this application provide an electronic device, which includes a processor and a memory. The memory stores a computer program, and the processor executes the page testing method as described in any of the above embodiments by calling the computer program stored in the memory.

[0008] On the other hand, embodiments of this application provide a computer program product, including computer instructions, which, when executed by a processor, implement the page testing method as described in any of the above embodiments.

[0009] The page testing method, page testing apparatus, computer-readable storage medium, electronic device, and computer program product provided in this application embodiment can acquire target test case data of the application page under test, and in response to switching the network state of the device under test from a first network state to a second network state, control the device under test to perform at least one interactive operation according to a test operation sequence, and acquire the current page image of the application page under test during or after controlling the device under test to perform at least one interactive operation, and determine the first test result corresponding to the application page under test based on the current page image, and / or acquire the target network state of the device under test during the network state switching process. The system collects data and determines the second test result for the device under test (DUT) based on the target network status data. This automates the testing of the DUT loading and displaying the application page under test in the second network state. Compared to the traditional approach where testers manually operate the DUT to load and display the application page and then manually verify whether the application page is loading correctly, this method reduces the reliance on manual operation, thereby improving testing efficiency to some extent. Furthermore, the test results can be determined based on the current page image and / or target network status data, ensuring that the test results are supported by data and are reliable. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of this application, 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 application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 This is a flowchart illustrating the page testing method provided in an embodiment of this application.

[0012] Figure 2 This is a flowchart illustrating the page testing method provided in an embodiment of this application.

[0013] Figure 3 This is a flowchart illustrating the page testing method provided in an embodiment of this application.

[0014] Figure 4 This is a flowchart illustrating the page testing method provided in an embodiment of this application.

[0015] Figure 5 This is a flowchart illustrating the page testing method provided in an embodiment of this application.

[0016] Figure 6 This is a schematic diagram of the structure of the page testing device provided in an embodiment of this application.

[0017] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0019] This application provides a page testing method, a page testing apparatus, a computer-readable storage medium, an electronic device, and a computer program product. Specifically, the page testing method of this application can be executed by an electronic device, which can be a terminal or a server. The terminal can be a smartphone, tablet, laptop, smart TV, wearable smart device, smart vehicle terminal, etc. The terminal can also include a client, which can be a browser client, instant messaging client, or mini-program, etc. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0020] It should be noted that, in this embodiment, the executing entity of the page testing method can be a terminal device or a server. The terminal device can be a local terminal device or a client device in a cloud platform. This embodiment does not limit the type of executing entity.

[0021] For example, when this page testing method runs on a terminal device, the terminal device may include a display screen and a processor. The display screen is used to present a graphical user interface (GUI) and receive instructions generated by the user interacting with the GUI. The processor is used to store applications, generate the GUI, respond to instructions, and control the display of the GUI on the display screen. When the user operates the GUI through the display screen, the GUI can control the local content of the terminal device in response to the received operation instructions. The terminal device can provide the GUI to the user in various ways, such as rendering it on the terminal device's display screen or presenting the GUI through holographic projection.

[0022] For example, when this page testing method runs on a server, it can be implemented and executed based on a cloud system. The cloud system includes servers and client devices. The application's runtime and the graphical user interface (GUI) presentation are separate. The storage and execution of the page testing method are completed on the server. The GUI presentation, however, is completed on the client. The client is primarily used for data reception, transmission, and GUI presentation. For example, the client can be a display device with data transmission capabilities located close to the user, such as a mobile terminal, television, computer, PDA, personal digital assistant, or head-mounted display. However, the terminal device for data processing is the server in the cloud. During execution, the user operates the client to send instructions to the server. The server executes the instructions, encodes and compresses the GUI data, returns it to the client via the network, and finally, the client decodes and outputs the GUI.

[0023] It should be noted that, in this embodiment, the executing entity of the page testing method can be a terminal device or a server. The terminal device can be a local terminal device or a client device in the aforementioned cloud system. This embodiment does not limit the type of executing entity.

[0024] The technical solution of this application will be described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0025] In related technologies, for the weak network settings of the tested mobile phone, testers manually configure the phone's network proxy status using packet capture proxy tools such as Charles, or adjust the phone's network download speed through the network download rate limit function in the phone's developer options, thereby creating a weak network environment. Understandably, after controlling the tested device such as the mobile phone in this environment, the loading performance of pages within applications (Apps) on the device can be verified under weak network conditions.

[0026] It's worth noting that weak network loading verification typically employs a test case accumulation approach, recording the page scenarios to be tested. Furthermore, after setting up the corresponding network environment, testers manually enter the designated page and wait for a period before manually judging whether the page loads correctly. In this traditional approach, the weak network setup relies on manual operation; each test case requires the tester's personal involvement, and network parameters must be manually configured on the proxy tool or device before each test, ensuring the accuracy of the mobile device's proxy settings. The entire process is repetitive, tedious, and prone to errors.

[0027] Furthermore, because the entire process requires manual intervention, this solution cannot be integrated into Continuous Integration / Continuous Deployment (CI / CD) workflows, making it difficult to achieve unattended automated testing and resulting in continuous investment and waste of manpower. Moreover, the execution of test cases for weak network loading verification also relies on manual operation, with page loading status entirely dependent on the tester's subjective judgment, easily leading to resource waste due to the repetitive manual investment in this task. Additionally, the lack of traceable records of test case execution and page loading performance means that if a problem needs to be traced back, the corresponding single test case must be re-executed, resulting in redundant resource consumption.

[0028] For the above issues, please refer to Figure 1 , Figure 1 This is a flowchart illustrating a page testing method provided in an embodiment of this application. It should be noted that the steps shown may be executed in a logical order different from that shown in the flowchart. The method includes: 110: Obtain the target test case data for the application page under test, wherein the test cases include a test operation sequence, and the test operation sequence is used to instruct the device under test to perform at least one interactive operation related to displaying the application page under test; 120: In response to switching the network state of the device under test from a first network state to a second network state, according to the test operation sequence, control the device under test to perform at least one interactive operation, wherein the network quality of the first network state is higher than the network quality of the second network state; 130: During or after controlling the device under test to perform at least one interactive operation, acquire the current page image of the application under test, and determine the first test result corresponding to the application under test page based on the current page image; and / or, 140: Obtain the target network status data of the device under test during the network status switching process, and determine the second test result corresponding to the device under test based on the target network status data.

[0029] Specifically, in application page testing under weak network conditions, traditional testing methods rely on manual configuration for network environment switching, which is cumbersome. Furthermore, manual interaction is required to trigger page loading, leading to low efficiency. The determination of page loading results and the device's identification and verification of network status changes both depend on subjective human judgment, making reliability difficult to guarantee. Therefore, this application provides an automated method for testing and verifying application pages under weak network conditions. The electronic device first acquires target test cases containing interactive operation instructions. Then, the network of the device under test is switched from a high-quality state to a low-quality state (i.e., from a first network state to a second network state). Subsequently, the device is controlled to execute interactive operations and capture page images according to the test cases. Simultaneously, device network data is collected during the network state switching process. Finally, the test results are determined based on the page images and / or device network status data, achieving automation and comprehensive verification of the testing process.

[0030] In some embodiments, the application page to be tested can be understood as the application interface that needs to be tested for loading performance under weak network conditions, and can be any functional page in the application, such as the homepage, search page, details page, etc.

[0031] In some embodiments, target test case data can be understood as a predefined set of structured data used to guide / guide electronic devices in testing.

[0032] In some embodiments, the test operation sequence can be understood as a series of ordered instructions used to define the interactive operations performed by the device under test related to displaying the application page under test, such as page clicks, application restarts, and starting or stopping content recording.

[0033] In some embodiments, the device under test can be understood as a terminal device, such as a mobile phone or tablet computer, that has the application under test installed to perform test operations.

[0034] In some embodiments, the first network state can be understood as a network environment with good network quality, characterized by high bandwidth, low latency, and low packet loss rate.

[0035] In some embodiments, the second network state includes a network environment with uplink and downlink data rates higher than 250 kb / s and a packet loss rate lower than 5%.

[0036] In some embodiments, the second network state can be understood as a network environment with network quality lower than that of the first network state, i.e., a weak network environment, which is usually characterized by low bandwidth, high latency, and high packet loss rate, and is used to simulate the network experience of users in scenarios such as subways, elevators, and remote areas.

[0037] In some embodiments, the second network state may be a network environment with uplink and downlink data rates below 250kb / s and a packet loss rate above 5%.

[0038] In some embodiments, the current page image can be understood as image data obtained by taking a screenshot of the application page under test by the device under test during or after performing a test interaction operation, which can reflect the actual loading status of the application page under test.

[0039] In some embodiments, the first test result can be understood as a test result derived from the analysis of the current page image, which can characterize whether the loading of the application page under test is normal and whether the expected display effect is achieved in the second network state.

[0040] In some embodiments, target network status data can be understood as network-related data collected by the device under test through its own network detection points, log recording, and other functions during the process of switching the network status from a first network status to a second network status. This includes information such as the time point of network status change, network type, and network parameters. The network type may include 2G, 3G, no network, etc., and the network parameters may include bandwidth, packet loss rate, etc.

[0041] In some embodiments, the second test result can be understood as a test result derived from the analysis of the target network state data, which can be used to determine whether the device under test can recognize the switching of network state.

[0042] In some embodiments, the second test result can characterize whether the device under test can promptly recognize that its own network state has switched to the second network state.

[0043] To more clearly illustrate the page testing method provided in the embodiments of this application, please refer to the following exemplary description: First, the electronic device reads the target test case data for the application page under test from the preset test case storage medium, such as reading the target test case data from an Excel spreadsheet or database, and parses the test operation sequence contained in the target test case data to determine the interactive operation that the device under test needs to perform, such as clicking a specific location or restarting the application.

[0044] Subsequently, the electronic device controls the network status of the tested device to switch from a high-quality first network status to a low-quality second network status through a network control module or a network packet capture proxy tool, and records the switching time.

[0045] Then, after the network state switch is completed, the electronic device controls the device under test to automatically execute various interactive operations according to the parsed test operation sequence, so as to trigger the loading process of the application page under test.

[0046] Subsequently, during or after the operation is completed, the current page image of the application under test is captured using a screenshot tool; and / or, target network status data generated by the device under test during network status switching is collected, such as network detection logs and network status reporting information.

[0047] Finally, based on the current page image, the page loading status is analyzed to determine whether it meets expectations, thus determining the first test result; and / or, the target network status data is parsed to verify whether the device accurately identifies the network status switch, thereby determining the second test result. This completes the testing and evaluation of the device under test displaying the application page in the second network state.

[0048] Thus, in this embodiment, target test case data of the application page under test can be obtained, and in response to switching the network state of the device under test from a first network state to a second network state, the device under test is controlled to perform at least one interactive operation according to the test operation sequence. During or after controlling the device under test to perform at least one interactive operation, the current page image of the application page under test is obtained, and a first test result corresponding to the application page under test is determined based on the current page image. Alternatively, target network state data of the device under test during the network state switching process is obtained, and a second test result corresponding to the device under test is determined based on the target network state data. This achieves automated testing of the device under test loading and displaying the application page under test in the second network state. Compared to the traditional approach where testers manually operate the device under test to load and display the application page, and then manually verify whether the application page loading is normal, this reduces the reliance on manual operation in the testing process, thereby improving testing efficiency to some extent. Furthermore, the test results can be determined based on the current page image and / or target network state data, ensuring data support and reliability of the test results.

[0049] In some embodiments provided in this application, step 130, determining the first test result corresponding to the application page to be tested based on the current page image, includes: inputting the current page image into a pre-trained first image processing model so that the first image processing model can identify the loading status of the application page to be tested based on the current page image; when it is identified that the application page to be tested has not finished loading, the first test result is determined to be unsuccessful.

[0050] Specifically, traditional weak network testing relies on manual observation of page images to determine the loading status. This results in significant subjective bias, low efficiency, and susceptibility to the tester's experience and condition, leading to insufficient reliability of the test results. Therefore, in some embodiments provided in this application, the electronic device can utilize a pre-trained first image processing model to analyze the current page image of the application under test acquired during the testing process. The first image processing model identifies the page loading status; if the identification result indicates that loading is incomplete, the first test result is directly determined as a failure, thus automating and standardizing page loading status identification and test result determination.

[0051] In some embodiments, the first image processing model can be understood as an artificial intelligence model that has been pre-trained in a specific scenario and has the ability to recognize the loading state of an application page, and can have capabilities such as image feature extraction and image feature analysis.

[0052] In some embodiments, the first image processing model can be understood as a large language model (LLM) with image processing capabilities.

[0053] In some embodiments, the loading status of the application page under test can be divided into two categories: loading complete and loading incomplete.

[0054] In some embodiments, when the application page under test is not fully loaded, the current page image of the application page under test may have features such as partial image blurring, blank areas, loading placeholders, and error indicators. Therefore, the first image processing model in this embodiment can identify whether the current page image has features such as partial image blurring, blank areas, loading placeholders, and error indicators, and output that the application page under test is not fully loaded when these features are identified, and conversely, output that the application page under test is fully loaded when these features are not identified.

[0055] To more clearly illustrate the page testing method provided in the embodiments of this application, please refer to the following exemplary description: During or after the device under test performs interactive operations related to the display of the application page under test according to the test operation sequence, the electronic device will automatically collect the current page image of the application page under test. This image is the core data basis for subsequent loading status recognition. It is necessary to fully present the visual features of the current page to ensure that the model can obtain sufficient analysis basis.

[0056] Subsequently, the electronic device inputs the captured image of the current page into the pre-trained first image processing model.

[0057] After receiving image data, the model can perform image preprocessing operations, including noise reduction, image normalization, and resolution adjustment, to eliminate interference factors that may occur during image acquisition and improve the recognition of image features.

[0058] Next, the model uses its built-in feature extraction module to extract key visual features related to the page loading status from the preprocessed image, such as blank areas, mosaics, blurred blocks, gray filled boxes, rotating loading icons, and loading error indicators (such as error text like "Error" or "404", or icons like broken links or network errors).

[0059] Finally, the model compares and matches the extracted key features with a pre-built feature database. This feature database contains a large number of typical feature samples from different applications and pages under various loading states. By calculating the similarity and matching degree between the current image features and the sample features, and combining this with a preset judgment threshold, the model infers the loading state of the current page and outputs the first test result. Thus, in this embodiment, the current page image can be input into a pre-trained first image processing model, enabling the model to identify the loading status of the application page under test based on the current image. When the model detects that the application page is not fully loaded, the first test result is determined to be a failure. This automates the page loading status identification process, eliminating the need for manual identification and further reducing manual intervention in the page testing process. It also avoids the subjective bias and inefficiency associated with manual identification, thereby ensuring the reliability of the first test result to a certain extent. Furthermore, because the page loading status is identified through the first image processing model, the timeliness and effectiveness of the identification are guaranteed.

[0060] In some embodiments provided in this application, the test cases also include an expected page image, which is the image of the application page under test when it is loaded. Furthermore, the page testing method further includes: when it is identified that the application page under test has been loaded successfully, inputting the expected page image and the current page image into a pre-trained second image processing model, so that the second image processing model can identify whether the current page image is similar to the expected page image, and when it is identified that the current page image is similar to the expected page image, determining that the first test result is passed, and when it is identified that the current page image is not similar to the expected page image, determining that the first test result is failed.

[0061] Specifically, considering the possibility that the first image processing model may identify that the page has been successfully loaded, but the page displayed on the device under test is not the target page, in some embodiments provided in this application, after the first image processing model identifies that the page has been successfully loaded, an automated similarity comparison can be performed between the current page image and the expected page image using a second image processing model and a preset expected page image in the test case. Based on the comparison result, it is determined whether the current page is the target page. If they are similar, the first test result is passed; if they are not similar, the first test result is failed, thereby automating the target consistency verification of the loaded page.

[0062] In some embodiments, the expected page image can be understood as a predefined standard image of the application page under test in the test case when it is fully loaded and functioning normally, and can be used as a benchmark to determine whether the current page is the target page.

[0063] In some embodiments, the second image processing model can be understood as an artificial intelligence model with image similarity comparison capabilities, which can extract visual features such as element layout, color distribution, and content details of two images, and thereby calculate the similarity between the two images, and output the judgment result of whether the two images are similar.

[0064] In some embodiments, the second image processing model and the first image processing model are the same large language model (LLM) with image processing capabilities.

[0065] In some embodiments, when the similarity between the expected page image and the current page image is greater than a threshold, the second image processing model determines that the expected page image and the current page image are similar; when the similarity between the expected page image and the current page image is less than or equal to the threshold, the second image processing model determines that the expected page image and the current page image are not similar. The threshold can be 0.90, 0.93, 0.95, etc., and can be set according to actual conditions.

[0066] Similarity: refers to the degree of matching between the current page image and the expected page image in terms of core visual features, which meets the preset standard. That is, there are no substantial differences in the position, shape, content of key elements of the page, as well as the overall layout structure and presentation of core information. Only minor visual deviations that do not affect the functional judgment are allowed (such as pixel-level subtle differences or slight style changes of non-key elements).

[0067] Thus, in this embodiment, when the application page under test is identified as successfully loaded, the expected page image and the current page image are input into a pre-trained second image processing model. This allows the second image processing model to identify whether the current page image is similar to the expected page image. When the current page image is identified as similar to the expected page image, the first test result is determined to be passed. When the current page image is identified as dissimilar to the expected page image, the first test result is determined to be failed. This avoids the situation where the first image processing model identifies that the page has been successfully loaded, but the page displayed on the device under test is not the target page under test. This further improves the accuracy of the page loading status and ensures the credibility of the first test result.

[0068] In some embodiments provided in this application, step 140, which determines the second test result corresponding to the device under test based on the target network status data, includes: when the target network status data includes a target time point in which the current network status is identified as the second network status, the second test result is determined to be passed; when the target network status data does not include the target time point, the second test result is determined to be failed.

[0069] Specifically, if the device under test (DUT) cannot correctly identify the switched second network state, it may lead to problems such as abnormal application adaptation logic and data reporting errors. Therefore, in some embodiments provided in this application, target network state data of the DUT during the network state switching process can be collected, and it can be determined whether the target network state data contains the target time point in which the second network state was identified. This allows for the output of a second test result that characterizes whether the DUT can accurately identify its own network state.

[0070] In some embodiments, target network status data can be understood as a collection of various data related to network status collected and stored by the device under test through the device's built-in network detection points, log recording modules, etc., during the entire process of the network status switching from the first network status to the second network status.

[0071] In some embodiments, target network status data can be understood as a collection of various data related to network status collected and stored by the device under test through built-in network detection points, log recording modules, etc., after the network status of the device under test is switched from the first network status to the second network status.

[0072] In some embodiments, the target network status data may include information such as network status identifier, status transition time record, and network parameter changes.

[0073] In some embodiments, the target time point can be understood as the specific time point at which the device under test successfully identifies that the current network state has switched to the second network state through its own network detection mechanism and records the identification behavior.

[0074] To more clearly illustrate the page testing method provided in the embodiments of this application, please refer to the following exemplary description: During the process of switching the network status of the device under test from the first network status to the second network status, or after the switch is completed, the device will continuously collect network status data in real time through network detection points, thereby forming target network status data and storing it.

[0075] Next, the electronic device analyzes the target network status data and determines the time point in the target network status data at which the tested device identifies the current network status as the second network status.

[0076] Finally, based on the analysis results, if the target time point exists in the target network status data, it indicates that the tested device has successfully identified the second network status, meeting the test requirements, and the second test result is determined to be passed. Conversely, if the target time point does not exist in the target network status data, it indicates that the device did not perceive the network status switch or failed to identify it, failing the test requirements, and the second test result is determined to be failed.

[0077] Thus, in this embodiment of the application, when the target network status data includes the target time point in which the current network status is identified as the second network status, the second test result is determined to be passed; and when the target network status data does not include the target time point, the second test result is determined to be failed, thereby realizing the verification of the device's network status identification capability.

[0078] In some embodiments provided in this application, the step of determining the second test result as passed when the target network state data includes a target time point in which the current network state is identified as the second network state includes: determining the second test result as passed when the target sub-data of the target network state data includes a target time point, wherein the target sub-data is the network state data generated by the device under test after the switching time point in the target network state data, and the switching time point is the time point at which the network state of the device under test is switched from the first network state to the second network state.

[0079] Specifically, considering practical applications, the tested device may, due to factors such as hardware performance, system latency, and network fluctuations, be able to identify the second network state and record the target time point, but the difference between the target time point and the actual network switching time point may be too large, far exceeding the reasonable response range. Therefore, if the second test result is determined solely by whether the target time point exists in the target network state data, the distorted second test result may not accurately reflect the tested device's own weak network diagnostic capabilities.

[0080] Based on this, in some embodiments provided in this application, the electronic device can determine whether the target time point is included in the sub-data of a specific part of the target network status data, thereby determining whether the second test result is passed or failed, thereby ensuring that the second test result matches the weak network diagnostic capability of the device under test.

[0081] In some embodiments, the switching time point can be understood as the specific time point at which the electronic device actively switches the network of the device under test from the first network state to the second network state, and can be recorded by the electronic device when performing the switching operation.

[0082] In some embodiments, target sub-data can be understood as a portion of the network state data after the switching time point in the target network state data. For example, if an electronic device switches the network of the device under test from the first network state to the second network state at 10:05:05, the electronic device can detect sub-data within the time window from 10:05:05 to 10:05:15 in the target network state data, and determine whether the target time point exists in this portion of sub-data. If it exists, the second test result is determined to be passed; otherwise, the second test result is determined to be failed.

[0083] Thus, in this embodiment of the application, when the target sub-data of the target network state data includes the target time point, the second test result is determined to be passed, thereby further improving the credibility of the second test result.

[0084] In some embodiments provided in this application, the test operation sequence is also used to determine the display content recording operation of the device under test (DUT) recording the displayed content. Therefore, the page testing method further includes: before switching the network state of the DUT from a first network state to a second network state, controlling the DUT to start recording the current displayed content of the DUT through the test operation sequence; after switching the network state of the DUT from the first network state to the second network state, controlling the DUT to stop recording the current displayed content of the DUT through the test operation sequence, thereby obtaining the display recording content of the DUT during the test process.

[0085] Specifically, to facilitate later problem tracing and scenario reproduction, in some embodiments provided in this application, control instructions for recording display content can be added to the test operation sequence. Before the network state switch, the test operation sequence can automatically control the device under test to start recording display content before the network switch and stop recording after the network switch, thereby obtaining the display recording content of the device display state that can record the entire test process, thus providing a basis for later problem tracing and scenario reproduction.

[0086] In some embodiments, the display content recording operation can be understood as an operation performed by the device under test to continuously collect and store the screen display content of the device under test.

[0087] In some embodiments, the display content recording operation can be understood as a screen recording operation.

[0088] In some embodiments, the display recording content can be understood as a data file generated by the device under test through the display content recording operation, which contains changes in the screen display content throughout the test.

[0089] Thus, in this embodiment of the application, before switching the network state of the device under test from the first network state to the second network state, the device under test can be controlled by a test operation sequence to start recording the current display content of the device under test, and after switching the network state of the device under test from the first network state to the second network state, the device under test can be controlled by a test operation sequence to stop recording the current display content of the device under test, thereby obtaining the display recording content of the device under test during the test. This allows the changes in the display content of the device under test before and after the network state switch to be recorded through the display recording content, and then the problem source can be traced and the scene reproduced through the display recording content later.

[0090] In some embodiments provided in this application, the test operation sequence is further used to determine the interactive operation of canceling the display of the application page under test. Therefore, the step of controlling the device under test to start recording the current display content of the device under test through the test operation sequence before switching the network state of the device under test from the first network state to the second network state includes: controlling the device under test to cancel the display of the application page under test through the test operation sequence before switching the network state of the device under test from the first network state to the second network state; and controlling the device under test to start recording the current display content of the device under test through the test operation sequence.

[0091] Specifically, to accurately simulate the scenario where a user controls a device to display the application page under test in a weak network condition, and to ensure the validity of the recorded content, in some embodiments provided in this application, before executing the recording operation to start the display content before the network state switch, the device under test is first controlled to perform an interactive operation to cancel the display of the application page under test through a test operation sequence, so that the current display content of the device under test is not the application page under test, and then the recording of the display content is started, ensuring that the recorded content can include the entire process of entering the application page under test from the non-application page under test after the network state switch, thereby ensuring the validity of the test process and the recorded content.

[0092] In some embodiments, the interactive operation of canceling the display of the application page under test can be understood as a specific operation defined by the test operation sequence for causing the device under test to terminate the current display state of the application page under test.

[0093] In some embodiments, the interactive operation of canceling the display of the application under test page may include restarting the application under test, closing the current page and returning to the previous page, clearing the page cache and then exiting the display, etc.

[0094] Thus, in this embodiment, before switching the network state of the device under test from the first network state to the second network state, the test operation sequence controls the device under test to cancel the display of the application page under test; the test operation sequence also controls the device under test to start recording the current display content. This ensures that the test process covers the process of entering the application page under test from the non-application page, thus matching the scenario where a user controls the device to display the application page under test in a weak network environment, thereby ensuring the effectiveness of the test process. Furthermore, it ensures that the recorded content includes the entire process of entering the application page under test from the non-application page after the network state switch, thus ensuring the validity of the recorded content.

[0095] In some embodiments provided in this application, the test operation sequence includes the target trigger position of the interactive operation. Furthermore, the page testing method further includes: inputting natural language text for defining the interactive operation and page image of the target page for performing the interactive operation into a pre-trained generative model, so that the generative model can perform trigger position recognition processing on the natural language text and page image to obtain the target trigger position.

[0096] Specifically, in this embodiment, the electronic device can, based on the target trigger position in the test operation sequence, execute an interactive operation at the target trigger position of the target page displayed on the device under test, to adjust the current page displayed on the device under test from the target page to the target page under test. It is understood that if the target trigger position is manually marked by the tester or obtained through cumbersome coordinate measurement tools, it is not only inefficient but also prone to coordinate deviations due to human error. Furthermore, when the layout of the application under test page is adjusted, the control positions are changed, or the version is iterated, all historically marked trigger positions will become invalid, requiring the tester to re-mark them one by one, resulting in extremely high maintenance costs.

[0097] Based on this, in some embodiments provided in this application, the electronic device uses a pre-trained generative model to input natural language text defining the interactive operation and page images of the target page as model input. The model then integrates the understanding of the text intent and the recognition of image elements to automatically locate and output the target trigger position required for the interactive operation, thereby achieving automated acquisition of the trigger position.

[0098] In some embodiments, natural language text can be understood as being used to explicitly describe the specific content of the interactive operations that need to be performed during the test, such as "click the search box at the top of the page" or "select the third option in the list and wait 3 seconds".

[0099] In some embodiments, the page image of the target page can be understood as the visual image of the specific page in the application under test corresponding to the interactive operation to be performed. For example, when the target page under test is a search page accessed from the application homepage, the page image of the target page is the image of the application homepage.

[0100] In some embodiments, the generative model can be understood as a pre-trained artificial intelligence model with the ability to fuse natural language understanding and image recognition, which can simultaneously parse the intent of textual instructions and visual information of images, thereby locating the specific location on the page corresponding to the interactive operation.

[0101] In some embodiments, the generation model, the first image processing module, and the second image processing model may be the same large language model, which has certain image processing capabilities and certain text processing capabilities.

[0102] In some embodiments, the target trigger location can be understood as the specific point information that needs to be accurately located when performing interactive operations such as clicking or swiping on the target page, and is usually presented in the format of screen coordinates such as horizontal and vertical coordinates.

[0103] Thus, in this embodiment, the natural language text used to define the interactive operation and the page image of the target page used to perform the interactive operation can be input into the pre-trained generative model, so that the generative model can perform trigger position recognition processing on the natural language text and page image to obtain the target trigger position, thereby realizing the automatic determination of the target trigger position and avoiding the need for manual annotation to determine the target trigger position, thereby ensuring the efficiency of the target trigger position determination.

[0104] Furthermore, when the layout of the application under test is adjusted, the position of controls is changed, or the version is iterated, the model can automatically re-identify the target trigger position simply by inputting the updated target page image and the original natural language text. This eliminates the need for manual modification of each test case, significantly reducing the maintenance cost of test cases and improving the reusability of test cases.

[0105] In some embodiments provided in this application, the page testing method further includes: determining the target test result of the device under test displaying the application page under test in a second network state based on the first test result and the second test result.

[0106] Specifically, considering that test results from a single dimension may not accurately reflect the performance of the device under test when displaying the application page under test in a second network state, for example, based solely on the first test result, it cannot be confirmed whether the device under test accurately recognizes the network state switch. This could lead to situations where the page loads normally but the device fails to correctly perceive the target network state, casting doubt on the validity of the test scenario. Furthermore, based solely on the second test result, it is impossible to determine the actual loading performance of the application page under the target network state.

[0107] Based on this, in some embodiments provided in this application, the electronic device can integrate and analyze the first test result related to page loading and the second test result related to the weak network diagnostic capability of the device under test, and finally output the target test result that can comprehensively reflect the overall performance of the device under test in displaying the application page under test in the second network state, so as to ensure the comprehensiveness and accuracy of the test conclusion.

[0108] In some embodiments, the target test result can be understood as the final test conclusion formed by combining the first test result and the second test result, which can comprehensively reflect the test device's page display function, loading performance and network adaptation capability under the second network state.

[0109] In some embodiments, the target test result can be categorized as pass or fail.

[0110] In some embodiments, when both the first test result and the second test result are passed, it indicates that the page loads normally in the second network state and the tested device accurately identifies the network state switch, thus the target test result is passed. Conversely, if either the first test result or the second test result is failed, the target test result is determined to be failed.

[0111] Thus, in this embodiment of the application, the target test result of the device under test displaying the application page under test in the second network state can be determined based on the first test result and the second test result. Therefore, the target test effect of displaying the application page under test in the second network state can be determined by the page loading state represented by the first test result and the weak network diagnostic capability of the device under test represented by the second test result.

[0112] All of the above technical solutions can be combined in any way to form optional embodiments of this application, and will not be described in detail here.

[0113] To more clearly illustrate the page testing method provided in the embodiments of this application, please refer to... Figure 2-5 , Figure 2-5 These are all schematic flowcharts of the page testing method provided in the embodiments of this application.

[0114] Specifically, such as Figure 2As shown, the electronic device can be understood as a server such as Jenkins deployed with a continuous integration / continuous deployment pipeline, possessing functions such as continuous integration / continuous deployment pipeline management, scheduled task scheduling, and automatic script execution. It can be understood that the electronic device can automatically trigger the execution of test scripts when preset time conditions or code submission conditions are met, and pass the "automatic trigger execution" instruction to the core main program.

[0115] The main program is responsible for receiving trigger commands from electronic devices and managing the entire testing process. It can handle task scheduling and connect to downstream modules / services. Specifically, the main program supports scheduled test triggering, parallel execution of tests on multiple devices, test environment management, and test result notification. Furthermore, the main program can connect to the device control module, log diagnostic service, screen recording and screenshot module, and report generation module through different functional links to achieve command issuance and data flow at each stage.

[0116] The device control module can receive instructions from the main program and is responsible for performing weak network switching / restoration operations, that is, the load switches the network status of the tested device between the first network status and the second network status.

[0117] The network control service can receive instructions from the device control module, specifically for implementing weak network environment switching and network status control, and further refined into network latency control and bandwidth limiting. In essence, the network control service can effectively simulate a weak network environment (second network state), ensuring that the device under test can load and display specific application pages in the simulated weak network environment.

[0118] The log diagnostic service can perform embedded log queries and weak network diagnostic analysis upon receiving instructions from the main program. It can extract key information from logs collected during the testing process, such as the timestamp when the device network status switches to the second network status, and can output diagnostic log matching results to locate network or page anomalies that occur during the testing process.

[0119] The screen recording and screenshot module can record and screenshot the page during the test process when it receives instructions from the main program, and upload the collected files. Artificial intelligence analysis services can process uploaded files, such as analyzing uploaded images to identify page loading completion or comparing image similarity to verify whether the current page image is the same as the expected page image.

[0120] The report generation module receives test result data from the main program and uses report generation tools such as Allure to generate visual test reports, ultimately outputting test reports in formats such as Hyper Text Markup Language (HTML). Understandably, the final generated report may include test case execution details, screenshots / screen recordings of the test process, and trend analysis of the test results, facilitating review and analysis by testers.

[0121] like Figure 3 As shown, an electronic device can be designed with a page scene library, which can store the basic information required for testing. Specifically, it can include a unique identifier for the scene name, a test case operation path for describing the business process, test case operation points for implementing technical execution instructions (i.e., interactive operations to enter or exit the target page under test), scene images, and a fallback comparison image address as a baseline for loading completion.

[0122] The scenario name is a unique identifier for each test scenario, used to locate and distinguish different test scenarios. The test case operation path defines the business-level operation step framework for the corresponding scenario. The test case operation point records technical information such as the location of interface elements and interaction trigger points corresponding to each operation in the test scenario. The scenario image is a screenshot of the test scenario's interface; this screenshot can be provided to a second image processing model or a large language model to generate test case operation points. The fallback comparison image address is the address of the baseline image (i.e., the expected page image) when the page finishes loading in the test scenario.

[0123] It is worth noting that the business description specification refers to the sequence of test operations expressed in natural language from a business perspective, such as "click xxx at a certain point", "click a certain point", "restart the application", "start recording", "click xxxx", and "stop recording". Understandably, this step description information can be used to generate the sound field for test case operation points, that is, to provide this step description information and scene images to a second image processing model or a large language model to generate test case operation points.

[0124] Specifically, the AI ​​conversion engine can receive and understand business description specifications in natural language, such as "click xxx point", "click a point", "restart application", "start recording", "click xxxx", and "end recording". Simultaneously, based on scene image recognition of target elements in the interface, such as the xxx button, it infers the element's specific coordinates on the device, such as x-axis and y-axis coordinates. The understanding of the interface element coordinates and business description specifications is then converted into technical operation instructions. For example, clicking xxx point is converted into an instruction containing coordinates and a waiting time, thus forming an executable instruction sequence. Finally, the generated technical instructions undergo format validation, such as verifying coordinate format, command syntax, and whether the instructions match the execution rules of the test device, ensuring that the instructions can be correctly recognized and executed by the automated test script or device. The validated instruction sequence is then used as the technical instruction specification input.

[0125] Technical instruction specifications can be understood as the final instruction set for automated test execution, or as technical operation commands that electronic devices / scripts can directly execute. Specifically, these may include x-axis coordinates, y-axis coordinates, wait time t, the `close` command to trigger application restart, the `start` command to initiate screen recording for the test process, and the `end` command to terminate screen recording for the test process.

[0126] After obtaining the technical directives and specifications, it can be based on Figure 4 The process shown is used for testing. Specifically, as follows: Figure 4 As shown, the process first reads the sequence of operation points from the test cases. This involves extracting the page coordinates (x, y) and operation time (t) sequences corresponding to the interactive operations to be performed, thus determining the page interaction locations and timing to be triggered during the test. Next, the operation instructions are parsed to convert abstract operation instructions in the test cases, such as "click the button" or "restart the application," into machine-executable instructions that the system can recognize. Finally, the execution environment is initialized, completing the initial state configuration of the test device and the application under test, such as launching the application to the initial page.

[0127] Following the position sequence read during the preparation phase, click interactions are executed at specified coordinates (x, y) and time (t) on the application page under test. These interactions include application restart, ending recording, and starting recording. The application restart operation refers to the application closing and restarting process performed using the `close` command when the test case contains the "restart application" instruction, simulating page loading during a user restart scenario. The ending recording operation is understood as stopping the test recording process using the `end` command. The starting recording operation is initiated by using the `start` command to begin recording the test process.

[0128] Understandably, during the entire process of executing click interactions according to the location sequence read in the preparation phase, before the recording operation is triggered, the network status of the test device is switched to a weak network environment, such as limiting bandwidth or increasing latency. After the recording operation is completed, the network status of the test device can be restored to a normal network to avoid the weak network environment affecting subsequent non-test operations.

[0129] It's also understandable that after the operation is executed and the network status switch is completed, data collection operations can be triggered, such as page screenshot collection, endpoint log collection, and timestamp recording during the test. Page screenshot collection refers to collecting image data of the current page after page interaction / loading is completed in a weak network environment, for subsequent analysis of the page loading status through models. Endpoint log collection refers to recording the device's network status data during the test, such as latency and bandwidth parameters in weak networks. Timestamp recording records the time points of key operations such as weak network switching, page clicks, and recording start / stop.

[0130] Understandably, after the data collection operation is completed, the data output stage can proceed, which may include outputting execution screenshot files, outputting network log data, and outputting timestamp data.

[0131] It's also understandable that after the data output stage, the output data can be validated and verified to obtain the test results for this test process. Specifically, for example... Figure 5 As shown, for the screenshots, timestamp data, and network log data output during the output data stage, three types of verification processing are performed in conjunction with the fallback comparison images in the page scene library.

[0132] The first type of verification processing is loading verification processing, which involves loading recognition through a large model. This means using a trained artificial intelligence model (corresponding to the first image processing model) to analyze the visual features of the screenshot (such as blank areas, loading placeholders, etc.), analyze the current loading process of the page, and, based on the model analysis results, determine the loading result and output a success / failure status. That is, if it is recognized as loading complete, it is judged as successful; otherwise, it is judged as failed.

[0133] The second type of verification processing is page similarity verification processing, which involves inputting the screenshot and the fallback image into the large model so that the large model can make a similarity judgment and output the similarity result. If the visual features and semantic elements of the two images are consistent, they are judged to be a match; otherwise, they are not a match.

[0134] The third type of verification processing is endpoint log verification, used to verify the validity of weak network logs. Specifically, it filters out the event tracking data under weak network conditions from the network logs, then aligns the extracted event tracking data with the timestamp data to confirm whether the event tracking was generated within the time window of the weak network condition, and analyzes the client status corresponding to the event tracking data, such as page request status and network parameters, to verify whether it matches the weak network scenario. Finally, it outputs the log verification result. If the event tracking generation time and corresponding status both match the weak network scenario, it is determined to be a valid event tracking; otherwise, it is invalid.

[0135] Furthermore, after completing the first to third types of verification, a comprehensive page verification result that confirms the consistency between the page state and visual appearance can be formed based on the results of the first and second types of verification. The validity of log data in weak network scenarios can also be confirmed by combining the results of the third type of verification.

[0136] Furthermore, by integrating the comprehensive page verification results, the page verification results are output, showing the consistency between the page loading status and visual appearance in a weak network environment. Based on the conclusions of the client log verification, the network verification results of client logs and event tracking points in a weak network environment are output, along with a summary of key data from the entire process, such as screenshots, log fragments, and judgment criteria, providing data support for subsequent test reports and problem investigation.

[0137] To facilitate better implementation of the page testing method of this application, this application also provides a page testing apparatus. Please refer to... Figure 6 , Figure 6 This is a schematic diagram of the structure of the page testing device provided in an embodiment of this application. The page testing device 200 can display a graphical user interface (GUI) via a terminal device. The GUI includes a virtual scene. The page testing device 200 may include: The acquisition module 210 is used to acquire target test case data of the application page under test, wherein the test cases include a test operation sequence, and the test operation sequence is used to instruct the device under test to perform at least one interactive operation related to displaying the application page under test; The control module 220 is configured to control the device under test to perform at least one interactive operation in response to switching the network state of the device under test from a first network state to a second network state, according to a test operation sequence, wherein the network quality of the first network state is higher than the network quality of the second network state. The test result determination module 230 is used to acquire the current page image of the application page under test during or after controlling the device under test to perform at least one interactive operation, and determine the first test result corresponding to the application page under test based on the current page image; and / or, acquire the target network status data of the device under test during the network state switching process, and determine the second test result corresponding to the device under test based on the target network status data.

[0138] In some embodiments, the test result determination module 230 is further configured to input the current page image into a pre-trained first image processing model, so that the first image processing model can identify the loading status of the application page under test based on the current page image, and determine the first test result as failing when it is identified that the application page under test has not finished loading.

[0139] In some embodiments, the test case further includes an expected page image, which is the image of the application page under test when it is loaded. Furthermore, the test result determination module 230 is further configured to input the expected page image and the current page image into a pre-trained second image processing model when it is identified that the application page under test has been successfully loaded, so that the second image processing model can identify whether the current page image is similar to the expected page image, and when it is identified that the current page image is similar to the expected page image, determine that the first test result is passed, and when it is identified that the current page image is not similar to the expected page image, determine that the first test result is failed.

[0140] In some embodiments, the test result determination module 230 is further configured to determine the second test result as passed when the target network state data includes a target time point in which the current network state is identified as the second network state, and to determine the second test result as failed when the target network state data does not include the target time point.

[0141] In some embodiments, the test result determination module 230 is further configured to determine the second test result as passed when the target sub-data of the target network state data includes a target time point, wherein the target sub-data is the network state data generated by the device under test after the switching time point in the target network state data, and the switching time point is the time point at which the network state of the device under test is switched from the first network state to the second network state.

[0142] In some embodiments, the page testing apparatus further includes a pre-switching control module and a post-switching control module. The pre-switching control module is used to control the device under test to begin recording its current display content via a test operation sequence before switching the network state of the device under test from a first network state to a second network state. The post-switching control module is used to control the device under test to stop recording its current display content via a test operation sequence after switching the network state of the device under test from the first network state to the second network state, thus obtaining the recorded display content of the device under test during the testing process.

[0143] In some embodiments, the pre-switch control module is further configured to control the device under test to cancel the display of the application page under test through a test operation sequence before switching the network state of the device under test from the first network state to the second network state, and to control the device under test to start recording the current display content of the device under test through a test operation sequence.

[0144] In some embodiments, the test operation sequence includes the target trigger position of the interactive operation. Therefore, the page testing device further includes a position determination module. The position determination module is used to input natural language text defining the interactive operation and a page image of the target page for performing the interactive operation into a pre-trained generative model, so that the generative model performs trigger position recognition processing on the natural language text and the page image to obtain the target trigger position.

[0145] In some embodiments, the test result determination module 230 is further configured to determine the target test result for the device under test to display the application page under test in the second network state based on the first test result and the second test result.

[0146] Each unit in the aforementioned page testing device can be implemented entirely or partially through software, hardware, or a combination thereof. These units can be embedded in or independent of the processor in the electronic device in hardware form, or stored in the memory of the electronic device in software form, so that the processor can call and execute the operations corresponding to each unit.

[0147] The page testing device 200 can be integrated into a terminal or server that has storage and a processor and thus computing power, or the page testing device 200 can be the terminal or server.

[0148] Optionally, this application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0149] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may be a terminal or a server. Figure 7 As shown, the electronic device 300 includes a processor 301 with one or more processing cores, a memory 302 with one or more computer-readable storage media, and a computer program stored in the memory 302 and executable on the processor. The processor 301 and the memory 302 are electrically connected. Those skilled in the art will understand that the electronic device structure shown in the figures does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0150] The processor 301 is the control center of the electronic device 300. It connects various parts of the electronic device 300 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 302, and calling data stored in the memory 302, it executes various functions of the electronic device 300 and processes data, thereby performing overall processing of the electronic device 300.

[0151] In this embodiment, the processor 301 in the electronic device 300 loads the instructions corresponding to the processes of one or more computer programs into the memory 302 according to the following steps, and the processor 301 runs the computer programs stored in the memory 302 to realize various functions: Obtain target test case data for the application page under test, wherein the test cases include a test operation sequence, the test operation sequence being used to instruct the device under test to perform at least one interactive operation related to displaying the application page under test; In response to switching the network state of the device under test from a first network state to a second network state, the device under test is controlled to perform the at least one interactive operation according to the test operation sequence, wherein the network quality of the first network state is higher than the network quality of the second network state; During or after controlling the device under test to perform the at least one interactive operation, the current page image of the application page under test is acquired, and a first test result corresponding to the application page under test is determined based on the current page image; and / or, The target network status data of the device under test during the network state switching process is obtained, and the second test result corresponding to the device under test is determined based on the target network status data.

[0152] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0153] Optional, such as Figure 7 As shown, the electronic device 300 also includes: a display screen 303, a radio frequency circuit 304, an audio circuit 305, an input unit 306, and a power supply 307. The processor 301 is electrically connected to the display screen 303, the radio frequency circuit 304, the audio circuit 305, the input unit 306, and the power supply 307. Those skilled in the art will understand that... Figure 7 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0154] The display screen 303 can be used to display a graphical user interface (GUI) and receive operation commands generated by the user interacting with the GUI. The display screen 303 may include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the electronic device. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. The touch panel can be used to collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation commands, and execute the corresponding program. Optionally, the touch panel may include a touch detection device and a touch controller. The touch detection device detects the user's touch location and the signal generated by the touch operation, and transmits the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, sends it to the processor 301, and can receive and execute commands from the processor 301. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 301 to determine the type of touch event. Subsequently, the processor 301 provides corresponding visual output on the display panel according to the type of touch event. In this embodiment, the touch panel and the display panel can be integrated into the display screen 303 to achieve input and output functions. However, in some embodiments, the touch panel and the display screen 303 can be implemented as two independent components to achieve input and output functions. That is, the display screen 303 can also be used as part of the input unit 306 to achieve input functions.

[0155] The radio frequency circuit 304 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other electronic devices, and to transmit and receive signals with network devices or other electronic devices.

[0156] Audio circuitry 305 can be used to provide an audio interface between a user and an electronic device via a speaker and a microphone. Audio circuitry 305 converts received audio data into electrical signals, transmits them to the speaker, and the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuitry 305, converted back into audio data, and then processed by processor 301 before being transmitted via radio frequency circuitry 304 to, for example, another electronic device, or output to memory 302 for further processing. Audio circuitry 305 may also include an earphone jack to facilitate communication between peripheral headphones and electronic devices.

[0157] The input unit 306 can be used to receive input numbers, characters, or object feature information (such as fingerprints, irises, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.

[0158] Power supply 307 is used to supply power to various components of electronic device 300. Optionally, power supply 307 can be logically connected to processor 301 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Power supply 307 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0159] although Figure 7 As not shown in the diagram, the electronic device 300 may also include a camera, sensor, wireless fidelity module, Bluetooth module, etc., which will not be described in detail here.

[0160] This application also provides a computer-readable storage medium for storing a computer program. This computer-readable storage medium can be applied to a computer device, and the computer program causes the computer device to execute the corresponding processes in the page testing method described in the embodiments of this application; for brevity, these will not be elaborated further here.

[0161] This application also provides a computer program product including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the corresponding process in the page testing method of the embodiments of this application. For simplicity, further details are omitted here.

[0162] This application also provides a computer program comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the corresponding process in the page testing method of this application. For brevity, further details are omitted here.

[0163] It should be understood that the processor in this application may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0164] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0165] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0166] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0167] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0168] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0169] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0170] In addition, the functional units in this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0171] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer or a server) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0172] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A page testing method, characterized in that, The method includes: Obtain target test case data for the application page under test, wherein the test cases include a test operation sequence, the test operation sequence being used to instruct the device under test to perform at least one interactive operation related to displaying the application page under test; In response to switching the network state of the device under test from a first network state to a second network state, the device under test is controlled to perform the at least one interactive operation according to the test operation sequence, wherein the network quality of the first network state is higher than the network quality of the second network state; During or after controlling the device under test to perform the at least one interactive operation, the current page image of the application page under test is acquired, and a first test result corresponding to the application page under test is determined based on the current page image; and / or, The target network status data of the device under test during the network state switching process is obtained, and the second test result corresponding to the device under test is determined based on the target network status data.

2. The page testing method according to claim 1, characterized in that, The step of determining the first test result corresponding to the application page under test based on the current page image includes: The current page image is input into a pre-trained first image processing model so that the first image processing model can identify the loading status of the application page under test based on the current page image. When it is identified that the page of the application under test has not finished loading, the first test result is determined to be unsuccessful.

3. The page testing method according to claim 2, characterized in that, The test cases also include a expected page image, which is the image of the application under test when the page has finished loading. The method further includes: When the application page under test is successfully loaded, the expected page image and the current page image are input into a pre-trained second image processing model so that the second image processing model can identify whether the current page image is similar to the expected page image. When the current page image is identified as similar to the expected page image, the first test result is determined to be passed; When it is determined that the current page image is not similar to the expected page image, the first test result is determined to be a failure.

4. The page testing method according to claim 1, characterized in that, Determining the second test result corresponding to the device under test based on the target network status data includes: When the target network state data includes the target time point in time when the current network state is identified as the second network state, the second test result is determined to be passed; When the target network status data does not include the target time point, the second test result is determined to be unsuccessful.

5. The page testing method according to claim 4, characterized in that, When the target network state data includes the target time point at which the current network state is identified as the second network state, determining the second test result as passed includes: When the target sub-data of the target network status data includes the target time point, the second test result is determined to be passed. The target sub-data is the network status data generated by the device under test after the switching time point in the target network status data. The switching time point is the time point at which the network status of the device under test is switched from the first network status to the second network status.

6. The page testing method according to claim 1, characterized in that, The test operation sequence is also used to determine the display content recording operation of the device under test, and the method further includes: Before switching the network state of the device under test from the first network state to the second network state, the test operation sequence controls the device under test to start recording the current display content of the device under test; After switching the network state of the device under test from the first network state to the second network state, the test operation sequence controls the device under test to stop recording the current display content of the device under test, thereby obtaining the display recording content of the device under test during the test.

7. A page testing device, characterized in that, The device includes: The acquisition module is used to acquire target test case data of the application page under test, wherein the test case includes a test operation sequence, and the test operation sequence is used to instruct the device under test to perform at least one interactive operation related to displaying the application page under test; A control module is configured to respond to switching the network state of the device under test from a first network state to a second network state, and to control the device under test to perform the at least one interactive operation according to the test operation sequence, wherein the network quality of the first network state is higher than the network quality of the second network state; The test result determination module is used to acquire the current page image of the application page under test during or after controlling the device under test to perform the at least one interactive operation, and determine the first test result corresponding to the application page under test based on the current page image; and / or, acquire the target network state data of the device under test during the network state switching process, and determine the second test result corresponding to the device under test based on the target network state data.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted for loading by a processor to perform the page testing method according to any one of claims 1-6.

9. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing a computer program, and the processor executing the page testing method according to any one of claims 1-6 by calling the computer program stored in the memory.

10. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the page testing method according to any one of claims 1-6.