Interface testing and tool configuration method, device, electronic device and storage medium

By introducing parameter controls and verification rule configurations into API testing tools, generating interface test requests and displaying results, the problem of existing tools being unable to debug complex interfaces is solved, and a more efficient and flexible API testing and debugging process is achieved.

CN113886216BActive Publication Date: 2024-09-17TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202010635919.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-03
Publication Date
2024-09-17
Estimated Expiration
2040-07-03

AI Technical Summary

Technical Problem

Existing API testing tools can only perform debugging, cannot provide open mini program tool capabilities, and cannot effectively verify API request parameters. The displayed results are single and cannot meet the needs of complex interface debugging.

Method used

Provide an interface testing method and tool configuration method, obtain the interface test parameters determined by the parameter control through the tool test page, generate an interface test request based on the pre-configured request information, and display the target interface return information, support parameter verification rule configuration, and implement Real-time debugging and tool-based calls to API interfaces.

Benefits of technology

It realizes flexible testing and debugging of API interfaces, provides higher security, scalability and reusability, and reduces duplication of work in the interface debugging and calling process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113886216B
    Figure CN113886216B
Patent Text Reader

Abstract

The present application relates to the field of computer technology, and in particular to an interface testing and tool configuration method, device, electronic device and storage medium, for improving the reusability and extensibility of interface testing tools, wherein the method comprises: in response to a test operation triggered by a tool testing page for a target interface, obtaining interface testing parameters for a target interface determined based on parameter controls in the tool testing page; generating an interface testing request based on pre-configured request-related information and interface testing parameters, and sending the interface testing request to a target interface service provider; obtaining interface return information returned by the target interface service provider, and displaying the test results generated based on the interface return information in the tool testing page. The testing tool in the present application is pre-configured based on the relevant configuration information of the target interface test, and provides tool-based capabilities for the target interface, reducing the duplication of interface debugging and calling.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] The testing tools in the related art all use a visual interface and a form to fill in the parameters required for the API (Application Programming Interface) request, and then assemble it into a request package through the request module to initiate a request to the target interface service provider to implement the function of debugging and calling the interface. However, the testing tools in the related art can only debug the API and cannot provide the open mini-program tool capabilities. Summary of the invention

[0003] The embodiments of the present application provide an interface testing and tool configuration method, device, electronic device and storage medium to improve the reusability and scalability of an interface testing tool.

[0004] According to the first aspect of the present application, an interface testing method provided by an embodiment of the present application includes:

[0005] In response to a test operation triggered by a tool test page for a target interface, obtaining interface test parameters for the target interface determined based on parameter controls in the tool test page, each parameter control corresponding to an interface test parameter related to the test;

[0006] Generate an interface test request based on pre-configured request related information and the interface test parameters, and send the interface test request to the target interface service provider, wherein the request related information and the parameter control are pre-configured according to the configuration information related to the test of the target interface acquired in response to a tool configuration operation for the target interface triggered through a tool configuration page;

[0007] The interface return information returned by the target interface service provider is obtained, and the test results generated based on the interface return information are displayed in the tool test page.

[0008] According to the second aspect of the present application, an interface test tool configuration method provided by an embodiment of the present application includes:

[0009] In response to a tool configuration operation for a target interface triggered by a tool configuration page, obtaining configuration information related to a test of the target interface;

[0010] The request-related information and parameter controls during the test are configured according to the configuration information, and each parameter control corresponds to an interface test parameter related to the test.

[0011] According to a third aspect of the present application, an interface testing device provided by an embodiment of the present application includes:

[0012] A first response unit, configured to, in response to a test operation triggered by a tool test page for a target interface, obtain an interface test parameter for the target interface determined based on a parameter control in the tool test page, each parameter control corresponding to an interface test parameter related to the test;

[0013] A request unit, configured to generate an interface test request based on pre-configured request related information and the interface test parameters, and send the interface test request to a target interface service provider, wherein the request related information and the parameter controls are pre-configured according to the configuration information related to the test of the target interface acquired in response to a tool configuration operation for the target interface triggered through a tool configuration page;

[0014] The display unit is used to obtain the interface return information returned by the target interface service provider, and display the test results generated based on the interface return information in the tool test page.

[0015] Optionally, the first response unit is further used for:

[0016] In response to an access operation triggered by a tool access entry for the target interface, the tool test page is displayed, wherein the tool access entry is generated based on the identification information assigned to the configuration information.

[0017] According to a fourth aspect of the present application, an interface test tool configuration device provided by an embodiment of the present application includes:

[0018] A second response unit, configured to obtain configuration information related to the test of the target interface in response to a tool configuration operation for the target interface triggered by the tool configuration page;

[0019] The configuration unit is used to configure the request-related information and parameter controls during the test according to the configuration information, each parameter control corresponding to an interface test parameter related to the test.

[0020] Optionally, the configuration information includes at least: tool configuration information and parameter configuration information;

[0021] The configuration unit is specifically used for:

[0022] The request related information is obtained and configured according to the tool configuration information, and the parameter control required for testing the target interface is obtained and configured according to the parameter configuration information, wherein the parameter configuration information at least includes parameter verification rules.

[0023] Optionally, the second response unit is further used for:

[0024] In response to a preview operation triggered by the tool configuration page, displaying a control editing page including a configuration result of the parameter control;

[0025] In response to an editing operation on a target parameter control triggered by the control editing page, acquiring control configuration information for the target parameter control;

[0026] The configuration unit is also used to:

[0027] The configuration of the target parameter control is modified according to the control configuration information.

[0028] Optionally, the device further comprises:

[0029] A second verification unit is used to verify preset test parameters based on the parameter verification rules after the configuration unit configures the request-related information and parameter controls during the test according to the configuration information and determines that the target interface service is accessible.

[0030] Optionally, the device further comprises:

[0031] A tool generating unit, used for storing the configuration information and assigning an identification information to the configuration information;

[0032] A tool access entry for accessing the tool test page is generated based on the identification information.

[0033] According to the fifth aspect of the present application, an electronic device provided by an embodiment of the present application includes a processor and a memory, wherein the memory stores program code, and when the program code is executed by the processor, the processor executes the steps of the above-mentioned interface testing method or the steps of the interface testing tool configuration method.

[0034] According to the sixth aspect of the present application, an embodiment of the present application provides a computer-readable storage medium, which includes a program code. When the program product is run on an electronic device, the program code is used to enable the electronic device to execute the method provided in various optional implementations of the above-mentioned first aspect or second aspect.

[0035] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in various optional implementations of the first aspect or the second aspect.

[0036] The beneficial effects of this application are as follows:

[0037] The embodiment of the present application provides an interface test and tool configuration method, device, electronic device and storage medium. Since the tool test page in the embodiment of the present application is configured based on the configuration information input by the user on the tool configuration page, wherein the configuration information is some configuration items related to the test of the target interface, the request related information corresponding to the interface test request can be configured in advance based on the configuration information input by the user, such as the request header, request URL (Uniform Resource Locator), etc. In addition, the tool test page also includes a parameter control corresponding to the interface test parameters, and the user can input the interface test parameters related to the target interface test based on the parameter control. The test tool in the embodiment of the present application is a tool required for testing the target interface. The test tool can be reused, and the request related information related to the test of the target interface will not change. It is only necessary to directly generate the interface test request according to the interface test parameters and the pre-configured request related information to perform the interface test, thereby solving the problem of testing and debugging the API interface, providing the ability of toolization, and reducing the repetitive work of interface debugging and calling.

[0038] Other features and advantages of the present application will be described in the subsequent description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0040] Figure 1 An optional page diagram of a testing tool in the related art;

[0041] Figure 2 An optional schematic diagram of an application scenario in an embodiment of the present application;

[0042] Figure 3 An optional schematic diagram of an interface testing method in an embodiment of the present application;

[0043] Figure 4A A schematic diagram of a system framework in an embodiment of the present application;

[0044] Figure 4B A schematic diagram of another system framework in an embodiment of the present application;

[0045] Figure 5An optional schematic diagram of a tool configuration page in an embodiment of the present application;

[0046] Figure 6 An optional schematic diagram of a control type configuration in an embodiment of the present application;

[0047] Figure 7 An optional schematic diagram of a control editing page in an embodiment of the present application;

[0048] Figure 8 An optional schematic diagram of a tool test page in an embodiment of the present application;

[0049] Fig. 9 An optional schematic diagram of an interface test tool configuration method in an embodiment of the present application;

[0050] Fig.10 A schematic diagram of a complete method flow of an interface test in an embodiment of the present application;

[0051] Fig.11 A schematic diagram of the structure of an interface testing device in an embodiment of the present application;

[0052] Fig.12 A schematic diagram of the structure of an interface test tool configuration device in an embodiment of the present application;

[0053] Fig.13 A schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the technical solution of the present application, rather than all of the embodiments. Based on the embodiments recorded in the application documents, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present application.

[0055] The following is an introduction to some concepts involved in the embodiments of the present application.

[0056] Form: It is mainly responsible for data collection in a web page. A form has three basic components: Form tag: It contains the URL of the CGI (Common Gateway Interface) program used to process the form data and the method of submitting the data to the server.

[0057] AC (Aho-Corasick automaton, multi-mode matching algorithm) automaton: mainly used to solve the matching problem of multi-mode strings, it is a variant of the dictionary tree (trie tree), a pseudo-tree structure (the main body is tree-shaped, but due to the addition of a fail pointer, it becomes a directed graph); the trie graph is a modification of the AC automaton, so that each node in the graph has MAXC outgoing edges (MAXC represents the size of the character set of the graph), and each node on the trie graph represents a state, and corresponds one-to-one with the node of the AC automaton. The AC automaton is based on the tire tree and adds a fail pointer. If the current point fails to match, the pointer is transferred to the place pointed to by the fail pointer, so that there is no need to backtrack, and the matching can continue. In the embodiment of the present application, the AC automaton can be used to match the keyword string, and the interface return information returned by the target interface can be further parsed.

[0058] http (HyperText Transfer Protocol) status code: It is a 3-digit code used to indicate the status of the http response of the web server. It is divided into the following categories: 1. Message: This type of status code means that the request has been accepted and needs to be processed. 2. Success: This type of status code means that the request has been successfully received, understood, and accepted by the server. 3. Redirection: This type of status code means that the client needs to take further action to complete the request. Usually, these status codes are used for redirection, and the subsequent request address (redirection target) is specified in the Location field of this response. 4. Request error: This type of status code means that the client may have an error, which hinders the server's processing. 5. Server error: (5, 6 prefix) This type of status code means that the server has an error or abnormal state in the process of processing the request, or it may be that the server realizes that it cannot complete the processing of the request with the current software and hardware resources. These status codes apply to any response method.

[0059] Reuse: refers to the same thing being reused multiple times in different environments without modification or with only slight modifications. Reusability refers to the property of being reusable. The test tool in the embodiment of the present application is reusable. It can be a small program with open capabilities. By scanning a QR code or based on a link, you can directly access the tool test page of the test tool to further test the target interface.

[0060] Tool configuration page: It is a user-oriented page for configuring the test tool. Through this interface, users can edit various configuration information, and then debug and configure the API in a tool-like manner. Among them, the configuration information includes tool configuration information, parameter configuration information, etc. In an embodiment of the present application, the tool configuration information may include the tool name, category, developer, request URL (i.e., interface API), purpose, remarks, etc.; parameter configuration information is used to configure the parameter controls required for the interface request, specifically including the configuration of parameter name, parameter verification rules, control type, control name, etc., where the control types include text boxes, multi-line text boxes, radio buttons, multiple-choice boxes, drop-down boxes, etc.

[0061] Control editing page: It is a user-oriented page for configuring parameter controls. Through this page, users can preview various configuration information related to parameter controls. In addition, they can further edit and modify various configuration information, including parameter name, parameter verification rules, control type, control name, etc.

[0062] Tool test page: This is a user-oriented page for testing interfaces. Through this page, users can enter various interface test parameters. Based on the various interface test parameters entered by the user and the previously pre-configured request-related information, an interface test request for accessing the interface service can be generated. In addition, after testing the target interface, the test results can be further displayed on this page. In the embodiment of the present application, the test results can be specifically divided into two parts: an http status code used to indicate the interface response status and a target keyword used to indicate the interface call result.

[0063] Primary key: A primary key is one or more fields in a table, whose value is used to uniquely identify a record in the table. In a relationship between two tables, a primary key is used to reference a specific record in one table from another table. A primary key is a unique key, part of the table definition. A table has only one primary key. A primary key can consist of one field or multiple fields, which are called single-field primary keys or multi-field primary keys. It is also called a primary code. And it can uniquely identify a row of data in a table, or it can uniquely identify an entity.

[0064] The following is a brief introduction to the design concept of the embodiment of the present application:

[0065] With the development of computer technology, people obtain various information through the Internet. HTTP is the most widely used network protocol on the Internet. All WWW files must comply with this standard. Before publishing a web page, you can test the HTTP interface by sending a web page HTTP request.

[0066] In the related technology, tools that can call and debug interfaces include Chrome browser plug-in Talend API Tester, Chrome browser plug-in post man, etc. These testing tools use a visual interface and a form to fill in the parameters required for API interface requests. For example Figure 1 As shown in the figure, it is a schematic diagram of the test interface of the Chrome browser plug-in Talend API Tester, which is mainly divided into two parts, one is the request part and the other is the interface response result.

[0067] Regarding the request part, it mainly involves the selection of the http request method, such as the POST request method (or the GET request method). After the user enters the request URL, request Header, and request BODY, click Figure 1 Click the Send button to send a request to the interface service to test the interface.

[0068] The Response part is mainly used to display the result returned by the request. In related technologies, the result returned by the request is mainly used to display the http status code. Therefore, the request result can only be judged based on the http status code and the information returned by the interface. It is impossible to flexibly judge the success or failure of the request based on the information returned by the interface. Figure 1 As shown in , the http status code is "302 Found (temporary move)", indicating that the server is currently responding to requests from web pages in different locations, but the requester should continue to use the original location for subsequent requests.

[0069] The testing tools in related technologies can only debug the API, but cannot verify the legality of API request parameters, cannot provide open mini-program tool capabilities, and can only display http status codes, with single display results.

[0070] In view of this, the embodiments of the present application provide an interface testing and tool configuration method, device, electronic device and storage medium. The interface testing tool in the embodiments of the present application can be a small program with specific open capabilities, which uses a parameterized configuration method to test the http / https interface, and can also generate a real-time graphical preview of the API interface configuration information, debug the API interface in real time, verify the legality of the request parameters of the API interface, and generate a tool call link for the API interface. Specifically, based on the API interface configuration information set by the tool developer, the request-related information and parameter controls related to the target interface are pre-configured, and the corresponding parameter verification rules are also configured in the parameter controls. Based on this test tool, a request can be initiated to the target interface, the response of the target interface can be checked, and the behavior of the target interface can be verified. In addition, based on the tool test page, a visual target interface call can be provided to the user, providing a more secure, extensible and reusable testing method.

[0071] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application may be combined with each other if there is no conflict.

[0072] like Figure 2 As shown, it is a schematic diagram of an application scenario of an embodiment of the present application. The application scenario diagram includes two terminal devices 210 and a server 230. The terminal device 210 can log in to the relevant page 220, such as the tool configuration page and tool test page in the embodiment of the present application. The terminal device 210 and the server 230 can communicate through the communication network. Each terminal device corresponds to a user, Figure 2 In the example, user A and user B each correspond to one terminal device 210, but the number of terminal devices is not limited. In some cases, the terminal devices may communicate with each other through the server 230, and direct communication may be established between the terminal devices. The direct communication between the terminal devices may be called point-to-point communication. In this case, some interaction processes between the terminal devices may not require the transfer of the server 230.

[0073] Among them, each terminal device may be installed with a client of the test tool provided in the embodiment of the present application. The client involved in the embodiment of the present application may be a pre-installed client, or a client embedded in an application (such as a mini-program), or a web version of the client, without limiting the specific type of the client. When the terminal device 210 sends an interface test request, it needs to communicate with the server 230 through the communication network, and when receiving the interface return information returned by the server 230, it also needs to communicate through the communication network.

[0074] In an optional implementation, the communication network is a wired network or a wireless network. The terminal 210 and the server 230 may be directly or indirectly connected via wired or wireless communication, which is not limited in the present application.

[0075] In the embodiment of the present application, the terminal device 210 is an electronic device used by the user, which can be a personal computer, mobile phone, tablet computer, notebook, e-book reader, etc., which has certain computing power and runs instant messaging software and websites or social software and websites. Each terminal device 210 is connected to the server 230 through a wireless network. The server 230 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected by wired or wireless communication, and this application is not limited here.

[0076] See also Figure 3 As shown, it is an implementation flow chart of an interface testing method provided in an embodiment of the present application. The specific implementation process of the method is as follows:

[0077] Step S31: in response to a test operation triggered by a tool test page for a target interface, obtaining interface test parameters for the target interface determined based on parameter controls in the tool test page, each parameter control corresponding to an interface test parameter related to the test;

[0078] Step S32: Generate an interface test request based on pre-configured request related information and interface test parameters, and send the interface test request to the target interface service provider, wherein the request related information is pre-configured according to the configuration information related to the test of the target interface acquired in response to the tool configuration operation for the target interface triggered through the tool configuration page;

[0079] In the embodiment of the present application, the target interface may be an http / https API interface on the web (World Wide Web), and the target interface service provider may refer to a corresponding web server.

[0080] Step S33: Obtain the interface return information returned by the target interface service provider, and display the test results generated based on the interface return information on the tool test page.

[0081] It should be noted that the request-related information related to the target interface test and the parameter controls in the tool test page are pre-configured. For the target interface, the test tool in the embodiment of the present application is a reusable and extensible test tool. Before implementing step S31, it is first necessary to configure the test tool provided in the embodiment of the present application through the configuration stage. After the configuration is completed, the user can use the test tool to test the target interface. At this time, the test process is shown in steps S31 to S33. Figure 4A and Figure 4B The interface testing method and interface testing tool configuration method in the embodiment of the present application are described in detail:

[0082] See also Figure 4A and Figure 4B As shown, it is two optional schematic diagrams of a system framework provided by the embodiment of the present application, which is mainly divided into three stages: configuration stage, test stage and tool stage. Among them, the configuration stage specifically includes a configuration module, a connectivity detection module and a verification module; the test stage specifically includes a request module, a verification module and a result processing module; the tool stage mainly includes a tool generation module.

[0083] The following first introduces the configuration phase in detail:

[0084] Specifically, the user can enter configuration information for the target interface in the tool configuration page, and the terminal device responds to the tool configuration operation for the target interface triggered by the tool configuration page to obtain configuration information related to the test of the target interface; further, the terminal device can configure the request-related information and parameter controls during the test according to the configuration information to achieve specific open capabilities and reusable effects.

[0085] In the embodiment of the present application, each parameter control corresponds to an interface test parameter related to the test. Among them, the configuration information includes at least tool configuration information and parameter configuration information. When configuring the request related information and parameter control during the test according to the configuration information, it is mainly divided into two parts:

[0086] 1. Obtain and configure the request-related information when testing the target interface according to the tool configuration information set by the tool developer;

[0087] Specifically, the tool configuration information includes: tool name, tool category, developer, request URL (i.e., interface API), purpose, remarks, etc. Based on these tool configuration information set by the tool developer, the request-related information related to the target interface test can be determined and configured.

[0088] 2. Obtain the parameter controls required for testing the target interface according to the parameter configuration information set by the tool developer, and configure them.

[0089] Specifically, the parameter configuration information is used to configure the parameter controls required by the interface request, including control type, control sequence number, control name, control remarks, parameter name, and parameter verification rules.

[0090] Among them, the control types include text box, multi-line text box, radio button, multiple-choice box, drop-down box, etc.

[0091] Specifically, text boxes can be used to enter text directly, multi-line text boxes can be used to enter multiple lines of text, drop-down boxes can display a drop-down selection list, radio button boxes indicate that only one item in the attribute value can be selected, that is, only a single selection is allowed, and multiple selection boxes indicate that multiple items in the attribute value can be selected, that is, multiple selections are allowed.

[0092] It should be noted that only some of the control types are listed in the above embodiments. In fact, any control type is applicable to the embodiments of the present application and is not specifically limited here.

[0093] In the embodiment of the present application, the above configuration process is implemented based on the configuration module in the configuration phase, and the configuration information required for the interface request can be configured and stored through the configuration module, including the request URL, request header, request parameters and parameter verification rules, etc. Specifically, the configuration module is implemented through front-end interaction, obtains the configuration information input by the tool developer, and composes the obtained configuration information into a structured json (JavaScript Object Notation, JS object notation) configuration.

[0094] See also Figure 5 As shown, it is a schematic diagram of a tool configuration page provided in an embodiment of the present application. Figure 5 In the page shown, tool developers can directly Figure 5 Enter the required tool configuration information and parameter configuration information in the text boxes corresponding to the configuration information shown, and debug and tool configure the API. Figure 5 The tool configuration information and parameter configuration information set by the tool developer are introduced in detail:

[0095] The tool configuration information specifically includes the following configuration items:

[0096] 1) The tool name is: Query merchant details; accordingly, the tool's enablement status can be further set. When the tool developer sets the enablement status to "Configuring", it indicates that the test tool is still in the configuration stage and has not yet been opened to the public. When the tool developer sets the enablement status to "Enabled", the test tool can be opened to the public, indicating that the tool is ready and can be provided to users;

[0097] 2) Tool classification: This configuration item can be directly filled in by the tool developer. In addition, it can also be left unconfigured, in which case the default is "unclassified";

[0098] 3) Developer: This configuration item can be directly filled in by the tool developer;

[0099] 4) Business side request URL: This configuration item can also be filled in directly by the tool developer, indicating the link corresponding to the target interface, such as Figure 5 As shown, the request URL filled in by the tool developer is:

[0100] / mchaccount / tool / get_merchant_by_id.

[0101] In the testing phase, based on the URL, an interface test request can be sent to the target interface service provider to test the target interface. The request method of the interface test request can be: GET request method or POST request method, which can be configured by the tool developer or selected by the user in the testing phase.

[0102] 5) Tool use: Figure 5 It can be seen that the purpose of this testing tool is to query the detailed information of the merchant;

[0103] 6) Tool Notes: Figure 5 It can be seen that the remark of this test tool is to call the WeChat payment merchant svrkit interface to query the merchant detailed information. Jump to<ahref=’http: / / testaccountxxxxxxx / tool / detail?FToolID=10’blank’> Modify merchant relationship.

[0104] Among them, based on the above tool configuration information, it can be determined that for this target interface for querying merchant detailed information, the request related information includes the request URL ( / mchaccount / tool / get_merchant_by_id), the request header and other information.

[0105] The parameter configuration information is used to configure the parameter control, including the control type, control configuration, whether it is a primary key, and operation.

[0106] 1) Control types include: text box, multi-line text box, radio button, multiple-choice box, drop-down box, etc. Tool developers can click Figure 5 The drop-down button shown will display other optional control types, such as Figure 6 As shown, the control type of the parameter control with sequence number 1 is a text box.

[0107] Among them, the choice of control type is mainly based on the interface test parameter corresponding to the parameter control. For example, when the interface test parameter is the merchant ID, the user needs to fill it out by himself, and the control type of the corresponding parameter control is generally a text box; when the interface test parameter is still the merchant ID, but several optional candidate merchant IDs are pre-configured, the control type of the corresponding parameter control can be a radio button, and so on.

[0108] 2) Control configuration: mainly refers to the detailed configuration information of the parameter control, including parameter name, parameter verification rules, control name, etc., which can be filled in by the tool developer. Figure 5 As shown in the figure, the tool developer fills in a parameter control of the text box type with sequence number 1. The specific control configuration includes:

[0109] {"order":1,"widget_type":"text","widget_label":"Merchant ID","widget_remark":"Required, please enter the merchant macid, example: 9xx","param_name":"merchant_id","is_required":1,"do_check":1,"check_regex":" / ^[1-9][0-9]*$ / "}.

[0110] Among them, the control configuration column contains a total of 8 configuration items, as follows:

[0111] "order":1, indicating the sequence number is 1;

[0112] "widget_type":"text", indicating that the control type is text;

[0113] "widget_label":"Merchant ID", which means the control label is the merchant ID, that is, the Chinese name of the control is the merchant ID;

[0114] "widget_remark":"Required, please enter the merchant macid, example: 9xx", which means the widget remark is "Required, please enter the merchant macid, example: 9xx";

[0115] "param_name":"merchant_id", which means the parameter name is merchant_id;

[0116] "is_required":1, indicating whether the required item is 1, that is, the request test parameter corresponding to the parameter control, that is, the merchant ID is a required item;

[0117] "do_check": 1, indicating whether the check item is 1, that is, the request test parameter corresponding to the parameter control needs to be checked;

[0118] "check_regex":" / ^[1-9][0-9]*$ / ", which means the (parameter) check rule is: / ^[1-9][0-9]*$ / .

[0119] In the embodiments of the present application, considering that interface test parameters generally have a value range, field type, etc., special interface test parameters also have a special format, such as identity card number, bank card number, with specified length and rules. Therefore, the interface test parameters can be verified based on the configuration of parameter verification rules. Compared with the method in the related art that cannot verify the legitimacy of API request parameters, the security and reliability of interface testing can be effectively improved.

[0120] The parameter verification rules listed in the above embodiment are in the form of regular expressions, which are used to detect whether the merchant ID complies with the ID rules. In addition, the parameter verification rules can also be set by code logic detection, third-party interface detection, etc., which are not specifically limited here.

[0121] 3) Is it a primary key: Indicates whether the interface test parameter corresponding to the parameter control is a primary key. The account primary key must be specified during tool configuration to record which account the operation is performed on and to facilitate subsequent viewing of account operation records.

[0122] 4) Operation: Tool developers can also configure operations related to parameter controls based on this configuration item.

[0123] It should be noted that all tool operations in the embodiments of the present application will be requested by the tool platform listed in the present application from the back end, calling the business side interface to complete the account operation. The tool platform listed in the present application will record the user's operations on the account. In addition, only system administrators and tool developers have the right to modify the tool configuration.

[0124] Optionally, after configuring the request-related information and parameter controls required for testing the target interface based on the configuration information set by the user on the tool configuration page, you can also click Figure 5The page preview button shown is used to preview and modify the configuration of the parameter control. At this time, the terminal device responds to the preview operation triggered by the tool developer through the tool configuration page and displays the control editing page containing the parameter control configuration result.

[0125] For example Figure 7 As shown, it is a schematic diagram of a control editing page provided in an embodiment of the present application. The figure shows in detail the configuration results in the parameter control configured in the above process, including the serial number of the parameter control, the control type, the Chinese name of the control, the control remarks, the parameter name, whether it is required, whether it is verified, and the verification rules, etc.

[0126] Depend on Figure 7 It can be seen that the sequence number is 1, the control type is text (text box), the Chinese name of the control is merchant ID, and the control note is: required, please enter the merchant mchid, example: 9xx, the parameter name is merchant_id. In addition, you can further set the interface test parameter corresponding to the parameter control to see whether it is a required item, whether it needs to be verified, etc. If verification is required, you need to further set the corresponding verification rules.

[0127] Among them, the parameter control with serial number 1 requires the merchant ID to be filled in, and the "Is it required" item is 1, indicating that the parameter is required (when it is 0, it indicates that the parameter is not required); in addition, the "Is it verified" item is 1, indicating that the parameter needs to be verified (similarly, when it is 0, it indicates that the parameter does not need to be verified).

[0128] In the embodiment of the present application, the user can also Figure 7 The control editing page shown further modifies the parameter control that was previously pre-configured according to the parameter configuration information. For example, the user is currently modifying the configuration item "Control Notes" in the "Text Box" type control. Specifically, the user clicks Figure 7 After remarking this configuration item in the control on the left, Figure 7 On the right side, you can modify this configuration item by editing the content in the text box corresponding to the merchant ID. After the modification is completed, click Figure 7 Click the OK button shown to trigger the configuration modification of the configuration item.

[0129] Specifically, the terminal device responds to the editing operation on the target parameter control triggered by the control editing page, and then obtains the control configuration information for the target parameter control, that is, based on the user's Figure 7The configuration information obtained after the modification of the right part in the middle, and the previous configuration of the target parameter control is modified based on the control configuration information. It should be noted that in the embodiment of the present application, only the system administrator and the tool developer have the right to modify the tool configuration. Each parameter control can be edited based on the control editing page, including setting the parameter name, parameter verification rules, and the configuration items can be previewed and confirmed. After the above editing is completed, the interface debugging of the parameter control can be performed.

[0130] Optionally, based on the connectivity detection module and verification module in the configuration phase, connectivity detection and parameter verification are performed on the target interface service party.

[0131] In the embodiment of the present application, by testing the connectivity of the API interface, it is detected whether the interface service exists and whether it is accessible, which can be specifically implemented by coding through curl and Python's request package. After determining that the target interface service is accessible, the preset test parameters entered by the tool developer are verified based on the pre-configured parameter verification rules to ensure the accuracy of the parameter verification rule configuration.

[0132] After the configuration phase is completed, you can enter the testing phase. The specific implementation method is as follows Figure 3 In addition, during the test phase, before actually sending out the interface test request, the connectivity of the target interface service provider can be tested again, and the interface test parameters entered by the user can be verified. Figure 4A or Figure 4B The verification module in the test phase shown can be implemented to determine whether the preset parameter verification rules are met. If the target interface service party cannot be connected, or the interface test parameters entered by the user do not meet the verification rules, an error can be actively reported to the user to prompt the user.

[0133] Specifically, after determining that the target interface service is accessible, each interface test parameter is verified according to the parameter verification rules in the parameter control corresponding to each interface test parameter, where the parameter verification rules in the parameter control are pre-configured based on the process in the above configuration phase. If the tool developer updates the previously configured parameter verification rules through the control editing page, the parameter verification rules in the parameter control are the latest parameter verification rules.

[0134] In the embodiment of the present application, when the interface test parameters are verified, they are mainly verified according to the pre-configured parameter verification rules. According to the above-listed embodiments, the verification methods may be the following: regular expression, code logic detection, third-party interface detection, etc.

[0135] After verification, an interface test request can be generated, which can be implemented based on the request module in the test phase. In the embodiment of the present application, the request related information specifically refers to the request header, request URL, etc., and the interface test parameter is mainly the merchant ID. When the user enters a merchant ID and follows Figure 8 After clicking Submit on the tool test page shown, the terminal device can generate an interface test request for the target interface based on the previously pre-configured request-related information and the interface test parameters entered by the user, and send it to the target interface service provider. After the terminal device receives the interface return information returned by the target interface service provider, it can further process the interface return information to form a test result. Figure 8 This is displayed in the tool test page shown, which can be executed based on the result processing module in the test phase.

[0136] Optionally, the test result includes two parts, one part is the http status code returned by the request, and the other part is the parsing result of the response information. In the embodiment of the present application, the parsing result of the response information mainly refers to the target keyword used to represent the interface call result.

[0137] Among them, the http status code has a standard, usually 200 indicates that the request service is successful, and the http status code used to indicate the interface response in the interface return information can be identified by regular expression parsing. In addition, the user can also configure keywords, and through the AC automatic machine keyword string matching parsing method, the various target keywords (key text descriptions) used to indicate the interface call results in the interface return information can be obtained; finally, the http status code and the target keyword are highlighted on the tool test page, for example, as key information marked in red and bold, to provide users with a visual interface call.

[0138] like Figure 8 The tool test page shown in the figure shows the detailed log section of the test result. The tool execution result is successful, which is determined based on the http status code. Figure 8 The http status code 200 is directly displayed in the query, and the query result is the text description of each target keyword obtained based on the AC automaton keyword string matching.

[0139] in, Figure 8The target keywords include: merchant ID, merchant number, merchant name, merchant notes, employee system account ID, menu template ID, ctf merchant number, wxAPPID, wx notification group number, company name, company address, company email, company person in charge, customer service phone number, contract project name, merchant country code, merchant security phone number, merchant type, merchant attributes, merchant status, responsible for BD, responsible for operation, idempotent ID, verify mac (Media Access Control), verify mac version, merchant creation time, etc. In addition, Figure 8 The tool test page shown further displays the tool purpose and tool notes to facilitate users to understand the test tool.

[0140] After the test phase is completed, you can enter the tool phase. After the test tool is configured, you can also generate a small program with open capabilities based on the tool generation module in the tool phase.

[0141] Specifically, the testing tool in the embodiment of the present application can automatically store previous configuration information in a database, assign an identification information, that is, a unique ID, to the configuration information through the tool generation stage, and generate a tool access entrance for accessing the tool test page under a domain name based on the identification information. The access entrance can be in the form of a link or a QR code.

[0142] When the user scans the QR code or clicks on the search link, an access operation is triggered. The terminal device responds to the access operation triggered by the tool access entry for the target interface and displays the tool test page.

[0143] Based on the above implementation, the capabilities of the testing tool in the embodiment of the present application can be opened up, and other users can directly reuse it, thus reducing the duplication of work for others.

[0144] It should be noted that Figure 4A and Figure 4B The difference lies in the relationship between the tool phase and the testing phase. Figure 4A The tool phase can be implemented after the testing phase, and Figure 4B The tool phase is independent of the test phase and can be implemented after the configuration phase is completed. In the embodiment of the present application, both methods are feasible. The tool test page in step S31 can be obtained by directly jumping after the configuration phase is completed, or it can be entered by scanning the access entrance after the access entrance is generated based on the tool phase. No specific limitation is made here.

[0145] It should be noted that the configuration module can be implemented by various types of UI (User Interface) interactions and configuration files. UI interaction forms include PC (Personal Computer) software, mobile software, applets, H5 web, etc., and configuration files include yaml configuration and general conf configuration. The request module can be implemented in a programming language that can initiate network requests, including C++, java, php, etc., without specific limitation here.

[0146] See also Fig. 9 As shown, it is an implementation flow chart of an interface testing method provided in an embodiment of the present application. The specific implementation process of the method is as follows:

[0147] Step S91: in response to a tool configuration operation for a target interface triggered by a tool configuration page, obtaining configuration information related to a test of the target interface;

[0148] Step S92: Configure the request-related information and parameter controls during the test according to the configuration information, each parameter control corresponding to an interface test parameter related to the test.

[0149] Optionally, the configuration information includes at least: tool configuration information and parameter configuration information;

[0150] Configure the request-related information and parameter controls during the test according to the configuration information, including:

[0151] Obtain request related information and configure it according to tool configuration information, and obtain parameter controls required for testing the target interface and configure it according to parameter configuration information, wherein the parameter configuration information at least includes parameter verification rules for verifying interface test parameters.

[0152] Optionally, the method further includes:

[0153] In response to a preview operation triggered by the tool configuration page, displaying a control editing page including a configuration result of the parameter control;

[0154] In response to an edit operation on a target parameter control triggered through a control editing page, obtaining control configuration information for the target parameter control;

[0155] Modify the configuration of the target parameter control according to the control configuration information.

[0156] Optionally, after configuring the request-related information and parameter controls for the test according to the configuration information, the following is further included:

[0157] After determining that the target interface service is accessible, the preset test parameters are verified based on the parameter verification rules.

[0158] Optionally, the method further includes:

[0159] Store the configuration information and assign an identification information to the configuration information;

[0160] A tool access entry for accessing a tool test page is generated based on the identification information.

[0161] In the above implementation, request-related information and some parameter controls can be pre-configured based on tool configuration information and parameter configuration information, and by automatically saving these configuration information, a QR code or link is generated as an access entry, so that the test tool in this application has open capabilities. That is to say, after the tool developer in the embodiment of the present application completes the configuration and debugging of an interface, the capability can be opened up so that users can directly reuse the corresponding test tools and reduce repetitive work for others.

[0162] In addition, during the configuration process, corresponding parameter verification rules are further configured in the parameter control to verify the legitimacy of the request test parameters entered by the user, thereby ensuring the security of the interface test.

[0163] It should be noted that the specific implementation process of the above-mentioned several optional interface tool configuration methods can be found in the above-mentioned embodiments, and will not be repeated here.

[0164] See also Fig.10 As shown, it is a complete method flow chart of an interface test, which is applied to Figure 2 The terminal device 210 is shown. The specific implementation process of the method is as follows:

[0165] Step S101: in response to a tool configuration operation for a target interface triggered by a tool configuration page, configure request-related information and parameter controls during testing according to configuration information input by a tool developer;

[0166] Step S102: In response to a preview operation triggered by the tool configuration interface, a control editing page including a parameter control configuration result is displayed;

[0167] Step S103: in response to an edit operation for a target parameter control triggered through the control editing page, according to the control configuration information for the target parameter control input by the tool developer, modify the configuration of the target parameter control according to the control configuration information;

[0168] Step S104: After the configuration is completed, the target interface is tested for connectivity;

[0169] Step S105: after determining that the target interface service can be connected, verify the preset test parameters input by the tool developer according to the pre-configured parameter verification rules;

[0170] Step S106: in response to a test operation triggered by a tool test page for a target interface, obtaining an interface test parameter for the target interface determined based on a parameter control in the tool test page;

[0171] Step S107: Performing connectivity detection and parameter verification on the target interface service provider;

[0172] Step S108: after the parameters are verified to be correct, an interface test request is generated based on the pre-configured request related information and interface test parameters, and the interface test request is sent to the target interface service provider;

[0173] Step S109: Obtain the interface return information returned by the target interface service provider, generate the test results based on the interface return information, and display them on the tool test page.

[0174] Based on the same inventive concept, the present application also provides an interface testing device. Fig.11 As shown, it is a structural schematic diagram of an interface testing device 1100 provided in an embodiment of the present application, which may include:

[0175] A first response unit 1101 is used to obtain, in response to a test operation triggered by a tool test page for a target interface, an interface test parameter for the target interface determined based on a parameter control in the tool test page, each parameter control corresponding to an interface test parameter related to the test;

[0176] The request unit 1102 is used to generate an interface test request based on pre-configured request related information and interface test parameters, and send the interface test request to the target interface service provider, wherein the request related information and parameter controls are pre-configured according to the configuration information related to the test of the target interface acquired in response to the tool configuration operation for the target interface triggered through the tool configuration page;

[0177] The display unit 1103 is used to obtain the interface return information returned by the target interface service provider, and display the test results generated based on the interface return information in the tool test page.

[0178] Optionally, the device further comprises:

[0179] The first verification unit 1104 is used to verify each interface test parameter according to the parameter verification rules in the parameter control corresponding to each interface test parameter, after determining that the target interface service provider is accessible before the request unit 1102 sends the interface test request to the target interface service provider, wherein the parameter verification rules in the parameter control are pre-configured according to the parameter configuration information in the configuration information.

[0180] Optionally, the test result includes an http status code and a target keyword; the display unit 1103 is specifically used for:

[0181] Extract the http status code used to indicate the interface response status from the interface return information through regular expression analysis, and obtain the target keyword used to indicate the interface call result from the interface return information through keyword matching analysis by AC automaton;

[0182] Highlight the http status code and target keywords on the tool test page.

[0183] Optionally, the first response unit 1101 is further configured to:

[0184] In response to an access operation triggered by a tool access entry for a target interface, a tool test page is displayed, wherein the tool access entry is generated based on identification information assigned to the configuration information.

[0185] In the above implementation, a device is provided that can verify the interface test parameters input by the user and has an interface test status with open capabilities. In addition, after the interface test is performed based on the device, the http status code returned by the interface and the detailed information of the interface response can also be displayed, enriching the display method of the interface test, so that the user can view the detailed information of the interface call more intuitively and conveniently.

[0186] Based on the same inventive concept, the present application embodiment also provides an interface test tool configuration device. Fig.12 As shown, it is a structural diagram of an interface test tool configuration device 1200 provided in an embodiment of the present application, which may include:

[0187] The second response unit 1201 is used to obtain configuration information related to the test of the target interface in response to the tool configuration operation for the target interface triggered by the tool configuration page;

[0188] The configuration unit 1202 is used to configure the request-related information and parameter controls during the test according to the configuration information, and each parameter control corresponds to an interface test parameter related to the test.

[0189] The second response unit 1201 is used to obtain configuration information related to the test of the target interface in response to the tool configuration operation for the target interface triggered by the tool configuration page;

[0190] The configuration unit 1202 is used to configure the request-related information and parameter controls during the test according to the configuration information, and each parameter control corresponds to an interface test parameter related to the test.

[0191] Optionally, the configuration information includes at least: tool configuration information and parameter configuration information;

[0192] The configuration unit 1202 is specifically used for:

[0193] Obtain request related information and configure it according to tool configuration information, and obtain parameter controls required for testing the target interface and configure it according to parameter configuration information, wherein the parameter configuration information at least includes parameter verification rules for verifying interface test parameters.

[0194] Optionally, the second response unit 1201 is further configured to:

[0195] In response to a preview operation triggered by the tool configuration page, displaying a control editing page including a configuration result of the parameter control;

[0196] In response to an edit operation on a target parameter control triggered through a control editing page, obtaining control configuration information for the target parameter control;

[0197] The configuration unit 1202 is further configured to:

[0198] Modify the configuration of the target parameter control according to the control configuration information.

[0199] Optionally, the device further comprises:

[0200] The second verification unit 1203 is used to verify the preset test parameters based on the parameter verification rules after the configuration unit 1202 configures the request related information and parameter controls during the test according to the configuration information and determines that the target interface service is accessible.

[0201] Optionally, the device further comprises:

[0202] The tool generation unit 1204 is used to store the configuration information and assign an identification information to the configuration information;

[0203] A tool access entry for accessing a tool test page is generated based on the identification information.

[0204] In the above implementation, request-related information and some parameter controls can be pre-configured based on tool configuration information and parameter configuration information, and by automatically saving these configuration information, a QR code or link is generated as an access entry, so that the test tool in this application has open capabilities. That is to say, after the tool developer in the embodiment of the present application completes the configuration and debugging of an interface, the capability can be opened up so that users can directly reuse the corresponding test tools and reduce repetitive work for others.

[0205] In addition, during the configuration process, corresponding parameter verification rules are further configured in the parameter control to verify the legitimacy of the request test parameters entered by the user, thereby ensuring the security of the interface test.

[0206] For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, when implementing this application, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.

[0207] After introducing the interface testing method and device according to the exemplary embodiment of the present application, next, an electronic device according to another exemplary embodiment of the present application is introduced.

[0208] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.

[0209] Based on the same inventive concept, an embodiment of the present application further provides an electronic device, Fig.13 is a block diagram of an electronic device 1300 according to an exemplary embodiment, including:

[0210] Processor 1310;

[0211] A memory 1320 for storing program codes executable by the processor 1310;

[0212] The processor 1310 is configured to execute program code to implement the steps of the interface testing method according to various exemplary embodiments of the present application or the steps of the interface testing tool configuration method according to various exemplary embodiments described in this specification. For example, the processor 1310 may execute the following steps: Figure 3 or Fig. 9 Follow the steps shown in .

[0213] In an exemplary embodiment, a storage medium including a program code is also provided, such as a memory 1320 including a program code. The program code can be executed by the processor 1310 of the electronic device 1300 to complete the above method.

[0214] Alternatively, the storage medium may be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.

[0215] In some possible implementations, the embodiments of the present application further provide a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps provided in various optional implementations of any of the above-mentioned interface testing methods or any of the interface testing tool configuration methods, such as Figure 3 or Fig. 9 Follow the steps shown in .

[0216] In some possible implementations, various aspects of the interface testing method or interface testing tool configuration method provided by the present application may also be implemented in the form of a program product, which includes program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of the interface testing method according to various exemplary implementations of the present application described above in this specification. For example, the computer device may execute the following steps: Figure 3 or Fig. 9 Follow the steps shown in .

[0217] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may 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 of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable 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.

[0218] The program product of the embodiment of the present application can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a computing device. However, the program product of the present application is not limited to this. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with a command execution system, device or device.

[0219] The readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein the readable program code is carried. 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. The readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with a command execution system, apparatus, or device.

[0220] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0221] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0222] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. An interface testing method, characterized in that: The method includes: In the test phase, in response to a test operation triggered by a tool test page for a target interface, interface test parameters related to testing the target interface are obtained based on parameter controls input in the tool test page; each parameter control corresponds to one interface test parameter; Generate an interface test request based on pre-configured request related information and the interface test parameters, and send the interface test request to the target interface service party; wherein the request related information and the parameter control are configured in the following manner: in the configuration stage, in response to a tool configuration operation for the target interface triggered by a tool configuration page, obtain configuration information related to the test of the target interface; the configuration information at least includes: tool configuration information and parameter configuration information; obtain request related information when performing the test according to the tool configuration information and configure it, and obtain parameter controls required for testing the target interface according to the parameter configuration information and configure it, and the parameter configuration information includes control type, control configuration, whether it is a primary key, and operation; Obtaining the interface return information returned by the target interface service provider, and displaying the test results generated based on the interface return information on the tool test page; Wherein, the method further comprises: In response to an access operation triggered by a tool access entry for the target interface, the tool test page is displayed; the tool access entry is generated based on identification information assigned to the configuration information after the configuration information is stored.

2. The method according to claim 1, characterized in that The parameter configuration information also includes parameter verification rules; before sending the interface test request to the target interface service party, it also includes: After determining that the target interface service is accessible, each interface test parameter is verified according to the parameter verification rules in the parameter control corresponding to each interface test parameter, wherein the parameter verification rules in the parameter control are pre-configured according to the parameter configuration information in the configuration information.

3. The method according to claim 1, characterized in that The test results include a hypertext transfer protocol (http) status code and target keywords; The test results generated based on the interface return information are displayed on the tool test page, specifically including: Extracting the http status code used to indicate the interface response status in the interface return information by regular expression analysis, and obtaining the target keyword used to indicate the interface call result in the interface return information by keyword matching analysis by AC automaton; The http status code and the target keyword are highlighted on the tool test page.

4. A method for configuring an interface test tool, characterized in that: The method comprises: In the configuration stage, in response to a tool configuration operation for a target interface triggered by a tool configuration page, configuration information related to the test of the target interface is obtained; the configuration information at least includes: tool configuration information and parameter configuration information; According to the tool configuration information, request-related information for testing is obtained and configured, and according to the parameter configuration information, parameter controls required for testing the target interface are obtained and configured; the parameter controls are used to input interface test parameters related to the testing of the target interface through a tool test page for the target interface during the testing phase, so as to generate an interface test request based on the request-related information and the interface test parameters during the testing phase, and send it to the target interface service party, and each parameter control corresponds to one interface test parameter, and the parameter configuration information includes control type, control configuration, whether it is a primary key, and operation; wherein, the tool test page is displayed in response to an access operation triggered by a tool access entry for the target interface, and the tool access entry is generated based on identification information assigned to the configuration information after storing the configuration information.

5. The method according to claim 4, characterized in that The method further comprises: In response to a preview operation triggered by the tool configuration page, displaying a control editing page including a configuration result of the parameter control; In response to an editing operation on a target parameter control triggered by the control editing page, acquiring control configuration information for the target parameter control; The configuration of the target parameter control is modified according to the control configuration information.

6. The method according to claim 4, characterized in that The parameter configuration information also includes parameter verification rules; after configuring the request related information and parameter controls during the test according to the configuration information, it also includes: After determining that the target interface service is accessible, the preset test parameters are verified based on the parameter verification rules.

7. An interface testing device, characterized in that: include: A first response unit is used to, in a test phase, in response to a test operation triggered by a tool test page for a target interface, obtain interface test parameters related to testing the target interface based on parameter controls input in the tool test page; each parameter control corresponds to one interface test parameter; A request unit, configured to generate an interface test request based on pre-configured request related information and the interface test parameters, and send the interface test request to a target interface service provider; wherein the request related information and the parameter control are configured in the following manner: in a configuration phase, in response to a tool configuration operation for a target interface triggered through a tool configuration page, configuration information related to the test of the target interface is obtained; the configuration information at least includes: tool configuration information and parameter configuration information; request related information when performing a test is obtained and configured according to the tool configuration information, and parameter controls required for testing the target interface are obtained and configured according to the parameter configuration information, and the parameter configuration information includes control type, control configuration, whether it is a primary key, and operation; A display unit, used for obtaining the interface return information returned by the target interface service provider, and displaying the test result generated based on the interface return information on the tool test page; Wherein, the first response unit is further used for: In response to an access operation triggered by a tool access entry for the target interface, the tool test page is displayed; the tool access entry is generated based on identification information assigned to the configuration information after the configuration information is stored.

8. The device according to claim 7, characterized in that The parameter configuration information also includes parameter verification rules; the device also includes: A first verification unit is used to verify each interface test parameter according to a parameter verification rule in a parameter control corresponding to each interface test parameter before the request unit sends the interface test request to the target interface service provider, after determining that the target interface service provider is accessible, wherein the parameter verification rule in the parameter control is pre-configured according to parameter configuration information in the configuration information.

9. The device according to claim 7, characterized in that The test results include http status code and target keywords; The display unit is specifically used for: Extracting the http status code used to indicate the interface response status in the interface return information by regular expression analysis, and obtaining the target keyword used to indicate the interface call result in the interface return information by keyword matching analysis by AC automaton; The http status code and the target keyword are highlighted on the tool test page.

10. An interface test tool configuration device, characterized in that: include: A second response unit, configured to obtain configuration information related to the test of the target interface in response to a tool configuration operation for the target interface triggered by the tool configuration page during the configuration phase; The configuration information at least includes: tool configuration information and parameter configuration information; A configuration unit, used to obtain and configure request-related information when performing a test according to the tool configuration information, and to obtain and configure parameter controls required for testing the target interface according to the parameter configuration information; the parameter controls are used to input interface test parameters related to the test of the target interface through a tool test page for the target interface during the test phase, so as to generate an interface test request based on the request-related information and the interface test parameters during the test phase, and send it to the target interface service party, and each parameter control corresponds to one interface test parameter, and the parameter configuration information includes control type, control configuration, whether it is a primary key, and operation; wherein the tool test page is displayed in response to an access operation triggered by a tool access entry for the target interface, and the tool access entry is generated based on identification information assigned to the configuration information after storing the configuration information.

11. An electronic device, characterized in that: It includes a processor and a memory, wherein the memory stores a program code, and when the program code is executed by the processor, the processor executes the steps of any method described in claims 1 to 3 or the steps of any method described in claims 4 to 6.

12. A computer-readable storage medium, characterized in that: It includes program code, and when the program code is run on an electronic device, the program code is used to enable the electronic device to execute the steps of any method described in claims 1 to 3 or the steps of any method described in claims 4 to 6.

Citation Information

Patent Citations

  • Measurement parameter processing method and system

    CN104615539A

  • Monitoring method and device for interface and electronic equipment

    CN107846321A

  • Interface testing method, system, device and storage medium based on database comparison

    CN109101415A

  • Interface testing method and interface testing device

    CN110032511A

  • Mock data verification method and device for protocol interface

    CN110275831A