CN117171397A - Page control positioning method, device and storage medium - Google Patents
Page control positioning method, device and storage medium Download PDFInfo
- Publication number
- CN117171397A CN117171397A CN202311141208.0A CN202311141208A CN117171397A CN 117171397 A CN117171397 A CN 117171397A CN 202311141208 A CN202311141208 A CN 202311141208A CN 117171397 A CN117171397 A CN 117171397A
- Authority
- CN
- China
- Prior art keywords
- control
- matched
- candidate
- information
- attribute information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 79
- 230000008569 process Effects 0.000 claims description 28
- 238000012360 testing method Methods 0.000 claims description 25
- 238000004590 computer program Methods 0.000 claims description 10
- 239000000725 suspension Substances 0.000 claims description 9
- 230000001960 triggered effect Effects 0.000 claims description 5
- 230000009191 jumping Effects 0.000 claims description 4
- 230000000750 progressive effect Effects 0.000 claims 1
- 238000010586 diagram Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 6
- 238000012545 processing Methods 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 5
- 230000008859 change Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 4
- 125000004122 cyclic group Chemical group 0.000 description 3
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 230000006399 behavior Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
Landscapes
- Programmable Controllers (AREA)
Abstract
The embodiment of the disclosure provides a page control positioning method, equipment and storage medium, which are used for acquiring control information of a control to be matched in an application program, wherein the control information comprises first attribute information; acquiring a first candidate control set matched with the first attribute information of the control to be matched from a directed graph of an application program page framework, wherein the directed graph takes different pages of an application program as nodes, and controls operation and control information for triggering skip among the pages are taken as edges for connecting the nodes; and carrying out step-by-step mutual matching of the superior control and/or the subordinate control according to respective control information for any candidate control in the control to be matched and the first candidate control set so as to search a target candidate control matched with the control to be matched from the first candidate control set. The robustness and accuracy of control matching can be improved under the condition that control level information is complex and various.
Description
Technical Field
The embodiment of the disclosure relates to the technical field of computer and network communication, in particular to a page control positioning method, equipment and a storage medium.
Background
Application programs (APP) carrying massive users and multiple complex business scenarios are also becoming increasingly important for functional robustness and functionality issues, in the face of user growth and product fast upgrade iterations.
Automated testing, which is the primary means of finding application problems, typically determines a test path based on a directed graph of the application page architecture (APP map), however, it often faces the problem that page controls are difficult to uniquely locate in the directed graph of the application page architecture (APP map).
Disclosure of Invention
The embodiment of the disclosure provides a page control positioning method, equipment and a storage medium, so as to improve the accuracy of page control positioning.
In a first aspect, an embodiment of the present disclosure provides a method for positioning a page control, including:
acquiring control information of a control to be matched in an application program, wherein the control information comprises first attribute information;
acquiring a first candidate control set matched with the first attribute information of the control to be matched from a directed graph of an application program page framework, wherein the directed graph takes different pages of an application program as nodes, and controls operation and control information for triggering skip among the pages are taken as edges for connecting the nodes;
And carrying out step-by-step mutual matching of the superior control and/or the subordinate control according to respective control information for any candidate control in the control to be matched and the first candidate control set so as to search a target candidate control matched with the control to be matched from the first candidate control set.
In a second aspect, an embodiment of the present disclosure provides a page control positioning device, including:
the control information acquisition unit is used for acquiring control information of a control to be matched in the application program, wherein the control information comprises first attribute information;
the candidate control acquisition unit is used for acquiring a first candidate control set matched with the first attribute information of the control to be matched from a directed graph of an application program page framework, wherein the directed graph takes different pages of the application program as nodes, and controls operation of jumping between the pages and control information are triggered to serve as edges connected with the nodes;
and the matching unit is used for carrying out step-by-step mutual matching of the superior control and/or the subordinate control on any candidate control in the control to be matched and the first candidate control set according to respective control information so as to search the target candidate control matched with the control to be matched from the first candidate control set.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executes the computer-executable instructions stored by the memory, causing the at least one processor to perform the page control positioning method as described above in the first aspect and the various possible designs of the first aspect.
In a fourth aspect, embodiments of the present disclosure provide a computer readable storage medium, where computer executable instructions are stored, which when executed by a processor, implement the page control positioning method according to the first aspect and the various possible designs of the first aspect.
In a fifth aspect, embodiments of the present disclosure provide a computer program product comprising computer-executable instructions which, when executed by a processor, implement the page control positioning method according to the first aspect and the various possible designs of the first aspect.
According to the page control positioning method, the page control positioning device and the storage medium, control information of a control to be matched in an application program is obtained, wherein the control information comprises first attribute information; acquiring a first candidate control set matched with the first attribute information of the control to be matched from a directed graph of an application program page framework, wherein the directed graph takes different pages of an application program as nodes, and controls operation and control information for triggering skip among the pages are taken as edges for connecting the nodes; and carrying out step-by-step mutual matching of the superior control and/or the subordinate control according to respective control information for any candidate control in the control to be matched and the first candidate control set so as to search a target candidate control matched with the control to be matched from the first candidate control set. According to the embodiment of the disclosure, the first candidate control set is screened out from the directed graph of the page framework of the application program based on the first attribute information of the control to be matched, so that the matching range is reduced, the robustness and accuracy of control matching can be improved under the condition that control level information is complex and various through layer-by-layer dynamic matching of the superior control and/or the subordinate control, and in addition, the first attribute information and the multidimensional information of the superior control and/or the subordinate control are applied in the matching process, so that the adaptability to control information loss and dynamic change is improved.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the solutions in the prior art, a brief description will be given below of the drawings that are needed in the embodiments or the description of the prior art, it being obvious that the drawings in the following description are some embodiments of the present disclosure, and that other drawings may be obtained from these drawings without inventive effort to a person of ordinary skill in the art.
FIG. 1 is a diagram illustrating an exemplary scenario of a page control positioning method according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a method for positioning a page control according to an embodiment of the disclosure;
fig. 3 is a flowchart of a method for positioning a page control according to another embodiment of the present disclosure;
FIG. 4 is a block diagram of a page control positioning device according to an embodiment of the present disclosure;
fig. 5 is a schematic hardware structure of an electronic device according to an embodiment of the disclosure.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present disclosure more apparent, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure, and it is apparent that the described embodiments are some embodiments of the present disclosure, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without inventive effort, based on the embodiments in this disclosure are intended to be within the scope of this disclosure.
Automated testing, which is the primary means of finding application problems, typically determines a test path based on a directed graph of the application page architecture (APP map), however, it often faces the problem that page controls are difficult to uniquely locate in the directed graph of the application page architecture (APP map). The main reasons for this problem include:
1) The parent-child hierarchical relationship of the page control is complex and various; in an application program of a complex service scene (for example, an application program of a platform-level complex service scene), massive and complex page scenes often exist in the application program, and various operable interaction behaviors are hidden among the page scenes, so that massive page nodes are stored in a directed graph (APP map) of an application program page architecture generated by manual testing and automatic operation data abstraction, complex directed edges (control operation) exist among the nodes, and an exponential potential testing path exists;
2) The key information of the page control is missing; such as missing control Identification (ID) information, missing control operation type information, etc.;
3) The page control information has dynamic variability and uncertainty; such as changes in control information as the version of the application upgrades, etc.
Therefore, for any control, it is difficult to uniquely locate the control in the directed graph (APP map) of the application page architecture, so that a test path (from a start scene to a specified end scene) for the control cannot be quickly and accurately obtained, and a valuable test path meeting the test requirement cannot be screened.
In order to solve the technical problems, the disclosure provides a page control positioning method, which includes acquiring control information of a control to be matched in an application program, wherein the control information includes first attribute information; acquiring a first candidate control set matched with first attribute information of a control to be matched from a directed graph of an application page framework, wherein the directed graph takes different pages of an application program as nodes, and controls operation and control information of skip among the pages are triggered to serve as edges for connecting the nodes; and carrying out step-by-step mutual matching of the superior control and/or the subordinate control according to respective control information for any candidate control in the control to be matched and the first candidate control set so as to search a target candidate control matched with the control to be matched from the first candidate control set. According to the embodiment, the first candidate control set is screened out from the directed graph of the application program page framework based on the first attribute information of the control to be matched, so that the matching range is reduced, the robustness and the accuracy of control matching can be improved under the condition that control level information is complex and various through layer-by-layer dynamic matching of the superior control and/or the inferior control, and in addition, the first attribute information and the multidimensional information of the superior control and/or the inferior control are applied in the matching process, so that the adaptability to control information loss and dynamic change is improved.
The page control positioning method can be applied to electronic equipment such as terminal equipment or a server, and as shown in fig. 1, the electronic equipment can acquire control information of a control to be matched in an application program, wherein the control information comprises first attribute information; acquiring a first candidate control set matched with first attribute information of a control to be matched from a directed graph of an application page framework; and carrying out step-by-step mutual matching of the superior control and/or the subordinate control according to respective control information for any candidate control in the control to be matched and the first candidate control set so as to search a target candidate control matched with the control to be matched from the first candidate control set.
Further, if a plurality of candidate controls matched with the controls to be matched still exist after the matching of the upper control and/or the lower control is completed, the matching of the multidimensional control information can be performed, and the matching of the multidimensional control information comprises, but is not limited to, one or more of control information such as control class information, control text information, control index information and the like, so as to determine target candidate controls.
The page control positioning method of the present disclosure will be described in detail below with reference to specific embodiments.
Referring to fig. 2, fig. 2 is a flowchart of a page control positioning method according to an embodiment of the disclosure. The method of the embodiment can be applied to electronic equipment such as terminal equipment or a server, and the method for positioning the page control comprises the following steps:
S201, control information of a control to be matched in an application program is obtained, wherein the control information comprises first attribute information.
In this embodiment, the control to be matched may be one control in any page of the application program, may be a plurality of controls in any page, or may be a plurality of controls in different pages. In this embodiment, control information of the control to be matched may be obtained from the application program, where the control information may include, but is not limited to: control identification Information (ID), control operation type information, upper level controls (father control, grandfather control, etc.), lower level controls (child control, grandson control), etc., wherein the control identification Information (ID) and/or the control operation type information may be recorded as first attribute information, and other information may be adopted as the first attribute information.
Optionally, when the control information of the control to be matched in the application program is obtained, analyzing the Tree information (json format) of the page Tree structure where the control to be matched is located, and obtaining the control information of the control to be matched. If the to-be-matched control is all the controls in any page of the application program, analyzing the page tree structure information to obtain the control information of all the controls of the page, and obtaining the control information set of all the controls of the page, wherein the first attribute information set can be obtained for the first attribute information.
S202, a first candidate control set matched with the first attribute information of the control to be matched is obtained from a directed graph of an application page framework, wherein the directed graph takes different pages of an application program as nodes, and control operation and control information of skip between the pages are triggered to serve as edges connected with the nodes.
In this embodiment, a directed graph (APP map) of an application page architecture is used to represent a page hierarchy, where different pages of an application are used as nodes in the directed graph, each node is connected by a directed edge, a directed edge connected between any two nodes is identified by a control operation and control information for triggering a jump between two pages, the directed graph of the application page architecture is often used in an automated test or problem interception scenario, and a test path set (a path from a start page to an end page) meeting test requirements can be determined based on the directed graph of the application page architecture.
In order to locate the control to be matched in the directed graph of the application page framework, in the disclosure, first, matching may be performed in the directed graph of the application page framework based on the first attribute information of the control to be matched, so as to find candidate controls matched with the first attribute information of the control to be matched. Wherein the first attribute information is control identification Information (ID) and/or control operation type information, which can reduce the number of candidate controls in the first candidate control set to a greater extent.
If the first attribute information includes control identification Information (ID), searching candidate controls which are the same as the identification Information (ID) of the control to be matched from a directed graph of the application page framework, if the first attribute information includes control operation type information, searching candidate controls which are the same as the control operation type information of the control to be matched from the directed graph of the application page framework, and if the first attribute information includes the identification Information (ID) and the control operation type information, searching candidate controls which are the same as the identification Information (ID) of the control to be matched and the control operation type information from the directed graph of the application page framework.
It should be noted that if some first attribute information of each control in the directed graph of the control to be matched and the application page architecture is missing, another first attribute information may be adopted to match.
S203, for any one candidate control in the control to be matched and the first candidate control set, performing step-by-step mutual matching of the superior control and/or the subordinate control according to respective control information so as to find a target candidate control matched with the control to be matched from the first candidate control set.
In this embodiment, considering that the to-be-matched control can be matched with a certain candidate control, the hierarchical relationship between the upper control and/or the lower control of the to-be-matched control should be completely consistent, so after the first candidate control set is acquired, control matching can be performed based on the hierarchical relationship between the upper control and/or the lower control, so that a target candidate control (which may not be found of course) uniquely matched with the to-be-matched control can be expected to be found from the first candidate control set, including only step-by-step mutual matching based on the upper control, or only step-by-step mutual matching based on the lower control, or step-by-step mutual matching based on the upper control and the lower control at the same time.
The step-by-step mutual matching is that the number of the steps is less than or equal to that of the upper-level control and/or the lower-level control, the matching speed is higher as the number of the steps is smaller, and if the candidate control uniquely matched with the control to be matched can be found when the number of the steps is smaller, the matching is completed without continuing the matching of more steps; if the candidate control matched with the control to be matched is not found when the number of the stages is small, the matching fails, and no more stages of matching is needed to be continued; if a plurality of candidate controls matched with the control to be matched can be found when the number of the stages is small, namely unique matching cannot be achieved, the number of the stages is increased, matching is carried out again from the plurality of candidate controls, the above process is repeated until the candidate control uniquely matched with the control to be matched is found, or matching fails, or matching of all upper nodes and/or all lower controls of the control to be matched is completed.
If the target candidate control matched with the control to be matched is finally found, the position of the control to be matched in the directed graph of the application page framework can be determined as the position of the target candidate control in the directed graph of the application page framework is known, and then the test path of the control to be matched can be determined according to the directed graph.
It should be noted that, because the above page control positioning method is dynamically performed, when control information changes, each control in the directed graph of the control to be matched and the application program page architecture is updated in real time, so that the above page control positioning method can be executed based on the updated control information, and accuracy of control positioning is ensured.
According to the page control positioning method, control information of the control to be matched in the application program is obtained, wherein the control information comprises first attribute information; acquiring a first candidate control set matched with the first attribute information of the control to be matched from a directed graph of an application program page framework, wherein the directed graph takes different pages of an application program as nodes, and controls operation and control information for triggering skip among the pages are taken as edges for connecting the nodes; and carrying out step-by-step mutual matching of the superior control and/or the subordinate control according to respective control information for any candidate control in the control to be matched and the first candidate control set so as to search a target candidate control matched with the control to be matched from the first candidate control set. According to the embodiment, the first candidate control set is screened out from the directed graph of the application program page framework based on the first attribute information of the control to be matched, so that the matching range is reduced, the robustness and the accuracy of control matching can be improved under the condition that control level information is complex and various through layer-by-layer dynamic matching of the superior control and/or the inferior control, and in addition, the first attribute information and the multidimensional information of the superior control and/or the inferior control are applied in the matching process, so that the adaptability to control information loss and dynamic change is improved.
Based on any one of the foregoing embodiments, step 203 may specifically include, for any one of the to-be-matched control and the first candidate control set, performing step-by-step mutual matching of an upper control and/or a lower control according to respective control information:
respectively extracting an upper control and/or a lower control of a first target level from the control information of the control to be matched and the control information of any candidate control in the first candidate control set, and performing mutual matching;
if the superior control and/or the subordinate control of the first target level of the control to be matched can be matched with the superior control and/or the subordinate control of the first target level of the plurality of candidate controls in the first candidate control set, taking the plurality of candidate controls as a second candidate control set, respectively extracting the superior control and/or the subordinate control of a second target level from the control information of the control to be matched and the control information of any candidate control in the second candidate control set, and re-matching the superior control and/or the subordinate control of the second target level, wherein the second target level is greater than the first target level; or alternatively
If the upper level control and/or the lower level control of the first target level of the control to be matched can be uniquely matched with the upper level control and/or the lower level control of the first target level of a certain candidate control in the first candidate control set, determining the candidate control as the target candidate control; or alternatively
And if the upper control and/or the lower control of the first target level of the control to be matched cannot be matched with the upper control and/or the lower control of the first target level of any candidate control in the first candidate control set, determining that the matching is failed.
The step-by-step mutual matching process of the upper control and/or the lower control comprises any one of the following steps:
determining the target candidate control; or alternatively
Determining that the matching fails; or alternatively
And completing the matching of all the superior nodes and/or all the subordinate controls of the control to be matched with the superior controls and/or the subordinate controls of the same level of the candidate control.
In an optional embodiment, for any one of the to-be-matched control and the first candidate control set, step-by-step mutual matching of the superior control can be performed according to respective control information, specifically, as shown in fig. 3, the superior control of the first target level can be extracted (cut out) from the control information of the to-be-matched control and the control information of any one of the first candidate control set, for example, a primary superior control, namely, a father control, and the to-be-matched control and the father control thereof and each candidate control and respective father control thereof in the first candidate control set are used as information to be matched for matching;
If the control to be matched and the parent control thereof can be uniquely matched with a certain candidate control and the parent control thereof in the first candidate control set, the control to be matched and the candidate control are the same, and the candidate control is determined to be a target candidate control matched with the control to be matched;
if the control to be matched and the parent control thereof cannot be matched with any candidate control in the first candidate control set and the parent control thereof, indicating that the control to be matched does not exist in the directed graph of the application program page framework, namely the matching fails;
if the to-be-matched control and the father control thereof can be matched with a plurality of candidate controls and respective father controls in the first candidate control set, the plurality of candidate controls are used as a second candidate control set, upper-level controls with a second target level (the second target level is larger than the first target level) are respectively extracted (cut out) from control information of the to-be-matched control and control information of any candidate control in the second candidate control set, for example, two-level upper-level controls, namely, the father control and the father control, are extracted, and the to-be-matched control, the father control and the father control are matched with each candidate control and the father control in the second candidate control set as information to be matched;
If the control to be matched and the father control and the grandfather control thereof can be uniquely matched with a certain candidate control and the father control and the grandfather control thereof in the second candidate control set, the control to be matched is the same control as the candidate control, and the candidate control is determined to be a target candidate control matched with the control to be matched;
if the to-be-matched control and the father control and the grandfather control thereof cannot be matched with any candidate control in the second candidate control set and the father control and the grandfather control thereof, the fact that the to-be-matched control does not exist in the directed graph of the application page framework is indicated, namely the matching fails;
if the to-be-matched control and the father control and the grandfather control thereof can be matched with a plurality of candidate controls in the second candidate control set and the father control and the grandfather control thereof, repeating the process, and continuing to match the father control, the grandfather control and the great grandfather control.
The suspension conditions of the above-described stepwise mutual matching process (cyclic process) include any one of the following:
determining the target candidate control;
determining that the matching fails;
and (3) finishing the matching of all the superior spaces of the control to be matched and the superior controls with the same level of the candidate control, namely tracing back to the root control of the control to be matched.
In another optional embodiment, for any one of the to-be-matched control and the first candidate control set, step-by-step mutual matching of the lower control can be performed according to respective control information, specifically, the lower control of the first target level can be extracted from the control information of the to-be-matched control and the control information of any one of the candidate control in the first candidate control set, for example, the lower control of the first target level is extracted, that is, the sub control is extracted, and the to-be-matched control and the sub control thereof are matched with each candidate control and each sub control thereof in the first candidate control set as information to be matched;
if the control to be matched and the child control thereof can be uniquely matched with a certain candidate control and the child control thereof in the first candidate control set, the fact that the control to be matched is the same control as the candidate control is indicated, and the candidate control is determined to be a target candidate control matched with the control to be matched;
if the control to be matched and the child controls thereof cannot be matched with any candidate control and the child controls thereof in the first candidate control set, the fact that the control to be matched is not in the directed graph of the application program page framework is indicated, namely the matching fails;
if the to-be-matched control and child controls thereof can be matched with a plurality of candidate controls and child father controls thereof in the first candidate control set, the plurality of candidate controls are used as a second candidate control set, lower-level controls of a second target level (the second target level is greater than the first target level) are respectively extracted from control information of the to-be-matched control and control information of any candidate control in the second candidate control set, for example, two-level lower-level controls, namely child controls and grandchild controls, and the to-be-matched control, child controls and grandchild controls thereof and each candidate control and grandchild control thereof in the second candidate control set are used as information to be matched, and matching is carried out;
If the control to be matched and the child control and the grandchild control thereof can be uniquely matched with a certain candidate control and the child control and the grandchild control thereof in the second candidate control set, the fact that the control to be matched is the same control as the candidate control is indicated, and the candidate control is determined to be a target candidate control matched with the control to be matched;
if the control to be matched and the child control and the grandchild control thereof cannot be matched with any candidate control in the second candidate control set and the child control and the grandchild control thereof, the fact that the control to be matched does not exist in the directed graph of the application page framework is indicated, namely the matching fails;
if the control to be matched and the child control and the grandchild control thereof can be matched with a plurality of candidate controls in the second candidate control set and the child control and the grandchild control thereof, repeating the process, and continuing to match the child control, the grandchild control and the grandchild control.
The suspension conditions of the above-described stepwise mutual matching process (cyclic process) include any one of the following:
determining the target candidate control;
determining that the matching fails;
and (3) finishing the matching of all subordinate controls of the control to be matched and subordinate controls of the same level of the candidate control, namely tracing back to leaf controls of the control to be matched.
In another optional embodiment, for any candidate control in the to-be-matched control and the first candidate control set, performing step-by-step mutual matching of an upper control and a lower control according to respective control information, specifically, first extracting the upper control and the lower control of the first target level from control information of the to-be-matched control and control information of any candidate control in the first candidate control set, for example, extracting a first-level upper control and a first-level lower control, namely a father control and a son control, and performing matching by taking the to-be-matched control and the father control and the son control thereof and each candidate control and each father control and son control thereof in the first candidate control set as information to be matched;
if the control to be matched and the father control and the child control thereof can be uniquely matched with a certain candidate control and the father control and the child control thereof in the first candidate control set, the control to be matched is the same control as the candidate control, and the candidate control is determined to be a target candidate control matched with the control to be matched;
if the control to be matched and the father control and the child control thereof cannot be matched with any candidate control in the first candidate control set and the father control and the child control thereof, the fact that the control to be matched does not exist in the directed graph of the application page framework is indicated, namely the matching fails;
If the to-be-matched control and the father control and the child control thereof can be matched with a plurality of candidate controls and respective father controls and child controls thereof in the first candidate control set, the plurality of candidate controls are used as a second candidate control set, an upper control and a lower control of a second target level (the second target level is greater than the first target level) are respectively extracted from control information of the to-be-matched control and control information of any candidate control in the second candidate control set, for example, a two-level upper control and a two-level lower control are extracted, namely, the father control, the grandfather control, the child control and the child control are matched with each candidate control and respective father control, grandfather control, child control and child control thereof in the second candidate control set as information to be matched;
if the control to be matched and the father control, the grandfather control, the child control and the grandson control of the control to be matched can be uniquely matched with a certain candidate control and the father control, the grandfather control, the child control and the grandson control of the control to be matched in the second candidate control set, the fact that the control to be matched is the same control as the candidate control is indicated, and the candidate control is determined to be a target candidate control matched with the control to be matched;
If the control to be matched and the father control, the grandfather control, the child control and the grandson control thereof cannot be matched with any candidate control in the second candidate control set and the father control, the grandfather control, the child control and the grandson control thereof, the fact that the control to be matched does not exist in the directed graph of the application page framework is indicated, namely, the matching fails;
if the to-be-matched control and the father control, the grandfather control, the child control and the grandson control of the to-be-matched control can be matched with the plurality of candidate controls in the second candidate control set and the father control, the grandfather control, the child control and the grandson control of the to-be-matched control, the above processes are repeated, and the matching among the father control, the grandfather control, the child control, the grandson control and the grandson control is continued.
The suspension conditions of the above-described stepwise mutual matching process (cyclic process) include any one of the following:
determining the target candidate control;
determining that the matching fails;
and finishing the matching of all the superior controls and all the subordinate controls of the control to be matched with the superior controls and the subordinate controls of the same level of the candidate controls, namely tracing back to the root controls and the leaf controls of the control to be matched.
In another alternative embodiment, the control to be matched may be matched with each other step by step from the upper control, when the matching of all the upper controls of the control to be matched with the upper controls of the same level of the candidate control is completed, there are still a plurality of candidate controls matched with the control to be matched, and then the matching process and the suspension condition of the control to be matched are similar to those of the above embodiment, and are not repeated here.
In another alternative embodiment, the lower level controls may be matched with each other step by step, when the matching of all the lower level controls of the control to be matched with the lower level controls of the same level of the candidate controls is completed, a plurality of candidate controls matched with the control to be matched still exist, and then the upper level controls continue to be matched with each other step by step, wherein the matching process and the suspension condition are similar to those of the above embodiment, and are not repeated here.
On the basis of the embodiment, if all the upper nodes and/or all the lower controls of the controls to be matched can still be matched with the upper controls and/or the lower controls of the same level of the plurality of candidate controls, the plurality of candidate controls are used as a third candidate control set;
further, matching the second attribute information of the control to be matched with the second attribute information of any candidate control in the third candidate control set respectively, so as to find a target candidate control matched with the control to be matched from the third candidate control set.
In this embodiment, the second attribute information may include, but is not limited to, one or more of the following: the confidence of the control Class (Class) information, the control text (text) information and the control index information is lower than that of the first attribute information, but the control Class (Class) information, the control text (text) information and the control index information can be used as a condition that the control to be matched is further matched with the third candidate control set, namely if the control to be matched can be matched with one candidate control in the third candidate control set, the second attribute information of the control to be matched and the third candidate control set is completely consistent.
Specifically, if the second attribute information of the control to be matched is uniquely matched with the second attribute information of a candidate control in the third candidate control set, the fact that the control to be matched can be uniquely matched with the candidate control is indicated, and the candidate control is determined to be the target candidate control; or alternatively
If the second attribute information of the control to be matched cannot be matched with the second attribute information of any candidate control in the third candidate control set, the control to be matched cannot be matched with any candidate control, and the matching fails; or alternatively
If the second attribute information of the control to be matched is matched with the second attribute information of the plurality of candidate controls in the third candidate control set, it is considered that the candidate controls have a plurality of control corresponding relations in the directed graph of the application page framework, and specific reasons for the fact may be that the same operation is executed on the same control to be matched due to other factors such as different AB experiments hit by the current equipment, different login account types (e.g. a member account and a non-member account), different equipment authority states (e.g. an authority state and a non-authority state), different results are generated, and then a plurality of different nodes (corresponding to different edges) exist in the directed graph of the application page framework. At this point, the plurality of candidate controls are determined to be the target candidate control, with specific further processing logic being defined by the downstream task itself.
Optionally, if the second attribute information includes multiple items, for example, includes control class information, control text information and control index information, the to-be-matched control and any candidate control in the third candidate control set may be sequentially matched with each item of the second attribute information according to the confidence level of the multiple items of the second attribute information (where the confidence level is from high to low, and is control class information > control text information > control index information);
in the process of matching a certain item of second attribute information, if the item of second attribute information of the control to be matched is uniquely matched with the item of second attribute information of a certain candidate control in the third candidate control set, determining the candidate control as the target candidate control; or alternatively
And when the last item of second attribute information is matched, if the item of second attribute information of the control to be matched can still be matched with the item of second attribute information of a plurality of candidate controls in the third candidate control set, determining the plurality of candidate controls as the target candidate control.
Specifically, matching control class information is performed first, namely, matching control class information of a control to be matched with control class information of each candidate control in a third candidate control set, if the control class information of the control to be matched can be uniquely matched with control class information of a certain candidate control in the third candidate control set, determining the candidate control as the target candidate control, and finishing matching (without matching of other second attribute information); if the control class information of the control to be matched cannot be matched with the control class information of any candidate control in the third candidate control set, the matching is failed, and the matching is ended; if the control class information of the control to be matched can be matched with the control class information of the plurality of candidate controls in the third candidate control set, the plurality of candidate controls are used as a fourth candidate control set;
Then matching control text information, namely matching the control text information of the control to be matched with the control text information of each candidate control in the fourth candidate control set, if the control text information of the control to be matched can be uniquely matched with the control text information of a certain candidate control in the fourth candidate control set, determining the candidate control as the target candidate control, and finishing matching (without matching other second attribute information); if the control text information of the control to be matched cannot be matched with the control text information of any candidate control in the fourth candidate control set, the matching is failed, and the matching is ended; if the control text information of the control to be matched can be matched with the control text information of a plurality of candidate controls in the fourth candidate control set, the plurality of candidate controls are used as a fifth candidate control set;
finally, matching control index information, namely matching the control index information of the control to be matched with the control index information of each candidate control in the fifth candidate control set, and if the control index information of the control to be matched can be uniquely matched with the control index information of a certain candidate control in the fifth candidate control set, determining the candidate control as the target candidate control and ending the matching; if the control index information of the control to be matched cannot be matched with the control index information of any candidate control in the fifth candidate control set, the matching is failed, and the matching is ended; and if the control index information of the control to be matched can be matched with the control index information of the plurality of candidate controls in the fifth candidate control set, outputting the plurality of candidate controls as target candidate controls.
It should be noted that, if a certain item of second attribute information of the control to be matched and the candidate control is missing, matching may be continued through other second attribute information.
In the embodiment, multidimensional information (control type information, control text information and control index information) of the control is adopted in the matching process, so that the accuracy of positioning the control is improved, and the adaptability to the loss of control information and dynamic change is improved.
Corresponding to the page control positioning method in the above embodiment, fig. 4 is a block diagram of the structure of the page control positioning device provided in the embodiment of the present disclosure. For ease of illustration, only portions relevant to embodiments of the present disclosure are shown. Referring to fig. 4, the page control positioning device 400 includes: control information acquisition unit 401, candidate control acquisition unit 402, matching unit 403.
The control information obtaining unit 401 is configured to obtain control information of a control to be matched in an application program, where the control information includes first attribute information;
a candidate control obtaining unit 402, configured to obtain a first candidate control set matched with the first attribute information of the control to be matched from a directed graph of an application page architecture, where the directed graph uses different pages of an application as nodes, and triggers control operation of jumping between the pages and control information as edges connected with the nodes;
And the matching unit 403 is configured to perform step-by-step mutual matching of the upper control and/or the lower control according to respective control information for any candidate control in the to-be-matched control and the first candidate control set, so as to find a target candidate control matched with the to-be-matched control from the first candidate control set.
In one or more embodiments of the present disclosure, the matching unit 403 is configured to, when performing step-by-step mutual matching of the control to be matched and any candidate control in the first candidate control set according to respective control information, perform step-by-step mutual matching of an upper control and/or a lower control on the control to be matched:
respectively extracting an upper control and/or a lower control of a first target level from the control information of the control to be matched and the control information of any candidate control in the first candidate control set, and performing mutual matching;
and if the superior control and/or the subordinate control of the first target level of the control to be matched can be matched with the superior control and/or the subordinate control of the first target level of the plurality of candidate controls in the first candidate control set, taking the plurality of candidate controls as a second candidate control set, respectively extracting the superior control and/or the subordinate control of the second target level from the control information of the control to be matched and the control information of any candidate control in the second candidate control set, and re-performing mutual matching, wherein the second target level is larger than the first target level.
In one or more embodiments of the present disclosure, the matching unit 403 is further configured to:
if the upper level control and/or the lower level control of the first target level of the control to be matched can be uniquely matched with the upper level control and/or the lower level control of the first target level of a certain candidate control in the first candidate control set, determining the candidate control as the target candidate control; or alternatively
And if the upper control and/or the lower control of the first target level of the control to be matched cannot be matched with the upper control and/or the lower control of the first target level of any candidate control in the first candidate control set, determining that the matching is failed.
In one or more embodiments of the present disclosure, the suspension condition of the step-by-step mutual matching process of the upper control and/or the lower control includes any one of the following:
determining the target candidate control; or alternatively
Determining that the matching fails; or alternatively
And completing the matching of all the superior nodes and/or all the subordinate controls of the control to be matched with the superior controls and/or the subordinate controls of the same level of the candidate control.
In one or more embodiments of the present disclosure, the first attribute information includes: control identification information and/or control operation type information.
In one or more embodiments of the present disclosure, the matching unit 403 is further configured to:
if all the upper nodes and/or all the lower controls of the controls to be matched can still be matched with the upper controls and/or the lower controls of the same level of the plurality of candidate controls, the plurality of candidate controls are used as a third candidate control set;
and matching the second attribute information of the control to be matched with the second attribute information of any candidate control in the third candidate control set respectively so as to search a target candidate control matched with the control to be matched from the third candidate control set.
In one or more embodiments of the present disclosure, when the matching unit 403 matches the second attribute information of the control to be matched with the second attribute information of any candidate control in the third candidate control set, so as to find a target candidate control matched with the control to be matched from the third candidate control set, the matching unit is configured to:
if the second attribute information of the control to be matched is uniquely matched with the second attribute information of a certain candidate control in the third candidate control set, determining the candidate control as the target candidate control; or alternatively
If the second attribute information of the control to be matched cannot be matched with the second attribute information of any candidate control in the third candidate control set, determining that the matching fails; or alternatively
And if the second attribute information of the control to be matched is matched with the second attribute information of the plurality of candidate controls in the third candidate control set, determining the plurality of candidate controls as the target candidate control.
In one or more embodiments of the present disclosure, the second attribute information includes one or more of: control class information, control text information, control index information.
In one or more embodiments of the present disclosure, if the second attribute information includes a plurality of items, the matching unit 403 is configured to, when matching the second attribute information of the control to be matched with the second attribute information of any candidate control in the third candidate control set, respectively:
according to the confidence level of the second attribute information, matching the second attribute information of each candidate control in the control to be matched and any candidate control in the third candidate control set in sequence;
in the process of matching a certain item of second attribute information, if the item of second attribute information of the control to be matched is uniquely matched with the item of second attribute information of a certain candidate control in the third candidate control set, determining the candidate control as the target candidate control; or alternatively
And when the last item of second attribute information is matched, if the item of second attribute information of the control to be matched can still be matched with the item of second attribute information of a plurality of candidate controls in the third candidate control set, determining the plurality of candidate controls as the target candidate control.
In one or more embodiments of the present disclosure, the control information obtaining unit 401, when obtaining control information of a control to be matched in an application program, is configured to:
and analyzing the page tree structure information of the control to be matched to obtain the control information of the control to be matched.
In one or more embodiments of the present disclosure, after searching for the target candidate control matched with the control to be matched from the first candidate control set, the matching unit 403 is further configured to:
and determining the test path of the target candidate control in the directed graph, and taking the test path of the target candidate control as the test path of the control to be matched.
The device provided in this embodiment may be used to execute the technical solution of the foregoing method embodiment, and its implementation principle and technical effects are similar, and this embodiment will not be described herein again.
Referring to fig. 5, a schematic diagram of a structure of an electronic device 500 suitable for use in implementing embodiments of the present disclosure is shown, where the electronic device 500 may be a terminal device or a server. The terminal device may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a personal digital assistant (Personal Digital Assistant, PDA for short), a tablet (Portable Android Device, PAD for short), a portable multimedia player (Portable Media Player, PMP for short), an in-vehicle terminal (e.g., an in-vehicle navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 5 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 5, the electronic apparatus 500 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 501 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage device 508 into a random access Memory (Random Access Memory, RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
In general, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (Liquid Crystal Display, abbreviated as LCD), a speaker, a vibrator, and the like; storage 508 including, for example, magnetic tape, hard disk, etc.; and communication means 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 shows an electronic device 500 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or from the storage means 508, or from the ROM 502. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 501.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer-readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above-described embodiments.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (Local Area Network, LAN for short) or a wide area network (Wide Area Network, WAN for short), or it may be connected to an external computer (e.g., connected via the internet using an internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the unit does not in any way constitute a limitation of the unit itself, for example the first acquisition unit may also be described as "unit acquiring at least two internet protocol addresses".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
In a first aspect, according to one or more embodiments of the present disclosure, there is provided a page control positioning method, including:
acquiring control information of a control to be matched in an application program, wherein the control information comprises first attribute information;
acquiring a first candidate control set matched with the first attribute information of the control to be matched from a directed graph of an application program page framework, wherein the directed graph takes different pages of an application program as nodes, and controls operation and control information for triggering skip among the pages are taken as edges for connecting the nodes;
and carrying out step-by-step mutual matching of the superior control and/or the subordinate control according to respective control information for any candidate control in the control to be matched and the first candidate control set so as to search a target candidate control matched with the control to be matched from the first candidate control set.
According to one or more embodiments of the present disclosure, for any candidate control in the to-be-matched control and the first candidate control set, performing step-by-step mutual matching of an upper control and/or a lower control according to respective control information includes:
respectively extracting an upper control and/or a lower control of a first target level from the control information of the control to be matched and the control information of any candidate control in the first candidate control set, and performing mutual matching;
And if the superior control and/or the subordinate control of the first target level of the control to be matched can be matched with the superior control and/or the subordinate control of the first target level of the plurality of candidate controls in the first candidate control set, taking the plurality of candidate controls as a second candidate control set, respectively extracting the superior control and/or the subordinate control of the second target level from the control information of the control to be matched and the control information of any candidate control in the second candidate control set, and re-performing mutual matching, wherein the second target level is larger than the first target level.
According to one or more embodiments of the present disclosure, the method further comprises:
if the upper level control and/or the lower level control of the first target level of the control to be matched can be uniquely matched with the upper level control and/or the lower level control of the first target level of a certain candidate control in the first candidate control set, determining the candidate control as the target candidate control; or alternatively
And if the upper control and/or the lower control of the first target level of the control to be matched cannot be matched with the upper control and/or the lower control of the first target level of any candidate control in the first candidate control set, determining that the matching is failed.
According to one or more embodiments of the present disclosure, the suspension condition of the step-by-step mutual matching process of the upper control and/or the lower control includes any one of the following:
determining the target candidate control; or alternatively
Determining that the matching fails; or alternatively
And completing the matching of all the superior nodes and/or all the subordinate controls of the control to be matched with the superior controls and/or the subordinate controls of the same level of the candidate control.
According to one or more embodiments of the present disclosure, the first attribute information includes: control identification information and/or control operation type information.
According to one or more embodiments of the present disclosure, the method further comprises:
if all the upper nodes and/or all the lower controls of the controls to be matched can still be matched with the upper controls and/or the lower controls of the same level of the plurality of candidate controls, the plurality of candidate controls are used as a third candidate control set;
and matching the second attribute information of the control to be matched with the second attribute information of any candidate control in the third candidate control set respectively so as to search a target candidate control matched with the control to be matched from the third candidate control set.
According to one or more embodiments of the present disclosure, the matching the second attribute information of the to-be-matched control with the second attribute information of any candidate control in the third candidate control set, so as to find a target candidate control matched with the to-be-matched control from the third candidate control set, includes:
if the second attribute information of the control to be matched is uniquely matched with the second attribute information of a certain candidate control in the third candidate control set, determining the candidate control as the target candidate control; or alternatively
If the second attribute information of the control to be matched cannot be matched with the second attribute information of any candidate control in the third candidate control set, determining that the matching fails; or alternatively
And if the second attribute information of the control to be matched is matched with the second attribute information of the plurality of candidate controls in the third candidate control set, determining the plurality of candidate controls as the target candidate control.
According to one or more embodiments of the present disclosure, the second attribute information includes one or more of: control class information, control text information, control index information.
According to one or more embodiments of the present disclosure, if the second attribute information includes a plurality of items, the matching the second attribute information of the control to be matched with the second attribute information of any candidate control in the third candidate control set includes:
according to the confidence level of the second attribute information, matching the second attribute information of each candidate control in the control to be matched and any candidate control in the third candidate control set in sequence;
in the process of matching a certain item of second attribute information, if the item of second attribute information of the control to be matched is uniquely matched with the item of second attribute information of a certain candidate control in the third candidate control set, determining the candidate control as the target candidate control; or alternatively
And when the last item of second attribute information is matched, if the item of second attribute information of the control to be matched can still be matched with the item of second attribute information of a plurality of candidate controls in the third candidate control set, determining the plurality of candidate controls as the target candidate control.
According to one or more embodiments of the present disclosure, the obtaining control information of a control to be matched in an application program includes:
And analyzing the page tree structure information of the control to be matched to obtain the control information of the control to be matched.
According to one or more embodiments of the present disclosure, after searching for the target candidate control matched with the control to be matched from the first candidate control set, the method further includes:
and determining the test path of the target candidate control in the directed graph, and taking the test path of the target candidate control as the test path of the control to be matched.
In a second aspect, according to one or more embodiments of the present disclosure, there is provided a page control positioning device, including:
the control information acquisition unit is used for acquiring control information of a control to be matched in the application program, wherein the control information comprises first attribute information;
the candidate control acquisition unit is used for acquiring a first candidate control set matched with the first attribute information of the control to be matched from a directed graph of an application program page framework, wherein the directed graph takes different pages of the application program as nodes, and controls operation of jumping between the pages and control information are triggered to serve as edges connected with the nodes;
and the matching unit is used for carrying out step-by-step mutual matching of the superior control and/or the subordinate control on any candidate control in the control to be matched and the first candidate control set according to respective control information so as to search the target candidate control matched with the control to be matched from the first candidate control set.
According to one or more embodiments of the present disclosure, when the matching unit performs step-by-step mutual matching of the control to be matched and any candidate control in the first candidate control set according to respective control information, the matching unit is configured to:
respectively extracting an upper control and/or a lower control of a first target level from the control information of the control to be matched and the control information of any candidate control in the first candidate control set, and performing mutual matching;
and if the superior control and/or the subordinate control of the first target level of the control to be matched can be matched with the superior control and/or the subordinate control of the first target level of the plurality of candidate controls in the first candidate control set, taking the plurality of candidate controls as a second candidate control set, respectively extracting the superior control and/or the subordinate control of the second target level from the control information of the control to be matched and the control information of any candidate control in the second candidate control set, and re-performing mutual matching, wherein the second target level is larger than the first target level.
According to one or more embodiments of the present disclosure, the matching unit is further configured to:
If the upper level control and/or the lower level control of the first target level of the control to be matched can be uniquely matched with the upper level control and/or the lower level control of the first target level of a certain candidate control in the first candidate control set, determining the candidate control as the target candidate control; or alternatively
And if the upper control and/or the lower control of the first target level of the control to be matched cannot be matched with the upper control and/or the lower control of the first target level of any candidate control in the first candidate control set, determining that the matching is failed.
According to one or more embodiments of the present disclosure, the suspension condition of the step-by-step mutual matching process of the upper control and/or the lower control includes any one of the following:
determining the target candidate control; or alternatively
Determining that the matching fails; or alternatively
And completing the matching of all the superior nodes and/or all the subordinate controls of the control to be matched with the superior controls and/or the subordinate controls of the same level of the candidate control.
According to one or more embodiments of the present disclosure, the first attribute information includes: control identification information and/or control operation type information.
According to one or more embodiments of the present disclosure, the matching unit is further configured to:
If all the upper nodes and/or all the lower controls of the controls to be matched can still be matched with the upper controls and/or the lower controls of the same level of the plurality of candidate controls, the plurality of candidate controls are used as a third candidate control set;
and matching the second attribute information of the control to be matched with the second attribute information of any candidate control in the third candidate control set respectively so as to search a target candidate control matched with the control to be matched from the third candidate control set.
According to one or more embodiments of the present disclosure, when the matching unit matches the second attribute information of the control to be matched with the second attribute information of any candidate control in the third candidate control set, so as to find a target candidate control matched with the control to be matched from the third candidate control set, the matching unit is configured to:
if the second attribute information of the control to be matched is uniquely matched with the second attribute information of a certain candidate control in the third candidate control set, determining the candidate control as the target candidate control; or alternatively
If the second attribute information of the control to be matched cannot be matched with the second attribute information of any candidate control in the third candidate control set, determining that the matching fails; or alternatively
And if the second attribute information of the control to be matched is matched with the second attribute information of the plurality of candidate controls in the third candidate control set, determining the plurality of candidate controls as the target candidate control.
According to one or more embodiments of the present disclosure, the second attribute information includes one or more of: control class information, control text information, control index information.
According to one or more embodiments of the present disclosure, if the second attribute information includes a plurality of items, the matching unit is configured to, when matching the second attribute information of the control to be matched with the second attribute information of any one candidate control in the third candidate control set, respectively:
according to the confidence level of the second attribute information, matching the second attribute information of each candidate control in the control to be matched and any candidate control in the third candidate control set in sequence;
in the process of matching a certain item of second attribute information, if the item of second attribute information of the control to be matched is uniquely matched with the item of second attribute information of a certain candidate control in the third candidate control set, determining the candidate control as the target candidate control; or alternatively
And when the last item of second attribute information is matched, if the item of second attribute information of the control to be matched can still be matched with the item of second attribute information of a plurality of candidate controls in the third candidate control set, determining the plurality of candidate controls as the target candidate control.
According to one or more embodiments of the present disclosure, when the control information obtaining unit obtains control information of a control to be matched in an application program, the control information obtaining unit is configured to:
and analyzing the page tree structure information of the control to be matched to obtain the control information of the control to be matched.
According to one or more embodiments of the present disclosure, after searching for a target candidate control matched with the control to be matched from the first candidate control set, the matching unit is further configured to:
and determining the test path of the target candidate control in the directed graph, and taking the test path of the target candidate control as the test path of the control to be matched.
In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device comprising: at least one processor and memory;
the memory stores computer-executable instructions;
The at least one processor executes the computer-executable instructions stored by the memory, causing the at least one processor to perform the page control positioning method as described above in the first aspect and the various possible designs of the first aspect.
In a fourth aspect, according to one or more embodiments of the present disclosure, there is provided a computer-readable storage medium having stored therein computer-executable instructions which, when executed by a processor, implement the page control positioning method as described in the first aspect and the various possible designs of the first aspect.
In a fifth aspect, according to one or more embodiments of the present disclosure, there is provided a computer program product comprising computer-executable instructions which, when executed by a processor, implement the page control positioning method according to the first aspect and the various possible designs of the first aspect.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.
Claims (15)
1. The page control positioning method is characterized by comprising the following steps of:
acquiring control information of a control to be matched in an application program, wherein the control information comprises first attribute information;
Acquiring a first candidate control set matched with the first attribute information of the control to be matched from a directed graph of an application program page framework, wherein the directed graph takes different pages of an application program as nodes, and controls operation and control information for triggering skip among the pages are taken as edges for connecting the nodes;
and carrying out step-by-step mutual matching of the superior control and/or the subordinate control according to respective control information for any candidate control in the control to be matched and the first candidate control set so as to search a target candidate control matched with the control to be matched from the first candidate control set.
2. The method according to claim 1, wherein for any candidate control in the to-be-matched control and the first candidate control set, performing step-by-step mutual matching of an upper control and/or a lower control according to respective control information includes:
respectively extracting an upper control and/or a lower control of a first target level from the control information of the control to be matched and the control information of any candidate control in the first candidate control set, and performing mutual matching;
and if the superior control and/or the subordinate control of the first target level of the control to be matched can be matched with the superior control and/or the subordinate control of the first target level of the plurality of candidate controls in the first candidate control set, taking the plurality of candidate controls as a second candidate control set, respectively extracting the superior control and/or the subordinate control of the second target level from the control information of the control to be matched and the control information of any candidate control in the second candidate control set, and re-performing mutual matching, wherein the second target level is larger than the first target level.
3. The method according to claim 2, wherein the method further comprises:
if the upper level control and/or the lower level control of the first target level of the control to be matched can be uniquely matched with the upper level control and/or the lower level control of the first target level of a certain candidate control in the first candidate control set, determining the candidate control as the target candidate control; or alternatively
And if the upper control and/or the lower control of the first target level of the control to be matched cannot be matched with the upper control and/or the lower control of the first target level of any candidate control in the first candidate control set, determining that the matching is failed.
4. A method according to claim 2 or 3, wherein the suspension condition of the progressive mutual matching process of the superior control and/or the inferior control comprises any one of the following:
determining the target candidate control; or alternatively
Determining that the matching fails; or alternatively
And completing the matching of all the superior nodes and/or all the subordinate controls of the control to be matched with the superior controls and/or the subordinate controls of the same level of the candidate control.
5. The method of claim 1, wherein the first attribute information comprises: control identification information and/or control operation type information.
6. The method according to claim 4, wherein the method further comprises:
if all the upper nodes and/or all the lower controls of the controls to be matched can still be matched with the upper controls and/or the lower controls of the same level of the plurality of candidate controls, the plurality of candidate controls are used as a third candidate control set;
and matching the second attribute information of the control to be matched with the second attribute information of any candidate control in the third candidate control set respectively so as to search a target candidate control matched with the control to be matched from the third candidate control set.
7. The method of claim 6, wherein the matching the second attribute information of the control to be matched with the second attribute information of any candidate control in the third candidate control set to find a target candidate control matched with the control to be matched from the third candidate control set includes:
if the second attribute information of the control to be matched is uniquely matched with the second attribute information of a certain candidate control in the third candidate control set, determining the candidate control as the target candidate control; or alternatively
If the second attribute information of the control to be matched cannot be matched with the second attribute information of any candidate control in the third candidate control set, determining that the matching fails; or alternatively
And if the second attribute information of the control to be matched is matched with the second attribute information of the plurality of candidate controls in the third candidate control set, determining the plurality of candidate controls as the target candidate control.
8. The method of claim 7, wherein the second attribute information comprises one or more of: control class information, control text information, control index information.
9. The method of claim 7, wherein if the second attribute information includes a plurality of items, the matching the second attribute information of the control to be matched with the second attribute information of any one of the third candidate control set, respectively, includes:
according to the confidence level of the second attribute information, matching the second attribute information of each candidate control in the control to be matched and any candidate control in the third candidate control set in sequence;
in the process of matching a certain item of second attribute information, if the item of second attribute information of the control to be matched is uniquely matched with the item of second attribute information of a certain candidate control in the third candidate control set, determining the candidate control as the target candidate control; or alternatively
And when the last item of second attribute information is matched, if the item of second attribute information of the control to be matched can still be matched with the item of second attribute information of a plurality of candidate controls in the third candidate control set, determining the plurality of candidate controls as the target candidate control.
10. The method of claim 1, wherein the obtaining control information of the control to be matched in the application program comprises:
and analyzing the page tree structure information of the control to be matched to obtain the control information of the control to be matched.
11. The method of claim 1, wherein after searching for the target candidate control matched with the control to be matched from the first candidate control set, further comprising:
and determining the test path of the target candidate control in the directed graph, and taking the test path of the target candidate control as the test path of the control to be matched.
12. A page control positioning device, comprising:
the control information acquisition unit is used for acquiring control information of a control to be matched in the application program, wherein the control information comprises first attribute information;
The candidate control acquisition unit is used for acquiring a first candidate control set matched with the first attribute information of the control to be matched from a directed graph of an application program page framework, wherein the directed graph takes different pages of the application program as nodes, and controls operation of jumping between the pages and control information are triggered to serve as edges connected with the nodes;
and the matching unit is used for carrying out step-by-step mutual matching of the superior control and/or the subordinate control on any candidate control in the control to be matched and the first candidate control set according to respective control information so as to search the target candidate control matched with the control to be matched from the first candidate control set.
13. An electronic device, comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing computer-executable instructions stored in the memory cause the at least one processor to perform the method of any one of claims 1-11.
14. A computer readable storage medium having stored therein computer executable instructions which, when executed by a processor, implement the method of any of claims 1-11.
15. A computer program product comprising computer-executable instructions which, when executed by a processor, implement the method of any of claims 1-11.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311141208.0A CN117171397A (en) | 2023-09-05 | 2023-09-05 | Page control positioning method, device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311141208.0A CN117171397A (en) | 2023-09-05 | 2023-09-05 | Page control positioning method, device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117171397A true CN117171397A (en) | 2023-12-05 |
Family
ID=88933249
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311141208.0A Pending CN117171397A (en) | 2023-09-05 | 2023-09-05 | Page control positioning method, device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117171397A (en) |
-
2023
- 2023-09-05 CN CN202311141208.0A patent/CN117171397A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR20160073402A (en) | Callpath finder | |
CN111897740B (en) | User interface testing method and device, electronic equipment and computer readable medium | |
CN112115153B (en) | Data processing method, device, equipment and storage medium | |
CN111352823B (en) | Test method, client and storage medium | |
CN110704833A (en) | Data permission configuration method, device, electronic device and storage medium | |
CN111857720B (en) | User interface state information generation method and device, electronic equipment and medium | |
CN112395363B (en) | Data synchronization method, device, equipment and readable storage medium | |
CN110781658A (en) | Resume analysis method and device, electronic equipment and storage medium | |
CN111258998A (en) | Data verification method, device, medium and electronic equipment | |
CN111124541B (en) | Configuration file generation method, device, equipment and medium | |
CN110413367B (en) | Task creation method and device, storage medium and electronic equipment | |
CN116225886A (en) | Test case generation method, device, equipment, storage medium and program product | |
CN113449498A (en) | Method and device for generating form, storage medium and electronic equipment | |
CN111414152B (en) | Method, system, readable medium and electronic device for realizing business logic | |
CN111752644A (en) | Interface simulation method, device, equipment and storage medium | |
CN115473839B (en) | Buried point-based data processing method, device, equipment and storage medium | |
CN117667663A (en) | Control positioning path determining method, device, equipment, storage medium and product | |
CN113094286B (en) | Page test method and device, storage medium and electronic equipment | |
CN117171397A (en) | Page control positioning method, device and storage medium | |
CN112433730B (en) | Code detection rule generation method and device and electronic equipment | |
CN112286609B (en) | Method and device for managing shortcut setting items of intelligent terminal | |
CN112486494A (en) | File generation method and device, electronic equipment and computer readable storage medium | |
CN118227453A (en) | Control matching method, device, equipment and medium of graphical user interface | |
CN118069486A (en) | Control searching method, device, equipment and storage medium | |
CN116822475A (en) | Processing method, device, equipment and medium of form data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |