Report intelligent testing method and device, computer device, and storage medium
By using an AI-powered large model to parse report page information and generate configuration parameters and adaptation scripts, and by automatically collecting and comparing data snapshots and visual snapshots, the problem of low efficiency and incomplete coverage in existing report testing has been solved, achieving efficient and accurate report testing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU YOUZAN TECH CO LTD
- Filing Date
- 2026-03-27
- Publication Date
- 2026-07-21
AI Technical Summary
Existing report testing solutions are inefficient, incomplete in coverage, and prone to errors. They cannot effectively cover front-end display anomalies and page structure changes, and manual testing is inefficient.
By acquiring report test configuration information, collecting multimodal page information, and using AI large model to parse and generate configuration parameters and adaptation scripts, benchmark and real-time data snapshots and visual snapshots are automatically collected and compared in two dimensions to generate test results.
It improves the efficiency, coverage, and accuracy of report testing, reduces manual intervention, and achieves automated two-dimensional anomaly testing.
Smart Images

Figure CN121935164B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to intelligent reporting testing methods, devices, computer equipment, and storage media. Background Technology
[0002] As enterprises advance their digital transformation, reports, as a core data display and analysis tool, are widely used in business scenarios such as Customer Relationship Management (CRM), sales, and operations. After adjustments to the report backend logic (such as data reading rules, calculation models, and interface architecture) or data update methods (such as offline data processing (DP) for data refresh and batch data synchronization), it is necessary to verify the accuracy of the report data and the stability of online functions (such as whether the display and interaction logic are normal) through testing to avoid impacting business decisions.
[0003] Existing report testing solutions mainly include interface extraction testing, UI automation testing, and manual testing. These solutions generally suffer from low efficiency and incomplete test coverage. For example, interface testing cannot cover front-end display anomalies, UI test scripts are prone to failure due to page structure changes, and manual testing is inefficient and error-prone. Therefore, there is an urgent need for an intelligent report testing method that can improve report testing efficiency, coverage, and accuracy. Summary of the Invention
[0004] This application provides a method, apparatus, computer equipment, and storage medium for intelligent report testing, which can improve report testing efficiency, report testing coverage, and testing accuracy.
[0005] In a first aspect, embodiments of this application provide a method for intelligent reporting testing, which includes:
[0006] Obtain the report test configuration information for the target report, including the access path of the target report;
[0007] The multimodal page information of the target report is collected through the access path;
[0008] The multimodal page information is analyzed using an AI big data model to generate configuration parameters and adaptation scripts;
[0009] Before the target report is adjusted, based on the access path, a baseline data snapshot and a baseline visual snapshot of the target report are collected through the configuration parameters and the adaptation script;
[0010] After the target report is adjusted, based on the access path, real-time data snapshots and real-time visual snapshots of the target report are collected through the configuration parameters and the adaptation script.
[0011] The target report is compared in two dimensions based on the benchmark data snapshot, the benchmark visual snapshot, the real-time data snapshot, and the real-time visual snapshot to obtain the test results of the target report.
[0012] In some embodiments, collecting the multimodal page information of the target report through the access path includes:
[0013] Access the access path via browser automation control tools;
[0014] When it is determined that the page corresponding to the access path is fully loaded, extract the complete HTML of the page;
[0015] The HTML parser parses the complete HTML of the page into a structured DOM tree, and based on the element attribute features in the structured DOM tree, identifies and filters advertisements and redundant components to obtain the target structured DOM tree.
[0016] Capture a full-page PNG screenshot of the page and encode the full-page PNG screenshot into Base64 format to obtain the target full-page PNG screenshot;
[0017] The target structured DOM tree and the target full-page PNG screenshot are combined to form the multimodal page information.
[0018] In some embodiments, the step of parsing the multimodal page information using an AI large model to generate configuration parameters and adaptation scripts includes:
[0019] Based on the AI big model, identify the report filtering components in the multimodal page information and generate the component selector corresponding to the report filtering components;
[0020] Based on the AI big model, the core data table is located for the multimodal page information to determine the mapping relationship between data fields and DOM nodes;
[0021] Based on the report filtering component and the corresponding component selector, filter component configuration parameters are generated. The configuration parameters include at least the component type, component selector, and default values for testing.
[0022] Based on the mapping relationship between the data fields and DOM nodes, data table configuration parameters are generated. The configuration parameters include at least table selector parameters, table header field mapping rules, and data extraction range.
[0023] Based on the configuration parameters of the filtering component and the configuration parameters of the data table, an executable adaptation script is generated.
[0024] In some embodiments, after generating the executable adaptation script based on the filtering component configuration parameters and the data table configuration parameters, the method further includes:
[0025] The browser's automation control tool is invoked to execute the adaptation script using the component selector, and the verification results are obtained.
[0026] If the verification result is a verification failure, the verification failure result is fed back to the AI big model, so that the AI big model can optimize the component selector and the adaptation script.
[0027] If the verification result is successful, the configuration parameters and the adaptation script are output, and the configuration parameters and the adaptation script are associated with the current test task of the target report.
[0028] In some embodiments, the step of performing a two-dimensional comparison of the target report based on the benchmark data snapshot, the benchmark visual snapshot, the real-time data snapshot, and the real-time visual snapshot to obtain the test result of the target report includes:
[0029] Perform a structured difference comparison on the real-time data snapshot and the real-time visual snapshot to identify the structured difference results;
[0030] Pixel-level comparison is performed on the baseline visual snapshot and the real-time visual snapshot. The number and proportion of differing pixels are counted, and the pixel-level difference result is determined based on the number and proportion of differing pixels.
[0031] The test results are determined based on the structured difference results and the pixel-level difference results.
[0032] In some embodiments, before collecting the multimodal page information of the target report through the access path, the method further includes:
[0033] Access the access path through a browser automation control tool and perform automatic login to the reporting system and switching between multiple target stores. Different target stores correspond to different target reports.
[0034] In some embodiments, after performing a two-dimensional comparison of the target report based on the benchmark data snapshot, the benchmark visual snapshot, the real-time data snapshot, and the real-time visual snapshot to obtain the test result of the target report, the method further includes:
[0035] A test report is generated based on the test results;
[0036] The test report is pushed to a preset terminal;
[0037] The configuration parameters and adaptation scripts are associated with the access path and stored in the knowledge base.
[0038] Secondly, embodiments of this application also provide a report intelligent testing device, which includes:
[0039] The transceiver unit is used to obtain report test configuration information for the target report, the report test configuration information including the access path of the target report;
[0040] The processing unit is configured to: collect multimodal page information of the target report through the access path; parse the multimodal page information using an AI large model to generate configuration parameters and adaptation scripts; before the target report is adjusted, collect a baseline data snapshot and a baseline visual snapshot of the target report based on the access path, the configuration parameters, and the adaptation scripts; after the target report is adjusted, collect a real-time data snapshot and a real-time visual snapshot of the target report based on the access path, the configuration parameters, and the adaptation scripts; and perform a two-dimensional comparison of the target report based on the baseline data snapshot, the baseline visual snapshot, the real-time data snapshot, and the real-time visual snapshot to obtain the test results of the target report.
[0041] Thirdly, embodiments of this application also provide a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method.
[0042] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed by a processor, can implement the above-described method.
[0043] This application provides a method, apparatus, computer device, and storage medium for intelligent report testing. The method includes: acquiring report testing configuration information for a target report, the report testing configuration information including the access path of the target report; collecting multimodal page information of the target report through the access path; parsing the multimodal page information using an AI large-scale model to generate configuration parameters and an adaptation script; before the target report is adjusted, collecting a baseline data snapshot and a baseline visual snapshot of the target report based on the access path, the configuration parameters, and the adaptation script; after the target report is adjusted, collecting a real-time data snapshot and a real-time visual snapshot of the target report based on the access path, the configuration parameters, and the adaptation script; and performing a two-dimensional comparison of the target report based on the baseline data snapshot, the baseline visual snapshot, the real-time data snapshot, and the real-time visual snapshot to obtain the test result of the target report. This application embodiment can automatically collect multimodal page information through the access path of the target report, and parse the multimodal page information through an AI large model to generate configuration parameters and adaptation scripts. Based on the automatically generated configuration parameters and adaptation scripts, it automatically collects data snapshots and visual snapshots before and after the report adjustment. Then, it performs two-dimensional anomaly testing on the target report based on the data snapshots and visual snapshots. It can be seen that this application does not require manual generation of test scripts, and performs anomaly testing on the report based on both data and visual dimensions, which can improve the report testing efficiency, report test coverage and test accuracy. Attached Figure Description
[0044] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 A flowchart illustrating the intelligent report testing method provided in this application embodiment;
[0046] Figure 2 A schematic diagram of a sub-process of the intelligent report testing method provided in the embodiments of this application;
[0047] Figure 3 This is another schematic diagram of a sub-process of the intelligent report testing method provided in the embodiments of this application;
[0048] Figure 4 This is another schematic diagram of a sub-process of the intelligent report testing method provided in the embodiments of this application;
[0049] Figure 5A schematic block diagram of the intelligent report testing device provided in the embodiments of this application;
[0050] Figure 6 A schematic block diagram of a computer device provided in an embodiment of this application. Detailed Implementation
[0051] 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, not all, of the embodiments of this application. 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.
[0052] It should be noted that if any AI models, software tools, or components not belonging to the applicant appear in the embodiments of this application, they are merely illustrative examples and do not represent actual use. The user personal information involved in the embodiments of this application is obtained by an entity authorized (with the knowledge and consent) or fully authorized by all parties through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.
[0053] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0054] It should also be understood that the terminology used in this application specification is for the purpose of describing particular embodiments only and is not intended to limit the application. As used in this application specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0055] It should also be further understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0056] This application provides a report intelligent testing method, apparatus, computer equipment, and storage medium.
[0057] The execution subject of this intelligent report testing method can be the intelligent report testing device provided in the embodiments of this application, or a computer device integrating the intelligent report testing device, or a report testing system integrating the intelligent report testing device. The intelligent report testing device can be implemented in hardware or software, and the computer device can be a terminal or a server. The terminal can be a smartphone, tablet computer, handheld computer, or laptop computer, etc. The report testing system is deployed in the computer device.
[0058] Figure 1 This is a flowchart illustrating the intelligent report testing method provided in an embodiment of this application. Figure 1 As shown, the method includes the following steps S110-S160.
[0059] S110. Obtain the report test configuration information for the target report, wherein the report test configuration information includes the access path of the target report.
[0060] In this embodiment, the access path is a Uniform Resource Locator (URL). Furthermore, in some embodiments, the report test configuration information also includes at least one of the following: filter conditions, store information, trigger mode, and scenario type.
[0061] Access path: Required field. It is the access link of the target report (the report to be tested) in the reporting system, which serves as the entry point for the AI parsing page.
[0062] Filtering criteria: Optional field, allowing users to configure report query parameters (such as time range, data dimensions, etc.) to ensure that the test environment is consistent with the actual business scenario; if the user does not enter any, the large model in subsequent steps will automatically parse the default filtering parameters displayed in the report (such as "last 7 days" and "all dimensions"), and match commonly used filtering combinations based on the page's historical interaction data to complete the automatic filling;
[0063] Store Information: Optional. In multi-store scenarios, the user specifies the target test store identifier (e.g., store ID). If not specified, the default test store used by the reporting system will be used. Note that a single store administrator may have multiple stores, and the report data for different stores will differ, even the structure of the report data for different store types may vary. Therefore, it is necessary to specify the store name. Alternatively, AI can automatically identify the store type and test each type separately, but it is essential to ensure that the reports being compared refer to the same store.
[0064] Trigger Mode: Optional field. Users select the test execution method (such as "timed trigger" or "manual trigger"). The default is manual trigger mode.
[0065] Scenario Type: Optional field. Users mark report adjustment scenarios (such as "report structure update", "data interface change", etc.) to guide subsequent steps in adapting to testing strategies. For example, when "report structure update" is marked, steps S120-130 will enhance the recognition accuracy of page controls, and step S160 will increase the visual dimension verification weight. If the user does not input, the AI will automatically identify the scenario type based on the differences in page structure and interface data.
[0066] This step stores the above information in the file corresponding to the report test configuration information for use in subsequent steps.
[0067] S120. Collect the multimodal page information of the target report through the access path.
[0068] In some embodiments, please refer to Figure 2 Step S120 includes:
[0069] S1201. Access the access path through a browser automation control tool;
[0070] S1202. When it is determined that the page corresponding to the access path is fully loaded, extract the complete HTML of the page;
[0071] S1203. The complete HTML of the page is parsed into a structured DOM tree by an HTML parser, and based on the element attribute features in the structured DOM tree, advertisements and redundant components are identified and filtered to obtain the target structured DOM tree.
[0072] S1204. Capture a full-page PNG screenshot of the page and encode the full-page PNG screenshot into Base64 format to obtain the target full-page PNG screenshot;
[0073] S1205. Combine the target structured DOM tree and the target full-page PNG screenshot into the multimodal page information.
[0074] Specifically, the browser automation control tool can be Puppeteer. In this embodiment, Puppeteer is used to access the URL of the target report and set waitUntil:'networkidle2' (a core configuration item related to page loading in Puppeteer, used to define the criteria for determining page loading completion) to ensure that the page is fully loaded. Then, the complete HyperText Markup Language (HTML) of the page is extracted and parsed into a structured Document Object Model (DOM) tree by Cheerio (an HTML parser). Advertisements and redundant components are automatically filtered out, and only core interactive and data areas such as filtering components and data tables are retained.
[0075] Capture a full-page screenshot of the Portable Network Graphics (PNG) and encode it into Base64 format. Combine this with the structured DOM tree to form a "multimodal information packet" to ensure the comprehensiveness of subsequent AI analysis.
[0076] In addition, in some embodiments, in order to ensure the security of the report, a login operation is required before accessing the target report. Only after successful login can the webpage corresponding to the target report be accessed. At this time, before executing step S120, it is also necessary to access the access path through the browser automation control tool and execute the automatic login of the report system and the switching operation of multiple target stores. Different target stores correspond to different target reports.
[0077] As can be seen, this embodiment achieves automated environment preparation for the reporting system in this step. Through multi-mode login adaptation and AI-assisted store switching, it improves the compatibility of the testing system with different stores and the testing efficiency.
[0078] The specific execution logic is as follows:
[0079] Step A: For each store in the test configuration information of each report, automatically log in using multiple modes (supporting username / password / Single Sign-On, SSO).
[0080] Username / password login: The headless browser driven by Puppeteer automatically locates the username / password input box and fills in the information, triggering the login button click; if there is a verification code step, optical character recognition (OCR) technology can be integrated to automatically complete the verification (optional extension).
[0081] SSO Single Sign-On: Adapts to enterprise-level SSO login process, automatically redirects to the SSO authorization page to complete authorization verification, without manual intervention;
[0082] Login-state intelligent caching: After successful login, the login-state cookie is stored according to the reporting system domain name and a reasonable validity period is set (such as 24 hours). Repeated tests within the validity period do not require repeated login, which greatly improves testing efficiency.
[0083] Step B, AI-assisted store switching:
[0084] Multi-store adaptation: Supports users to configure the ID / name of the target test store (compatible with single store / multiple stores), or directly use the default test store preset by the report testing system;
[0085] Intelligent switching logic: After logging in, the selector generated by AI intelligent recognition (different from the traditional fixed selector) is used to locate the store switching component (such as input box, drop-down list, store card); if it is a multi-store specified scenario, the store ID / name is automatically filled in and the confirmation operation is triggered, and then the "Enter Store" button is located to complete the page jump;
[0086] Precise verification mechanism: After entering the store, the store identifier (such as hidden fields, URL parameters, and page title) in the page DOM structure is parsed to verify that the current store is consistent with the target store configured in step S100, ensuring that the report data belongs to the correct category;
[0087] Step C, providing fault tolerance and security assurance strategies:
[0088] Login error: If the account password is wrong, SSO authorization fails, or verification code recognition fails, a retry mechanism will be triggered (up to 3 retries, with an interval of 2 seconds between each retrieval). If the retry fails, an alert with a specific reason will be pushed.
[0089] Switching error: If the store switching component fails to locate (e.g., page structure change), the AI self-healing adaptation capability is invoked to regenerate the selector and try again; if the target store does not exist or there is no response when entering the store, the process is terminated directly and an alert is pushed.
[0090] Security measures: Login information (username, password, SSO token) is encrypted during transmission and storage to prevent the leakage of sensitive information.
[0091] S130. The multimodal page information is parsed using an AI big data model to generate configuration parameters and adaptation scripts.
[0092] Before inputting multimodal page information into the AI big model, the multimodal page information will be anonymized (such as masking mobile phone numbers and amounts) to prevent data leakage.
[0093] In some embodiments, please refer to Figure 3 Step S130 includes:
[0094] S1301. Based on the AI big model, identify the report filtering component in the multimodal page information and generate the component selector corresponding to the report filtering component;
[0095] S1302. Based on the AI big model, perform core data table positioning processing on the multimodal page information to determine the mapping relationship between data fields and DOM nodes;
[0096] S1303. Based on the report filtering component and the corresponding component selector, generate filtering component configuration parameters, wherein the configuration parameters include at least the component type, the component selector, and a default value for testing.
[0097] S1304. Based on the mapping relationship between the data fields and DOM nodes, generate data table configuration parameters, which include at least table selector parameters, table header field mapping rules, and data extraction range.
[0098] S1305. Based on the configuration parameters of the filtering component and the configuration parameters of the data table, generate the executable adaptation script.
[0099] Specifically, the "multimodal information packet" is transmitted to the large AI model via axios (a Promise-based Node.js / browser-based HTTP client tool). Guided by a pre-set, precise prompt, the AI completes three core tasks:
[0100] 1. Identify report filtering components (input boxes, dropdown lists, date pickers, etc.) and generate corresponding CSS selector components / XPath component selectors;
[0101] 2. Locate the core data table and parse the DOM rules of the table header and row data (such as the mapping relationship between data fields and DOM nodes);
[0102] 3. Generate standardized configuration parameters (including filter component configuration and table structure configuration) and adaptable scripts that can be run directly;
[0103] In some embodiments, after generating the executable adaptation script, the method further includes:
[0104] The browser automation control tool is invoked to execute the adaptation script using the component selector to obtain a verification result. If the verification result is a verification failure, the verification failure result is fed back to the AI big model, so that the AI big model can optimize the component selector and the adaptation script. If the verification result is a verification success, the configuration parameters and the adaptation script are output, and the configuration parameters and the adaptation script are associated with the current test task of the target report.
[0105] Specifically, this embodiment allows for configuration and script verification optimization. It calls Puppeteer to attempt to locate components using an AI-generated selector and execute adaptation scripts to verify the validity of the configuration. If the location fails or the script execution is abnormal, a secondary AI interaction is automatically triggered to provide feedback on the reasons for the failure (such as "selector location failure" or "table structure recognition deviation") to the AI, thereby dynamically optimizing the selector and script. After successful verification, standardized configuration and adaptation scripts are output and associated with the current test task.
[0106] If component location / script execution fails and secondary AI optimization still fails to resolve the issue, a manual intervention entry point (such as manually modifying the selector or supplementing configuration parameters) is provided to avoid process interruption.
[0107] S140. Before the target report is adjusted, based on the access path, a baseline data snapshot and a baseline visual snapshot of the target report are collected through the configuration parameters and the adaptation script.
[0108] This embodiment collects a baseline data snapshot and a visual snapshot before the report is adjusted. Specifically, the baseline data snapshot is JSON data, which is collected through the following steps:
[0109] Run the AI-generated adaptation script to extract core information such as report headers, row data, and total number of rows;
[0110] Construct a standardized JSON structure (including test configuration information, collection timestamps, and complete report data) to ensure compatibility in subsequent comparisons;
[0111] Storage path: report_data / data / [date]_[type]_filter_[condition]_shop_[store ID].json, the store and filter condition are distinguished by the file name.
[0112] The baseline visual snapshot is acquired using the following steps:
[0113] Configure Puppeteer screenshot parameters: fullPage: true (full-page scrolling screenshot), type: "png" (no format), fixed viewport 1920×1080, to ensure the screenshot... Figure 1 To the point of being compatible;
[0114] Storage path: report_data / snapshots / [date]_[type]_filter_[condition]_shop_[shopID].png, uniquely associated with the test task ID and JSON data.
[0115] This embodiment provides fault tolerance and security protection strategies, as follows:
[0116] Snapshot integrity verification: Verify the integrity of JSON data fields and the clarity of the visual snapshot. If the verification fails, re-collect the data (maximum of 2 retries).
[0117] Storage encryption: Snapshot files are encrypted when stored and can only be accessed by authorized users.
[0118] S150. After the target report is adjusted, based on the access path, real-time data snapshots and real-time visual snapshots of the target report are collected through the configuration parameters and the adaptation script.
[0119] In this embodiment, the logic and step S140 for collecting data snapshots and visual snapshots are consistent, realizing automated and consistent acquisition of dual snapshots.
[0120] Specifically, after the report structure / interface is adjusted, the report page is reloaded; according to the rules of step S400, real-time data snapshots (JSON format) and real-time visual snapshots (PNG format) are collected; the real-time snapshots and the baseline snapshots of step S400 are associated with the same test task ID.
[0121] S160. The target report is compared in two dimensions based on the benchmark data snapshot, the benchmark visual snapshot, the real-time data snapshot, and the real-time visual snapshot to obtain the test result of the target report.
[0122] In some embodiments, please refer to Figure 4 Step S160 includes:
[0123] S1601. Perform a structured difference comparison on the real-time data snapshot and the real-time visual snapshot, and identify the structured difference results;
[0124] S1602. Perform pixel-level comparison between the benchmark visual snapshot and the real-time visual snapshot, count the number and proportion of different pixels, and determine the pixel-level difference result based on the number and proportion of different pixels.
[0125] S1603. Determine the test result based on the structured difference result and the pixel-level difference result.
[0126] Specifically, when performing data dimension comparison (structured differences), the completeness and format validity (such as field type and data format) of the baseline and real-time JSON snapshot are first verified; then, the jsondiffpatch tool is used for deep comparison, outputting difference details: total number of differences, difference type (field addition / missing / value change), path of the difference field, original value and new value; suitable scenarios include: accurately identifying structured anomalies such as data addition / deletion, field value change, and table header adjustment caused by data manipulation.
[0127] When performing visual dimension comparison (pixel-level differences), a pixel-level comparison algorithm is used to compare the baseline with the real-time visual snapshot and generate a comparison image of the difference area marked in red. Then, the degree of difference is quantified: the number and percentage of difference pixels are counted and divided into three levels according to preset thresholds: "slight (e.g., ≤1%), moderate (e.g., 1%-5%), and severe (e.g., >5%)". Applicable scenarios include: identifying visual anomalies such as report layout disorder, control disappearance, and abnormal data display caused by data manipulation.
[0128] Finally, anomaly integration is performed: the two-dimensional difference results (structured difference results and pixel-level difference results) are linked and integrated to generate an anomaly list containing "difference level, difference type, and details link".
[0129] In addition, this embodiment also provides fault tolerance and security protection strategies, including:
[0130] Comparison and anomaly handling: If problems such as JSON format incompatibility or snapshot file corruption occur, the anomaly type will be automatically marked and an alert will be pushed, without affecting the execution of other test tasks.
[0131] Furthermore, after obtaining the test results of the target report, the method further includes:
[0132] A test report is generated based on the test results; the test report is pushed to a preset terminal; and the configuration parameters and adaptation scripts are associated with the access path and stored in the knowledge base.
[0133] Specifically, this step synchronizes test results and stores test assets. The specific execution logic is as follows:
[0134] Multi-channel result push: Lark Push, integrating Lark Robot API, automatically pushes difference summaries to designated Lark groups, with push content including "comparison time, involved reports / stores, difference level, difference screenshot link, and detailed report download address"; Email Push: integrating the nodemailer library, pushes emails to designated responsible persons such as product, development, and operations, with content including "structured difference details, difference screenshot attachments, and operation suggestions (such as "severe differences require urgent verification of data manipulation scripts")";
[0135] Knowledge base update and reuse: Storage structure: grouped by the MD5 hash value of the report URL, storing report metadata, AI-generated standardized configurations, adaptation scripts, historical snapshots, and similar report indexes; Reuse logic: When adapting a new report, the knowledge base is queried first. If there is a record with "completely identical hash value" or "similarity ≥ 90%" for the access path, the configuration and script are directly reused; if no matching record is found, the AI-generated configuration is called and stored in the knowledge base to achieve "analysis once, reuse multiple times"; At this point, after step S110, the knowledge base is first queried based on the hash value of the access path to see if there is an access path record with a similarity greater than a preset value (such as 90%). If there is an access path record with a similarity greater than the preset value, the configuration parameters and adaptation script corresponding to the access path record are directly reused to collect data in steps S140 and S150. If not, the configuration parameters and adaptation script are generated based on steps S120 and S130 before collecting data in steps S140 and S150.
[0136] Extended functionality support: Supports customizable difference thresholds, allowing users to set push thresholds (e.g., "only push moderate and above differences"); supports association with data manipulation tasks, enabling integration with data manipulation task systems to automatically trigger the "before data manipulation - after data manipulation" snapshot collection and comparison process;
[0137] Supports historical version rollback: records all snapshots and comparison records, supports querying the differences between any two historical versions, and facilitates problem review;
[0138] Fault tolerance and security: Push exception handling. When Lark / email push fails, it will automatically retry twice. If the retry fails, it will log the error and remind the user to handle it manually.
[0139] Access control: Test logs, difference reports, and knowledge base configurations require authorized access to prevent unauthorized operations.
[0140] In summary, the embodiments of this application can automatically collect multimodal page information through the access path of the target report, and parse the multimodal page information through an AI large model to generate configuration parameters and adaptation scripts. Based on the automatically generated configuration parameters and adaptation scripts, data snapshots and visual snapshots are automatically collected before and after the report is adjusted. Then, based on the data snapshots and visual snapshots, dual-dimensional anomaly testing of the target report is performed. It can be seen that this application does not require manual generation of test scripts, and anomaly testing of the report based on both data and visual dimensions can improve report testing efficiency, report test coverage, and test accuracy.
[0141] Figure 5 This is a schematic block diagram of a report intelligent testing device provided in an embodiment of this application. Figure 5 As shown, corresponding to the above-described intelligent report testing method, this application also provides an intelligent report testing device 500. The intelligent report testing device 500 includes a unit for executing the above-described intelligent report testing method, and the intelligent report testing device 500 can be configured in a terminal or server. Specifically, please refer to... Figure 5 The intelligent test device 500 for reporting includes a transceiver unit 501 and a processing unit 502, wherein:
[0142] The transceiver unit 501 is used to obtain report test configuration information for the target report, the report test configuration information including the access path of the target report;
[0143] Processing unit 502 is configured to: collect multimodal page information of the target report through the access path; parse the multimodal page information using an AI large model to generate configuration parameters and adaptation scripts; before the target report is adjusted, collect a baseline data snapshot and a baseline visual snapshot of the target report based on the access path, using the configuration parameters and the adaptation scripts; after the target report is adjusted, collect a real-time data snapshot and a real-time visual snapshot of the target report based on the access path, using the configuration parameters and the adaptation scripts; and perform a two-dimensional comparison of the target report based on the baseline data snapshot, the baseline visual snapshot, the real-time data snapshot, and the real-time visual snapshot to obtain the test result of the target report.
[0144] In some embodiments, the processing unit 502, when performing the process of collecting multimodal page information of the target report through the access path, includes:
[0145] Access the access path via browser automation control tools;
[0146] When it is determined that the page corresponding to the access path is fully loaded, extract the complete HTML of the page;
[0147] The HTML parser parses the complete HTML of the page into a structured DOM tree, and based on the element attribute features in the structured DOM tree, identifies and filters advertisements and redundant components to obtain the target structured DOM tree.
[0148] Capture a full-page PNG screenshot of the page and encode the full-page PNG screenshot into Base64 format to obtain the target full-page PNG screenshot;
[0149] The target structured DOM tree and the target full-page PNG screenshot are combined to form the multimodal page information.
[0150] In some embodiments, when the processing unit 502 performs the step of parsing the multimodal page information using an AI large model to generate configuration parameters and adaptation scripts, it is specifically used for:
[0151] Based on the AI big model, identify the report filtering components in the multimodal page information and generate the component selector corresponding to the report filtering components;
[0152] Based on the AI big model, the core data table is located for the multimodal page information to determine the mapping relationship between data fields and DOM nodes;
[0153] Based on the report filtering component and the corresponding component selector, filter component configuration parameters are generated. The configuration parameters include at least the component type, component selector, and default values for testing.
[0154] Based on the mapping relationship between the data fields and DOM nodes, data table configuration parameters are generated. The configuration parameters include at least table selector parameters, table header field mapping rules, and data extraction range.
[0155] Based on the configuration parameters of the filtering component and the configuration parameters of the data table, an executable adaptation script is generated.
[0156] In some embodiments, after performing the step of generating the executable adaptation script based on the filter component configuration parameters and the data table configuration parameters, the processing unit 502 is further configured to:
[0157] The browser's automation control tool is invoked to execute the adaptation script using the component selector, and the verification results are obtained.
[0158] If the verification result is a verification failure, the verification failure result is fed back to the AI big model, so that the AI big model can optimize the component selector and the adaptation script.
[0159] If the verification result is successful, the configuration parameters and the adaptation script are output, and the configuration parameters and the adaptation script are associated with the current test task of the target report.
[0160] In some embodiments, when the processing unit 502 performs the step of performing a two-dimensional comparison of the target report based on the benchmark data snapshot, the benchmark visual snapshot, the real-time data snapshot, and the real-time visual snapshot to obtain the test result of the target report, it is specifically used for:
[0161] Perform a structured difference comparison on the real-time data snapshot and the real-time visual snapshot to identify the structured difference results;
[0162] Pixel-level comparison is performed on the baseline visual snapshot and the real-time visual snapshot. The number and proportion of differing pixels are counted, and the pixel-level difference result is determined based on the number and proportion of differing pixels.
[0163] The test results are determined based on the structured difference results and the pixel-level difference results.
[0164] In some embodiments, before performing the step of collecting the multimodal page information of the target report through the access path, the processing unit 502 is further configured to:
[0165] Access the access path through a browser automation control tool and perform automatic login to the reporting system and switching between multiple target stores. Different target stores correspond to different target reports.
[0166] In some embodiments, after performing the step of performing a two-dimensional comparison of the target report based on the benchmark data snapshot, the benchmark visual snapshot, the real-time data snapshot, and the real-time visual snapshot to obtain the test result of the target report, the processing unit 502 is further configured to:
[0167] A test report is generated based on the test results;
[0168] The test report is pushed to a preset terminal;
[0169] The configuration parameters and adaptation scripts are associated with the access path and stored in the knowledge base.
[0170] In summary, the embodiments of this application can automatically collect multimodal page information through the access path of the target report, and parse the multimodal page information through an AI large model to generate configuration parameters and adaptation scripts. Based on the automatically generated configuration parameters and adaptation scripts, data snapshots and visual snapshots are automatically collected before and after the report is adjusted. Then, based on the data snapshots and visual snapshots, dual-dimensional anomaly testing of the target report is performed. It can be seen that this application does not require manual generation of test scripts, and anomaly testing of the report based on both data and visual dimensions can improve report testing efficiency, report test coverage, and test accuracy.
[0171] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned intelligent report testing device and each unit can be referred to the corresponding description in the foregoing method embodiments. For the sake of convenience and brevity, it will not be repeated here.
[0172] The aforementioned intelligent reporting testing device can be implemented as a computer program, which can perform tasks such as... Figure 6 It runs on the computer device shown.
[0173] Please see Figure 6 , Figure 6 This is a schematic block diagram of a computer device 600 provided in an embodiment of this application. The computer device 600 can be a terminal or a server.
[0174] See Figure 6 The computer device 600 includes a processor 602, a memory, and a network interface 605 connected via a system bus 601. The memory may include a non-volatile storage medium 603 and internal memory 604.
[0175] The non-volatile storage medium 603 may store an operating system 6031 and a computer program 6032. The computer program 6032 includes program instructions that, when executed, cause the processor 602 to perform a report-based intelligent testing method.
[0176] The processor 602 provides computing and control capabilities to support the operation of the entire computer device 600.
[0177] The internal memory 604 provides an environment for the execution of the computer program 6032 in the non-volatile storage medium 603. When the computer program 6032 is executed by the processor 602, the processor 602 can execute a report intelligent testing method.
[0178] This network interface 605 is used for network communication with other devices. Those skilled in the art will understand that... Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device 600 to which the present application is applied. The specific computer device 600 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0179] The processor 602 is used to run a computer program 6032 stored in the memory to perform the following steps:
[0180] Obtain the report test configuration information for the target report, including the access path of the target report;
[0181] The multimodal page information of the target report is collected through the access path;
[0182] The multimodal page information is analyzed using an AI big data model to generate configuration parameters and adaptation scripts;
[0183] Before the target report is adjusted, based on the access path, a baseline data snapshot and a baseline visual snapshot of the target report are collected through the configuration parameters and the adaptation script;
[0184] After the target report is adjusted, based on the access path, real-time data snapshots and real-time visual snapshots of the target report are collected through the configuration parameters and the adaptation script.
[0185] The target report is compared in two dimensions based on the benchmark data snapshot, the benchmark visual snapshot, the real-time data snapshot, and the real-time visual snapshot to obtain the test results of the target report.
[0186] It should be understood that, in the embodiments of this application, the processor 602 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0187] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.
[0188] Therefore, this application also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When executed by a processor, the program instructions cause the processor to perform the following steps:
[0189] Obtain the report test configuration information for the target report, including the access path of the target report;
[0190] The multimodal page information of the target report is collected through the access path;
[0191] The multimodal page information is analyzed using an AI big data model to generate configuration parameters and adaptation scripts;
[0192] Before the target report is adjusted, based on the access path, a baseline data snapshot and a baseline visual snapshot of the target report are collected through the configuration parameters and the adaptation script;
[0193] After the target report is adjusted, based on the access path, real-time data snapshots and real-time visual snapshots of the target report are collected through the configuration parameters and the adaptation script.
[0194] The target report is compared in two dimensions based on the benchmark data snapshot, the benchmark visual snapshot, the real-time data snapshot, and the real-time visual snapshot to obtain the test results of the target report.
[0195] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.
[0196] 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, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. 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 implementations should not be considered beyond the scope of this application.
[0197] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0198] The steps in the methods of this application embodiment can be adjusted, merged, or deleted according to actual needs. The units in the apparatus of this application embodiment can be merged, divided, or deleted according to actual needs. Furthermore, the functional units in the various embodiments of 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.
[0199] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part 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, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0200] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered 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 method for intelligent testing of reports, characterized in that, include: Obtain the report test configuration information for the target report, including the access path of the target report; The multimodal page information of the target report is collected through the access path; The multimodal page information is analyzed using an AI big data model to generate configuration parameters and adaptation scripts; Before the target report is adjusted, based on the access path, a baseline data snapshot and a baseline visual snapshot of the target report are collected through the configuration parameters and the adaptation script; After the target report is adjusted, based on the access path, real-time data snapshots and real-time visual snapshots of the target report are collected through the configuration parameters and the adaptation script. The target report is compared in two dimensions based on the benchmark data snapshot, the benchmark visual snapshot, the real-time data snapshot, and the real-time visual snapshot to obtain the test result of the target report. The benchmark data snapshot and the real-time data snapshot are in JSON format, and the benchmark visual snapshot and the real-time visual snapshot are in PNG format. The process of collecting multimodal page information of the target report through the access path includes: Access the access path via browser automation control tools; When it is determined that the page corresponding to the access path is fully loaded, extract the complete HTML of the page; The HTML parser parses the complete HTML of the page into a structured DOM tree, and based on the element attribute features in the structured DOM tree, identifies and filters advertisements and redundant components to obtain the target structured DOM tree. Capture a full-page PNG screenshot of the page and encode the full-page PNG screenshot into Base64 format to obtain the target full-page PNG screenshot; The target structured DOM tree and the target full-page PNG screenshot are combined to form the multimodal page information.
2. The method according to claim 1, wherein parsing the multimodal page information using an AI large model to generate configuration parameters and adaptation scripts includes: Based on the AI big model, identify the report filtering components in the multimodal page information and generate the component selector corresponding to the report filtering components; Based on the AI big model, the core data table is located for the multimodal page information to determine the mapping relationship between data fields and DOM nodes; Based on the report filtering component and the corresponding component selector, filter component configuration parameters are generated. The configuration parameters include at least the component type, component selector, and default values for testing. Based on the mapping relationship between the data fields and DOM nodes, data table configuration parameters are generated. The configuration parameters include at least table selector parameters, table header field mapping rules, and data extraction range. Based on the configuration parameters of the filtering component and the configuration parameters of the data table, an executable adaptation script is generated.
3. The method according to claim 2, characterized in that, After generating the executable adaptation script based on the filtering component configuration parameters and the data table configuration parameters, the method further includes: The browser's automation control tool is invoked to execute the adaptation script using the component selector, and the verification results are obtained. If the verification result is a verification failure, the verification failure result is fed back to the AI big model, so that the AI big model can optimize the component selector and the adaptation script. If the verification result is successful, the configuration parameters and the adaptation script are output, and the configuration parameters and the adaptation script are associated with the current test task of the target report.
4. The method according to claim 1, characterized in that, The step of performing a two-dimensional comparison of the target report based on the benchmark data snapshot, the benchmark visual snapshot, the real-time data snapshot, and the real-time visual snapshot to obtain the test result of the target report includes: Perform a structured difference comparison on the real-time data snapshot and the real-time visual snapshot to identify the structured difference results; Pixel-level comparison is performed on the baseline visual snapshot and the real-time visual snapshot. The number and proportion of differing pixels are counted, and the pixel-level difference result is determined based on the number and proportion of differing pixels. The test results are determined based on the structured difference results and the pixel-level difference results.
5. The method according to claim 1, characterized in that, Before collecting the multimodal page information of the target report through the access path, the method further includes: Access the access path through a browser automation control tool and perform automatic login to the reporting system and switching between multiple target stores. Different target stores correspond to different target reports.
6. The method according to claim 1, characterized in that, After performing a two-dimensional comparison of the target report based on the benchmark data snapshot, the benchmark visual snapshot, the real-time data snapshot, and the real-time visual snapshot to obtain the test result of the target report, the method further includes: A test report is generated based on the test results; The test report is pushed to a preset terminal; The configuration parameters and adaptation scripts are associated with the access path and stored in the knowledge base.
7. A report intelligent testing device, characterized in that, include: The transceiver unit is used to obtain report test configuration information for the target report, the report test configuration information including the access path of the target report; The processing unit is configured to collect multimodal page information of the target report through the access path; parse the multimodal page information through an AI big data model to generate configuration parameters and adaptation scripts; before the target report is adjusted, collect a baseline data snapshot and a baseline visual snapshot of the target report based on the access path, the configuration parameters, and the adaptation scripts; after the target report is adjusted, collect a real-time data snapshot and a real-time visual snapshot of the target report based on the access path, the configuration parameters, and the adaptation scripts. The target report is compared in two dimensions based on the benchmark data snapshot, the benchmark visual snapshot, the real-time data snapshot, and the real-time visual snapshot to obtain the test result of the target report. The benchmark data snapshot and the real-time data snapshot are in JSON format, and the benchmark visual snapshot and the real-time visual snapshot are in PNG format. The processing unit performs the process of collecting multimodal page information of the target report through the access path, including: Access the access path via browser automation control tools; When it is determined that the page corresponding to the access path is fully loaded, extract the complete HTML of the page; The HTML parser parses the complete HTML of the page into a structured DOM tree, and based on the element attribute features in the structured DOM tree, identifies and filters advertisements and redundant components to obtain the target structured DOM tree. Capture a full-page PNG screenshot of the page and encode the full-page PNG screenshot into Base64 format to obtain the target full-page PNG screenshot; The target structured DOM tree and the target full-page PNG screenshot are combined to form the multimodal page information.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the report intelligent testing method as described in any one of claims 1-6.
9. A storage medium, characterized in that, The storage medium stores a computer program, which includes program instructions that, when executed by a processor, cause the processor to perform the report intelligent testing method as described in any one of claims 1-6.