Page testing method, computer device, storage medium and computer program product
By using visual analysis technology for page testing, and utilizing anomaly detection across multiple visual feature dimensions, the low testing efficiency of existing technologies is solved, resulting in more efficient and accurate page testing results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TENCENT MUSIC ENTERTAINMENT TECH (SHENZHEN) CO LTD
- Filing Date
- 2026-05-20
- Publication Date
- 2026-07-24
Smart Images

Figure CN122450845A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automated testing technology, and in particular to a page testing method, apparatus, computer equipment, storage medium, and computer program product. Background Technology
[0002] Page testing refers to testing activities conducted on terminal pages to verify that the terminal pages function properly, meet performance standards, and are compatible and stable, ensuring that the pages can meet design requirements and user expectations in different scenarios.
[0003] Existing automated page testing technologies are primarily based on code-driven testing. This approach involves writing test scripts to drive the execution of user interface interactions and using code assertions to determine whether the test page's state meets expectations.
[0004] However, when faced with changes such as changes in page layout, control properties, or interaction steps, this code-driven testing approach requires adaptive code adjustments to keep up with the changes, resulting in lower testing efficiency and increased testing costs. Summary of the Invention
[0005] Therefore, it is necessary to provide a page testing method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve the efficiency of terminal page testing in response to the above-mentioned technical problems.
[0006] Firstly, this application provides a page testing method. The method includes:
[0007] In response to the received page test command, load the test page corresponding to the page test command;
[0008] If the test page is detected to have finished loading, then obtain a screenshot of the target page of the test page;
[0009] Based on the test configuration information carried by the page test instruction, anomaly detection processing is performed on the target page screenshot under multiple visual feature dimensions to obtain the anomaly detection results of the target page screenshot under the multiple visual feature dimensions.
[0010] Based on the anomaly detection results of the multiple visual feature dimensions, the target test result of the test page is determined.
[0011] In one embodiment, based on the test configuration information carried by the page test instruction, anomaly detection processing is performed on the target page screenshot under multiple visual feature dimensions to obtain the anomaly detection results of the target page screenshot under the multiple visual feature dimensions, including:
[0012] The target page screenshot undergoes anomaly detection processing in at least two visual feature dimensions: Based on the color block configuration information in the test configuration information, a white screen detection process is performed on the target page screenshot to obtain a white screen detection result; an image comparison process is performed between the baseline page in the test configuration information and the target page screenshot to obtain an image comparison result; based on preset keywords in the test configuration information, keyword detection processing is performed on the target page screenshot to obtain a keyword detection result; and content detection processing is performed on the target page screenshot for both text and images to obtain a content detection result.
[0013] Based on at least two of the white screen detection results, the image comparison results, the keyword detection results, and the content detection results, the anomaly detection results for the multiple visual feature dimensions are obtained.
[0014] In one embodiment, the step of performing white screen detection processing on the target page screenshot based on the color block configuration information in the test configuration information to obtain the white screen detection result of the target page screenshot includes:
[0015] Based on the color block configuration information, a baseline white screen detection window is determined for the target page screenshot;
[0016] The target page screenshot is subjected to sliding detection processing through the benchmark white screen detection window to obtain the color block detection information of the target page screenshot within the benchmark white screen detection window;
[0017] Based on the color block detection information and the color block configuration information, the white screen detection result of the target page screenshot is determined.
[0018] In one embodiment, determining the white screen detection result of the target page screenshot based on the color block detection information and the color block configuration information includes:
[0019] Based on the color block detection information, the standard deviation of each color channel of the target page screenshot within the baseline white screen detection window is obtained;
[0020] If the standard deviation of each color channel is less than the standard deviation threshold corresponding to the color block configuration information, then the white screen detection result indicates that there is a white screen anomaly in the target page screenshot.
[0021] In one embodiment, the step of performing image comparison processing on the screenshots of the baseline page and the target page in the test configuration information to obtain the image comparison result of the target page screenshot includes:
[0022] Based on the screenshot of the target page, the image features of the test page and the image statistical feature histogram of the test page are obtained, and the image features of the benchmark page and the image statistical feature histogram of the benchmark page are obtained.
[0023] Calculate the histogram similarity between the image statistical feature histogram of the test page and the image statistical feature histogram of the benchmark page to obtain the histogram similarity between the test page and the benchmark page;
[0024] Based on the image features of the test page and the image features of the benchmark page, the structural similarity between the target page screenshot and the benchmark page is obtained;
[0025] The image comparison results of the target page screenshot are obtained based on the histogram similarity and the structural similarity.
[0026] In one embodiment, the step of performing keyword detection processing on the target page screenshot based on preset keywords in the test configuration information to obtain the keyword detection result of the target page screenshot includes:
[0027] The target page screenshot is subjected to optical character recognition processing to obtain the text information in the target page screenshot;
[0028] The text information is subjected to keyword detection processing to obtain the keywords in the text information;
[0029] Based on the preset keywords in the test configuration information and the abnormal keywords in the keyword database, text matching processing is performed on the keywords to obtain the text matching results of the keywords; the text matching results are used to characterize whether there are target keywords in the keywords that match the preset keywords and / or the abnormal keywords;
[0030] Based on the text matching results, the keyword detection results of the target page screenshot are determined.
[0031] In one embodiment, the step of performing content detection processing on the target page screenshot for text and image to obtain the content detection result of the target page screenshot includes:
[0032] The text information is subjected to semantic recognition processing to obtain the semantic information of the text information;
[0033] The text information and semantic information are subjected to text content detection processing to obtain the text content detection result of the target page screenshot;
[0034] The target page screenshot is subjected to image content detection processing to obtain the image content detection result of the target page screenshot;
[0035] Based on the text content detection results and the image content detection results, the content detection results of the target page screenshot are obtained.
[0036] In one embodiment, obtaining a screenshot of the target page of the test page includes:
[0037] If the test page is detected to be a mobile page type, the screen capture program of the mobile device used to display the test page is used to capture the device interface of the mobile device to obtain a screenshot of the target page of the test page.
[0038] If the page type is detected to be a web-based page type, the browser engine will take a screenshot of the browser page corresponding to the test page to obtain a screenshot of the target page of the test page.
[0039] In one embodiment, before loading the test page corresponding to the received page test instruction, the process includes:
[0040] Obtain the test configuration information input for the test page; the test configuration information includes color block configuration information, benchmark page, and preset keywords;
[0041] Based on the test configuration information, the page test instructions are generated.
[0042] Secondly, this application also provides a page testing apparatus. The apparatus includes:
[0043] The test page loading module is used to load the test page corresponding to the received page test command in response to the page test command.
[0044] The page screenshot module is used to obtain a screenshot of the target page of the test page if the test page is detected to have finished loading.
[0045] An anomaly detection module is used to perform anomaly detection processing on the target page screenshot under multiple visual feature dimensions according to the test configuration information carried by the page test instruction, and obtain the anomaly detection results of the target page screenshot under the multiple visual feature dimensions.
[0046] The result determination module is used to determine the target test result of the test page based on the anomaly detection results of the multiple visual feature dimensions.
[0047] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0048] In response to the received page test command, load the test page corresponding to the page test command;
[0049] If the test page is detected to have finished loading, then obtain a screenshot of the target page of the test page;
[0050] Based on the test configuration information carried by the page test instruction, anomaly detection processing is performed on the target page screenshot under multiple visual feature dimensions to obtain the anomaly detection results of the target page screenshot under the multiple visual feature dimensions.
[0051] Based on the anomaly detection results of the multiple visual feature dimensions, the target test result of the test page is determined.
[0052] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0053] In response to the received page test command, load the test page corresponding to the page test command;
[0054] If the test page is detected to have finished loading, then obtain a screenshot of the target page of the test page;
[0055] Based on the test configuration information carried by the page test instruction, anomaly detection processing is performed on the target page screenshot under multiple visual feature dimensions to obtain the anomaly detection results of the target page screenshot under the multiple visual feature dimensions.
[0056] Based on the anomaly detection results of the multiple visual feature dimensions, the target test result of the test page is determined.
[0057] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0058] In response to the received page test command, load the test page corresponding to the page test command;
[0059] If the test page is detected to have finished loading, then obtain a screenshot of the target page of the test page;
[0060] Based on the test configuration information carried by the page test instruction, anomaly detection processing is performed on the target page screenshot under multiple visual feature dimensions to obtain the anomaly detection results of the target page screenshot under the multiple visual feature dimensions.
[0061] Based on the anomaly detection results of the multiple visual feature dimensions, the target test result of the test page is determined.
[0062] The aforementioned page testing method, apparatus, computer equipment, storage medium, and computer program product, in response to a received page testing instruction, load the test page corresponding to the page testing instruction; if the test page is detected to be fully loaded, obtain a screenshot of the target page; perform anomaly detection processing on the target page screenshot under multiple visual feature dimensions according to the test configuration information carried by the page testing instruction, and obtain the anomaly detection results of the target page screenshot under multiple visual feature dimensions; determine the target test result of the test page based on the anomaly detection results of the multiple visual feature dimensions.
[0063] The beneficial effects of this application are as follows: It utilizes visual analysis technology to drive the testing process, accurately identifying the page loading status of the test page through visual perception. After the test page is detected to be fully loaded, a screenshot of the target page is obtained. Based on the test configuration information, anomaly detection processing is performed on the target page screenshot across multiple visual feature dimensions. This allows for comprehensive and accurate identification of visual anomalies, rendering anomalies, and layout anomalies on the test page from multiple perspectives. Finally, the target test result of the test page is determined based on the comprehensive anomaly detection results across multiple visual feature dimensions. This avoids omissions and misjudgments caused by single-dimensional detection, improving the comprehensiveness and accuracy of page anomaly detection, thereby enhancing the accuracy of the target test result of the test page. Attached Figure Description
[0064] Figure 1 This is a diagram illustrating the application environment of a page testing method in one embodiment;
[0065] Figure 2 This is a flowchart illustrating a page testing method in one embodiment;
[0066] Figure 3 This is a flowchart illustrating the steps of performing anomaly detection processing on a target page screenshot across multiple visual feature dimensions in one embodiment.
[0067] Figure 4 This is a schematic diagram illustrating sliding detection processing using a baseline white screen detection window in one embodiment.
[0068] Figure 5 This is a schematic diagram of an interface where the target page screenshot in one embodiment has a white screen anomaly;
[0069] Figure 6This is a schematic diagram showing the comparison results of the image statistical feature histogram of the test page and the image statistical feature histogram of the benchmark page in one embodiment;
[0070] Figure 7 This is a schematic diagram illustrating the principle of a page testing method in one embodiment;
[0071] Figure 8 This is a structural block diagram of a page testing device in one embodiment;
[0072] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0073] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application.
[0074] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0075] The page testing method provided in this application embodiment can be applied to, for example, Figure 1The application environment is shown below. Computer device 101 is the R&D and management equipment used by testers. Computer device 101 is equipped with a visual configuration platform, a real device management platform, a visual analysis and processing server, and a data storage server. The visual configuration platform is a software platform used for developing, configuring, and managing test pages. It provides functional modules such as a test task configuration interface, a task monitoring interface, a result display interface, and a monitoring dashboard. The visual configuration interface supports both form filling and natural language input, and interacts with the backend server asynchronously via Ajax (Asynchronous JavaScript and XML) requests to verify the validity of configuration data in real time. The real device management platform is used to manage and schedule real devices on different operating platforms and operating systems, such as iOS, Android, HarmonyOS, and Web. The visual analysis and processing server is equipped with a GPU (Graphics Processing Unit) accelerator card for performing computationally intensive tasks such as OCR (Optical Character Recognition) technology and image analysis. The data storage server is used to store screenshots, test reports, historical data, and other information.
[0076] The visualization configuration platform, the physical device management platform, the visual analysis and processing server, and the data storage server can be connected via an internal network. The visualization configuration platform and the physical device management platform communicate via API (Application Programming Interface). The physical device management platform controls the physical device 102 via USB (Universal Serial Bus) or a wireless network. The visual analysis and processing server receives screenshot data from the physical device 102 via a message queue and returns the analysis results. The data storage server provides a unified data access interface for each module to call.
[0077] Computer device 101 may include, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices (such as smart speakers), and portable wearable devices (such as smart bracelets, smartwatches, and head-mounted devices). Real device 102 refers to the actual physical device used for testing; a real device possesses complete physical components, such as processors, memory, storage, screens, cameras, and sensors, and can realistically reflect the operation of the test page in the hands of an actual user. Real device 102 includes various models and system versions of mobile devices and PC (Personal Computer) devices used to perform actual page access and screenshot tasks.
[0078] In one embodiment, such as Figure 2 As shown, a page testing method is provided, which can be applied to... Figure 1 Taking a computer device as an example, the explanation includes the following steps:
[0079] Step S201: In response to the received page test instruction, load the test page corresponding to the page test instruction.
[0080] The page test instructions are used to direct computer program commands for testing terminal pages. Terminal pages refer to pages displayed on various terminal devices such as mobile phones, tablets, and computers. The types of terminal pages include, but are not limited to, web pages displayed by browsers, native pages displayed by various apps (Applications) and web pages embedded in apps, as well as native pages and web pages embedded in mini-programs within apps such as WeChat.
[0081] For example, the visual configuration platform generates page test instructions based on the page information of the test page to be tested, and sends the page test instructions to the real device management platform. The real device management platform responds to the page test instructions sent by the visual configuration platform, establishes connections with real devices running various operating systems such as iOS, Android, HarmonyOS, and Web, maintains a stable connection with each real device, and obtains operational permissions for each real device. After successful connection, each real device waits to receive the page information of the test page to be tested, and the applications on the real device maintain a designated login status for immediate response. This method of establishing connections with real devices for page testing is highly cross-platform compatible, effectively masking differences between different terminals and operating systems. It uniformly adopts URL-driven and visual analysis technologies, applicable to mobile apps, H5 pages, mini-programs, and PC web pages on operating systems such as iOS, Android, and HarmonyOS, achieving a single solution covering anomaly detection for multiple page types.
[0082] The real device management platform allocates appropriate real devices based on page test instructions, supporting parallel execution by multiple real devices to improve testing efficiency. The platform calls the corresponding loading driver based on the page type of the test page specified in the test instruction, and loads the page address of the test page through the loading driver. For example, if the page type is a mobile page, the computer device can use URL Schema (a custom protocol format used for inter-app navigation, wake-up, and communication) or Deep Link (a technology that allows direct deep jumps from the outside to a specific page within an app) to directly wake up the real device and open the test page. If the page type is a PC web page, the computer device can control the browser engine in the real device to open the test page carrying the page address from the test configuration information. Additionally, other types of device management platforms can drive emulators to open the target page and take screenshots, or the target page can be opened and screenshots taken on the operator's local emulator terminal.
[0083] Computer equipment monitors the loading progress of test pages on real devices in real time to determine whether the test pages have finished loading. For example, AI (Automatic Intelligence) technologies such as OCR text recognition, image feature extraction, and similarity analysis of adjacent pages can be used to intelligently determine the page loading status, reducing manual intervention and improving the accuracy of detection.
[0084] Step S202: If the test page is detected to have finished loading, obtain a screenshot of the target page of the test page.
[0085] The target page screenshot refers to a screenshot taken after the test page has finished loading and rendering.
[0086] For example, when it is detected that the test page has finished loading and rendering on the real device, the real device management platform drives the corresponding components on the real device to take a screenshot of the test page. Then the real device obtains the target page screenshot of the test page and sends the target page screenshot to the computer device.
[0087] Step S203: Based on the test configuration information carried by the page test command, perform anomaly detection processing on the target page screenshot under multiple visual feature dimensions to obtain the anomaly detection results of the target page screenshot under multiple visual feature dimensions.
[0088] Among them, test configuration information refers to the information configured for testing pages, such as page content, page address, and content to be tested.
[0089] For example, the computer device can perform anomaly detection processing on the target page screenshot under multiple visual feature dimensions based on the test configuration information. For example, it can cover anomaly detection under multiple visual feature dimensions such as white screen detection, page restoration degree, abnormal keyword detection and illegal content detection, and output the anomaly detection results of the target page screenshot under each visual feature dimension.
[0090] Step S204: Determine the target test result of the test page based on the anomaly detection results of multiple visual feature dimensions.
[0091] For example, if the anomaly detection results for the test page are all negative across all visual feature dimensions, then the target test result for the test page is confirmed to be negative. If at least one anomaly detection result is positive, then the target test result for the test page is confirmed to be negative. A comprehensive anomaly detection report is generated by combining the anomaly detection results across all visual feature dimensions. This report includes test information for the test page (real device, test time, etc.), anomaly type and quantity statistics, a detailed description of each anomaly (e.g., anomaly location, anomaly content, screenshot annotations, etc.), a screenshot of the target page, and highlighted anomaly areas within the screenshot.
[0092] In some embodiments, the anomaly detection report can also be displayed in a visual manner. The visualized anomaly detection report includes real-time screenshots, anomaly area annotations, difference heatmaps, statistical charts, etc., enabling developers to intuitively and quickly locate and understand page anomalies and improve the efficiency of problem investigation.
[0093] If the target test result on the test page is abnormal, the page developers can be alerted via email, instant messaging tools, system messages, etc. It supports custom alert rules and alert recipients, and provides anomaly trend analysis and statistical reports; the target test result can also be stored on a data storage server.
[0094] In the above-mentioned page testing method, visual analysis technology is used to drive the testing process. The page loading status of the test page is accurately identified through visual perception, and a screenshot of the target page is obtained after the test page is detected to be loaded. Anomaly detection processing is performed on the target page screenshot under multiple visual feature dimensions according to the test configuration information. This can comprehensively and accurately identify visual anomalies, rendering anomalies, and layout anomalies on the test page from multiple levels. Finally, the target test result of the test page is determined based on the anomaly detection results of multiple visual feature dimensions. This avoids omissions and misjudgments caused by single-dimensional detection, improves the comprehensiveness and accuracy of page anomaly detection, and thus improves the accuracy of the target test result of the test page.
[0095] In one embodiment, step S203 above, based on the test configuration information carried by the page test instruction, performs anomaly detection processing on the target page screenshot under multiple visual feature dimensions to obtain anomaly detection results for the target page screenshot in multiple visual feature dimensions. Specifically, this includes performing anomaly detection processing on the target page screenshot in at least two of the following visual feature dimensions: performing white screen detection processing on the target page screenshot based on the color block configuration information in the test configuration information to obtain a white screen detection result for the target page screenshot; performing image comparison processing on the baseline page and the target page screenshot in the test configuration information to obtain an image comparison result for the target page screenshot; performing keyword detection processing on the target page screenshot based on the preset keywords in the test configuration information to obtain a keyword detection result for the target page screenshot; performing content detection processing on the target page screenshot for text and images to obtain a content detection result for the target page screenshot; and obtaining anomaly detection results for multiple visual feature dimensions based on at least two of the white screen detection result, image comparison result, keyword detection result, and content detection result.
[0096] The test configuration information includes at least color block configuration information, a baseline page image, and preset keywords.
[0097] Among them, the color block configuration information is used to characterize the information for the test page regarding the solid color block configuration for the page. A solid color block refers to an area composed of a single color that has no texture, no gradient, and no impurities.
[0098] For example, the computer device detects solid color block information, such as the area of solid color blocks in the target page screenshot, based on color block configuration information to confirm whether there are abnormal white screens in the target page screenshot (e.g., the area of an abnormal white screen is larger than the area of the largest solid color block area in the color block configuration information), and outputs the white screen detection result. The computer device compares the screenshots of the baseline page and the target page to determine whether there are differences in layout, elements, colors, fonts, and other aspects of the target page screenshot compared to the original design (i.e., the baseline page), and outputs the image comparison result of the target page screenshot. The computer device detects whether the text in the target page screenshot matches preset keywords to determine whether there are page error messages in the target page screenshot, and outputs the keyword detection result of the target page screenshot. The computer device detects whether the text and images in the target page screenshot violate regulations, and outputs the content detection result of the target page screenshot. Of course, anomaly detection can also be performed based on test configuration information, considering multiple visual feature dimensions such as completeness recognition and abnormal layout recognition. Finally, by combining at least two of the detection results from visual feature dimensions such as white screen detection results, image comparison results, keyword detection results, and content detection results, the anomaly detection results of the target page screenshot are obtained.
[0099] In this embodiment, multiple test configuration information, such as color block configuration information, benchmark page, and preset keywords, are combined to perform multiple detection operations on the target page screenshot, including white screen detection, image comparison, keyword recognition, and image and text content detection. Verification is carried out from multiple visual feature dimensions, such as page display status, screen differences, keywords causing page errors, and compliance of image and text content. This breaks the limitations of a single detection method and can comprehensively and meticulously uncover various potential anomalies in the page screenshot, enriching the coverage dimensions and judgment criteria of anomaly detection, thereby effectively improving the comprehensiveness, accuracy, and reliability of page anomaly detection.
[0100] In one embodiment, such as Figure 3 As shown, the above steps, based on the color block configuration information in the test configuration information, perform white screen detection processing on the target page screenshot to obtain the white screen detection result of the target page screenshot, specifically including the following:
[0101] Step S301: Based on the color block configuration information in the test configuration information, determine the baseline white screen detection window for the target page screenshot.
[0102] The color block configuration information includes details such as the area, position, and color of each solid color block area configured on the test page. For example, the color block configuration information includes the area information of the largest solid color block area configured on the test page.
[0103] The baseline white screen detection window refers to a sliding window used to detect whether there is an abnormal white screen in the screenshot of the target page.
[0104] For example, the computer device parses the page test instructions to obtain the color block configuration information of the test page. The test configuration information includes information such as the area, position, and color of each pure color block area configured on the test page. Based on the area of the largest pure color block area in the color block configuration information, the computer device determines a baseline white screen detection window for the test page. For example, the size of the baseline white screen detection window can be set to be larger than the area of the largest pure color block area on the test page, in order to detect whether there are any abnormal white screen situations on the test page. For example, if a pure color block larger than the configured largest pure color block area is detected in the window, it indicates that an abnormal white screen situation may have occurred.
[0105] Step S302: Through the baseline white screen detection window, perform sliding detection processing on the target page screenshot to obtain the color block detection information of the target page screenshot within the baseline white screen detection window.
[0106] Among them, the color block detection information is used to describe the position, area, and color of the pure color block detected within the baseline white screen detection window.
[0107] For example, Figure 4This is a schematic diagram illustrating the sliding detection process using a baseline white screen detection window, as shown below. Figure 4 The baseline white screen detection window can be started from the origin of the target page screenshot (e.g., the first pixel of the top left corner of the target page screenshot) and slid sequentially (e.g., from left to right, from top to bottom). The computer device calculates whether the image within the baseline white screen detection window is a solid color block; if a solid color block is detected, its position, area, and color are detected to obtain the color block detection information within the baseline white screen detection window.
[0108] Step S303: Determine the white screen detection result of the target page screenshot based on the detection information and configuration information of each color block.
[0109] For example, if the area of at least one color block detection information is greater than the area of the largest color block region in the color block configuration information, then the white screen detection result of the target page screenshot is determined to be a white screen anomaly, that is, the test page has a white screen anomaly. Figure 5 The screenshot shows an interface with a white screen error. In practical applications, white screen errors include, but are not limited to, only the page background, the page being almost entirely white, and parts of the page being white.
[0110] In this embodiment, the baseline white screen detection window of the target page screenshot is flexibly configured based on the color block configuration information in the test configuration information, which can improve the targeting and accuracy of white screen detection. By performing sliding detection processing on the target page screenshot through the baseline white screen detection window, the color block detection information in the corresponding area can be obtained comprehensively and meticulously. Then, the white screen detection result is determined by comprehensively determining the color block detection information and the color block configuration information, which can realize the automated and standardized judgment of page white screen anomalies. The detection conclusion can be quickly output without manual intervention, which improves the accuracy and reliability of white screen detection, and also improves the efficiency of page anomaly detection.
[0111] In one embodiment, step S303 above, which determines the white screen detection result of the target page screenshot based on the detection information of each color block and the configuration information of the color block, specifically includes the following: based on the detection information of each color block, the standard deviation of each color channel of the target page screenshot within the baseline white screen detection window is obtained; if the standard deviation of each color channel is less than the standard deviation threshold corresponding to the color block configuration information, then it is confirmed that the white screen detection result indicates that there is a white screen anomaly in the target page screenshot.
[0112] The standard deviation threshold can be set based on the color of the largest pure color block area in the color block configuration information, or it can be set based on empirical or experimental values.
[0113] For example, the target page screenshot can be an RGB (Red Green Blue) color image. If the image within the baseline white screen detection window is detected to be a solid color block, the standard deviation σ of the image within the baseline white screen detection window in each color channel is calculated. The standard deviation σ is calculated as follows:
[0114]
[0115] In the formula, σ c The standard deviation of color channel c (including R, G, and B channels) is represented by: H; the height of the baseline white screen detection window (number of pixel columns); W; the width of the baseline white screen detection window (number of pixel rows); and N, the total number of pixels within the baseline white screen detection window (N = H * W). ijc This represents the pixel value of the pixel in the i-th row and j-th column within the baseline white screen detection window, on the c-th color channel; μ c This represents the average pixel value of the c-th color channel within the detection window, which is the average value of all pixel values in that color channel.
[0116] If the standard deviation of each color channel is detected to be less than the standard deviation threshold T sd This indicates the presence of unexpected blank solid-color areas, confirming that the image within the baseline white screen detection window is a white screen anomaly, and thus confirming that the target page screenshot also has a white screen anomaly. In practical applications, the white screen detection result (Uniform) of the target page screenshot can be represented by the following formula:
[0117]
[0118] In this embodiment, the standard deviation of each color channel in the target page screenshot within the baseline white screen detection window is obtained based on the color block detection information. This quantifies the color uniformity of the page area, providing objective and reliable data for judging white screen anomalies. By comparing the standard deviation of each color channel with the standard deviation threshold corresponding to the color block configuration information, the automated and standardized judgment of white screen anomalies can be achieved, avoiding the subjectivity and misjudgment risk brought by manual judgment, and improving the accuracy and stability of white screen detection. At the same time, the judgment logic is simple, efficient, and computationally inefficient, and can quickly output detection results, effectively improving the overall efficiency of page anomaly detection.
[0119] In one embodiment, the above steps perform image comparison processing on the screenshots of the benchmark page and the target page in the test configuration information to obtain the image comparison result of the target page screenshot. Specifically, this includes: obtaining the image features and image statistical feature histogram of the test page based on the target page screenshot; obtaining the image features and image statistical feature histogram of the benchmark page in the test configuration information; calculating the histogram similarity between the image statistical feature histogram of the test page and the image statistical feature histogram of the benchmark page to obtain the histogram similarity between the test page and the benchmark page; obtaining the structural similarity between the target page screenshot and the benchmark page based on the image features of the test page and the benchmark page; and obtaining the image comparison result of the target page screenshot based on the histogram similarity and structural similarity.
[0120] The baseline page refers to the design draft image of the test page; it can be obtained by taking a screenshot of the test page during the page design phase. For example, after the test page is developed, a screenshot of the test page can be taken and saved as the baseline page.
[0121] For example, image features and image histograms of the target page screenshot are extracted and labeled as image features and image statistical feature histograms of the test page, respectively. Image features and image histograms of the benchmark page in the test configuration information are extracted and labeled as image features and image statistical feature histograms of the benchmark page, respectively. Histogram similarity (HistSim) between the image statistical feature histograms of the test page and the benchmark page is calculated using a similarity algorithm. Structural similarity (SSIM) between the image features of the test page and the benchmark page is also calculated. Finally, the target similarity between the target page screenshot and the benchmark page is obtained by combining the histogram similarity and structural similarity. The calculation method for the target similarity is as follows:
[0122] FinallScore = n * SSIM + m * HistSim
[0123] In the formula, FinallScore represents the target similarity; m represents the weight of histogram similarity; n represents the weight of structural similarity, and m+n=1.
[0124] Among them, the image statistical feature histogram (including the image statistical feature histogram of the test page and the image statistical feature histogram of the benchmark page) can reflect the difference regions between two images. For example, the image statistical feature histogram can be calculated based on image statistical features such as color distribution and brightness distribution. Figure 6 This is a schematic diagram showing the comparison results between the image statistical feature histogram of the test page and the image statistical feature histogram of the benchmark page. Figure 6The horizontal axis in the graph represents the image's statistical features. In practical applications, these features are typically the grayscale, brightness, or color channel intensity values of pixels. Figure 6 The vertical axis in the graph represents the number of pixels corresponding to the image statistical feature (or the frequency of occurrence of the image statistical feature).
[0125] Image features (including those of the test page and the baseline page) can reveal the specific differences between the two images. Image features include visual characteristics such as page layout structure and element positions.
[0126] Among them, target similarity can reflect the degree to which the target page screenshot reproduces the reference image.
[0127] If the target similarity is lower than a preset similarity threshold, it indicates that the target page screenshot has a low degree of fidelity to the reference image, and there are obvious visual differences between the two. Therefore, image registration is performed on the target page screenshot and the reference image to handle issues such as resolution and size differences, ensuring that the two images are compared in the same coordinate system. Through image comparison algorithms, detailed difference information is detected between the target page screenshot and the reference image, including differences in element position, element size (width, height, ratio, etc.), color (background color, text color, icon color, etc.), font (font type, font size, font weight, etc.), and layout (spacing, alignment, arrangement, etc.). The target similarity, along with the target similarity and difference information of the target page screenshot, is set as the image comparison result between the target page screenshot and the reference page.
[0128] In addition, other image feature extraction algorithms such as mean square error, peak signal-to-noise ratio, and perceptual hashing can be used to determine page similarity, thereby achieving the detection effect of whether static pages have undergone abnormal changes.
[0129] In this embodiment, by performing similarity processing on the image statistical feature histogram of the test page and the image statistical feature histogram of the benchmark page, a histogram similarity is obtained. This can accurately reflect the degree of similarity between pages from the perspective of overall color distribution. At the same time, based on the image features of the test page and the benchmark page, a structural similarity is obtained, which can accurately depict page differences from the details of page layout, element structure, etc. The combination of the two effectively improves the comprehensiveness and accuracy of the comparison between the target page screenshot and the benchmark page, thereby improving the reliability and accuracy of the image comparison results.
[0130] In one embodiment, step S203, which involves performing keyword detection processing on a screenshot of the target page based on preset keywords in the test configuration information to obtain keyword detection results for the screenshot, specifically includes the following: performing optical character recognition processing on the screenshot of the target page to obtain text information in the screenshot; performing keyword detection processing on the text information to obtain keywords in the text information; performing text matching processing on the keywords based on preset keywords in the test configuration information and abnormal keywords in the keyword database to obtain text matching results for the keywords; the text matching results are used to characterize whether there are target keywords that match the preset keywords and / or abnormal keywords; and determining the keyword detection results for the screenshot of the target page based on the text matching results.
[0131] The keyword database refers to a database used to store abnormal keywords. Abnormal keywords are keywords that describe abnormal situations on the page.
[0132] Among them, preset keywords refer to keywords that are pre-set to address possible anomalies on the test page.
[0133] It's important to note that both preset keywords and exception keywords are terms used to describe abnormal page conditions. The difference lies in that exception keywords are common, frequently used terms for reporting page errors, while preset keywords also include custom, special, or less common terms for reporting page errors.
[0134] For example, computer vision OCR technology is used to extract text information from a screenshot of a target page. This text information includes all text in the screenshot and its attributes such as position, font, and color. First, keyword detection is performed on the text information to obtain the keywords. Then, based on preset keywords in the test configuration information and abnormal keywords in the keyword dictionary, text matching is performed on the keywords. For instance, the keyword dictionary is used to detect whether the keywords in the text information contain common abnormal keywords such as "404," "500," "network error," "loading failure," and "service exception," and whether custom, special, or rare preset keywords appear. The first text matching result of the obtained keywords is then output.
[0135] Furthermore, necessary business keywords can be pre-set in the test configuration information, and the second text matching results of the keywords in the text information can be output. Finally, based on the first and second text matching results, the keyword detection result of the target page screenshot is comprehensively determined; for example, if the second text matching result indicates that the keywords in the text information are missing at least one business keyword, then the keyword detection result is confirmed to be abnormal; or, if the first text matching result indicates that the keywords in the text match at least one abnormal keyword or a preset keyword, then the keyword detection result is confirmed to be abnormal; otherwise, the keyword detection result is confirmed to be normal. The computer equipment can also record detailed information such as the anomaly type, the abnormal keyword, and the location where the abnormal keyword appears.
[0136] In this embodiment, by performing optical character recognition (OCR) processing on the target page screenshot to extract the text information, the page can be transformed from visual image content into text content, achieving non-intrusive page text information collection. By performing keyword detection on the text information and combining preset keywords with abnormal keywords for text matching processing, it is possible to accurately identify whether there is expected key content or abnormal sensitive content on the page, effectively improving the targeting and accuracy of text detection, reducing manual verification costs, thereby improving the intelligence level and detection efficiency of page testing, while ensuring the objectivity and consistency of the detection results.
[0137] In one embodiment, the above steps perform content detection processing on the target page screenshot for both text and image to obtain the content detection result of the target page screenshot. Specifically, this includes: performing semantic recognition processing on the text information to obtain the semantic information of the text information; performing text content detection processing on the text information and the semantic information to obtain the text content detection result of the target page screenshot; performing image content detection processing on the target page screenshot to obtain the image content detection result of the target page screenshot; and obtaining the content detection result of the target page screenshot based on the text content detection result and the image content detection result.
[0138] Among them, the text content detection results are used to reflect whether the text information contains illegal information, sensitive words, inappropriate expressions, or other textual violations.
[0139] Among them, the image content detection results are used to reflect whether the target page screenshot contains illegal image content.
[0140] Computer devices can combine acquired text and images, using natural language processing and image understanding technologies to obtain the semantic meaning of the test page content, understand the business scenario and functional intent of the test page, and identify whether it contains illegal content. For example, computer devices can use semantic recognition models based on natural language processing or large-scale models to perform semantic recognition processing on text information, understand the meaning of the text information, and obtain the corresponding semantic information. Text content detection processing of text information and semantic information can identify whether it contains illegal content from both deep semantic and literal meaning dimensions, outputting the text content detection result. Image content detection processing of the target page screenshot can involve inputting the target page screenshot into an image recognition model based on deep learning or large-scale models to identify whether there is illegal image content in the target page screenshot, obtaining the image content detection result of the target page screenshot. If at least one of the text content detection result and the image content detection result indicates a violation, the content detection result of the target page screenshot is confirmed as abnormal; otherwise, the content detection result of the target page screenshot is confirmed as abnormally normal. The text content detection results and image content detection results can also record information such as the type, location, and severity of the violation.
[0141] In this embodiment, semantic information is obtained by semantic recognition of text information. Then, text content detection processing is performed on the text information and semantic information to comprehensively identify the page text content from both literal and deep semantic dimensions, improving the completeness and accuracy of text detection. At the same time, image content detection processing is performed on the target page screenshot to obtain the detection of illegal content in the image visual aspect of the target page screenshot, realizing multimodal illegal content detection of the target page screenshot. Finally, the content detection results of the target page screenshot are obtained by combining the text content detection results and the image content detection results. Comprehensive analysis and judgment are performed from both text semantic and visual image aspects, which greatly improves the accuracy, reliability and intelligence of page content detection, thereby improving the overall testing effect of page testing.
[0142] In one embodiment, step S202, obtaining a screenshot of the target page of the test page, specifically includes the following: if the test page is detected to be a mobile page type, then the screen capture program of the mobile device used to display the test page is used to capture a screenshot of the device interface of the mobile device to obtain a screenshot of the target page of the test page; if the test page is detected to be a web page type, then the browser page corresponding to the test page is captured by the browser engine to obtain a screenshot of the target page of the test page.
[0143] For different types of test pages, the real device can adaptively select different screenshot components (i.e., screenshot programs, screenshot plugins, browser engines, etc.) to perform page screenshots. For example, if the test page is detected as a mobile page, such as a page on a mobile device's application, the real device management platform can drive the mobile device's screenshot program to take a full-screen screenshot of all content on the mobile device's display screen and set this full-screen screenshot as the target page screenshot for the test page. If the test page is detected as a web page, such as a browser page on a PC device, the real device management platform can control the PC device's browser engine to take a screenshot of the browser page's content and set this browser page screenshot as the target page screenshot for the test page. The real device management platform obtains the target page screenshot returned by the real device (including mobile devices and PC devices) and stores the target page screenshot on the data storage server.
[0144] In this embodiment, screenshots are taken using corresponding screenshot components based on the page type of the test page. For example, screenshots can be taken directly using a screenshot program on a mobile device or through a browser engine on a PC. This achieves accurate adaptation and screenshot processing for different types of test pages, ensuring that the screenshot results are consistent with the actual displayed interface and improving the authenticity and accuracy of the page screenshots. At the same time, it eliminates the need to develop complex screenshot logic for different real devices, simplifying the cross-platform screenshot process, reducing the complexity and adaptation cost of screenshot implementation, and thus enhancing the versatility and robustness of the page testing solution.
[0145] In one embodiment, before loading the test page corresponding to the received page test instruction in response to the above step S201, the method includes: obtaining test configuration information input for the test page; the test configuration information includes color block configuration information, a baseline page, and preset keywords; and generating a page test instruction based on the test configuration information.
[0146] For example, before conducting page testing, test configuration information for the test page, expressed in natural language, is obtained. Test engineers can input test configuration information in a visual configuration platform using natural language, based on the page design and test requirements. They can also fill in various test configuration details sequentially in a visual form provided by the platform, or import test configuration information in batches. This test configuration information includes, but is not limited to, the page address, test content (such as white screen detection, keyword detection, and page comparison), the area of the largest allowed solid color block on the page and the standard deviation threshold of the color channels, a list of business keywords, a list of erroneous keywords, a benchmark page (optional, obtainable by taking a screenshot of the test page), and detection execution strategies (such as immediate execution, scheduled execution, and continuous monitoring).
[0147] When performing page testing, the visual configuration platform generates page test instructions based on the page information of the test page to be tested, and sends the page test instructions to the real device management platform.
[0148] In this embodiment, the configuration information of the test page (i.e., test configuration information) is described by natural language description, configuration parameters, and a designed baseline page. This reduces the dependence on code, so that when the page layout or page interaction logic changes, the baseline page or natural language description can be modified accordingly. This lowers the barrier to entry and reduces maintenance costs. Operators do not need to have programming skills and can complete the creation and management of test cases through a visual configuration interface, which greatly reduces the development, maintenance and management costs of test cases.
[0149] To more clearly illustrate the page testing method provided in this disclosure, a specific embodiment is given below to describe the page testing method in detail. A page testing method is provided that can be applied to… Figure 1 The computer equipment in the document specifically includes the following:
[0150] Figure 7This diagram illustrates the principle of the page testing method. Developers configure test pages on computer devices, including various types of mobile apps, H5 pages, mini-programs, and PC front-end pages. Operators configure test pages through a visual configuration platform. This platform provides functional modules such as a task configuration interface, task monitoring interface, result display interface, and monitoring dashboard. It offers two configuration methods: natural language input and visual forms. Configuration content includes the URL address or URL schema of the page to be tested, page type, selected detection items, detection parameters, keyword list, upload of baseline design drafts, and execution strategy. During testing, developers can view the execution status, progress, and logs in real time on the monitoring interface, facilitating troubleshooting. After testing, a visual detection report is generated, displaying the detection conclusions, results of each detection item, anomaly statistics charts, and anomaly severity distribution. Anomaly areas are highlighted on screenshots and provided with detailed explanations. Design draft comparison testing provides side-by-side comparison views and difference heatmaps, displaying detailed data such as position offset, color difference, and size difference, and calculating the overall fidelity score. The test report supports exporting in PDF, HTML, and Excel formats, and includes complete configuration information, execution time, device information, screenshot evidence, and anomaly details. It also provides an alarm function, allowing configuration of multiple alarm recipients, various alarm methods, and alarm level rules, automatically triggering alarms based on the severity of the anomaly. Continuous monitoring tasks provide a monitoring dashboard displaying page quality trends, anomaly frequency, historical data, and other data; it supports setting monitoring cycles or trigger conditions to achieve automated quality monitoring. The system supports unified management of multiple pages and projects, providing functions such as project grouping, batch configuration, quality scoring, and trend analysis; it identifies high-frequency problems through historical data analysis, providing data support for quality improvement. The visual configuration platform supports permission management, assigning appropriate operation permissions to different roles such as administrators, developers, testers, and project managers.
[0151] At the start of the test, the real device management platform connects to each operating system device and obtains device operation permissions, i.e., authentication, such as Token, User login, Cookie, Time of Flight (TOF), and Local storage permissions; the real device waits to receive the target page information to be tested, and each application on the mobile device maintains a specified login state; the designated real device receives the page test command, and if it is a mobile-type page, the real device management platform uses the mobile device's URL. The system immediately opens the test page. If it's a PC web page, the real device management platform controls the PC device's browser engine to open the test page with specified request header information and preset user information. It intelligently analyzes the test page's loading status and immediately takes a screenshot upon successful loading to obtain the target page screenshot. For mobile pages, the real device management platform drives the mobile device's screenshot program to take a full-screen screenshot of the device's display content. For PC web pages, the real device management platform controls the PC device's browser engine to take a full-screen screenshot of the page content within the browser. Through anomaly detection across multiple visual feature dimensions, including white screen recognition, abnormal keyword detection, completeness recognition, abnormal layout recognition, and other unknown anomaly recognition, the system determines whether the target page screenshot contains anomalies.
[0152] After completing all anomaly detections, the results are summarized to generate the target test results and a visualized anomaly detection report. The anomaly detection report includes detection conclusions, anomaly type statistics, detailed information for each anomaly, screenshots, and annotations. The anomaly detection report data is stored in a database, and an alert service is notified via a message queue.
[0153] The alarm service sends alarm notifications and automatically generates reports through multiple message notification channels based on the severity of the anomaly and alarm configuration. It supports alarm rule configuration, such as limiting alarms to only severe anomalies or setting alarm frequency limits. Alarm messages include an anomaly summary and report links, facilitating quick problem confirmation by operators in display modules such as the "Data Dashboard" and "Page Plaza."
[0154] For test pages that require continuous monitoring, computer devices support scheduled or triggered automatic execution of detection tasks. Based on pre-configured monitoring strategies, monitoring tasks can be triggered on a scheduled basis, supporting anomaly detection to be performed at fixed intervals or when specific events are triggered (such as after a version release).
[0155] In this embodiment, at least the following beneficial effects are achieved: (1) The threshold for use and maintenance costs are reduced. Operators do not need to have programming skills and can complete the creation and management of test cases through a visual configuration interface. When the page layout or interaction logic changes, the configuration parameters can be updated quickly without modifying the code, which greatly reduces the development, maintenance and management costs of test cases. (2) The method of establishing a connection with a real device for page testing has strong cross-platform universality and can shield the differences between different terminals and operating systems. It uniformly adopts URL-driven and visual analysis technology, which is applicable to mobile APP, H5, mini-programs and PC web pages of operating systems such as iOS, Android, and HarmonyOS, and realizes a solution that covers the anomaly detection of multiple page types. (3) The detection dimensions are comprehensive and efficient, covering multiple visual feature dimensions such as white screen recognition, abnormal keyword detection, completeness recognition, and abnormal layout recognition. The detection is completed quickly through visual analysis technology, and a comprehensive detection report can be output in a short time to efficiently discover page defects.
[0156] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0157] Based on the same inventive concept, this application also provides a page testing apparatus for implementing the page testing method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more page testing apparatus embodiments provided below can be found in the limitations of the page testing method described above, and will not be repeated here.
[0158] In one embodiment, such as Figure 8 As shown, a page testing apparatus 800 is provided, comprising:
[0159] The test page loading module 801 is used to load the test page corresponding to the received page test command.
[0160] The page screenshot module 802 is used to obtain a screenshot of the target page of the test page if the test page is detected to have finished loading.
[0161] The anomaly detection module 803 is used to perform anomaly detection processing on the target page screenshot under multiple visual feature dimensions according to the test configuration information carried by the page test command, and obtain the anomaly detection results of the target page screenshot under multiple visual feature dimensions.
[0162] The result determination module 804 is used to determine the target test result of the test page based on the anomaly detection results of multiple visual feature dimensions.
[0163] In one embodiment, the anomaly detection module 803 is further configured to perform anomaly detection processing on the target page screenshot in at least two of the following visual feature dimensions: perform white screen detection processing on the target page screenshot based on the color block configuration information in the test configuration information to obtain the white screen detection result of the target page screenshot; perform image comparison processing on the baseline page and the target page screenshot in the test configuration information to obtain the image comparison result of the target page screenshot; perform keyword detection processing on the target page screenshot based on the preset keywords in the test configuration information to obtain the keyword detection result of the target page screenshot; perform content detection processing on the target page screenshot for text and images to obtain the content detection result of the target page screenshot; and obtain anomaly detection results in multiple visual feature dimensions based on at least two of the white screen detection result, image comparison result, keyword detection result, and content detection result.
[0164] In one embodiment, the page testing device 800 further includes a white screen detection module, which is used to determine a baseline white screen detection window for the target page screenshot based on the color block configuration information; to perform sliding detection processing on the target page screenshot through the baseline white screen detection window to obtain the color block detection information of the target page screenshot within the baseline white screen detection window; and to determine the white screen detection result of the target page screenshot based on the color block detection information and the color block configuration information.
[0165] In one embodiment, the page testing device 800 further includes a white screen anomaly detection module, which is used to obtain the standard deviation of each color channel of the target page screenshot within the baseline white screen detection window based on the detection information of each color block; if the standard deviation of each color channel is less than the standard deviation threshold corresponding to the color block configuration information, it is confirmed that the white screen detection result indicates that there is a white screen anomaly in the target page screenshot.
[0166] In one embodiment, the page testing device 800 further includes an image comparison module, configured to obtain image features of the test page and an image statistical feature histogram of the test page based on a screenshot of the target page; and to obtain image features of a benchmark page and an image statistical feature histogram of the benchmark page; calculate the histogram similarity between the image statistical feature histogram of the test page and the image statistical feature histogram of the benchmark page to obtain the histogram similarity between the test page and the benchmark page; obtain the structural similarity between the screenshot of the target page and the benchmark page based on the image features of the test page and the image features of the benchmark page; and obtain the image comparison result of the screenshot of the target page based on the histogram similarity and the structural similarity.
[0167] In one embodiment, the page testing device 800 further includes a keyword detection module, which performs optical character recognition processing on the target page screenshot to obtain text information in the target page screenshot; performs keyword detection processing on the text information to obtain keywords in the text information; performs text matching processing on the keywords based on preset keywords in the test configuration information and abnormal keywords in the keyword library to obtain the text matching result of the keywords; the text matching result is used to characterize whether there are target keywords that match the preset keywords and / or abnormal keywords; and determines the keyword detection result of the target page screenshot based on the text matching result.
[0168] In one embodiment, the page testing device 800 further includes a content detection module, which performs semantic recognition processing on the text information to obtain semantic information of the text information; performs text content detection processing on the text information and semantic information to obtain the text content detection result of the target page screenshot; performs image content detection processing on the target page screenshot to obtain the image content detection result of the target page screenshot; and obtains the content detection result of the target page screenshot based on the text content detection result and the image content detection result.
[0169] In one embodiment, the page screenshot module 802 is further configured to, if the page type of the test page is detected to be a mobile page type, perform screenshot processing on the device interface of the mobile device used to display the test page through a screenshot program to obtain a target page screenshot of the test page; if the page type is detected to be a web page type, perform screenshot processing on the browser page corresponding to the test page through a browser engine to obtain a target page screenshot of the test page.
[0170] In one embodiment, the page testing device 800 further includes a test configuration module for acquiring test configuration information input for the test page; the test configuration information includes color block configuration information, a baseline page, and preset keywords; and generates page test instructions based on the test configuration information.
[0171] Each module in the aforementioned page testing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0172] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 9 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a page testing method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0173] Those skilled in the art will understand that Figure 9 The structure shown is a block diagram of a partial structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0174] In one embodiment, a computer device is also provided, 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 method embodiments.
[0175] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0176] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0177] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0178] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0179] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A page testing method, characterized in that, The method includes: In response to the received page test command, load the test page corresponding to the page test command; If the test page is detected to have finished loading, then obtain a screenshot of the target page of the test page; Based on the test configuration information carried by the page test instruction, anomaly detection processing is performed on the target page screenshot under multiple visual feature dimensions to obtain the anomaly detection results of the target page screenshot under the multiple visual feature dimensions. Based on the anomaly detection results of the multiple visual feature dimensions, the target test result of the test page is determined.
2. The method according to claim 1, characterized in that, The step of performing anomaly detection processing on the target page screenshot under multiple visual feature dimensions based on the test configuration information carried by the page test instruction, and obtaining the anomaly detection results of the target page screenshot under the multiple visual feature dimensions, includes: The target page screenshot undergoes anomaly detection processing in at least two visual feature dimensions: Based on the color block configuration information in the test configuration information, a white screen detection process is performed on the target page screenshot to obtain a white screen detection result; an image comparison process is performed between the baseline page in the test configuration information and the target page screenshot to obtain an image comparison result; based on preset keywords in the test configuration information, keyword detection processing is performed on the target page screenshot to obtain a keyword detection result; and content detection processing is performed on the target page screenshot for both text and images to obtain a content detection result. Based on at least two of the white screen detection results, the image comparison results, the keyword detection results, and the content detection results, the anomaly detection results for the multiple visual feature dimensions are obtained.
3. The method according to claim 2, characterized in that, The step of performing white screen detection processing on the target page screenshot based on the color block configuration information in the test configuration information, and obtaining the white screen detection result of the target page screenshot, includes: Based on the color block configuration information, a baseline white screen detection window is determined for the target page screenshot; The target page screenshot is subjected to sliding detection processing through the benchmark white screen detection window to obtain the color block detection information of the target page screenshot within the benchmark white screen detection window; Based on the color block detection information and the color block configuration information, the white screen detection result of the target page screenshot is determined.
4. The method according to claim 3, characterized in that, The step of determining the white screen detection result of the target page screenshot based on the detection information of each color block and the configuration information of the color blocks includes: Based on the color block detection information, the standard deviation of each color channel of the target page screenshot within the baseline white screen detection window is obtained; If the standard deviation of each color channel is less than the standard deviation threshold corresponding to the color block configuration information, then the white screen detection result indicates that there is a white screen anomaly in the target page screenshot.
5. The method according to claim 2, characterized in that, The step of performing image comparison processing on the screenshots of the baseline page and the target page in the test configuration information to obtain the image comparison result of the target page screenshot includes: Based on the screenshot of the target page, the image features of the test page and the image statistical feature histogram of the test page are obtained, and the image features of the benchmark page and the image statistical feature histogram of the benchmark page are obtained. Calculate the histogram similarity between the image statistical feature histogram of the test page and the image statistical feature histogram of the benchmark page to obtain the histogram similarity between the test page and the benchmark page; Based on the image features of the test page and the image features of the benchmark page, the structural similarity between the target page screenshot and the benchmark page is obtained; The image comparison results of the target page screenshot are obtained based on the histogram similarity and the structural similarity.
6. The method according to claim 2, characterized in that, The step of performing keyword detection processing on the target page screenshot based on preset keywords in the test configuration information to obtain the keyword detection result of the target page screenshot includes: The target page screenshot is subjected to optical character recognition processing to obtain the text information in the target page screenshot; The text information is subjected to keyword detection processing to obtain the keywords in the text information; Based on the preset keywords in the test configuration information and the abnormal keywords in the keyword database, text matching processing is performed on the keywords to obtain the text matching results of the keywords; the text matching results are used to characterize whether there are target keywords in the keywords that match the preset keywords and / or the abnormal keywords; Based on the text matching results, the keyword detection results of the target page screenshot are determined.
7. The method according to claim 6, characterized in that, The step of performing content detection processing on the target page screenshot for text and image to obtain the content detection result of the target page screenshot includes: The text information is subjected to semantic recognition processing to obtain the semantic information of the text information; the text information and the semantic information are subjected to text content detection processing to obtain the text content detection result of the target page screenshot; The target page screenshot is subjected to image content detection processing to obtain the image content detection result of the target page screenshot; Based on the text content detection results and the image content detection results, the content detection results of the target page screenshot are obtained.
8. The method according to any one of claims 1 to 7, characterized in that, The step of obtaining a screenshot of the target page of the test page includes: If the test page is detected to be a mobile page type, the screen capture program of the mobile device used to display the test page is used to capture the device interface of the mobile device to obtain a screenshot of the target page of the test page. If the page type is detected to be a web-based page type, the browser engine will take a screenshot of the browser page corresponding to the test page to obtain a screenshot of the target page of the test page.
9. The method according to any one of claims 1 to 7, characterized in that, Before loading the test page corresponding to the received page test instruction, the process includes: Obtain the test configuration information input for the test page; the test configuration information includes color block configuration information, benchmark page, and preset keywords; Based on the test configuration information, the page test instructions are generated.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 9.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.