Control information management method and device, equipment and readable storage medium

By dividing the project into a control library layer, a business layer, a presentation layer and a driver layer, and integrating control mapping and driving capabilities, the coupling and cost problems in control positioning information management are solved, and the ability to efficiently test and adapt to different driver libraries is achieved.

CN120336196AInactive Publication Date: 2025-07-18国泰新点软件股份有限公司
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510819664.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2025-07-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, the writing method of control positioning information has high coupling, poor reusability, low readability, and hierarchical design leads to high initial development and post-maintenance costs.

Method used

The target project is divided into the control library layer, the business layer, the presentation layer and the driver layer. Through the integration of control mapping and driving capabilities, the test pages are automatically generated, reducing the probability of manual writing errors and increasing applicability.

Benefits of technology

It improves the convenience of control positioning information management, reduces development costs and error probability, and enhances the applicability of the project.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120336196A_ABST
    Figure CN120336196A_ABST
Patent Text Reader

Abstract

The invention discloses a control information management method and device, equipment and a readable storage medium, and relates to the technical field of software engineering. Comprising the following steps: firstly, carrying out structure layering on a target project to obtain a control library layer, a business layer, a presentation layer and a driving layer of the target project; obtaining a target control file of the target project, and mapping a target control into a control library layer based on the target control file; the target control file comprises at least two target controls; sending a control library in the control library layer to the business layer, and sending the driving capability in the driving layer to the business layer by using the presentation layer; and finally, generating a test page of each target control by utilizing the business layer, and testing the target controls according to the driving capability and the test pages. According to the method, the convenience of control information management is improved, and the management cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software engineering, and more particularly to a method, apparatus, device, and readable storage medium for managing control information. Background Art

[0002] The core of the UI automation test process mainly consists of three steps: locating controls, operating controls, and assertion verification. Among them, the accurate location of controls depends on the control location information written by testers. Currently, there are mainly two ways to write control location information: one is to hard-code the control path in the test code, but this way has high coupling, poor reusability, and low readability of the test code; the other is to perform hierarchical design based on POM, but in this way, too many abstraction levels lead to code bloat, high initial development costs, and high later maintenance costs.

[0003] Therefore, there is an urgent need for a method for managing control information that can overcome the above defects. Summary of the Invention

[0004] The purpose of the present invention is to provide a method, apparatus, device, and readable storage medium for managing control information, which divides the target project into four layers, each layer undertakes different tasks, increases the convenience of managing control location information, and avoids the cost increase caused by excessive layering. In addition, the test page is automatically generated, reducing the error probability of manual writing and increasing the development efficiency. Finally, the processing of the presentation layer on the driver layer enables the method in the present application to adapt to different driver libraries, increasing the applicability of the project.

[0005] To achieve the above object, the present invention provides the following technical solutions: In a first aspect, the present invention provides a method for managing control information, the method comprising: Performing structure layering on the target project to obtain a control library layer, a business layer, a presentation layer, and a driver layer of the target project; Obtaining a target control file of the target project, and mapping the target controls to the control library layer based on the target control file; the target control file contains at least two target controls; Sending the control library in the control library layer to the business layer, and using the presentation layer to send the driving ability in the driver layer to the business layer; Using the business layer to generate test pages for each target control, and testing the target controls according to the driving ability and the test pages.

[0006] In some embodiments, obtaining a target control file of the target project, and mapping the target controls to the control library layer based on the target control file, includes: Obtain the target control file of the target project, and parse the attribute information of each target control from the target control file; the attribute information includes the section, key, and value of the target control; Map the target control to the control library layer based on the attribute information of the target control.

[0007] In some embodiments, mapping the target control to the control library layer based on the attribute information of the target control includes: Generate a page description, a control description, and a control path of the target control based on the attribute information of the target control; Map the target control to the control library layer using the unified control path syntax based on the page description, control description, and control path of the target control.

[0008] In some embodiments, using the presentation layer to send the driving capabilities in the driver layer to the business layer includes: Use the presentation layer to extract the driving capabilities from the automated test driver library in the driver layer; After integrating and aggregating the driving capabilities, send the driving capabilities to the business layer.

[0009] In some embodiments, using the business layer to generate test pages for each target control includes: Generate test pages for each target control using a test page generation tool according to the page description, control description, and control path of the target control.

[0010] In some embodiments, the driver layer is used to store the automated test driver library.

[0011] In a second aspect, the present invention also provides a control information management device, which includes: A project layering module, configured to perform structural layering on the target project to obtain a control library layer, a business layer, a presentation layer, and a driver layer of the target project; A control mapping module, configured to obtain the target control file of the target project and map the target control to the control library layer based on the target control file; the target control file contains at least two target controls; A business sending module, configured to send the control library in the control library layer to the business layer, and use the presentation layer to send the driving capabilities in the driver layer to the business layer; A control testing module, configured to generate test pages for each target control using the business layer, and test the target control according to the driving capabilities and test pages.

[0012] In a third aspect, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the control information management method provided in the first aspect.

[0013] Fourthly, the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the management method of control information provided in the first aspect is implemented.

[0014] Fifthly, the present invention further provides a computer program product, including a computer program. When the computer program is executed by a processor, the management method of control information provided in the first aspect is implemented.

[0015] The beneficial effects of the present invention are as follows: In the management method of control information provided by the present invention, first, the target project is structurally stratified to obtain the control library layer, business layer, presentation layer, and driver layer of the target project; then, the target control file of the target project is obtained, and the target control is mapped to the control library layer based on the target control file; the target control file contains at least two target controls; then, the control library in the control library layer is sent to the business layer, and the driving ability in the driver layer is sent to the business layer by using the presentation layer; finally, the business layer generates test pages for each target control, and tests the target control according to the driving ability and the test pages. The target project is divided into four layers, and each layer undertakes different tasks, which increases the convenience of control positioning information management and avoids the cost increase caused by excessive stratification. In addition, the automatic generation of test pages reduces the error probability of manual writing and increases the development efficiency. Finally, the processing of the presentation layer on the driver layer enables the method in the present application to adapt to different driver libraries and increases the applicability of the project.

[0016] The above description is only an overview of the technical solution of the present invention. In order to be able to understand the technical means of the present invention more clearly and implement it according to the content of the specification, the following describes in detail with preferred embodiments of the present invention and accompanying drawings as follows. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a schematic flowchart of a management method of control information shown in an embodiment of the present invention; Figure 2 It is a schematic flowchart of another management method of control information shown in an embodiment of the present invention; Figure 3 It is a schematic structural diagram of a management device of control information shown in an embodiment of the present invention; Figure 4 It is a schematic structural diagram of another management device of control information shown in an embodiment of the present invention; Figure 5 It is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0018] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0019] It should be noted that the references to "an embodiment", "embodiment", "example embodiment", etc. in this specification mean that the described embodiment may include specific features, structures or characteristics, but not every embodiment must include these specific features, structures or characteristics. In addition, such expressions do not refer to the same embodiment. Further, when combining specific features, structures or characteristics with an embodiment, it has been shown that it is within the knowledge of those skilled in the art to combine such features, structures or characteristics with other embodiments whether or not there is an explicit description.

[0020] In addition, the technical features involved in different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0021] In some embodiments, as Figure 1 shown, a method for managing control information is provided. The specific method includes: S101, perform structural layering on the target project to obtain the control library layer, business layer, presentation layer, and driver layer of the target project.

[0022] Among them, the control library layer is used to store target controls, the business layer is used to execute tests on the target controls, the presentation layer is used to process the driving ability, and the driver layer is used to store an automated test driver library, and most of the stored in the automated test driver library are some mainstream automated test drivers.

[0023] Specifically, the entire target project is structurally layered according to different processing flows. The part for storing target controls is taken as the control library layer, the part for testing target controls is taken as the business layer, the part for processing the driving ability is taken as the presentation layer, and the part for storing the automated test driver library is taken as the driver layer.

[0024] S102, obtain the target control file of the target project, and map the target controls to the control library layer based on the target control file.

[0025] Among them, the target control file contains at least two target controls; the target control file is the file used to store target controls in the target project.

[0026] Specifically, the control library layer includes different spaces, each of which is used to store target controls of a specific type. In this way, the target controls can be stored regularly in the control library layer. Therefore, the target controls can be mapped to different positions in the control library layer according to the types of the target controls.

[0027] Optionally, the method of mapping the target control to the control library layer based on the target control file may also be: obtaining the target control file of the target project and parsing the attribute information of each target control from the target control file; the attribute information includes the section, key, and value of the target control; mapping the target control to the control library layer based on the attribute information of the target control.

[0028] Specifically, the method of mapping the target control to the control library layer based on the attribute information of the target control may also be generating a page description, a control description, and a control path of the target control based on the attribute information of the target control; and mapping the target control to the control library layer using a unified control path syntax based on the page description, the control description, and the control path of the target control.

[0029] Exemplarily, relevant software can be used to extract attributes such as the section, key, and value of the target control from the target control file. Different sections, keys, and values correspond to different page descriptions, control descriptions, and control paths of the target control. Therefore, based on a pre-set relationship mapping table between the section, key, value and the page description, control description, and control path, the page description, control description, and control path corresponding to each target control can be determined. The page descriptions, control descriptions, and control paths corresponding to different positions in the control library layer are all different. Therefore, according to the page description, control description, and control path of each target control, using a unified control path syntax (such as stagexpath), each target control can be mapped to the corresponding position in the control library layer, that is, the mapping of the target control to the control library layer is completed. Since a unified control path syntax is used when mapping the target control to the control library layer, the formed control library layer can use a unified matching method to match the drivers in the driver layer, greatly reducing the cost of matching with the driver layer.

[0030] S103, sending the control library in the control library layer to the service layer, and using the presentation layer to send the driving ability in the driver layer to the service layer.

[0031] Specifically, first parse the control library layer, and after the parsing process, send the control library layer to the service layer. At this time, in order to implement the testing of the target control, it is also necessary to use the presentation layer to send the driving ability in the driver layer to the service layer, so that the service layer can then execute the testing of the target control.

[0032] Optionally, the specific method of using the presentation layer to send the driving capabilities in the driving layer to the business layer includes: extracting the driving capabilities from the automated test driving library in the driving layer using the presentation layer; after integrating and aggregating the driving capabilities, sending the driving capabilities to the business layer.

[0033] Specifically, the driving layer stores the current mainstream automated test driving libraries on the market, which include various driving capabilities. These driving capabilities need to be integrated and aggregated, and then sent to the business layer, specifically to the test pages generated in the business layer. When subsequently testing the target controls based on the test pages, these driving capabilities can be directly used for driving.

[0034] S104, use the business layer to generate test pages for each target control, and test the target control according to the driving capabilities and the test pages.

[0035] Specifically, relevant page generation tools can be used to generate test pages for target controls according to a certain template, and then use the driving capabilities sent by the presentation layer to drive the test pages to test the target controls.

[0036] Optionally, another method of using the business layer to generate test pages for each target control can be: according to the page description, control description, and control path of the target control, use the test page generation tool to generate test pages for each target control.

[0037] Specifically, the test pages corresponding to different target controls are different, but their generation logics are the same. Therefore, based on the page description, control description, and control path of the target control, using a test page generation tool (such as generate_page), according to a certain template (such as page.tmpl), the corresponding test pages for different target controls can be automatically generated. Testers can also write test case business code based on the test pages and can also locate the relevant target controls.

[0038] In the method for managing control information in the above embodiments, first, the target project is hierarchically structured to obtain the control library layer, business layer, presentation layer, and driver layer of the target project; then, the target control file of the target project is obtained, and the target controls are mapped to the control library layer based on the target control file; the target control file contains at least two target controls; then, the control library in the control library layer is sent to the business layer, and the presentation layer is used to send the driving capabilities in the driver layer to the business layer; finally, the business layer is used to generate test pages for each target control, and the target controls are tested according to the driving capabilities and test pages. The target project is divided into four layers, each layer undertakes different tasks, which increases the convenience of managing control positioning information and avoids the cost increase caused by excessive layering. In addition, the automatic generation of test pages reduces the error probability of manual writing and increases the development efficiency. Finally, the processing of the presentation layer on the driver layer enables the method in this application to adapt to different driver libraries and increases the applicability of the project.

[0039] To more comprehensively demonstrate this solution, an alternative way of the method for managing control information is given in this embodiment, as Figure 2 shown: S201, hierarchically structure the target project to obtain the control library layer, business layer, presentation layer, and driver layer of the target project.

[0040] S202, obtain the target control file of the target project, and parse the attribute information of each target control from the target control file.

[0041] Among them, the target control file contains at least two target controls; the attribute information includes the section, key, and value of the target control.

[0042] S203, generate the page description, control description, and control path of the target control based on the attribute information of the target control.

[0043] S204, map the target control to the control library layer using the unified control path syntax based on the page description, control description, and control path of the target control.

[0044] S205, send the control library in the control library layer to the business layer.

[0045] S206, use the presentation layer to extract the driving capabilities from the automated test driver library in the driver layer.

[0046] Among them, the driver layer is used to store the automated test driver library.

[0047] S207, after integrating and converging the driving capabilities, send the driving capabilities to the business layer.

[0048] S208. Generate test pages for each target control using a test page generation tool based on the page description, control description, and control path of the target control.

[0049] S209. Test the target control according to the driving ability and the test page.

[0050] For the specific processes of S201 - S209 above, reference can be made to the descriptions in the foregoing method embodiments. Their implementation principles and technical effects are similar and will not be elaborated here.

[0051] Based on the same inventive concept, an embodiment of the present application further provides a control information management device for implementing the control information management method involved above. The solution provided by this device to solve problems is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the control information management device provided below can refer to the limitations on the control information management method in the foregoing text and will not be elaborated here.

[0052] In one embodiment, as Figure 3 shown, a control information management device is provided. The device includes: A project layering module 30, configured to perform structural layering on a target project to obtain a control library layer, a business layer, a presentation layer, and a driver layer of the target project; A control mapping module 31, configured to obtain a target control file of the target project and map the target control to the control library layer based on the target control file; the target control file contains at least two target controls; A business sending module 32, configured to send the control library in the control library layer to the business layer and use the presentation layer to send the driving ability in the driver layer to the business layer; A control testing module 33, configured to generate test pages for each target control using the business layer and test the target control according to the driving ability and the test page.

[0053] In another embodiment, as Figure 4 shown, the above Figure 3 control mapping module 31 includes: An attribute parsing unit 310, configured to obtain a target control file of the target project and parse the attribute information of each target control from the target control file; the attribute information includes the section, key, and value of the target control; A control mapping unit 311, configured to map the target control to the control library layer based on the attribute information of the target control.

[0054] In another embodiment, the above Figure 4The control mapping unit 311 therein is specifically configured to: generate a page description, a control description, and a control path of the target control based on the attribute information of the target control; map the target control to the control library layer by using the unified control path syntax based on the page description, the control description, and the control path of the target control.

[0055] In another embodiment, the above-mentioned Figure 3 The service sending module 32 therein is specifically configured to: extract the driving capabilities from the automated test driving library in the driving layer by using the presentation layer; after integrating and converging the driving capabilities, send the driving capabilities to the service layer.

[0056] In another embodiment, the above-mentioned Figure 3 The control testing module 33 therein is specifically configured to: generate test pages for each target control by using a test page generation tool according to the page description, the control description, and the control path of the target control.

[0057] In another embodiment, the driving layer is used to store the automated test driving library.

[0058] The embodiment of the present application further provides an electronic device. In some embodiments, referring to Figure 5 , the electronic device 700 includes an input unit 710, a memory 720, a processor 730, and an output unit 740. The memory 720 stores program instructions that can be run on the processor 730. The processor 730 can execute the management method and / or technical solution based on the control information in the foregoing embodiments by calling the program instructions. The electronic device 700 can be a mobile terminal device such as a mobile phone or a computer.

[0059] In addition, the embodiment of the present application further provides a computer-readable storage medium for storing a computer program for executing the management method of control information. For example, computer program instructions, when executed by a computer, can call or provide the method and / or technical solution according to the present application through the operation of the computer. The program instructions for calling the method of the present application may be stored in a fixed or removable storage medium, and / or transmitted and / or stored in a storage medium running according to the program instructions through a data stream in a broadcast or other signal-bearing medium.

[0060] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present application can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. Optionally, they can be implemented with program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module for implementation. In this way, the present application is not limited to any specific combination of hardware and software.

[0061] The technical features of the above embodiments can be arbitrarily integrated. For the sake of concise description, not all possible integrations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the integration of these technical features, it should be considered as the scope described in this specification.

[0062] The above embodiments only represent several implementation manners of the present invention, and the description is relatively specific and detailed. However, it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several deformations and improvements can still be made, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the invention patent should be subject to the appended claims.

Claims

1. A method for managing control information, characterized in that The method includes: Performing structural layering on the target project to obtain a control library layer, a business layer, a presentation layer, and a driver layer of the target project; Obtaining a target control file of the target project, and mapping target controls to the control library layer based on the target control file; at least two target controls are included in the target control file; Sending the control library in the control library layer to the business layer, and using the presentation layer to send the driving capabilities in the driver layer to the business layer; Using the business layer to generate test pages for each of the target controls, and testing the target controls according to the driving capabilities and the test pages.

2. The management method of control information according to claim 1, wherein Obtaining a target control file of the target project, and mapping target controls to the control library layer based on the target control file, includes: Obtaining the target control file of the target project, and parsing attribute information of each target control from the target control file; the attribute information includes a section, a key, and a value of the target control; Mapping the target controls to the control library layer based on the attribute information of the target controls.

3. The management method of control information according to claim 2, characterized in that Mapping the target controls to the control library layer based on the attribute information of the target controls, includes: Generating a page description, a control description, and a control path of the target control based on the attribute information of the target control; Mapping the target controls to the control library layer using a unified control path syntax based on the page description, the control description, and the control path of the target control.

4. The management method of control information according to claim 1, characterized in that, Using the presentation layer to send the driving capabilities in the driver layer to the business layer, includes: Using the presentation layer to extract driving capabilities from an automated test driver library in the driver layer; After integrating and converging the driving capabilities, sending the driving capabilities to the business layer.

5. The management method of control information according to claim 3, characterized in that, Using the business layer to generate test pages for each of the target controls, includes: Generating test pages for each of the target controls using a test page generation tool according to the page description, the control description, and the control path of the target control.

6. The management method of control information according to claim 1, characterized in that, The driver layer is used to store an automated test driver library.

7. A management device for control information, characterized in that, The apparatus includes: A project layering module, configured to perform structural layering on a target project to obtain a control library layer, a business layer, a presentation layer, and a driver layer of the target project; A control mapping module, configured to obtain a target control file of the target project, and map target controls to the control library layer based on the target control file; at least two target controls are included in the target control file; A business sending module, configured to send the control library in the control library layer to the business layer, and use the presentation layer to send the driving capabilities in the driver layer to the business layer; A control testing module, configured to use the business layer to generate test pages for each of the target controls, and test the target controls according to the driving capabilities and the test pages.

8. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the control information management method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, it implements the method for managing control information described in any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method for managing control information described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Automatic test application platform based on enterprise demand development and test method

    CN113076249A

  • Automatic test method and device for user interface, electronic equipment and storage medium

    CN113778898A

  • Test method and system, readable medium and electronic equipment

    CN114443480A

  • User interface automated testing method and apparatus, and computer-readable storage medium

    WO2020233331A1