Test case error reporting processing method and related device
By acquiring and classifying page information and element vector information of error cases, user operation mapping relationships are generated, and error cases are automatically completed and retested, solving the problem of low testing efficiency in user interface automation testing and achieving efficient test case management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA PING AN PROPERTY INSURANCE CO LTD
- Filing Date
- 2022-06-17
- Publication Date
- 2026-04-10
AI Technical Summary
In existing technologies, user interface automated testing methods require a lot of manpower and resources to maintain test cases when page elements or styles change, resulting in low testing efficiency.
By obtaining the page information corresponding to the error case, determining the vector information of the error element, and classifying it into n levels according to preset rules and vector information, a mapping relationship between the error element and user operation is generated, and the error case is automatically completed and retested.
It enables automatic test completion when test cases report errors, saving manpower and resources, avoiding manual completion or rewriting of test cases, and improving testing efficiency.
Smart Images

Figure CN115033486B_ABST
Abstract
Claims
1. A method for handling test case errors, characterized in that, Includes the following steps: When a test case throws an error due to an unknown element change or an unknown page style change, obtain the page information corresponding to the error case. The page information is parsed into HTML format. From the HTML page information, the element information of the error-reporting element in the page corresponding to the error case is obtained. The element information includes the identifier of the error-reporting element. An image recognition algorithm is used to identify the page information, obtaining candidate boxes for elements in the page corresponding to the error case. The candidate boxes include the element's identifier and attributes. The candidate boxes are matched with the element information of the error-reporting element to determine the valid candidate boxes corresponding to the error-reporting element. A region-of-interest (ROI) pooling algorithm is used to identify the valid candidate boxes, obtaining the vector information of the error-reporting element. The vector information includes the error-reporting element's identifier and attributes. The error-reporting elements are classified into n levels according to preset rules and the vector information to obtain the mapping relationship between the error-reporting elements and user operations. In the mapping relationship, one error element corresponds to at least one user operation; The preset rules include the relationship between page elements and user operations; Complete the error case according to the mapping relationship, and retest the error case; The step of matching the candidate boxes of the element with the element information of the error-reporting element to determine the valid candidate boxes corresponding to the error-reporting element includes: When the identifier of the target element in the candidate box is the same as the identifier of the error-reporting element in the element information, the candidate box corresponding to the target element is determined to be a valid candidate box. The generation of the preset rules includes: Intercept all background requests from the logged-in system, and statistically analyze the page elements and user operations corresponding to commonly used functions based on the interface information corresponding to the background requests. Obtain preset page elements and the user operations corresponding to the preset page elements, and generate preset rules based on the user operations corresponding to the preset page elements and the preset page elements.
2. The processing method according to claim 1, characterized in that, Before using the region-of-interest pooling algorithm to identify the valid candidate boxes and obtain the vector information of the error-reporting elements, the processing method further includes: Clustering algorithms are used to cluster the valid candidate boxes.
3. The processing method according to claim 1, characterized in that, The step of classifying the error-reporting elements into n levels according to preset rules and the vector information to obtain the mapping relationship between the error-reporting elements and user operations includes: The user operation corresponding to the page element with the same identifier as the error-reporting element in the preset rules is determined as the user operation corresponding to the error-reporting element; The mapping relationship is generated based on the user operation corresponding to the error element and the error element itself.
4. The processing method according to claim 1, characterized in that, The step of completing the error case according to the mapping relationship and retesting the error case includes: Based on the mapping relationship, the user operations corresponding to the error element are used sequentially to retest the error element until the error case no longer reports an error, thus confirming that the error case has been successfully completed.
5. A test case error processing apparatus, used to execute the method according to any one of claims 1 to 4, characterized in that, include: The acquisition module is used to retrieve the page information corresponding to the error case; The determination module is used to parse the page information into HTML format and obtain the element information of the error element in the page corresponding to the error case from the HTML format page information; The page information is identified using an image recognition algorithm to obtain candidate boxes of elements in the page corresponding to the error case; the candidate boxes of the elements are matched with the element information of the error element to determine the valid candidate boxes corresponding to the error element; the valid candidate boxes are identified using a region of interest pooling algorithm to obtain the vector information of the error element; the vector information includes the identifier and attributes of the error element. The classification module is used to classify the error-reporting element into n levels according to preset rules and the vector information, and to obtain the mapping relationship between the error-reporting element and the user operation. In the mapping relationship, one error element corresponds to at least one user operation; The preset rules include the relationship between page elements and user operations; The testing module is used to complete the error cases according to the mapping relationship and retest the error cases.
6. A computer device, comprising a memory and a processor, wherein the memory stores computer-readable instructions, and the processor, when executing the computer-readable instructions, implements the steps of the test case error handling method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the test case error handling method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Webpage test method and device, electronic device and medium
CN108628741A
Test case execution method and device, storage medium and equipment
CN112579465A