Domain control platform interface testing method and device and storage medium

By adding domain terminal data to the domain control platform and creating interface template files, analyzing interface mode files, determining operation application scenarios and generating test script use cases, and testing the domain control platform interface, the test problem that the existing technology cannot be applied to the domain control platform is solved, and effective testing of the domain control platform interface is realized.

CN119829435APending Publication Date: 2025-04-15KYLIN CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411846247.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

The existing interface testing methods and tools are not suitable for domain control platforms and cannot be effectively tested based on the actual situation of the domain control platform.

Method used

Provide a domain control platform interface testing method, including adding domain terminal data to the configured domain control platform, creating a json-format interface template file based on the functional units of the domain control platform, parsing the interface mode file to obtain visual information, receiving parameters and domain terminal data to determine the operation application scenario, configuring assertion rules to generate test script use cases, and using these use cases to test the domain control platform interface.

Benefits of technology

Through this method, visual information of the interface can be generated based on the actual situation of the domain control platform, operation application scenarios can be determined, and test script use cases can be generated in combination with assertion rules to effectively test the domain control platform interface, solving the test problem that the existing technology cannot be applied to the domain control platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829435A_ABST
    Figure CN119829435A_ABST
Patent Text Reader

Abstract

The invention discloses a domain control platform interface test method and device and a storage medium. The method comprises the following steps: adding domain terminal data to a configured domain control platform; respectively creating corresponding interface template files in json formats according to functional units of the domain control platform; analyzing the interface mode file to obtain visual information of an interface; receiving parameters and domain adding terminal data input based on the visual information, and determining a corresponding operation application scene; configuring an assertion rule according to the operation application scene, and generating a test script case by using the input parameters and the configuration assertion rule; and testing the domain control platform interface by utilizing the test script use case. According to the actual situation of the domain control platform, through the interface template file, visual information of the interface is generated, an operation application scene is determined according to parameters input by a user, a test script case is generated in combination with an assertion rule, and the interface of the domain control platform is tested.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of testing technology, and in particular to a domain control platform interface testing method, device and storage medium. Background Art

[0002] With the rapid development of Internet technology, when there are many computers and users in the enterprise network, many problems will be encountered in device management and user management, resulting in low management efficiency, high security risks, high operation and maintenance costs, etc. More and more enterprises are beginning to use domain control platforms to manage and maintain their network systems.

[0003] At present, there are some interface testing methods and tools that can be used for automated testing. However, due to the complexity and huge amount of data of the domain control platform, the existing interface testing methods and tools are not applicable to the domain control platform. It is not possible to perform actual testing based on the actual situation of the domain control platform. Summary of the invention

[0004] The embodiments of the present invention provide a domain control platform interface testing method, device and storage medium to solve the technical problem that the testing method in the prior art is not applicable to the domain control platform.

[0005] In a first aspect, an embodiment of the present invention provides a domain control platform interface testing method, including:

[0006] Add domain terminal data to the configured domain control platform;

[0007] Create corresponding interface template files in JSON format according to the functional units of the domain control platform;

[0008] Parsing the interface mode file to obtain visualization information of the interface;

[0009] Receive parameters and domain terminal data input based on visual information, and determine corresponding operation application scenarios;

[0010] Configure assertion rules according to the operation application scenario, and generate test script cases using input parameters and configured assertion rules;

[0011] The domain control platform interface is tested using the test script use case.

[0012] In a second aspect, an embodiment of the present invention further provides a domain control platform interface testing device, including:

[0013] Add a module to add domain terminal data to the configured domain control platform;

[0014] A creation module is used to create corresponding interface template files in json format according to the functional units of the domain control platform;

[0015] A parsing module, used for parsing the interface mode file to obtain visual information of the interface;

[0016] A receiving module, used to receive parameters and domain terminal data input based on visual information, and determine corresponding operation application scenarios;

[0017] The generation module is used to configure assertion rules according to the operation application scenario and generate test script cases using the input parameters and configured assertion rules;

[0018] The test module is used to test the domain control platform interface using the test script use case.

[0019] In a third aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the domain control platform interface testing method provided in the above embodiment.

[0020] The domain control platform interface testing method, device and storage medium provided in the embodiment of the present invention are as follows: adding domain terminal data to the configured domain control platform; creating corresponding interface template files in json format according to the functional units of the domain control platform; parsing the interface mode file to obtain the visual information of the interface; receiving the parameters and domain terminal data input based on the visual information to determine the corresponding operation application scenario; configuring the assertion rules according to the operation application scenario, and generating a test script case using the input parameters and the configured assertion rules; and testing the domain control platform interface using the test script case. According to the actual situation of the domain control platform, the interface visual information can be generated through the interface template file, the operation application scenario can be determined according to the parameters input by the user, and the test script case can be generated in combination with the assertion rules to test the domain control platform interface. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0022] Figure 1 It is a flowchart of a method for testing a domain control platform interface provided in Embodiment 1 of the present invention;

[0023] Figure 2 It is a flowchart of a method for testing a domain control platform interface provided in Embodiment 2 of the present invention;

[0024] Figure 3 It is a structural diagram of the domain control platform interface testing device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION

[0025] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0026] Embodiment 1

[0027] Figure 1 : is a flowchart of a domain control platform interface testing method provided in Embodiment 1 of the present invention. This embodiment is applicable to the case of testing a domain control platform interface. The method can be executed by a domain control platform interface testing device, and specifically includes the following steps:

[0028] Step 110, adding domain terminal data to the configured domain control platform.

[0029] In this embodiment, the domain control platform to be tested is first configured. Exemplarily, the domain control platform can be deployed on a Linux server. The domain control platform deployment method can be selected to be deployed on a single server or on multiple servers. After the domain control platform is configured, domain terminal data can be added. Exemplarily, data can be inserted into the terminal table of the domain control platform database through a preset script to simulate the domain terminal data. In this way, testable domain terminal data can be set on the domain control platform.

[0030] Step 120: Create corresponding interface template files in JSON format according to the functional units of the domain control platform.

[0031] For example, the corresponding json format interface file can be written according to the organizational structure, user management, terminal host, policy management, message management and other test modules of the domain control platform. The field content defined in the interface file includes the interface tool name, version, type, interface name of the module to be tested, pre-action, post-action, identity authentication, etc. The template mainly specifies some fields of the module, such as interface name, path, method type, etc.

[0032] Step 130: parse the interface mode file to obtain visualization information of the interface.

[0033] For example, the written json format file is imported into the mainstream interface testing tool and parsed into a visual configuration interface, such as the apifox tool. The parsed content includes the interface name, URL information, and parameter names required by the functional module interface. The above tools can be used to obtain the visualized information and display it, so that testers can improve the relevant content based on the visualized information.

[0034] Step 140: receiving parameters input based on the visualization information and domain terminal data, and determining a corresponding operation application scenario.

[0035] Based on the visual information and the displayed attribute information, the tester can pass in the parameters corresponding to the parameter names in the Params, body, Header, etc., and determine the corresponding operation application scenario according to the passed in parameters. For example, the operation application scenario corresponding to the test can be determined according to the passed in parameters and other information according to a preset mapping table, or according to other rules, or by using a clustering classification method.

[0036] Step 150: configure assertion rules according to the operation application scenario, and generate test script use cases using the input parameters and the configured assertion rules.

[0037] Assertions are a type of first-order logic in a program. Their purpose is to express and verify the results expected by software developers. When the program executes to the assertion position, the corresponding assertion should be true. If the assertion is not true, the program will terminate execution and give an error message. By configuring assertion rules according to the operation application scenario, and generating test script cases based on the input parameters and the configured assertion rules, it is easy for testers to find problems through the set assertions.

[0038] Further, according to the scenario, preconditions and / or postconditions are configured. For example, if the interface requires preconditions, such as connecting to a database to insert data, database configuration information is added to the preconditions and SQL is added, and the use case is saved to complete the writing. And based on the test environment address, port, database connection information, global variables, input parameters, preconditions and / or postconditions, and assertion rules, a test script use case is generated. For example, it can include: the test script use case is generated based on the test environment address, port, database connection information, global variables, input parameters, preconditions and / or postconditions, and assertion rules, including: generating a use case pre-operation column; generating an interface request content column; generating a use case post-operation column; generating a test script use case based on the use case pre-operation column, interface request content column, use case post-operation column, test environment address, port, database connection information, global variables, and assertion rules.

[0039] Step 160: Use the test script case to test the domain control platform interface.

[0040] By testing the domain control platform interface according to the test script use cases generated in the above steps, you can get the interface return results, interface request time, average interface request time and other indicators.

[0041] This embodiment adds domain terminal data to the configured domain control platform; creates corresponding interface template files in json format according to the functional units of the domain control platform; parses the interface mode file to obtain visual information of the interface; receives parameters and domain terminal data input based on the visual information, and determines the corresponding operation application scenario; configures assertion rules according to the operation application scenario, and generates test script cases using the input parameters and configured assertion rules; and uses the test script cases to test the domain control platform interface. According to the actual situation of the domain control platform, the interface visual information can be generated through the interface template file, the operation application scenario can be determined according to the parameters input by the user, and the test script case can be generated in combination with the assertion rules to test the domain control platform interface.

[0042] Embodiment 2

[0043] Figure 2 This is a flow chart of the domain control platform interface testing method provided by the second embodiment of the present invention. This embodiment is optimized based on the above embodiment, and the domain control platform interface can be tested by using the test script case. The specific optimization is: using the test script case to generate a continuous integration test task, and copying the test task to the execution machine. And it is further optimized as follows: using the automated testing module, creating an automatic test directory to add all interface cases that have been successfully debugged; configuring the batch automatic operation environment, setting the number of loops, the number of threads, etc., exporting the database configuration file and the data local operation json file, and copying them to the execution machine.

[0044] See also Figure 2 , the domain control platform interface testing method comprises:

[0045] Step 210, adding domain terminal data to the configured domain control platform.

[0046] Step 220: Create corresponding interface template files in json format according to the functional units of the domain control platform.

[0047] Step 230: parse the interface mode file to obtain visualization information of the interface.

[0048] Step 240, receiving parameters input based on the visualization information and domain terminal data, and determining the corresponding operation application scenario.

[0049] Step 250, configure assertion rules according to the operation application scenario, and generate test script use cases using the input parameters and configured assertion rules.

[0050] Step 260: Create an automatic test directory using the automatic test module, and add all successfully debugged interface use cases to the automatic test directory.

[0051] Select automated testing, add test scenarios, import all interface scripts that have passed debugging, and create a continuous integration test task under CI / CD.

[0052] Step 270, configure the batch automatic operation environment, set the number of loops and threads; export the database configuration file and data local operation json file, and copy them to the execution machine.

[0053] You can control the number of test scenario executions by setting the number of loops. After the task is created, export the data to a json file that supports local operation and put it into the directory of the execution machine. The above method can realize automatic testing of a large number of test cases.

[0054] Furthermore, the method may also include: using ZenTao to create a test order, pull the test script cases of all interfaces; after the test is completed, the results are directly synchronized with ZenTao, automatically backfill the case results, and generate a test report. The ZenTao platform can be used to create a test order, receive the test results, and then generate a complete test report. Exemplarily, the test report includes: the number of passed cases, the number of failed cases, the number of untested cases, the total time, the interface request time, the average interface request time and other indicators.

[0055] This embodiment tests the domain control platform interface using the test script use case, and specifically optimizes it as follows: using the test script use case to generate a continuous integration test task, and copying the test task to the execution machine. And further optimize it as follows: using the automated testing module, creating an automatic test directory to add all successfully debugged interface use cases; configuring a batch automatic running environment, setting the number of loops, number of threads, etc., exporting database configuration files and data local running json files, and copying them to the execution machine. Using the above method, a large number of test cases can be automatically executed, and a complete test of the domain control platform can be achieved.

[0056] Embodiment 3

[0057] Figure 3 is a schematic diagram of the structure of the domain control platform device provided by the fourth embodiment of the present invention, see Figure 3 , the domain control platform device comprises:

[0058] An adding module 310 is used to add domain terminal data to the configured domain control platform;

[0059] A creation module 320 is used to create corresponding interface template files in json format according to the functional units of the domain control platform;

[0060] The parsing module 330 is used to parse the interface mode file to obtain visual information of the interface;

[0061] The receiving module 340 is used to receive parameters and domain terminal data input based on the visualization information, and determine the corresponding operation application scenario;

[0062] A generating module 350 is used to configure assertion rules according to the operation application scenario, and generate test script use cases using input parameters and configured assertion rules;

[0063] The testing module 360 ​​is used to test the domain control platform interface using the test script use case.

[0064] The domain control platform interface testing device provided in this embodiment adds domain terminal data to the configured domain control platform; creates corresponding interface template files in json format according to the functional units of the domain control platform; parses the interface mode file to obtain visual information of the interface; receives parameters and domain terminal data input based on the visual information, and determines the corresponding operation application scenario; configures assertion rules according to the operation application scenario, and generates test script use cases using the input parameters and configured assertion rules; and uses the test script use cases to test the domain control platform interface. According to the actual situation of the domain control platform, the interface visual information can be generated through the interface template file, the operation application scenario can be determined according to the parameters input by the user, and the test script use cases can be generated in combination with the assertion rules to test the domain control platform interface.

[0065] Based on the above embodiments, the device further includes:

[0066] Add a module to use scripts to insert simulated domain-added terminal data into the terminal table of the domain control platform database.

[0067] Based on the above embodiments, the device further includes:

[0068] A first configuration module, used to configure preconditions and / or postconditions according to the operation application scenario;

[0069] Accordingly, the generating module includes:

[0070] The first generation unit is used to generate a test script case using input parameters, preconditions and / or postconditions, and assertion rules.

[0071] Based on the above embodiments, the device further includes:

[0072] The second configuration module is used to configure the test environment address, port, database connection information and global variables;

[0073] Accordingly, the generating module includes:

[0074] The second generation unit is used to generate test script cases based on the test environment address, port, database connection information, global variables, input parameters, preconditions and / or postconditions, and assertion rules.

[0075] Based on the above embodiments, the second generating unit is used to:

[0076] Generate a list of pre-operations for the use case;

[0077] Generate interface request content column;

[0078] Generate post-operation column for use cases;

[0079] Generate test script cases based on the use case pre-operation column, interface request content column, use case post-operation column, test environment address, port, database connection information, global variables, and assertion rules

[0080] Based on the above embodiments, the test module includes:

[0081] The copying unit is used to generate a continuous integration test task using the test script case and copy the test task to the execution machine.

[0082] Based on the above embodiments, the replication unit is used to:

[0083] Use the automated testing module to create an automated testing directory;

[0084] Add all interface use cases that have been successfully debugged;

[0085] Configure the batch automatic operation environment and set the number of loops and threads;

[0086] Export the database configuration file and data local run json file and copy it to the execution machine.

[0087] Based on the above embodiments, the device further includes:

[0088] Pull module, used to create test orders using ZenTao and pull test scripts for all interfaces;

[0089] The test report generation module is used to synchronize the test results directly with ZenTao after the test is completed, automatically backfill the test case results, and generate a test report.

[0090] The domain control platform interface testing device provided in the embodiment of the present invention can execute the domain control platform interface testing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0091] Embodiment 4

[0092] Embodiment 4 of the present invention further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the domain control platform interface testing method as described in any one of the above embodiments.

[0093] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0094] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0095] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0096] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or device. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0097] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A domain control platform interface testing method, characterized in that: include: Add domain terminal data to the configured domain control platform; Create corresponding interface template files in JSON format according to the functional units of the domain control platform; Parsing the interface mode file to obtain visualization information of the interface; Receive parameters and domain terminal data input based on visual information, and determine corresponding operation application scenarios; Configure assertion rules according to the operation application scenario, and generate test script cases using input parameters and configured assertion rules; The domain control platform interface is tested using the test script use case.

2. The method according to claim 1, characterized in that The method further comprises: Configure preconditions and / or postconditions according to the operation application scenario; Accordingly, the generation of test script use cases using input parameters and configuration assertion rules includes: Generate test script cases using input parameters, preconditions and / or postconditions, and assertion rules.

3. The method according to claim 1, characterized in that: The adding of domain terminal data to the configured domain control platform includes: Use the script to insert simulated domain-added terminal data into the terminal table of the domain control platform database.

4. The method according to claim 2, characterized in that: The method further comprises: Configure the test environment address, port, database connection information and global variables; Accordingly, the use of input parameters, preconditions and / or postconditions, and assertion rules to generate test script use cases includes: Generate test script cases based on the test environment address, port, database connection information, global variables, input parameters, preconditions and / or postconditions, and assertion rules.

5. The method according to claim 4, characterized in that The test script use case is generated based on the test environment address, port, database connection information, global variables, input parameters, preconditions and / or postconditions, and assertion rules, including: Generate a list of pre-operations for the use case; Generate interface request content column; Generate post-operation column for use cases; Generate test script cases based on the use case pre-operation column, interface request content column, use case post-operation column, test environment address, port, database connection information, global variables and assertion rules.

6. The method according to claim 1, characterized in that The testing of the domain control platform interface using the test script use case includes: The test script case is used to generate a continuous integration test task, and the test task is copied to the execution machine.

7. The method according to claim 1, characterized in that The step of generating a continuously integrated test task using the test script case and copying the test task to an execution machine includes: Use the automated testing module to create an automated testing directory; Add all interface use cases that have been successfully debugged; Configure the batch automatic operation environment and set the number of loops and threads; Export the database configuration file and data local run json file and copy it to the execution machine.

8. The method according to claim 7, characterized in that The method further comprises: Use ZenTao to create a test order and pull test scripts for all interfaces. After the test is completed, the results are directly synchronized with ZenTao, which automatically backfills the test case results and generates a test report.

9. A domain control platform interface testing device, characterized in that: include: Add a module to add domain terminal data to the configured domain control platform; A creation module is used to create corresponding interface template files in json format according to the functional units of the domain control platform; A parsing module, used for parsing the interface mode file to obtain visual information of the interface; A receiving module, used to receive parameters and domain terminal data input based on visual information, and determine corresponding operation application scenarios; The generation module is used to configure assertion rules according to the operation application scenario and generate test script cases using the input parameters and configured assertion rules; The test module is used to test the domain control platform interface using the test script use case.

10. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions, when executed by a computer processor, are used to execute the domain control platform interface testing method as described in any one of claims 1-8.