Interface test method, device and equipment based on test platform and storage medium

The interface testing method addresses scalability issues by converting components into a writable test script, enabling real-time adjustments and improving test success rates and efficiency through interface management trees and assertion components.

CN119105950APending Publication Date: 2024-12-10CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410604453.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-15
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

Existing interface testing methods lack scalability due to the use of fixed test scripts, limiting their adaptability to varying test requirements.

Method used

An interface testing method that converts request, project, and thread components into a writable test script, which can be edited and added to a test engine, allowing real-time adjustments based on actual test requirements, and includes features like interface management trees, assertion components, and test listeners to enhance test stability and efficiency.

Benefits of technology

The method achieves scalable interface testing by allowing real-time script adjustments, improving test success rates and stability, and enhancing test efficiency through concurrent case execution and environmental parameter persistence.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119105950A_ABST
    Figure CN119105950A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of interface testing, in particular to an interface testing method and device based on a testing platform, equipment and a storage medium. According to the method, the request component, the project component and the thread component are converted into the test script, and then the test script is added to the test engine of the test platform. As the test script has the characteristic of being writable, that is, the test script can be changed and edited according to the actual test requirements for the to-be-tested interface, and the test engine allows the test script to be changed and edited, the test script is added to the test engine on the test platform; therefore, the interface test method based on the test platform has certain expandability, that is, the test script can be adjusted in real time according to the actual test requirement of the interface, so that the interface test method has certain expandability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of interface testing technology, and specifically to an interface testing method, device, equipment and storage medium based on a testing platform. Background Art

[0002] Automated testing of interfaces can be implemented on a test platform. The prior art uses a test script developed and edited by a third party to test the interface on a test platform, and the test script is fixed, resulting in the defect that interface testing based on the test platform is not scalable.

[0003] In summary, the existing interface testing methods have the defect of being non-scalable.

[0004] Therefore, the prior art still needs to be improved and enhanced. Summary of the invention

[0005] The present application provides an interface testing method, apparatus, device and storage medium based on a testing platform to solve the technical problem that the interface testing method in the related art has the defect of being non-scalable.

[0006] To achieve the above objectives, this application adopts the following technical solutions:

[0007] The first embodiment of the present application provides an interface testing method based on a testing platform, comprising the following steps:

[0008] Acquire the test information of the interface to be tested, and generate a request component and a project component according to the test information;

[0009] Obtaining environmental parameter information of the test platform, and generating a thread component based on the environmental parameter information;

[0010] The request component, the project component and the thread component are converted into a test script, and the test script is added to a test engine on a test platform, and the interface to be tested is tested by the test engine to obtain a test result of the interface to be tested.

[0011] According to the above technical means, the embodiment of the present application converts the request component, the project component and the thread component into a test script, and then adds the test script to the test engine of the test platform. Since the test script has the characteristic of being writable, that is, the test script can be changed and edited according to the actual test requirements of the interface to be tested, and the test engine allows the test script to be changed and edited, the present application adds the test script to the test engine on the test platform, so that the interface testing method of the present application based on the test platform has a certain scalability, that is, the test script can be adjusted in real time according to the actual test requirements of the interface, so that the interface testing method of the present application has a certain scalability.

[0012] In addition, the present application adds the test script to the test engine, which can improve the stability of the interface test, that is, by testing the interface through the test engine, the test success rate can be improved.

[0013] Optionally, in an embodiment of the present application, the obtaining the information to be tested of the interface to be tested includes:

[0014] Creating an interface management tree for the interface to be tested;

[0015] The test transmission parameters, the test request and the test case are acquired through the interface management tree, and the test transmission parameters, the test request and the test case are modified into a set data format as the test information.

[0016] According to the above-mentioned technical means, the embodiment of the present application creates an interface management tree, and adjusts and modifies the test transmission parameters, test requests and test cases input by the user to the test platform through the interface management tree, so that the modified information meets the test requirements, thereby ensuring that the interface test can be executed normally.

[0017] Optionally, in an embodiment of the present application, generating a request component and a project component according to the information to be tested includes:

[0018] Generate a request component according to the transfer parameter to be tested and the request to be tested;

[0019] When the test case is a case that needs to be executed concurrently, configure the serializeThreadGroups parameter value, and generate the project component according to the serializeThreadGroups parameter value.

[0020] According to the above technical means, the embodiment of the present application configures the concurrent execution of test cases in the serializeThreadGroups parameter value, thereby improving the test speed of the test cases and further improving the test efficiency.

[0021] Optionally, in an embodiment of the present application, obtaining environmental parameter information of the test platform and generating a thread component according to the environmental parameter information includes:

[0022] Determine whether there are global environment parameters, public environment parameters and personal environment parameters in the config configuration item of the test platform; if the global environment parameters, the public environment parameters and the personal environment parameters are in the config configuration item, extract the global environment parameters, the public environment parameters and the personal environment parameters from the config configuration item, and use the global environment parameters, the public environment parameters and the personal environment parameters as the environment parameter information;

[0023] A thread component is generated according to the global environment parameter, the public environment parameter and the personal environment parameter.

[0024] According to the above-mentioned technical means, the embodiment of the present application converts the three environmental parameters of the test platform into thread components, so that the three environmental parameters become persistent parameters. Persistent parameters mean that each time the interface is tested, the environmental parameters of the test platform are fixed and unchanged, thereby preventing the accuracy of the interface test from being affected by changes in the environment of the test platform, thereby improving the stability of the test results.

[0025] Optionally, in one embodiment of the present application, converting the request component, the item component, and the thread component into a test script includes:

[0026] The request component, the item component and the thread component are converted into a Jmx script, and the Jmx script is used as a test script.

[0027] According to the above technical means, the embodiment of the present application uses the Jmx script as a test script, so that the test script can be modified according to the test requirements, thereby improving the convenience of the test.

[0028] Optionally, in one embodiment of the present application, the method further includes generating an assertion component, and adding the assertion component to the test script to add it to the test engine, wherein the assertion component corresponds to the assertion rule of the interface to be tested, and the testing of the interface to be tested by the test engine to obtain a test result of the interface to be tested includes:

[0029] Determine whether the test platform has a pre-script and a post-script;

[0030] When the test platform has the pre-script and the post-script, the test engine test is started through the pre-script, so as to test the interface to be tested through the started test engine;

[0031] The post-script receives the response information sent by the interface to be tested in response to the information to be tested, and generates a test result according to the response information and the assertion rule.

[0032] According to the above technical means, the embodiment of the present application takes into account the pre- and post-scripts of the test platform, which can improve the success rate of the automated test interface.

[0033] Optionally, in one embodiment of the present application, the method further includes generating a test listener component, and adding the test listener component to the test script to add it to the test engine, wherein the test listener component is used to monitor the test progress of the interface to be tested, and the post-script receives the response information sent by the interface to be tested for the information to be tested, and generates a test result according to the response information and the assertion rule, including:

[0034] When the request return of the interface to be tested is obtained through the test listener component, the response information sent by the interface to be tested for the information to be tested is received through the post-script, and the response information is parsed to obtain response parsing information;

[0035] A test result is generated according to the information to be tested, the response parsing information and the assertion rule.

[0036] According to the above technical means, the embodiment of the present application sets a listener to monitor the progress of the interface test in real time, and can accurately determine whether the response of the interface is correct through the assertion rules. If the response is correct, it means that the interface can work normally, otherwise it indicates that the interface cannot work normally.

[0037] Optionally, in an embodiment of the present application, the method for acquiring the information to be tested includes debugging entry, text entry and import entry.

[0038] According to the above technical means, the embodiment of the present application sets three input methods: debugging input, text input and import input, so that the user can use a variety of input methods to write test information to the test platform.

[0039] A second aspect of the present application provides an interface testing device based on a testing platform, including:

[0040] The first component generation module is used to obtain the test information of the interface to be tested, and generate a request component and a project component according to the test information;

[0041] The second component generation module is used to obtain the environmental parameter information of the test platform and generate a thread component according to the environmental parameter information;

[0042] The test module is used to convert the request component, the project component and the thread component into a test script, and add the test script to the test engine on the test platform, and test the interface to be tested through the test engine to obtain the test result of the interface to be tested.

[0043] Optionally, in one embodiment of the present application, the first component generation module includes:

[0044] An interface management tree creation unit, used to create an interface management tree of the interface to be tested;

[0045] The test information collection unit is used to obtain the transmission parameters to be tested, the request to be tested and the case to be tested through the interface management tree, and modify the transmission parameters to be tested, the request to be tested and the case to be tested into a set data format as the information to be tested.

[0046] Optionally, in one embodiment of the present application, the first component generation module includes:

[0047] A request component generating unit, used for generating a request component according to the transfer parameter to be tested and the request to be tested;

[0048] The project component generation unit is used to configure the serializeThreadGroups parameter value when the test case is a test case that needs to be executed concurrently, and generate the project component according to the serializeThreadGroups parameter value.

[0049] Optionally, in one embodiment of the present application, the second component generation module includes:

[0050] an environmental parameter extraction unit, for determining whether there are global environmental parameters, public environmental parameters and personal environmental parameters in the config configuration item of the test platform, and when the global environmental parameters, the public environmental parameters and the personal environmental parameters are in the config configuration item, extracting the global environmental parameters, the public environmental parameters and the personal environmental parameters from the config configuration item, and using the global environmental parameters, the public environmental parameters and the personal environmental parameters as the environmental parameter information;

[0051] The thread component generating unit is used to generate a thread component according to the global environment parameter, the public environment parameter and the personal environment parameter.

[0052] Optionally, in one embodiment of the present application, the test module includes:

[0053] The test script generating unit is used to convert the request component, the project component and the thread component into a Jmx script, and use the Jmx script as a test script.

[0054] Optionally, in one embodiment of the present application, the test module further includes:

[0055] A judging unit, used to judge whether the test platform has a pre-script and a post-script;

[0056] A starting unit, used for starting the test engine test through the pre-script when the test platform has the pre-script and the post-script, so as to test the interface to be tested through the started test engine;

[0057] The testing unit is used to receive the response information sent by the interface to be tested to the information to be tested through the post-script, and generate a test result according to the response information and the assertion rule.

[0058] Optionally, in one embodiment of the present application, the testing unit includes:

[0059] A parsing mechanism, for receiving, through the post-script, response information sent by the interface to be tested for the information to be tested, and parsing the response information to obtain response parsing information when the request return of the interface to be tested is obtained through the test listener component;

[0060] The testing mechanism is used to generate a test result according to the information to be tested, the response parsing information and the assertion rule.

[0061] The third aspect of the present application provides a terminal device, which includes a memory, a processor, and an interface test program based on a test platform stored in the memory and executable on the processor. When the processor executes the interface test program based on the test platform, the steps of the interface test method based on the test platform described above are implemented.

[0062] The fourth aspect embodiment of the present application provides a computer-readable storage medium, on which is stored an interface testing program based on a test platform. When the interface testing program based on the test platform is executed by a processor, the steps of the above-mentioned interface testing method based on the test platform are implemented.

[0063] Beneficial effects of this application:

[0064] (1) The embodiment of the present application converts the request component, the project component and the thread component into a test script, and then adds the test script to the test engine of the test platform. Since the test script has the characteristic of being writable, that is, the test script can be changed and edited according to the actual test requirements of the interface to be tested, and the test engine allows the test script to be changed and edited, the present application adds the test script to the test engine on the test platform, so that the interface test method of the present application based on the test platform has a certain scalability, that is, the test script can be adjusted in real time according to the actual test requirements of the interface, so that the interface test method of the present application has a certain scalability.

[0065] (2) The embodiment of the present application creates an interface management tree, and adjusts and modifies the information to be tested input by the user to the test platform through the interface management tree, so that the modified information to be tested meets the test requirements, thereby ensuring that the interface test can be executed normally.

[0066] (3) The embodiment of the present application also converts the assertion rules and the listener components into a test script, through which the interface test progress can be automatically monitored and the assertion rules can be automatically loaded, thereby improving the test speed.

[0067] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0069] Figure 1 This is the overall flow chart of this application;

[0070] Figure 2 A schematic diagram of the interaction between the front-end and back-end of the test platform in an embodiment of the present application;

[0071] Figure 3 A schematic diagram of the scene arrangement in the embodiment of the present application;

[0072] Figure 4 This is a schematic diagram of input and analysis in an embodiment of the present application;

[0073] Figure 5 Schematic diagram of each model of the test platform in the embodiment of the present application;

[0074] Figure 6 This is a schematic diagram of environmental management in an embodiment of the present application;

[0075] Figure 7 This is a flowchart of the interface test in the embodiment of the present application;

[0076] Figure 8 A flowchart of the use of the test platform in the embodiment of the present application;

[0077] Fig. 9 A schematic diagram of setting test time and test content in an embodiment of the present application;

[0078] Fig.10 A schematic diagram of a timing test in an embodiment of the present application;

[0079] Fig.11 A schematic diagram of the structure of an interface testing device based on a testing platform according to an embodiment of the present application;

[0080] Fig.12 This is a block diagram of the internal structure of the terminal device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0081] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0082] The following describes the interface testing method, device, equipment and storage medium based on the test platform of the embodiment of the present application with reference to the accompanying drawings. Aiming at the technical problem that the existing interface testing method mentioned in the above background technology has the defect of non-scalability, the present application provides an interface testing method based on the test platform.

[0083] An application scenario of the present application is as follows: the interface to be tested is a mobile phone APP interface, and the information to be tested set for the mobile phone APP interface is converted into a request component (the request component is equivalent to a code module, that is, the information to be tested is compiled into a code module) and a project component (the project component is also relative to the code module, and the project component is used to set whether to execute the interface test case in parallel or in serial), and the environmental parameter information of the test platform is also converted into a thread component, and then the request component, the project component and the thread component are converted into a test script, and the test script is added to the test engine of the test platform. During the test, by controlling the test engine, the test platform can be controlled to transmit the task that the interface needs to perform to the mobile phone APP interface, and the task is to let the mobile phone APP interface execute the specific test content in the information to be tested in serial or parallel mode.

[0084] Specifically, Figure 1 A flowchart of an interface testing method based on a testing platform provided in an embodiment of the present application.

[0085] like Figure 1As shown, the interface testing method based on the test platform includes the following steps:

[0086] S100, obtaining the test information of the interface to be tested, and generating a request component and a project component according to the test information;

[0087] S200, obtaining environmental parameter information of a test platform, and generating a thread component according to the environmental parameter information;

[0088] S300, converting the request component, the project component and the thread component into a test script, and adding the test script to a test engine on a test platform, testing the interface to be tested through the test engine to obtain a test result of the interface to be tested.

[0089] Step S100 is that the back end of the test platform obtains the information to be tested through the front end of the test platform, such as Figure 2 As shown, the user writes the information of the test interface into the front end of the test platform, and then the front end transmits the information to the back end through the gateway, and the back end generates components based on the information. Before generating components, the front end and back end of the test platform must be connected first. The specific process of establishing the connection is as follows:

[0090] The user writes a request connection through the front end of the test platform, and the front end sends the request connection to the back end of the test platform through the http protocol. The request connection is a socket connection. A socket connection is established between the front and back ends, that is, a long connection is established. The results of the back end test can be returned to the front end through the long connection, so that the user can view the test status on the front end.

[0091] In one embodiment, step S100 includes the following specific steps S101, S102, S103, and S104:

[0092] S101: Create an interface management tree for the interface to be tested.

[0093] The backend of the test platform creates an interface management tree according to user requirements for hierarchical management of interface data.

[0094] S102, obtaining a to-be-tested transmission parameter, a to-be-tested request and a to-be-tested case through the interface management tree, and modifying the to-be-tested transmission parameter, the to-be-tested request and the to-be-tested case into a set data format as the to-be-tested information.

[0095] When the user inputs the original information to be tested into the test platform through the front end, the front end transmits the information to the interface management tree. If the data format of the information does not conform to the set data format that the test platform can handle, the data format of the information is modified in the interface management tree until it meets the set data format.

[0096] The parameters to be tested are the test interface, which are the data that needs to be transferred from the test platform to the interface. The parameters to be tested are stored in the parameter group of the request component in the format of key-value. The test cases to be tested are the multiple test cases set for the test interface.

[0097] The request to be tested includes request header parameters, request body and request path. The request header parameters include some additional information about the request, such as the client type, the source of the request, the content type of the request, etc. The request header exists in the form of a key-value pair, which is used to provide metadata about the request to the server where the interface to be tested is located. When the request body type is form-data, it can be tested whether the interface can process parameter key values ​​and file parameters; when the request body type is x-www-form-urlencoded, it can be tested whether the interface can process parameter key values; when the request body type is JSON, it is processed into json format to generate subsequent request components. If the request path includes the environment path and the interface path, if there are multiple interfaces on the server where the interface to be tested is located, then the environment path is the path for the test platform to reach the server. If there is only one interface to be tested on the server, then there is no environment path, only the interface path (the user enters the requested interface path into the front end of the test platform, and transmits it to the back end and saves the interface path in the form of rest parameters). If there is an environment path, the environment path is parsed to obtain parameters such as domain (request domain name), port (request port), and path (test path) to generate subsequent request components. Parse the interface path to obtain path parameters, and then url-encode the path parameters to generate subsequent request components.

[0098] In this embodiment, in addition to the parameters to be tested, the requests to be tested and the cases to be tested, such as Figure 3 As shown in the figure, there are also application scenarios of interfaces. Figure 3 As shown, users fill in the basic scenario information according to the scenario business process, import the interface information to be tested into the backend of the test platform through API management (that is, the interface management tree), and import the test cases into the backend of the test platform through API management. Users can also manually create the interface information to be tested.

[0099] like Figure 3As shown, before starting to test the interface, you also need to write test steps, by adding a transaction manager, if judge, count looper, ForEach looper, and While looper on the test platform to control the test steps of the interface test. The transaction manager is used to classify the interface, the if judge is used to determine whether the next test step can be executed, the count looper is used to control the number of loops of the interface test, and the test will automatically stop when the number of loops is reached. The ForEach looper is equivalent to the FOR statement in the code, and the While looper will control the termination of the test when the above number of loops is reached to prevent an infinite loop.

[0100] like Figure 4 As shown in the figure, the front end of the test platform is set with three entry methods: debugging entry, text entry, and import entry. Users can choose the corresponding entry method according to the test information to be written to the test platform. For example, the interface path, request header, and request parameters are written to the test platform through debugging entry, and the mandatory nature, examples, and instructions of the parameters are recorded in detail to query the request response. Edit the interface management in the form of text entry to achieve the management of the interface. Write the test data in data formats such as Postman, jmeter, YApi, swagger2.0, swagger3.0, openApi, etc. to the test platform through three-party import. When the user chooses text entry, the basic information, request information, response information, etc. of the interface need to be manually debugged, and the interface management information can be edited in Markdown format. Users can also choose the three-party import method to write interface management information to the test platform, edit interface management information, and add interface management information. When the user chooses three-party import, it is necessary to select the node and environment to which the imported data belongs.

[0101] S103: Generate a request component according to the transfer parameter to be tested and the request to be tested.

[0102] The request component that modularizes the above-mentioned parameters to be tested and request to be tested to generate code is a prior art.

[0103] S104, when the test case is a test case that needs to be executed concurrently, configure the serializeThreadGroups parameter value, and generate a project component according to the serializeThreadGroups parameter value.

[0104] If the execution time of a single test case among several test cases is greater than the total execution time of several test cases, then choose concurrent execution. If you choose concurrent execution, you need to configure parameters in serializeThreadGroups of the test platform to tell the test platform to execute test cases concurrently.

[0105] In one embodiment, step S200 includes the following specific steps: determining whether there are global environment parameters, public environment parameters and personal environment parameters in the config configuration item of the test platform; when the global environment parameters, the public environment parameters and the personal environment parameters are in the config configuration item, extracting the global environment parameters, the public environment parameters and the personal environment parameters from the config configuration item, and using the global environment parameters, the public environment parameters and the personal environment parameters as the environment parameter information; generating a thread component based on the global environment parameters, the public environment parameters and the personal environment parameters.

[0106] The user will first set the environment parameters of the test platform through the front end of the test platform and save the environment parameters in the config configuration item of the test platform. When it is necessary to generate a thread component, the environment parameters are extracted from the config configuration item. Then the data structure of the environment parameters is converted into hashTree data to generate the thread component.

[0107] like Figure 5 As shown in FIG, the backend of the evaluation platform is provided with a common function module, a data management module, a use case management module, a scenario coding module, an automated execution module, and a report statistics module. Figure 6 The environmental parameter information includes global environmental parameters, public environmental parameters and personal environmental parameters. The public environment of the test platform can be configured with parameters and host in the public function module. Public environmental parameters are environmental parameters that will be used in different test projects or test cases. The global environmental parameters are not created by the user, but are automatically created by the program when creating a project (that is, a test case). The project global environment will be automatically queried and used when executing a job in the current project, and the global environment can also be configured with parameters in the public function module. The project personal environment is created by the user, and the configuration items can be divided into host and parameter configuration. The project personal environment can only be used in the current project.

[0108] In one embodiment, before starting to test the interface in step S300, first ensure that the interface path is correct, that is, to determine that the interface filled in on the test platform is correct, so that normal testing can be performed between the subsequent test platform and the interface to be tested. The specific process of this embodiment is as follows: the interface path URL of the interface to be tested is written to the back end of the test platform through the front end of the test platform. If the interface path is filled in incorrectly, the back end will report that the domain name where the interface path is located cannot be resolved, thereby informing the user that the interface path of the interface to be tested needs to be re-filled. If the interface path is filled in correctly, the back end report can be resolved to the domain name, that is to say, the interface test can be performed normally through the test platform later.

[0109] In one embodiment, an assertion component and a test listener component are further added to the test foot in step S300, wherein the assertion component corresponds to the assertion rule of the interface to be tested, and the test listener component is used to monitor the test progress of the interface to be tested.

[0110] Set up a test listener component on the test platform, such as Figure 7 As shown, the listener component can monitor the progress of interface parameter parsing such as interface path processing, and can also monitor the pre-script component, post-script component, post-extraction, and assertion rules of the test platform.

[0111] The assertion rule records the correspondence between the information requested for the test and the test results. For example, the assertion rule records that when the test information 1+1 is given to the interface, the correct response of the interface is 2.

[0112] In this embodiment, step S300 includes the following specific steps S301, S302, S303, and S304:

[0113] S301, determining whether the test platform has a pre-script and a post-script.

[0114] S302, when the test platform has the pre-script and the post-script, the test engine test is started through the pre-script, so as to test the interface to be tested through the started test engine.

[0115] When the test platform has the pre-script and post-script, the above components are written into the pre-script in the form of code. The pre-script is then started to start the test interface of each component.

[0116] S303, when the request return of the interface to be tested is obtained through the test listener component, the response information sent by the interface to be tested for the information to be tested is received through the post-script, and the response information is parsed to obtain response parsing information.

[0117] When the interface receives the test information, it will respond and send the response to the post-script.

[0118] S304: Generate a test result according to the information to be tested, the response parsing information and the assertion rule.

[0119] like Figure 8As shown, the backend of the test platform extracts the response information from the post-script, and then judges the performance of the interface based on the response information, the information of the request test, and the assertion rules, that is, obtains the test results of the interface. The backend sends the test results to the frontend through the long connection socket between it and the frontend, so that the user can view the test results on the frontend.

[0120] The above steps S100 to S300 are all automatically executed on the test platform. In one embodiment, Fig. 9 As shown, the running mode, running time, running task content, and message notification of the automatic running of the test platform are set. The running mode can be set to serial and parallel operation. The running time includes single running time and cyclic running time. The starting time point of the single running time is after the current time point. The cyclic running time can be filled in according to the cycle time of the cycle on a daily, weekly, monthly, etc. The cycle is executed at each service condition time point, and the parsed time point is in CRON format to add a scheduled task. The running task content includes all, all use cases, all scenarios, and custom use cases. All means executing all interface use cases and scenarios, all use cases means executing all interface use cases, and all scenarios means executing all scenarios. Custom use cases means that users can configure the use case content and select interface use cases and scenarios by themselves. As shown Fig. 9 As shown, the user can also set the form of message notification, which means that the user sets the method for receiving the test results of the test platform for the interface. The message notification includes email and front-end page display.

[0121] The automated test in this embodiment includes automated start test, automated pause test, immediate execution test, etc. Fig.10 As shown, the user can set a time on the test platform, that is, the user can set a time point for the test, and when the time point is reached, the test platform starts testing the interface.

[0122] Next, an interface testing device based on a testing platform proposed in accordance with an embodiment of the present application will be described with reference to the accompanying drawings.

[0123] like Fig.11 As shown, the interface testing device 10 based on the testing platform includes: a first component generating module 100 , a second component generating module 200 and a testing module 300 .

[0124] Specifically, the first component generation module 100 is used to obtain the to-be-tested information of the to-be-tested interface, and generate a request component and a project component according to the to-be-tested information.

[0125] The second component generation module 200 is used to obtain environmental parameter information of the test platform and generate a thread component according to the environmental parameter information.

[0126] The test module 300 is used to convert the request component, the project component and the thread component into a test script, and add the test script to the test engine on the test platform, and test the interface to be tested through the test engine to obtain the test result of the interface to be tested.

[0127] It should be noted that the aforementioned explanation of the embodiment of the interface testing method based on the test platform is also applicable to the interface testing device based on the test platform of this embodiment, and will not be repeated here.

[0128] Fig.12 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. The terminal device may include:

[0129] A memory 501 , a processor 502 , and a computer program stored in the memory 501 and executable on the processor 502 .

[0130] When the processor 502 executes the program, the interface testing method based on the testing platform provided in the above embodiment is implemented.

[0131] Furthermore, the terminal device also includes:

[0132] The communication interface 503 is used for communication between the memory 501 and the processor 502 .

[0133] The memory 501 is used to store computer programs that can be executed on the processor 502 .

[0134] The memory 501 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0135] If the memory 501, the processor 502 and the communication interface 503 are implemented independently, the communication interface 503, the memory 501 and the processor 502 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.12 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0136] Optionally, in a specific implementation, if the memory 501, the processor 502 and the communication interface 503 are integrated on a chip, the memory 501, the processor 502 and the communication interface 503 can communicate with each other through an internal interface.

[0137] The processor 502 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0138] This embodiment also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the interface testing method based on the testing platform as described above is implemented.

[0139] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0140] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0141] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes additional implementations, in which the order shown or discussed may not be followed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0142] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can read instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or N wirings (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary and then storing it in a computer memory.

[0143] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0144] A person skilled in the art may understand that all or part of the steps in the above-mentioned embodiment method may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0145] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0146] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. An interface testing method based on a testing platform, characterized in that: The following steps are involved: Acquire the test information of the interface to be tested, and generate a request component and a project component according to the test information; Obtaining environmental parameter information of the test platform, and generating a thread component based on the environmental parameter information; The request component, the project component and the thread component are converted into a test script, and the test script is added to a test engine on a test platform, and the interface to be tested is tested by the test engine to obtain a test result of the interface to be tested.

2. The interface testing method based on the testing platform according to claim 1, characterized in that: The step of obtaining the test information of the interface to be tested includes: Creating an interface management tree for the interface to be tested; The test transmission parameters, the test request and the test case are acquired through the interface management tree, and the test transmission parameters, the test request and the test case are modified into a set data format as the test information.

3. The interface testing method based on the testing platform as claimed in claim 2, characterized in that: The step of generating a request component and a project component according to the information to be tested includes: Generate a request component according to the transfer parameter to be tested and the request to be tested; When the test case is a case that needs to be executed concurrently, configure the serializeThreadGroups parameter value, and generate the project component according to the serializeThreadGroups parameter value.

4. The interface testing method based on the testing platform according to claim 1, characterized in that: The step of obtaining environmental parameter information of the test platform and generating a thread component according to the environmental parameter information includes: Determine whether there are global environment parameters, public environment parameters and personal environment parameters in the config configuration item of the test platform, and when the global environment parameters, the public environment parameters and the personal environment parameters are in the config configuration item, use the global environment parameters, the public environment parameters and the personal environment parameters as the environment parameter information; A thread component is generated according to the global environment parameter, the public environment parameter and the personal environment parameter.

5. The interface testing method based on the testing platform according to claim 1, characterized in that: The converting the request component, the item component and the thread component into a test script comprises: The request component, the item component and the thread component are converted into a Jmx script, and the Jmx script is used as a test script.

6. The interface testing method based on the testing platform according to claim 1, characterized in that: The method further comprises generating an assertion component, and adding the assertion component to the test engine by adding the assertion component into the test script, wherein the assertion component corresponds to the assertion rule of the interface to be tested; The testing the interface to be tested by the test engine to obtain a test result of the interface to be tested includes: Determine whether the test platform has a pre-script and a post-script; When the test platform has the pre-script and the post-script, the test engine test is started through the pre-script, so as to test the interface to be tested through the started test engine; The post-script receives the response information sent by the interface to be tested in response to the information to be tested, and generates a test result according to the response information and the assertion rule.

7. The interface testing method based on the testing platform as claimed in claim 6, characterized in that: The method further comprises generating a test listener component, and adding the test listener component to the test engine by adding the test listener component into the test script, wherein the test listener component is used to monitor the test progress of the interface to be tested; The step of receiving, through the post-script, response information sent by the interface to be tested in response to the information to be tested, and generating a test result according to the response information and the assertion rule comprises: When the request return of the interface to be tested is obtained through the test listener component, the response information sent by the interface to be tested for the information to be tested is received through the post-script, and the response information is parsed to obtain response parsing information; A test result is generated according to the information to be tested, the response parsing information and the assertion rule.

8. The interface testing method based on the testing platform according to any one of claims 1 to 7, characterized in that: The acquisition methods of the information to be tested include debugging entry, text entry and import entry.

9. An interface testing device based on a testing platform, characterized in that: include: The first component generation module is used to obtain the to-be-tested information of the to-be-tested interface, and generate a request component and a project component according to the to-be-tested information; The second component generation module is used to obtain the environmental parameter information of the test platform and generate a thread component according to the environmental parameter information; The test module is used to convert the request component, the project component and the thread component into a test script, and add the test script to the test engine on the test platform, and test the interface to be tested through the test engine to obtain the test result of the interface to be tested.

10. A terminal device, characterized in that: The terminal device includes a memory, a processor, and an interface testing program based on a testing platform stored in the memory and executable on the processor. When the processor executes the interface testing program based on the testing platform, the steps of the interface testing method based on the testing platform as described in any one of claims 1 to 8 are implemented.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an interface testing program based on a test platform. When the interface testing program based on the test platform is executed by a processor, the steps of the interface testing method based on a test platform as described in any one of claims 1-8 are implemented.