Data burying point testing method and device based on natural language intelligent identification control

By using a method based on natural language intelligent control recognition, the instability of automated testing caused by UI changes was solved, achieving efficient data tracking testing and reducing script maintenance costs.

CN113886236BActive Publication Date: 2026-02-10HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111150897.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-29
Publication Date
2026-02-10
Estimated Expiration
2041-09-29

AI Technical Summary

Technical Problem

In existing technologies, UI automation testing is greatly affected by changes in the position of control elements and text, which can lead to unusable automation scripts or low recognition rates for image recognition controls and slow element location efficiency.

Method used

A method based on natural language intelligent control recognition is adopted. The target control is identified by XPath and target parameters to determine whether the target element exists in the page element structure. After matching, data points are obtained for verification, avoiding the need to know the element attributes in advance and decompose the page modules.

Benefits of technology

It improves the matching efficiency of automated tests, reduces the maintenance cost of automated scripts, and enables stable data tracking tests under UI changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113886236B_ABST
    Figure CN113886236B_ABST
Patent Text Reader

Abstract

The application discloses a data burying point test method and device based on natural language intelligent identification control, and comprises the following steps: identifying a target control based on a natural language script, the target control comprising XPath and a first target parameter; determining whether a target element exists in a current page element structure based on the XPath, the target element comprising a second target parameter, and the target element being at least one; if the target element exists, determining whether the target control matches the target element based on the first target parameter and the second target parameter; in the case that the target control matches the target element, obtaining data burying points corresponding to the target element, and verifying the data burying points. In the above process, the target control can be identified through natural language, and it is determined whether the target element exists based on the XPath in the target control, front-end page operation is performed, and automatic verification of burying point data is performed, so that the element attribute and the decomposed page module do not need to be known in advance, and the matching efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a data embedding test method and apparatus based on natural language intelligent recognition controls. Background Technology

[0002] Data tracking automation testing for front-end applications is greatly affected by frequent UI changes. Changes in element position, text, icons, and business data can all cause reported data errors, which can seriously affect the normal operation of automated testing.

[0003] Currently, the mainstream UI automation testing control location methods in China fall into two categories. One is the mainstream webdriver and appium page location method. These components provide open interfaces for element location, allowing for location based on element ID, name, class name, XPath, etc. However, prior knowledge of the control element's attributes is required, and changes in element position or text will render the automation script unusable. The other method uses image recognition automation testing, such as test.ai and Applitool. The drawback of image recognition controls is their low recognition rate. Element location requires breaking down page modules and comparing each module against a pre-built image library, resulting in very low matching efficiency and slow element location. Summary of the Invention

[0004] In view of the above problems, this invention provides a data tracking testing method and apparatus based on natural language intelligent recognition controls. This addresses the shortcomings of existing technologies that rely on open interfaces for element location within components. While these interfaces allow location based on element ID, name, class name, XPath, etc., prior knowledge of element attributes is required, and changes in element position or text render automated scripts unusable. Alternatively, image recognition-based automated testing methods, such as test.ai and Applitool, are used. However, image recognition controls suffer from low recognition rates and require decomposing page modules and comparing them against a pre-set image library, resulting in very low matching efficiency and slow element location. The specific solution is as follows:

[0005] A data tracking testing method based on natural language intelligent recognition controls includes:

[0006] The target control is identified based on natural language scripting, wherein the target control includes: XPath and a first target parameter;

[0007] Based on the XPath, it is determined whether a target element exists in the current page element structure, wherein the target element includes: a second target parameter, and the target element is at least one;

[0008] If they exist, determine whether the target control matches the target element based on the first target parameter and the second target parameter;

[0009] If the target control matches the target element, obtain the data tracking point corresponding to the target element and verify the data tracking point.

[0010] Optionally, the above methods, based on natural language scripting to identify target controls, include:

[0011] Extract keywords from the natural language script and convert the keywords into controls;

[0012] The control is fuzzy matched against preset controls, and if the matching requirement is met, the control is used as the target control.

[0013] Optionally, the method described above, determining whether the target control matches the target element based on the first target parameter and the second target parameter, includes:

[0014] Calculate the first matching value between the first target parameter and the second target parameter;

[0015] Determine whether the first matching value is greater than a preset matching threshold.

[0016] Optionally, the method described above, which determines whether a target element exists in the current page element structure based on the XPath, further includes:

[0017] If it does not exist, generate alternative XPaths based on general processing methods;

[0018] Based on the alternative XPath, a first alternative target element is determined, and a second matching value between the first alternative target element and the target control is determined;

[0019] If the second matching value is less than the preset similarity threshold, traverse each element of the current page to determine whether there is a second candidate target element that is greater than the preset similarity threshold.

[0020] Optionally, in the above method, if the target control matches the target element, the data tracking point corresponding to the target element is obtained, and the data tracking point is validated, including:

[0021] Perform preset automated operations on the target element to obtain data embedding points;

[0022] The data points are validated based on the data point validation script.

[0023] A data tracking and testing device based on natural language intelligent recognition controls includes:

[0024] The recognition module is used to recognize a target control based on a natural language script, wherein the target control includes: an XPath and a first target parameter;

[0025] The first determining module is used to determine whether a target element exists in the current page element structure based on the XPath, wherein the target element includes: a second target parameter, and the target element is at least one;

[0026] The second determining module is used to determine, if present, whether the target control matches the target element based on the first target parameter and the second target parameter;

[0027] The acquisition and verification module is used to acquire data points corresponding to the target element when the target control matches the target element, and to verify the data points.

[0028] Optionally, in the aforementioned apparatus, the identification module includes:

[0029] The acquisition unit is used to acquire keywords in the natural language script and convert the keywords into controls.

[0030] The matching unit is used to perform fuzzy matching of the control among preset controls, and if the matching requirements are met, the control is used as the target control.

[0031] Optionally, in the aforementioned apparatus, the second determining module includes:

[0032] The calculation unit is used to calculate a first matching value between the first target parameter and the second target parameter;

[0033] The first judgment unit is used to determine whether the first matching value is greater than a preset matching degree threshold.

[0034] Optionally, the second determining module further includes:

[0035] The generation unit is used to generate alternative XPaths based on general processing methods if no XPath exists.

[0036] The determining unit is configured to determine a first candidate target element based on the candidate XPath, and determine a second matching value between the first candidate target element and the target control;

[0037] The second judgment unit is used to traverse each element of the current page and determine whether there is a second candidate target element that is greater than the preset similarity threshold when the second matching value is less than the preset similarity threshold.

[0038] Optionally, in the aforementioned apparatus, the acquisition and verification module includes:

[0039] The execution unit is used to perform preset automated operations on the target element to obtain data embedding points;

[0040] The verification unit is used to verify the data embedding points based on the data embedding point verification script.

[0041] Compared with the prior art, the present invention has the following advantages:

[0042] This invention discloses a data tracking test method and apparatus based on natural language intelligent recognition controls, comprising: recognizing a target control based on natural language scripts, wherein the target control includes an XPath and a first target parameter; determining whether a target element exists in the current page element structure based on the XPath, wherein the target element includes a second target parameter, and there is at least one target element; if it exists, determining whether the target control matches the target element based on the first target parameter and the second target parameter; if the target control matches the target element, acquiring the data tracking point corresponding to the target element, and verifying the data tracking point. In the above process, the target control can be recognized through natural language, and the existence of a target element can be determined based on the XPath in the target control, thereby executing front-end page operations and automating the verification of tracking data. This eliminates the need for prior knowledge of element attributes and decomposition of page modules, improving matching efficiency. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 This is a flowchart of a data tracking test method based on a natural language intelligent recognition control disclosed in an embodiment of the present invention;

[0045] Figure 2 This is a schematic diagram of the execution flow of a data tracking test method based on a natural language intelligent recognition control disclosed in an embodiment of the present invention;

[0046] Figure 3 This is a structural block diagram of a data embedding test device based on a natural language intelligent recognition control, as disclosed in an embodiment of the present invention. Detailed Implementation

[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0048] This invention discloses a data tracking testing method and apparatus based on natural language intelligent recognition controls. Applied to the process of control recognition and data tracking testing, it enables the creation of automated test case scripts using natural language, intelligent element matching, execution of front-end page operations, and automated verification of tracking data. This significantly reduces the maintenance cost of automated scripts and improves matching efficiency. The execution flow of the testing method is as follows: Figure 1 As shown, the steps include:

[0049] S101. Identify target controls based on natural language scripts, wherein the target controls include: XPath and first target parameters;

[0050] In this embodiment of the invention, target controls are identified based on natural language scripts, wherein the natural language scripts carry keywords.

[0051] First, it is necessary to obtain the keywords in the natural language script and convert them into controls. The specific implementation methods include the following two:

[0052] (1) Common Control Training Library: This library stores the data structures of common controls. It uses keyword matching to query whether a control is of that type. For example, search controls generally have a fixed format, with the id usually being "search", the name usually being "search", "search the whole network", "search this site", etc. When the keyword "search" is passed in natural language, the data structure assembled from the id, name, text, tag, attr, xpath and other parameters of the control can be obtained by fuzzy matching the name value. The control training library is continuously iterated and maintained. Controls with fewer matching times will be removed, and those with more matching times will be selected first.

[0053] (2) General processing method: If the input keyword cannot be matched with any data structure in the training library, then the default setting will be name = the input "keyword", the other fields will be empty, and a data structure will be assembled and passed to the algorithm of the next process.

[0054] In this embodiment of the invention, a common control training library is first used to obtain control attributes based on the keywords, and then the controls are assembled based on these attributes. The control attributes include: XPath (path) and a first parameter, wherein the first parameter includes at least one of the following: platform number, executable program identifier, page source code, search keyword, type, text, and other attributes. The platform number / executable program identifier indicates a configuration file, such as the web interface of a certain satellite TV station. When the automated test starts and the device under test is opened, the page source code (pagesource) can be obtained. The search keyword can be "login". The type (type) is a component field of a data structure, and the text (text) is also a component field of a data structure.

[0055] The control is fuzzy matched against preset controls. If a match is found, the control is used as the target control. The fuzzy matching process includes: obtaining the XPath of the control; furthermore, during automated execution, the element structure `pagesource` of the current page is passed to the next execution unit, and the XPath found in the previous step is also passed to the next execution unit. The corresponding position of the element in `pagesource` is found through the XPath, and then the weight value of each attribute is calculated using a matching rule algorithm to confirm whether the matching degree between the element in `pagesource` and the passed control data structure reaches the expected matching degree. If a match is found, the XPath of the element in `pagesource` is returned. The target control includes: XPath and a first target parameter.

[0056] If no match is found, a retry mechanism is initiated to search for another element with a lower matching degree.

[0057] S102. Determine whether a target element exists in the current page element structure based on the XPath, wherein the target element includes: a second target parameter, and the target element is at least one;

[0058] In this embodiment of the invention, XPath is used to search for whether a target element exists in the current page element structure. The target element is at least one, and the target element includes a second target parameter, which corresponds to the first target parameter.

[0059] S103. Determine whether the target control matches the target element based on the first target parameter and the second target parameter;

[0060] In this embodiment of the invention, when the target element exists in the current page element structure, it is determined whether the target control matches the target element based on the first target parameter and the second target parameter. The first target parameter or the second target parameter varies depending on the control or element. The specific matching process is as follows:

[0061] Assume the target control has first target parameters: keyword, type, attribute, and weight; and the target element has second target parameters: type and attribute. The weight is dynamically adjusted based on the specific attribute values. The first and second target parameters are then obtained.

[0062] The matching degree between the keyword and the element attribute is calculated, the matching value between type and element type is calculated, and the matching value between attribute and element attribute is calculated. The specific calculation process can be performed using third-party tools, but the specific calculation process is not limited in this embodiment of the invention.

[0063] The final matching degree is calculated by multiplying the weights by the matching values.

[0064] The matching degree is modified based on the comparison of multiple execution results. If there is only one target element, the matching degree is directly compared with a preset matching degree threshold to determine whether the matching degree is greater than the preset matching degree threshold. If there are multiple target elements, the maximum matching degree among each matching degree is selected and compared with the preset matching degree threshold to determine whether it is greater than the preset matching degree threshold. The preset matching degree threshold can be set based on experience or specific circumstances. In this embodiment of the invention, no specific limitation is made.

[0065] Furthermore, if the target element does not exist in the current page element structure or the matching degree is less than a preset matching degree threshold, a candidate XPath is generated based on a general processing method. A first candidate target element is determined based on the candidate XPath, and a second matching value is determined between the first candidate target element and the target control. If the second matching value is less than the preset similarity threshold, each element of the current page is traversed to determine if a second candidate target element greater than the preset similarity threshold exists. If it exists, the traversal stops, and the corresponding element and matching value are returned; otherwise, null is returned. Further, if the second matching value is greater than the preset similarity threshold, the corresponding element and matching value are returned.

[0066] S104. Obtain the data embedding points corresponding to the target element and verify the data embedding points.

[0067] In this embodiment of the invention, when the matching value is greater than a preset matching threshold, the corresponding element and matching value are returned, and it is determined that the target control matches the target element. The page control script performs corresponding automated operations, such as clicking, inputting, and swiping, based on the assembled target element attributes, to obtain data points. If the target element location fails, the element matching algorithm will be called again until the target element is located successfully, and the automated operation is successful.

[0068] Preferably, it is confirmed whether the target element can be clicked, input, or swiped; if the click, input, or swiping operation cannot be performed correctly, a retry mechanism is initiated to reselect the target element.

[0069] The data tracking points are validated based on the data tracking point validation script. The natural language-based data tracking point test script is as follows:

[0070]

[0071]

[0072] The specific verification process includes:

[0073] When a button is clicked, a data entry is reported. This data is intercepted using a third-party tool, such as Charles, and sent to the data receiving service within the automation framework. The data is then stored in the database. Once the data is successfully stored, the automation framework starts the automated test case validation program, sending key test case information to the data validation service. The data validation service searches for the stored data based on the characteristics of the test case. It also retrieves a template data entry from the template database. By comparing these two sets of data, it can determine whether there has been an over-reporting, under-reporting, or incorrect value, and then outputs the test case result.

[0074] This invention discloses a data tracking test method based on natural language intelligent control recognition, comprising: recognizing a target control based on natural language scripts, the target control including an XPath and a first target parameter; determining whether a target element exists in the current page element structure based on the XPath, the target element including a second target parameter, and at least one target element; if it exists, determining whether the target control matches the target element based on the first and second target parameters; if the target control matches the target element, obtaining the data tracking point corresponding to the target element and verifying the data tracking point. In the above process, the target control can be recognized through natural language, and the existence of a target element can be determined based on the XPath in the target control, executing front-end page operations and automatically verifying the tracking data, without needing prior knowledge of element attributes and decomposing page modules, thus improving matching efficiency.

[0075] In this embodiment of the invention, a schematic diagram of the processing flow based on the above method is shown below. Figure 2 As shown, the input is natural language. The system determines if the control type is a common type. If so, it assembles a common data structure; otherwise, it assembles an uncommon data structure. The common data structure has preset values ​​for each attribute, while the uncommon data structure only has a value for the keyword, with the other fields empty. The system outputs a list of controls to the control training library. It then determines if the training library has retrieved any elements. If so, it retrieves the data structure with the highest fuzzy matching degree, which includes attributes such as XPath, text, name, and attribute. It calculates the matching value using a matching degree algorithm and determines if the element's matching value is greater than a preset matching degree threshold. If so, it returns the data structure. If not, it iterates through the remaining data structure lists in the training library, finds elements, calculates their matching values, retrieves the element with the highest matching value, and determines if its matching value is greater than a preset matching degree threshold. If so, it returns the data structure. If not, it iterates through all elements on the page, matching them using keyword and attribute, and determines if any element has a matching value greater than the preset matching degree threshold. If so, it stops iterating and returns the data structure; otherwise, it returns empty and ends the process.

[0076] Furthermore, if no element is found, the data structure is assembled to generate a data structure with "keyword = keyword" and the rest of the fields empty. The element matching algorithm is executed in pagesource. The page traverses all elements and uses keyword and attribute to match the elements. It is determined whether there are any elements with a matching value greater than the preset matching threshold. If so, the traversal stops and the data structure is returned. If not, an empty string is returned and the process ends.

[0077] For example, the above process can be illustrated as follows:

[0078] (1) Input natural language, such as "login", and the natural language automated test case script will run;

[0079] (2) The control type recognition algorithm runs, performs fuzzy matching of control types based on keywords, and assembles control attributes;

[0080] (3) Search the MySQL control library to see if it contains data that matches the current control;

[0081] (4) If matching data exists in the MySQL control library, the data structure is passed to the control matching algorithm module to confirm whether the current data structure is the element being searched for.

[0082] (5) If the data retrieved from the MySQL control library cannot match the element that matches the keyword, start the control retrieval again to find the first element that best meets the requirements;

[0083] (6) Return to the operation execution module to confirm whether the element can be clicked, input, or swiped;

[0084] (7) If the click, input or swipe operation cannot be performed correctly, the retry mechanism is started and the operation (5)-(6) is repeated.

[0085] (8) After the element operation is successfully executed, the data tracking verification module is started, the template data is read from the MySQL database for verification, and an automated test report is output and archived.

[0086] The above process, which uses natural language to write automated test case scripts, intelligently matches elements, executes front-end page operations, and performs automated verification of embedded data, can significantly reduce the maintenance cost of automated scripts.

[0087] Based on the above-described data tracking testing method using a natural language intelligent recognition control, this embodiment of the invention provides a data tracking testing device based on a natural language intelligent recognition control. The structural block diagram of the testing device is shown below. Figure 3 As shown, it includes:

[0088] The module includes an identification module 201, a first determination module 202, a second determination module 203, and an acquisition and verification module 204.

[0089] in,

[0090] The recognition module 201 is used to recognize a target control based on a natural language script, wherein the target control includes: an XPath and a first target parameter;

[0091] The first determining module 202 is used to determine whether a target element exists in the current page element structure based on the XPath, wherein the target element includes: a second target parameter, and the target element is at least one;

[0092] The second determining module 203 is used to determine, if present, whether the target control matches the target element based on the first target parameter and the second target parameter;

[0093] The acquisition and verification module 204 is used to acquire data points corresponding to the target element and verify the data points when the target control matches the target element.

[0094] This invention discloses a data tracking testing device based on natural language intelligent control recognition, comprising: recognizing a target control based on natural language scripts, the target control including an XPath and a first target parameter; determining whether a target element exists in the current page element structure based on the XPath, the target element including a second target parameter, and at least one target element; if it exists, determining whether the target control matches the target element based on the first and second target parameters; if the target control matches the target element, acquiring the data tracking point corresponding to the target element and verifying the data tracking point. In the above process, the target control can be recognized through natural language, and the existence of a target element can be determined based on the XPath in the target control, executing front-end page operations and performing automated data tracking verification without prior knowledge of element attributes or decomposition of page modules, thus improving matching efficiency.

[0095] In this embodiment of the invention, the identification module 201 includes:

[0096] Acquire unit 205 and matching unit 206.

[0097] in,

[0098] The acquisition unit 205 is used to acquire keywords in the natural language script and convert the keywords into controls.

[0099] The matching unit 206 is used to perform fuzzy matching of the control among preset controls, and if the matching requirements are met, the control is used as the target control.

[0100] In this embodiment of the invention, the second determining module 203 includes:

[0101] Calculation unit 207 and first judgment unit 208.

[0102] in,

[0103] The calculation unit 207 is used to calculate a first matching value between the first target parameter and the second target parameter;

[0104] The first judgment unit 208 is used to determine whether the first matching value is greater than a preset matching degree threshold.

[0105] In this embodiment of the invention, the second determining module 203 further includes:

[0106] The generation unit 209, the determination unit 210, and the second judgment unit 211.

[0107] in,

[0108] The generation unit 209 is used to generate alternative XPaths based on a general processing method if no XPath exists.

[0109] The determining unit 210 is used to determine a first candidate target element based on the candidate XPath, and to determine a second matching value between the first candidate target element and the target control;

[0110] The second judgment unit 211 is used to traverse each element of the current page and determine whether there is a second candidate target element that is greater than the preset similarity threshold when the second matching value is less than the preset similarity threshold.

[0111] In this embodiment of the invention, the acquisition and verification module 204 includes:

[0112] Execution unit 212 and verification unit 213.

[0113] in,

[0114] The execution unit 212 is used to perform a preset automated operation on the target element to obtain data embedding points;

[0115] The verification unit 213 is used to verify the data embedding points based on the data embedding point verification script.

[0116] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0117] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0118] The above provides a detailed description of the data embedding test method and apparatus based on natural language intelligent recognition control provided by the present invention. Specific examples have been used to illustrate the principle and implementation of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation and application scope based on the idea of ​​the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A data tracking test method based on natural language intelligent recognition controls, characterized in that, include: The method for identifying target controls based on natural language scripts includes: obtaining keywords from the natural language script and converting the keywords into controls; performing fuzzy matching on the controls in preset controls; and, if the matching requirement is met, using the controls as the target controls and returning the data structure of the target controls. Based on the XPath, it is determined whether a target element exists in the current page element structure, wherein the target element includes: a second target parameter, and the target element is at least one; If they exist, determine whether the target control matches the target element based on the first target parameter and the second target parameter; When the target control matches the target element, obtain the data tracking point corresponding to the target element and verify the data tracking point; Determining whether a target element exists in the current page element structure based on the XPath also includes: If not, generate alternative XPaths based on general processing methods; among them, assemble the data structure to generate a data structure with name=keyword and the rest empty, and perform element matching on the current page; Based on the candidate XPath, a first candidate target element is determined, and a second matching value between the first candidate target element and the target control is determined; If the second matching value is less than the preset similarity threshold, the elements of the current page are traversed to determine whether there is a second candidate target element that is greater than the preset similarity threshold.

2. The method according to claim 1, characterized in that, Determining whether the target control matches the target element based on the first target parameter and the second target parameter includes: Calculate the first matching value between the first target parameter and the second target parameter; Determine whether the first matching value is greater than a preset matching threshold.

3. The method according to claim 1, characterized in that, When the target control matches the target element, the data tracking point corresponding to the target element is obtained, and the data tracking point is validated, including: Perform preset automated operations on the target element to obtain data embedding points; The data points are validated based on the data point validation script.

4. A data embedding test device based on natural language intelligent recognition control, characterized in that, include: A recognition module is used to recognize a target control based on a natural language script, wherein the target control includes an XPath and a first target parameter; wherein the recognition module includes an acquisition unit, used to acquire keywords in the natural language script and convert the keywords into controls; and a matching unit, used to perform fuzzy matching of the control in preset controls, and if the matching requirements are met, to use the control as the target control and return the data structure of the target control; The first determining module is used to determine whether a target element exists in the current page element structure based on the XPath, wherein the target element includes: a second target parameter, and the target element is at least one; The second determining module is used to determine, if present, whether the target control matches the target element based on the first target parameter and the second target parameter; The acquisition and verification module is used to acquire the data points corresponding to the target element when the target control matches the target element, and to verify the data points. The second determining module further includes: The generation unit is used to generate alternative XPaths based on a general processing method if no XPath exists; it assembles data structures, generates data structures with name=keyword and the rest empty, and performs element matching on the current page; The determining unit is configured to determine a first candidate target element based on the candidate XPath, and determine a second matching value between the first candidate target element and the target control; The second judgment unit is used to traverse each element of the current page and determine whether there is a second candidate target element that is greater than the preset similarity threshold when the second matching value is less than the preset similarity threshold.

5. The apparatus according to claim 4, characterized in that, The second determining module includes: The calculation unit is used to calculate a first matching value between the first target parameter and the second target parameter; The first judgment unit is used to determine whether the first matching value is greater than a preset matching degree threshold.

6. The apparatus according to claim 4, characterized in that, The acquisition and verification module includes: The execution unit is used to perform preset automated operations on the target element to obtain data embedding points; The verification unit is used to verify the data embedding points based on the data embedding point verification script.

Citation Information

Patent Citations

  • Test method and device, storage medium and computer equipment

    CN110928763A

  • Control test method and device, equipment and storage medium

    CN112732589A