Page test method and device, electronic equipment and storage medium
By using the target big model to analyze the test page screenshots in UI automation testing, identify exceptions and generate test results, the problems of high maintenance costs of test scripts and limited test coverage in the existing technology are solved, and more efficient test coverage and exception detection are achieved.
Patent Information
- Application Number
- CN202510241051.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-06-03
AI Technical Summary
When the existing UI automation testing technology faces changes in the UI interface, the test script needs to be modified a lot, which increases maintenance costs, and insufficient judgment on small element compatibility issues and business abnormal status, resulting in limited test coverage.
Using a page testing method based on the target big model, by obtaining the associated test page logic and the result assertion of the target page, analyzing the test page screenshots provided by multiple devices, identifying exceptions and generating page test results, to achieve dynamic adaptation to changes in the UI interface and comprehensive abnormality detection.
It reduces the cost and threshold of test maintenance, improves test coverage, ensures adaptability to page layout and function updates, and provides more comprehensive abnormality detection guarantees.
Smart Images

Figure CN120086141A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a page testing method, apparatus, electronic device, and storage medium. Background Art
[0002] In the prior art, when performing UI (User Interface Designer) automated testing, test scripts are usually closely related to the specific positions and attributes of UI elements. Once the UI interface changes, such as element position adjustment, attribute modification, or style update, the original test scripts are likely to require a large number of modifications and adjustments, thus increasing the maintenance cost.
[0003] Currently, when performing UI automated testing, testers need to have certain programming skills and experience in using test frameworks, which increases the testing threshold. Moreover, the current UI automated testing technology has insufficient compatibility for tiny elements and judgment of business abnormal states, resulting in limited test coverage. Summary of the Invention
[0004] In view of the above problems, embodiments of this application provide a page testing method, apparatus, electronic device, and storage medium that overcome the above problems or at least partially solve the above problems.
[0005] In a first aspect, embodiments of this application provide a page testing method, including:
[0006] Obtaining page testing logic associated with N test pages and result assertions associated with a target page based on a page testing intention, where N is an integer greater than 1, the N test pages are serial pages connected in sequence, the target page is the last test page among the N test pages, and the page testing logic is used to instruct the N test pages to perform serial testing;
[0007] For each of the first N - 1 test pages, analyzing test page screenshots respectively provided by multiple devices based on a target large model, identifying whether there are abnormalities in the test pages of each device in at least one of the compatibility dimension, business dimension, and layout dimension, and marking process abnormalities for the test pages with abnormalities, where the first N - 1 test pages perform abnormality testing in sequence according to the page arrangement order based on the page testing logic;
[0008] After the first N - 1 test pages complete the abnormality testing, analyzing the target page screenshots respectively provided by the multiple devices based on the target large model, and obtaining target page analysis results respectively corresponding to the multiple devices;
[0009] Generate the page test results for each device based on the result assertion associated with the target page, the target page analysis results corresponding to the multiple devices respectively, and the process exception marking situation.
[0010] In a second aspect, an embodiment of the present application provides a page test device, including:
[0011] An acquisition module, configured to acquire the page test logic associated with N test pages and the result assertion associated with the target page based on the page test intention, where N is an integer greater than 1, the N test pages are serial pages connected in sequence, the target page is the last test page among the N test pages, and the page test logic is used to instruct the N test pages to perform serial tests;
[0012] A processing module, configured to, for each of the first N - 1 test pages, analyze the test page screenshots respectively provided by multiple devices based on the target large model, identify whether there are abnormalities in the test pages of each device in at least one of the compatibility dimension, the business dimension, and the layout dimension, and mark the process exceptions for the test pages with abnormalities, where the first N - 1 test pages perform exception tests in sequence according to the page arrangement order based on the page test logic;
[0013] An analysis and acquisition module, configured to, after the first N - 1 test pages complete the exception tests, analyze the target page screenshots respectively provided by the multiple devices based on the target large model, and acquire the target page analysis results corresponding to the multiple devices respectively;
[0014] A generation module, configured to generate the page test results for each device based on the result assertion associated with the target page, the target page analysis results corresponding to the multiple devices respectively, and the process exception marking situation.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, and a computer program stored on the memory and executable on the processor, where when the computer program is executed by the processor, the steps of the page test method described in the first aspect above are implemented.
[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the page test method described in the first aspect above are implemented.
[0017] The technical solution of the embodiment of the present application can generate a page test logic associated with N test pages and a result assertion associated with the target page by analyzing the user's page test intention based on the natural language processing ability of the target large model, and can accurately understand the user's intention through intelligent analysis and give test instructions; by analyzing the test page screenshots provided by the device based on the visual understanding ability of the target large model, it can identify whether there are abnormalities in the test pages of each device in at least one of the compatibility dimension, business dimension, and layout dimension, and can rely on efficient image processing algorithms and image recognition technologies to efficiently identify and evaluate page abnormalities, providing more comprehensive anomaly detection guarantees; in order to ensure the adaptability to page layout and function updates during the test process, dynamic analysis is performed on each test page, and the adaptive adjustment mechanism is reasonably utilized, effectively improving the test accuracy.
[0018] Furthermore, the page test solution based on the large model provides more comprehensive test guarantees and improves the test coverage rate while reducing the test maintenance cost and test threshold. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 A schematic diagram showing the page test method provided by the embodiment of the present application;
[0020] Figure 2 A specific implementation flowchart showing the page test method provided by the embodiment of the present application;
[0021] Figure 3 A schematic diagram showing the page test device provided by the embodiment of the present application;
[0022] Figure 4 A schematic diagram showing the structure of the electronic device provided by the embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0023] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0024] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of the present application. Therefore, the appearances of "in one embodiment" or "in an embodiment" throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. The plurality in the embodiments of the present application can include two and more than two.
[0025] In various embodiments of the present application, it should be understood that the magnitudes of the serial numbers of the following processes do not imply the order of execution, and the order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0026] The embodiments of the present application provide a page testing method. Based on a large model with natural language processing capabilities and visual understanding capabilities, the testing intention of the user is parsed, and in the application program page testing scenario and the mini-program page testing scenario, a comprehensive automated test of the page is performed based on the page screenshot provided by the device, so as to solve the problems of high maintenance cost, high technical threshold, and limited test coverage rate existing in the traditional UI testing method.
[0027] As Figure 1 shown, the page testing method provided by the embodiments of the present application includes the following steps:
[0028] Step 101: Obtain the page testing logic associated with N test pages and the result assertion associated with the target page based on the page testing intention, where N is an integer greater than 1, the N test pages are serial pages connected in sequence, the target page is the last test page among the N test pages, and the page testing logic is used to instruct the N test pages to perform a serial test.
[0029] The page testing method provided by the embodiments of the present application is applied to a testing system, and the testing system integrates a target large model with natural language processing capabilities and visual understanding capabilities. After the testing system obtains the target description associated with the page testing intention provided by the user, based on the intelligent natural language processing module of the target large model, the testing intention of the user is accurately understood, and then the page testing logic associated with N test pages and the result assertion associated with the target page are obtained.
[0030] Specifically, the testing system parses the description information associated with the page testing intention based on the target large model to generate the page testing logic and the result assertion; wherein, the page testing logic includes the testing steps for the first N - 1 test pages, and each test page among the first N - 1 test pages automatically executes the matching testing steps based on the test operation instruction to switch to the next test page; the result assertion includes the expected result of the target page.
[0031] In the target description parsing stage, the testing system accurately understands the testing intention of the user through the intelligent natural language processing module, and generates the page testing logic that can be executed by the testing system and the result assertion associated with the target page to ensure the comprehensiveness of the test.
[0032] In automated testing, result assertion is the ultimate goal of automation. By comparing the expected result with the actual result, it is determined whether the test case passes. If the expected result does not match the actual result, the test will fail. The result assertion in this embodiment includes the expected result of the target page.
[0033] The page test logic is associated with N serially connected test pages. The N test pages are connected in sequence, and the subsequent test page is triggered based on the operations on the previous test page. The last test page among the N serially connected test pages is the target page. And the page test logic includes test steps for the first N - 1 test pages. For the first N - 1 test pages, each test page corresponds to a test step. The test page automatically executes the matching test step based on the test operation instructions provided by the test system to switch to the next test page. The last test page (target page) is the final page of the test and does not execute test steps.
[0034] Step 102: For each of the first N - 1 test pages, based on the target large model, analyze the test page screenshots respectively provided by multiple devices, identify whether there are abnormalities in the test pages of each device in at least one of the compatibility dimension, business dimension, and layout dimension, and mark the process abnormalities for the test pages with abnormalities, where the first N - 1 test pages are sequentially subjected to abnormality testing based on the page test logic and in the page arrangement order.
[0035] For the N serially connected test pages, the first N - 1 test pages belong to process testing, and the last test page (target page) belongs to result testing. For the first N - 1 test pages, based on the target large model, abnormality testing is sequentially performed on the N - 1 test pages in the page arrangement order, and when testing any page, the page screenshot information provided by multiple devices is required.
[0036] When sequentially testing the first N - 1 test pages according to the page arrangement order, for any test page, obtain the test page screenshots corresponding to the current test page respectively provided by multiple devices. Since the target large model has visual understanding ability, it can analyze the test page screenshots respectively provided by multiple devices based on the target large model to identify whether there are abnormalities in the test pages of each device in at least one of the compatibility dimension, business dimension, and layout dimension. After identifying the test page with abnormalities, mark the process abnormalities for the test page.
[0037] For multiple devices that provide screenshots of the test page, the multiple devices correspond to the same device type. For example, the multiple devices are all mobile phones, tablets, or PC (Personal Computer) devices, and the multiple devices can support different device models. For example, the multiple devices are all mobile phones, and the multiple mobile phones correspond to different models. By receiving the screenshots of the test page provided by multiple devices for the same test page, the test system can perform batch page testing; and by receiving the screenshots of the test page provided by devices of different models for page testing, the test system can achieve multi-device compatibility testing.
[0038] For each device, it communicates with the test system. The test system controls the test page on the device to execute test steps based on the page test logic for page testing. For example, the test system sends adb (Android Debug Bridge) signaling to the device. By sending adb signaling to the device, it can control the test page on the device to automatically execute operations such as click to jump, slide the page, long-press the button, and input in the text box based on this signaling to execute test steps. The test page on the device is an application test page or a mini-program test page. The test page automatically executes the matching test steps based on the test operation instructions provided by the test system to switch to the next test page with a connection relationship. For each test step executed, the device provides a screenshot of the test page to the test system, and the test system analyzes the screenshot of the test page based on the target large model to identify abnormal test pages in at least one dimension.
[0039] Step 103: After completing the abnormal test on the first N - 1 test pages, analyze the target page screenshots respectively provided by multiple devices based on the target large model to obtain the target page analysis results respectively corresponding to the multiple devices.
[0040] After completing the abnormal test on the first N - 1 test pages among the N test pages, obtain the target page screenshots corresponding to the target pages respectively provided by multiple devices, and then use the visual understanding ability of the target large model to analyze the target page screenshots of multiple devices to obtain the target page analysis results respectively corresponding to the multiple devices based on image analysis.
[0041] Step 104: Generate the page test results of each device based on the result assertion related to the target page, the target page analysis results respectively corresponding to multiple devices, and the process abnormal marking situation.
[0042] After obtaining the target page analysis results of each device based on the target large model, determine the page result marking information of each device based on the result assertion related to the target page and the target page analysis results of each device. This marking information is used to indicate whether the analysis result provided by the target large model meets the expectation of the result assertion.
[0043] After determining the page result marking information of the device, generate the page test result of the device based on the page result marking information and the process exception marking situation corresponding to the device, so as to obtain the final page test result by fusing the page result marking information of the associated target page and the process exception marking situations of the previous N-1 test pages.
[0044] In the above implementation scheme of this application, generate the page test logic for associating N test pages and the result assertion for associating the target page by analyzing the user's page test intention based on the natural language processing ability of the target large model, which can accurately understand the user's intention through intelligent analysis and give test instructions; analyze the test page screenshots provided by the device based on the visual understanding ability of the target large model, and identify whether there are abnormalities in the test pages of each device in at least one of the compatibility dimension, business dimension, and layout dimension. It can rely on efficient image processing algorithms and image recognition technologies to efficiently identify and evaluate page abnormalities, providing a more comprehensive abnormal detection guarantee; in order to ensure the adaptability to page layout and function updates during the test process, perform dynamic analysis on each test page and reasonably utilize the adaptive adjustment mechanism, effectively improving the test accuracy.
[0045] Furthermore, the page test scheme based on the large model provides a more comprehensive test guarantee and improves the test coverage rate while reducing the test maintenance cost and test threshold.
[0046] The following introduces the scheme for identifying abnormalities in test pages in at least one dimension. When analyzing the test page screenshots provided by multiple devices respectively based on the target large model, and identifying whether there are abnormalities in the test pages of each device in at least one of the compatibility dimension, business dimension, and layout dimension, and performing process exception marking on the test pages with abnormalities, the following steps are included:
[0047] Obtain the test page screenshots for the current test page provided by multiple devices respectively;
[0048] Perform image recognition on the test page screenshots provided by multiple devices based on the target large model, and analyze at least one of the visual differences, business execution logics, and page layout differences of the test page screenshots, so as to identify whether there are abnormalities in the test pages of each device in at least one dimension;
[0049] In response to the current test page of the device having an abnormality, perform process exception marking on the current test page.
[0050] When batch-identifying anomalies in at least one dimension of a certain test page, obtain test page screenshots of the current test page provided by multiple devices respectively, and perform image recognition on the test page screenshots provided by multiple devices based on the visual understanding ability of the target large model, so as to analyze at least one of the visual differences, business execution logic, and page layout differences of the test page screenshots by relying on efficient image processing algorithms and image recognition technologies, and then identify whether there are anomalies in the current test pages of each device in at least one dimension.
[0051] When it is identified that there is an anomaly in the current test page of a certain device, perform a process anomaly mark on the current test page of this device. The anomalies of the current test page can be one or more of visual content anomalies, business status anomalies, and page layout anomalies. Correspondingly, when performing a process anomaly mark on the current test page, the marked anomalies are associated with at least one of visual content anomalies, business status anomalies, and page layout anomalies.
[0052] For each of the first N - 1 test pages, the test system obtains test page screenshots of the current test page provided by multiple devices, and batch-analyzes the test page screenshots provided by multiple devices. While improving the test efficiency based on batch processing, it can perform page tests by receiving test page screenshots provided by different models of devices to achieve multi-device compatibility testing.
[0053] Among them, when performing image recognition on the test page screenshots provided by multiple devices based on the target large model and analyzing the visual differences of the test page screenshots, it includes:
[0054] Perform image content comparison on the test page screenshots provided by multiple devices based on the target large model, determine the first test page screenshot with image content anomalies, so as to identify the test page with anomalies in the compatibility dimension, and the test page corresponding to the first test page screenshot is marked as a process anomaly in the compatibility dimension.
[0055] For the first N-1 test pages, after obtaining the test page screenshots provided by multiple devices for a certain test page, the target large model is used to compare the image contents of the test page screenshots provided by multiple devices. This process relies on efficient image processing algorithms to ensure accurate judgment of subtle differences in complex scenarios. Specifically: Based on image recognition technology and image processing algorithms, the target large model analyzes the image contents of the test page screenshots provided by multiple devices, detects details such as color changes, element position offsets, and font style changes in the screenshots, to visually differentiate multiple test page screenshots, identify the first test page screenshot that has a visual difference from other test page screenshots, and achieve accurate judgment of visual differences in complex scenarios by relying on efficient image processing algorithms and image recognition technology, so as to capture difference information from color changes to dynamic elements.
[0056] The test page corresponding to the first test page screenshot is a test page with an anomaly in the compatibility dimension, and the test page corresponding to the first test page screenshot is marked as a process anomaly in the compatibility dimension. By identifying the first test page screenshot that has a visual difference from other screenshots through image content comparison, the compatibility of the device can be evaluated based on the image content comparison.
[0057] Among them, when performing image recognition on the test page screenshots provided by multiple devices based on the target large model and analyzing the business execution logic of the test page screenshots, it includes:
[0058] Based on the target large model, perform intelligent analysis on the page contents of the test page screenshots provided by multiple devices, judge whether the page contents conform to the predetermined business rules and processes, to identify the second test page screenshot with a business anomaly. The test page corresponding to the second test page screenshot is marked as a process anomaly in the business dimension.
[0059] While performing visual difference identification on the test page screenshots provided by multiple devices for compatibility evaluation, the test system can also analyze the business logic of the test page screenshots with the help of the target large model, to judge whether the contents in the test page conform to the predetermined business rules and processes, and combined with the previously defined business anomaly status, identify the second test page screenshot with a business anomaly. The test page corresponding to the identified second test page screenshot is marked as a process anomaly in the business dimension.
[0060] When analyzing the business logic of the test page screenshots with the help of the target large model, the test system will pre-summarize some error codes and error messages of the business. The target large model identifies the test page screenshots to judge whether the test page has the above contents. Then, combined with the previously defined business anomaly status, determine the second test page screenshot with a business anomaly, and further identify the business anomaly test page.
[0061] For example, in the usage scenario of an e-commerce platform, the test system not only monitors the quantity and price of products in the shopping cart in real time, but also compares the real-time data obtained from the front end with historical data to automatically identify potential anomalies. As an example, if the test system detects a significant price fluctuation of a certain product in the shopping cart or the product representation is missing, it will mark the UI automation test case as failed. This process relies on dynamic data collection and real-time status monitoring functions to achieve accurate judgment of abnormal states through automatic threshold setting. In this process, the test system will integrate business logic and visual features to provide a more comprehensive assessment of the business status.
[0062] By combining business logic analysis, while detecting the visual features of the test page, the test system can also perform intelligent analysis on business rules and processes, automatically judge whether the business content conforms to the predetermined rules, accurately judge the abnormal business status, and achieve intelligent identification of abnormal states.
[0063] Among them, when performing image recognition on the test page screenshots provided by multiple devices based on the target large model and analyzing the page layout differences of the test page screenshots, it includes:
[0064] Based on the target large model, compare the test page screenshots provided by multiple devices with the target historical page screenshots to determine the third test page screenshot with page layout anomalies, so as to identify the test page with anomalies in the layout dimension. The test page corresponding to the third test page screenshot is marked as a process anomaly in the layout dimension.
[0065] In order to cope with possible page layout changes or function updates during the test process, after the test system obtains the test page screenshots provided by multiple devices for a certain test page among the first N - 1 test pages, based on the target large model, compare the test page screenshots provided by multiple devices with the adapted target historical page screenshots, so as to automatically identify and evaluate whether there are major changes in the layout of the current test page based on the comparison between the current page screenshot and the historical page screenshot. Once a significant change is detected, determine the test page with anomalies in the layout dimension, and this test page is marked as a process anomaly in the layout dimension.
[0066] The target historical page screenshot adapted to the current test page screenshot is a pre-stored screenshot, and the target historical page screenshot corresponds to the same page as the current test page screenshot. By taking screenshots and saving the historical page, a page comparison benchmark can be provided to facilitate measuring page layout changes based on this benchmark.
[0067] In an optional embodiment of the present application, when generating the page test results of each device based on the result assertion related to the target page, the target page analysis results corresponding to multiple devices, and the process exception marking situation, it includes: for each device, comparing the target page analysis result corresponding to the device with the expected result indicated by the result assertion to generate the page result marking information corresponding to the device, where the page result marking information indicates whether the target page analysis result matches the expected result; fusing the page result marking information corresponding to the device and the process exception marking situation corresponding to the device to generate the page test result corresponding to the device.
[0068] After completing the exception testing of the first N - 1 test pages and obtaining the target page analysis results corresponding to multiple devices by analyzing the target page screenshots respectively provided by multiple devices based on the target large model, for each device, comparing the target page analysis result of the device with the expected result indicated by the result assertion to generate the page result marking information of the device. If the target page analysis result matches the expected result indicated by the result assertion, it indicates that the target page analysis result meets the expectation, and at this time the page result is marked as normal. If the target page analysis result does not match the expected result indicated by the result assertion, it indicates that the target page analysis result does not meet the expectation, and at this time the page result is marked as abnormal.
[0069] After determining the page result marking information of the device, fuse the page result marking information of the device and the process exception marking situation of the device to obtain the final page test result of the device through the fusion of process information and result information.
[0070] It should be noted that there is no inevitable relationship between the process exception marking situation and the page result marking information. The process may be marked as abnormal while the page result may be marked as normal. For example, the process exception is that the page style is problematic, but it does not affect the continued click operation, and the page result is marked as normal. The final page test result needs to consider both the page result marking information and the process exception marking situation.
[0071] If the page result marking information of the device indicates abnormal and the process exception marking situation of the device indicates abnormal, the page test result obtained by fusing the page result marking information and the process exception marking situation indicates a test failure; if the page result marking information of the device indicates abnormal and the process exception marking situation of the device indicates normal, the page test result obtained by fusing the page result marking information and the process exception marking situation indicates a test failure; if the page result marking information of the device indicates normal and the process exception marking situation of the device indicates normal, the page test result obtained by fusing the page result marking information and the process exception marking situation indicates a test success.
[0072] By generating page result marking information through the comparison between the analysis results of the target page and the expected results, and fusing the page result marking information with the process anomaly marking situation to generate page test results, the final page test situation can be determined considering both process information and result information.
[0073] It should be noted that the test system in the embodiments of this application also incorporates the test capabilities to support cross-platform and multi-device scenarios, giving full play to the generalization ability of the large model. When performing UI automated testing, the test system can conduct page tests for different types of devices (such as PC devices and mobile phones). The test system can automatically identify the device type and environment, ensuring the consistency of the user experience to the greatest extent, and ultimately achieving comprehensive testing and anomaly monitoring capabilities.
[0074] The following introduces the page test method provided by this application through a specific implementation process, as Figure 2 shown below:
[0075] Step 201: Analyze the description information related to the page test intention based on the target large model to obtain the page test logic for N associated test pages and the result assertion for the associated target page, where the target page is the last test page among the N test pages.
[0076] Step 202: The test system controls the N - 1 test pages on multiple devices to sequentially perform page automated testing based on the page test logic.
[0077] Step 203: The test system obtains the test page screenshots provided by multiple devices for the current test page. After this step, steps 204, 205, and 206 are executed.
[0078] Step 204: Compare the image content of the test page screenshots provided by multiple devices based on the target large model to identify the test pages with anomalies in the compatibility dimension.
[0079] Step 205: Conduct intelligent analysis of the page content of the test page screenshots provided by multiple devices based on the target large model to identify the test pages with business anomalies.
[0080] Step 206: Compare the test page screenshots provided by multiple devices with the target historical page screenshots based on the target large model to identify the test pages with anomalies in the layout dimension.
[0081] If the test page with anomalies in the compatibility dimension is identified in step 204, step 207 is executed for process anomaly marking. If the test page with business anomalies is identified in step 205, step 207 is executed for process anomaly marking. If the test page with anomalies in the layout dimension is identified in step 206, step 207 is executed for process anomaly marking. After the test for this test page is completed, switch to the next test page and execute step 203. If no anomaly test page is identified in step 204, step 205, and step 206, then step 208 is executed to determine that the process verification has passed, and then switch to the next test page and execute step 203.
[0082] Step 209: After the anomaly tests are completed for N - 1 test pages, analyze the target page screenshots respectively provided by multiple devices based on the target large model to obtain the target page analysis results respectively corresponding to the multiple devices.
[0083] Step 210: For each device, compare the target page analysis result with the expected result indicated by the result assertion to generate page result marking information, and fuse the page result marking information with the process anomaly marking situation of the device to generate the page test result of the device.
[0084] In the above implementation process, the core lies in realizing the parsing of the user's target description, the generation of test logic, and the judgment of abnormal states through deep learning and image processing technologies.
[0085] By converting the user's natural language description into machine-readable test logic and assertion conditions and understanding and analyzing complex images, the UI automation assertion process is simplified. The business side does not need to write code, saving business test resources while improving the UI assertion efficiency.
[0086] While detecting visual feature anomalies of the page, the test system conducts intelligent analysis on business rules and processes, identifies layout anomalies of the page, accurately judges business anomaly states and layout anomaly states, ensures the efficient identification and evaluation of anomalies, and provides a more comprehensive anomaly detection guarantee.
[0087] An embodiment of the present application provides a page test device, as Figure 3 described, including:
[0088] An acquisition module 301, configured to obtain page test logic associated with N test pages and result assertions associated with a target page based on a page test intention, where N is an integer greater than 1, the N test pages are serial pages connected in sequence, the target page is the last test page among the N test pages, and the page test logic is used to instruct the N test pages to conduct serial tests;
[0089] The processing module 302 is configured to, for each of the first N - 1 test pages, analyze the test page screenshots respectively provided by multiple devices based on the target large model, identify whether there are abnormalities in the test pages of each device in at least one of the compatibility dimension, business dimension, and layout dimension, and mark the process abnormalities for the test pages with abnormalities, where the first N - 1 test pages are subjected to abnormality tests in sequence according to the page arrangement order based on the page test logic;
[0090] The analysis and acquisition module 303 is configured to, after the abnormality tests of the first N - 1 test pages are completed, analyze the target page screenshots respectively provided by the multiple devices based on the target large model, and obtain the target page analysis results respectively corresponding to the multiple devices;
[0091] The generation module 304 is configured to generate the page test results of each device based on the result assertions associated with the target page, the target page analysis results respectively corresponding to the multiple devices, and the process abnormality marking situation.
[0092] Optionally, the acquisition module is further configured to:
[0093] Parse the description information associated with the page test intention based on the target large model to generate the page test logic and the result assertions;
[0094] Wherein, the page test logic includes the test steps for the first N - 1 test pages, and each of the first N - 1 test pages automatically executes the matching test steps based on the test operation instructions to switch to the next test page; the result assertions include the expected results of the target page.
[0095] Optionally, the processing module includes:
[0096] An acquisition sub - module, configured to acquire the test page screenshots respectively provided by the multiple devices for the current test page;
[0097] An identification and analysis sub - module, configured to perform image recognition on the test page screenshots provided by the multiple devices based on the target large model, and analyze at least one of the visual differences, business execution logic, and page layout differences of the test page screenshots, so as to identify whether there are abnormalities in the test pages of each device in at least one dimension;
[0098] A marking sub - module, configured to mark the process abnormalities for the current test page in response to the existence of abnormalities in the current test page of the device.
[0099] Optionally, the identification and analysis sub - module is further configured to:
[0100] Based on the target large model, compare the screenshot of the test page provided by the multiple devices to determine the first screenshot of the test page with abnormal image content, so as to identify the test page with abnormal compatibility dimension;
[0101] Among them, the test page corresponding to the first screenshot of the test page is marked as a process exception in the compatibility dimension.
[0102] Optionally, the identification and analysis sub-module is further used for:
[0103] Based on the target large model, perform intelligent analysis on the screenshot of the test page provided by the multiple devices to determine whether the page content conforms to the predetermined business rules and processes, so as to identify the second screenshot of the test page with business anomalies;
[0104] Among them, the test page corresponding to the second screenshot of the test page is marked as a process exception in the business dimension.
[0105] Optionally, the identification and analysis sub-module is further used for:
[0106] Based on the target large model, compare the screenshot of the test page provided by the multiple devices with the target historical page screenshot to determine the third screenshot of the test page with abnormal page layout, so as to identify the test page with abnormal layout dimension;
[0107] Among them, the test page corresponding to the third screenshot of the test page is marked as a process exception in the layout dimension.
[0108] Optionally, the generation module includes:
[0109] The comparison and generation sub-module is used to compare the target page analysis result corresponding to each device with the expected result indicated by the result assertion for each device, and generate the page result marking information corresponding to the device, where the page result marking information indicates whether the target page analysis result matches the expected result;
[0110] The fusion and generation sub-module is used to fuse the page result marking information corresponding to the device and the process exception marking situation corresponding to the device to generate the page test result corresponding to the device.
[0111] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant parts, please refer to the partial description of the method embodiment.
[0112] An embodiment of the present application also provides an electronic device, including: a processor, a memory, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, it implements each process of the above-mentioned page testing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0113] For example, Figure 4 shows a schematic physical structure diagram of an electronic device. As Figure 4 shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430, and a communication bus 440. Among them, the processor 410, the communication interface 420, and the memory 430 complete mutual communication through the communication bus 440. The processor 410 can call the logical instructions in the memory 430. The processor 410 is used to execute each process of the page testing method embodiment of the present application, which will not be elaborated one by one here.
[0114] In addition, when the logical instructions in the above-mentioned memory 430 are implemented in the form of a software functional unit and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present application.
[0115] An embodiment of the present application also provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is executed by the processor, it implements each process of the above-mentioned page testing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be elaborated here. Among them, the computer-readable storage medium is, for example, a read-only memory (ROM for short), a random access memory (RAM for short), a magnetic disk, or an optical disc, etc.
[0116] It should be noted that in this text, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the existence of additional identical elements in the process, method, article or device comprising such element.
[0117] From the description of the above embodiments, those skilled in the art can clearly understand that the above-described method of the embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in various embodiments of the present application.
[0118] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them belong to the protection scope of the present application.
[0119] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in connection with the embodiments disclosed in the embodiments of the present application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0120] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0121] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical or other forms.
[0122] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0123] In addition, in each embodiment of the present application, the functional units can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
[0124] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of this 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 for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical discs that can store program codes.
[0125] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, and all should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A page testing method, characterized in that: include: Acquire page test logic associated with N test pages and result assertion associated with a target page based on a page test intention, where N is an integer greater than 1, the N test pages are serially connected serial pages, the target page is the last test page among the N test pages, and the page test logic is used to instruct the N test pages to perform serial testing; For each of the first N-1 test pages, the test page screenshots provided by multiple devices are analyzed based on the target big model, and whether there is an abnormality in the test page of each device is identified in at least one dimension of the compatibility dimension, the business dimension, and the layout dimension, and the test page with the abnormality is marked as a process abnormality, wherein the first N-1 test pages are tested for abnormality in sequence based on the page test logic and in the order in which the pages are arranged; After the first N-1 test pages complete the abnormal test, analyzing the target page screenshots respectively provided by the multiple devices based on the target big model, and obtaining the target page analysis results respectively corresponding to the multiple devices; Based on the result assertion associated with the target page, the target page analysis results corresponding to the multiple devices respectively, and the process abnormality marking conditions, the page test results of each device are generated.
2. The method according to claim 1, characterized in that The method of obtaining the page test logic associated with N test pages and the result assertion associated with the target page based on the page test intention includes: Parsing the description information associated with the page test intent based on the target big model to generate the page test logic and the result assertion; The page test logic includes test steps for the first N-1 test pages, each of the first N-1 test pages automatically executes matching test steps based on test operation instructions to switch to the next test page; the result assertion includes the expected result of the target page.
3. The method according to claim 1, characterized in that The test page screenshots provided by multiple devices are analyzed based on the target big model, and whether the test page of each device is abnormal is identified in at least one dimension of compatibility dimension, business dimension and layout dimension, and the test page with abnormality is marked as abnormal, including: Obtaining test page screenshots for the current test page respectively provided by the multiple devices; Performing image recognition on the test page screenshots provided by the multiple devices based on the target big model, analyzing at least one of visual differences, business execution logic, and page layout differences of the test page screenshots, so as to identify whether there is an abnormality in the test page of each device in at least one dimension; In response to an abnormality existing in a current test page of the device, a process abnormality mark is performed on the current test page.
4. The method according to claim 3, characterized in that Performing image recognition on the test page screenshots provided by the multiple devices based on the target large model, and analyzing visual differences of the test page screenshots, including: Performing image content comparison on the test page screenshots provided by the multiple devices based on the target macro model, determining a first test page screenshot having abnormal image content, so as to identify a test page having abnormality in the compatibility dimension; Among them, the test page corresponding to the first test page screenshot is marked as a process exception in the compatibility dimension.
5. The method according to claim 3, characterized in that: Performing image recognition on the test page screenshots provided by the multiple devices based on the target big model, and analyzing the business execution logic of the test page screenshots, including: Based on the target big model, intelligently analyze the page content of the test page screenshots provided by the multiple devices to determine whether the page content complies with predetermined business rules and processes, so as to identify the second test page screenshot with business anomalies; Among them, the test page corresponding to the second test page screenshot is marked as a process abnormality in the business dimension.
6. The method according to claim 3, characterized in that Performing image recognition on the test page screenshots provided by the multiple devices based on the target large model, and analyzing page layout differences of the test page screenshots, including: Comparing the test page screenshots provided by the multiple devices with the target historical page screenshots based on the target macro model, determining a third test page screenshot having a page layout abnormality, so as to identify the test page having an abnormality in the layout dimension; Among them, the test page corresponding to the third test page screenshot is marked as having a process abnormality in the layout dimension.
7. The method according to claim 1, characterized in that The generating of page test results of each device based on the result assertion associated with the target page, the target page analysis results corresponding to the plurality of devices respectively, and the process abnormality marking conditions includes: For each device, comparing the target page analysis result corresponding to the device with the expected result indicated by the result assertion, and generating page result tag information corresponding to the device, wherein the page result tag information indicates whether the target page analysis result matches the expected result; The page result marking information corresponding to the device and the process abnormality marking situation corresponding to the device are integrated to generate the page test result corresponding to the device.
8. A page testing device, characterized in that: include: an acquisition module, used for acquiring page test logic associated with N test pages and result assertion associated with a target page based on a page test intention, where N is an integer greater than 1, the N test pages are serially connected serial pages, the target page is the last test page among the N test pages, and the page test logic is used for instructing the N test pages to perform serial testing; A processing module is used to analyze the test page screenshots respectively provided by multiple devices based on the target big model for each test page in the first N-1 test pages, identify whether there is an abnormality in the test page of each device in at least one dimension of compatibility dimension, business dimension and layout dimension, and mark the test page with abnormality as a process abnormality, wherein the first N-1 test pages are sequentially tested for abnormality based on the page test logic and in the order in which the pages are arranged; An analysis and acquisition module, configured to analyze the target page screenshots respectively provided by the plurality of devices based on the target big model after the first N-1 test pages complete the abnormality test, and obtain target page analysis results respectively corresponding to the plurality of devices; The generating module is used to generate page test results of each device based on the result assertion associated with the target page, the target page analysis results corresponding to the multiple devices respectively, and the process abnormality marking conditions.
9. An electronic device, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the page testing method according to any one of claims 1 to 7 when executed by the processor.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the page testing method according to any one of claims 1 to 7 are implemented.