CN-121979804-A - UI (user interface) automatic testing system and method based on database input parameters
Abstract
The invention provides a UI automatic test system and a method based on database input parameters, which belong to the technical field of data processing, and specifically comprise a data acquisition and management module, a database management module and a database management module, wherein the data acquisition and management module is responsible for acquiring diversified test input parameters from a database in real time; the system comprises a page operation module, a test execution module and a test result analysis and reporting module, wherein the page operation module is responsible for realizing the positioning of page elements, the test execution module is responsible for realizing large-scale data driving test, and the test result analysis and reporting module is responsible for collecting, processing and visualizing all results in the test execution process, automatically generating detailed test logs, integrating all test data, generating a structured test report and improving the reliability of test processing.
Inventors
- LUO WENZHUO
- YANG KAI
- ZHANG YIHAO
Assignees
- 浙江子不语电子商务有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260407
Claims (10)
- 1. The UI automation test system based on the database input parameters is characterized by comprising the following specific components: The data acquisition and management module is responsible for establishing dynamic connection with various databases, acquiring diversified test input parameters from the databases in real time according to preset query conditions, providing data caching, determining identification deviation data of page elements corresponding to the test cases based on the test data of the test cases, and determining a cache management strategy of the database input parameters of the test cases based on the identification deviation data; The page operation module is responsible for abstracting each page of the application program into an independent page object, and can dynamically adjust the positioning strategy by utilizing an intelligent element positioning algorithm to realize the positioning of page elements; the test execution module is used for dynamically injecting different data sets from the database for the same test case by combining with the data acquisition and management module so as to realize large-scale data driving test; The test result analysis and reporting module is responsible for collecting, processing and visualizing all results in the test execution process, automatically generating detailed test logs, integrating all test data, generating a structured test report, and determining the update management method of the cache management strategy of the test case of the target management strategy by using the similarity degree of page elements corresponding to different test cases and the test cases of the target management strategy and the cache management method of the associated database of the test cases of the target management strategy.
- 2. The database input parameter based UI automated test system of claim 1, wherein the test input parameters comprise product codes, user IDs, order numbers.
- 3. The database input parameter based UI automation test system of claim 1, further comprising a spam mechanism that enables predefined default or backup test data automatically when a database connection fails or a query is not a result.
- 4. A method for automatically testing a UI based on database input parameters, applied to the UI automatic testing system for database input parameters according to any one of claims 1 to 3, comprising the following steps: Determining identification deviation data of page elements corresponding to test cases based on the test data of the test cases, determining a cache management and control strategy of database input parameters of the test cases based on the identification deviation data, and determining cache influence risk types of the test cases by utilizing the cache management and control strategy and associated databases of different test cases; Determining a cache influence risk type of the test case of the database, and determining a cache management method of the database by combining test case data of a target management strategy in the test case of the database; And determining the update management method of the cache management strategy of the test case of the target management strategy by using the similarity degree of page elements corresponding to different test cases and the test case of the target management strategy and the cache management method of the association database of the test case of the target management strategy.
- 5. The UI automation test method based on database input parameters according to claim 4, wherein the test data of the test case includes a test result of the test case in a history and identification deviation data of the test result.
- 6. The UI automation test method based on the database input parameter according to claim 4, wherein the identification deviation data of the page element corresponding to the test case is determined according to whether the page element to be verified for obtaining the test case is successfully identified in the test result in the history.
- 7. The UI automation test method based on database input parameters according to claim 4, wherein the method for determining a cache management policy of the database input parameters of the test case is: The page element corresponding to the test case is used as an associated page element, and the identification deviation times of the associated page element in the test case are determined according to the identification deviation data of the associated page element; determining identification risk page elements in the associated page elements by utilizing the identification deviation times; And determining a cache management and control strategy of the database input parameters of the test case according to the identification risk page element data in the associated page elements of the test case.
- 8. The method for automatically testing the UI based on the database input parameters according to claim 7, wherein the identified risk page element is an associated page element with an identified deviation number greater than a preset deviation number threshold.
- 9. The UI automation test method based on the database input parameter according to claim 4, wherein the method for determining the update management method of the cache management policy of the test case of the target management policy is: Taking the test cases of the target management and control strategy as cache management and control test cases, determining the same number of identification risk page elements of the cache management and control test cases and different test cases according to the associated page elements of the test cases, and determining the reference test cases of the cache management and control test cases by using the same number; Determining an associated database of a preset cache management method in the associated database by using a cache management method of the associated database of the test case of the target management strategy, and taking the associated database as a limit database; And determining an updating result of a cache management policy of the cache management test case based on the reference test case data of the cache management test case and the limit database data.
- 10. The UI automation test method based on the database input parameters according to claim 9, wherein the reference test case is a test case with a ratio of the identified risk page elements of the cache management test case being greater than a preset risk ratio threshold.
Description
UI (user interface) automatic testing system and method based on database input parameters Technical Field The invention belongs to the technical field of data processing, and particularly relates to a UI (user interface) automatic testing system and method based on database input parameters. Background With the increasing sophistication of modern Web applications and the continued evolution of business logic, user Interface (UI) automated testing plays an increasingly critical role in ensuring software product quality and user experience. Conventional UI automation test scripts often hard-code or store test data in static files. The static data mode can not effectively simulate the diversity and dynamic change of data in a real service environment, so that the coverage of a test scene is insufficient, and potential defects caused by specific data combination are difficult to find. In addition, once the business requirement is changed, the data structure is adjusted or the test environment is updated, the hard-coded test data needs to be manually modified one by one, so that the time and the labor are consumed, the artificial error is extremely easy to be introduced, and the sustainable integration and continuous delivery (CI/CD) process of the test is severely restricted. Therefore, the existing UI automation test framework has a plurality of defects in the aspects of element positioning stability, error processing robustness, intelligent generation of test reports and the like, the factors affect the reliability, efficiency and value of the automation test together, the reliability of the automation test process can be greatly improved by constructing a test platform directly connected with a database, meanwhile, the cache management method of the database related to the test case is determined according to the positioning deviation risks of page elements corresponding to different test cases, so that the improvement of the efficiency and the reliability of the test process becomes the technical problem to be solved, Therefore, a new UI automation test system and method capable of overcoming the above-mentioned drawbacks, realizing the dynamic test data, the efficient test execution and the intelligent test report are needed. Disclosure of Invention In order to achieve the purpose of the invention, the invention adopts the following technical scheme: specifically, the application provides a UI automation test system based on database input parameters, which specifically comprises: The data acquisition and management module is responsible for establishing dynamic connection with various databases, acquiring diversified test input parameters from the databases in real time according to preset query conditions, providing data caching, determining identification deviation data of page elements corresponding to the test cases based on the test data of the test cases, and determining a cache management strategy of the database input parameters of the test cases based on the identification deviation data; The page operation module is responsible for abstracting each page of the application program into an independent page object, and can dynamically adjust the positioning strategy by utilizing an intelligent element positioning algorithm to realize the positioning of page elements; the test execution module is used for dynamically injecting different data sets from the database for the same test case by combining with the data acquisition and management module so as to realize large-scale data driving test; The test result analysis and reporting module is responsible for collecting, processing and visualizing all results in the test execution process, automatically generating detailed test logs, integrating all test data, generating a structured test report, and determining the update management method of the cache management strategy of the test case of the target management strategy by using the similarity degree of page elements corresponding to different test cases and the test cases of the target management strategy and the cache management method of the associated database of the test cases of the target management strategy. Specifically, the test input parameters include product codes, user IDs, and order numbers. Further, a spam mechanism is also included, i.e., the system can automatically enable predefined default or alternate test data when a database connection fails or the query is not result. In a second aspect, the present application provides a UI automation test method based on database input parameters, which is applied to the UI automation test system of database input parameters, and specifically includes: S1, determining identification deviation data of page elements corresponding to test cases based on the test data of the test cases, determining a cache management strategy of database input parameters of the test cases based on the identification deviation data, and determining cache influ