CN116795713A - Interface testing method, device, equipment and readable storage medium - Google Patents

Interface testing method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN116795713A
CN116795713A CN202310790710.8A CN202310790710A CN116795713A CN 116795713 A CN116795713 A CN 116795713A CN 202310790710 A CN202310790710 A CN 202310790710A CN 116795713 A CN116795713 A CN 116795713A
Authority
CN
China
Prior art keywords
interface
test
tested
parameters
case set
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310790710.8A
Other languages
Chinese (zh)
Inventor
孙事成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qingsongchou Information Technology Co ltd
Original Assignee
Beijing Qingsongchou Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qingsongchou Information Technology Co ltd filed Critical Beijing Qingsongchou Information Technology Co ltd
Priority to CN202310790710.8A priority Critical patent/CN116795713A/en
Publication of CN116795713A publication Critical patent/CN116795713A/en
Pending legal-status Critical Current

Links

Landscapes

  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The application provides a method, a device, equipment and a readable storage medium for testing an interface, wherein the method comprises the steps of obtaining interface parameter information of the interface to be tested, and the interface parameter information comprises the following steps: whether the interface parameter name, the interface parameter type and the interface parameter need to be filled; acquiring test parameters of an interface to be tested according to the interface parameter information; processing the test parameters to obtain a target test case set; and inputting the target test case set into the interface to be tested to obtain a test result of the interface to be tested. The method can achieve the effect of improving the efficiency of interface test.

Description

Interface testing method, device, equipment and readable storage medium
Technical Field
The present application relates to the field of interface testing, and in particular, to a method, apparatus, device, and readable storage medium for interface testing.
Background
At present, for the existing test flow, the method mainly comprises the steps of functional test, user page automatic test and interface automatic test, wherein the interface test is mainly carried out on the rear-end interface by manual data verification, and the test method mainly comprises the steps of using a large number of interface test tools and completing the interface test by repeated data verification.
The interface test has a great limitation, wherein sensitive information may exist, information leakage is easy to occur, a large amount of interface information needs to be processed manually, and the efficiency of the interface test is low.
Therefore, how to improve the efficiency of interface test is a technical problem to be solved.
Disclosure of Invention
The embodiment of the application aims to provide a method for testing an interface, and the technical scheme of the embodiment of the application can achieve the effect of improving the efficiency of the interface test.
In a first aspect, an embodiment of the present application provides a method for testing an interface, including obtaining interface parameter information of an interface to be tested, where the interface parameter information includes: whether the interface parameter name, the interface parameter type and the interface parameter need to be filled; acquiring test parameters of an interface to be tested according to the interface parameter information; processing the test parameters to obtain a target test case set; and inputting the target test case set into the interface to be tested to obtain a test result of the interface to be tested.
In the embodiment of the application, the test parameters can be generated through the interface parameter information, the target test case set for testing the interface to be tested can be obtained after the processing, and then the testing of the interface to be tested is completed.
In some embodiments, obtaining interface parameter information of an interface to be tested includes: and acquiring interface parameter information input by a user or acquiring the interface parameter information by analyzing an interface document address.
In the embodiment of the application, the interface parameter information can be quickly obtained by inputting or analyzing the interface document address by the user.
In some embodiments, obtaining test parameters of an interface to be tested according to interface parameter information includes: determining whether to generate a test parameter; when determining to generate test parameters, screening interface parameters corresponding to the interface parameter types as the test parameters; and when the test parameters are determined not to be generated, acquiring the test parameters through a preset parameter range.
In the embodiment of the application, the interface parameters corresponding to the interface parameter types can be selected as the test parameters or the test parameters can be directly obtained from the preset parameter range, so that the effect of quickly obtaining the test parameters can be achieved, and further the interface test to be tested can be quickly completed.
In some embodiments, processing the test parameters to obtain a set of target test cases includes: testing parameters through a preset testing method to obtain a plurality of test case sets, wherein the testing method comprises the following steps: at least one of an orthogonal theory method, an equivalence class test theory method and a boundary value test theory method; and aggregating a plurality of test case sets and removing repeated test cases to obtain a target test case set.
In the embodiment of the application, the test parameters are processed by a plurality of test methods, a plurality of test case sets can be obtained, and the target test case set can be formed after screening, so that the effect of rapidly testing the interface to be tested through the target test case set can be achieved.
In some embodiments, before inputting the target test case set into the interface to be tested to obtain the test result of the interface to be tested, the method further includes: analyzing the interface document address to obtain the interface address of the interface to be tested or obtain the interface address input by the user; and calling the interface to be tested through the interface address.
In the embodiment of the application, the interface address can be obtained by inputting or analyzing the interface document address by a user, and further the automatic test of the interface to be tested can be realized by the interface address.
In some embodiments, before inputting the target test case set into the interface to be tested to obtain the test result of the interface to be tested, the method further includes: generating a test tag according to the generation time of the target test case set and the parameters of the test case; and storing the target test case set and the test tag in a database so as to obtain the target test case set from the database when the interface to be tested is tested again.
In the embodiment of the application, when the interface test is performed on the interface to be tested again, the target test case set can be quickly obtained through the generated test tag, so that the effect of quickly testing the interface to be tested is achieved.
In some embodiments, after inputting the target test case set into the interface to be tested to obtain the test result of the interface to be tested, the method further includes: and generating a test report based on the test result, wherein the test report comprises a plurality of test cases and the test result corresponding to each test case.
In the embodiment of the application, the test result corresponding to each test case can be rapidly checked according to the generated test report, so that the effect of rapidly checking the interface problem is achieved.
In a second aspect, an embodiment of the present application provides an apparatus for testing an interface, including:
the first obtaining module is configured to obtain interface parameter information of an interface to be tested, where the interface parameter information includes: whether the interface parameter name, the interface parameter type and the interface parameter need to be filled;
the second acquisition module is used for acquiring the test parameters of the interface to be tested according to the interface parameter information;
the first obtaining module is configured to obtain interface parameter information of an interface to be tested, where the interface parameter information includes: whether the interface parameter name, the interface parameter type and the interface parameter need to be filled;
the second acquisition module is used for acquiring the test parameters of the interface to be tested according to the interface parameter information;
the processing module is used for processing the test parameters to obtain a target test case set;
and the test module is used for inputting the target test case set into the interface to be tested to obtain a test result of the interface to be tested.
Optionally, the first obtaining module is specifically configured to:
and acquiring interface parameter information input by a user or acquiring the interface parameter information by analyzing an interface document address.
Optionally, the second obtaining module is specifically configured to:
determining whether to generate a test parameter;
when determining to generate test parameters, screening interface parameters corresponding to the interface parameter types as the test parameters;
and when the test parameters are determined not to be generated, acquiring the test parameters through a preset parameter range.
Optionally, the processing module is specifically configured to:
testing parameters through a preset testing method to obtain a plurality of test case sets, wherein the testing method comprises the following steps: at least one of an orthogonal theory method, an equivalence class test theory method and a boundary value test theory method;
and aggregating a plurality of test case sets and removing repeated test cases to obtain a target test case set.
Optionally, the apparatus further includes:
the calling module is used for analyzing the interface document address to acquire the interface address of the interface to be tested or acquiring the interface address input by a user before the testing module inputs the target test case set into the interface to be tested to acquire the test result of the interface to be tested;
and calling the interface to be tested through the interface address.
Optionally, the apparatus further includes:
the storage module is used for generating a test tag according to the generation time of the target test case set and the parameters of the test case before the test module inputs the target test case set into the interface to be tested to obtain the test result of the interface to be tested;
and storing the target test case set and the test tag in a database so as to obtain the target test case set from the database when the interface to be tested is tested again.
Optionally, the apparatus further includes:
the generating module is used for generating a test report based on the test result after the test module inputs the target test case set into the interface to be tested to obtain the test result of the interface to be tested, wherein the test report comprises a plurality of test cases and the test result corresponding to each test case.
In a third aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory storing computer readable instructions which, when executed by the processor, perform the steps of the method as provided in the first aspect above.
In a fourth aspect, embodiments of the present application provide a readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the method as provided in the first aspect above.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the embodiments of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and should not be considered as limiting the scope, and other related drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for testing an interface according to an embodiment of the present application;
FIG. 2 is a flow chart of a method for implementing interface testing according to an embodiment of the present application;
FIG. 3 is a schematic block diagram of an apparatus for interface testing according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an apparatus for interface testing according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present application.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
Some of the terms involved in the embodiments of the present application will be described first to facilitate understanding by those skilled in the art.
Terminal equipment: the mobile terminal, stationary terminal or portable terminal may be, for example, a mobile handset, a site, a unit, a device, a multimedia computer, a multimedia tablet, an internet node, a communicator, a desktop computer, a laptop computer, a notebook computer, a netbook computer, a tablet computer, a personal communications system device, a personal navigation device, a personal digital assistant, an audio/video player, a digital camera/camcorder, a positioning device, a television receiver, a radio broadcast receiver, an electronic book device, a game device, or any combination thereof, including the accessories and peripherals of these devices, or any combination thereof. It is also contemplated that the terminal device can support any type of interface (e.g., wearable device) for the user, etc.
And (3) a server: the cloud server can be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, and can also be a cloud server for providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, basic cloud computing services such as big data and artificial intelligent platforms and the like.
UI: the User Interface (User Interface) refers to the overall design of man-machine interaction, operation logic and attractive Interface for software. The good UI design not only enables the software to have individuality and taste, but also enables the operation of the software to be comfortable, simple and free, and fully embody the positioning and the characteristics of the software.
DDT: "Data-drive Tests", contains a class decorator ddt and two method decorators Data (directly input test Data), file_data (test Data can be obtained from json or yaml).
Pytest: a very mature fully functional Python test framework.
Comma Separated Values (CSV, sometimes also called character separation Values, because separation characters may not be commas), whose file stores table data (numbers and text) in plain text. Plain text means that the file is a sequence of characters, free of data that must be interpreted as binary digits.
Json: (JavaScript Object Notation, JS object profile) is a lightweight data exchange format. It stores and presents data in a text format that is completely independent of the programming language based on a subset of ECMAScript (European Computer Manufacturers Association, js specification by the european computer institute). The compact and clear hierarchical structure makes JSON an ideal data exchange language. Is easy to read and write by people, is easy to analyze and generate by machines, and effectively improves the network transmission efficiency.
CSV: comma Separated Values (sometimes referred to as character separation Values because separation characters may not be commas), whose files store table data (numbers and text) in plain text form. Plain text means that the file is a sequence of characters, free of data that must be interpreted as binary digits.
The application is applied to the scene of interface test, and the specific scene is to automatically match corresponding test parameters according to some parameter information of the interface to be tested, and realize the rapid test of the interface to be tested according to the test parameters.
At present, for the existing test flow, the method mainly comprises a function test, a user page automation test and an interface automation test, wherein the function test comprises the following steps: the testers manually test the business process, boundary values, compatibility, availability, safety and the like. UI automation: the method is mainly used for testing the directions of page interaction, skip, prompt, existing function regression and the like. And (3) interface automation: the method mainly checks whether the back-end interface is subjected to data checking, and mainly comprises boundary values, equivalence classes, stability and robustness of the interface and use of the interface in monitoring. The interface test is mainly carried out on the rear-end interface by manual operation, and the test method mainly comprises the steps of using a large number of interface test tools and completing the interface test by repeated data verification. The interface test has a great limitation, wherein sensitive information may exist, information leakage is easy to occur, a large amount of interface information needs to be processed manually, and the efficiency of the interface test is low.
The application obtains interface parameter information of the interface to be tested, wherein the interface parameter information comprises: whether the interface parameter name, the interface parameter type and the interface parameter need to be filled; acquiring test parameters of an interface to be tested according to the interface parameter information; processing the test parameters to obtain a target test case set; and inputting the target test case set into the interface to be tested to obtain a test result of the interface to be tested. The method can be used for achieving the effect of improving the efficiency of interface test by avoiding wasting a large amount of time caused by generating the test parameter test interface through a manual test interface or manual programming like the prior art.
In the embodiment of the present application, the execution body may be an interface test device in the interface test system, and in practical application, the interface test device may be electronic devices such as a terminal device and a server, which is not limited herein.
The method of interface testing according to an embodiment of the present application is described in detail below with reference to fig. 1.
Referring to fig. 1, fig. 1 is a flowchart of a method for testing an interface according to an embodiment of the present application, where the method for testing an interface shown in fig. 1 includes:
step 110: and acquiring interface parameter information of the interface to be tested.
Wherein the interface parameter information includes: the interface parameter name, the interface parameter type and the interface parameter need not be filled, and also can comprise interface address parameters and the like, wherein the interface parameter name can be one or more, each interface parameter corresponds to one interface parameter name according to the number of the interface parameters, the interface parameter type can be input parameters, output parameters and the like, and the interface parameter need not be filled to indicate whether the parameter is a necessary parameter or not, and can also indicate whether the interface parameter name, the interface parameter type and the interface parameter need not be filled with interface parameter information which is a necessary parameter or not. The interface to be tested can be an interface for system docking, an interface for application program docking, a docking between computer software, and the like.
In some embodiments of the present application, obtaining interface parameter information of an interface to be tested includes: and acquiring interface parameter information input by a user or acquiring the interface parameter information by analyzing an interface document address.
In the process, the application can quickly acquire the interface parameter information by inputting or analyzing the interface document address by the user.
The interface file address is analyzed to obtain the interface file of the interface to be tested, and the interface file comprises interface parameter information, interface configuration information and the like. The interface parameter information can also be directly obtained through the preset interface parameters stored by the system. The interface parameter information comprises information such as a preset docking object, a parameter array, a custom field, a programming function and the like.
Step 120: and acquiring the test parameters of the interface to be tested according to the interface parameter information.
The test parameters comprise test input parameters, execution conditions, expected results and the like. The test parameters may also include only one parameter name and a parameter value corresponding to the parameter name.
In some embodiments of the present application, obtaining test parameters of an interface to be tested according to interface parameter information includes: determining whether to generate a test parameter; when determining to generate test parameters, screening interface parameters corresponding to the interface parameter types as the test parameters; and when the test parameters are determined not to be generated, acquiring the test parameters through a preset parameter range.
In the process, the interface parameters corresponding to the interface parameter types can be selected as the test parameters or the test parameters can be directly obtained from the preset parameter range, so that the effect of quickly obtaining the test parameters can be achieved, and further the interface test to be tested can be quickly completed.
The interface parameters corresponding to the screening interface parameter types are used as test parameters, and the interface parameters corresponding to the screening interface parameter types from the database system are used as the test parameters. The preset parameter range can be set according to requirements, and the parameter range can be limited by the name, the storage place and the parameter type of the parameter to obtain the test parameter.
Step 130: and processing the test parameters to obtain a target test case set.
Each test case in the target test case set may include data such as input parameters, execution conditions, and expected results.
In some embodiments of the present application, processing test parameters to obtain a target test case set includes: testing parameters through a preset testing method to obtain a plurality of test case sets, wherein the testing method comprises the following steps: at least one of an orthogonal theory method, an equivalence class test theory method and a boundary value test theory method; and aggregating a plurality of test case sets and removing repeated test cases to obtain a target test case set.
In the process, the test parameters are processed by a plurality of test methods, a plurality of test case sets can be obtained, and the target test case set can be formed after screening, so that the effect of rapidly testing the interface to be tested through the target test case set can be achieved.
The test parameters are tested through a preset test method, so that a test case set can be generated.
Step 140: and inputting the target test case set into the interface to be tested to obtain a test result of the interface to be tested.
In one embodiment, inputting the target test case set into the interface to be tested, and obtaining the test result of the interface to be tested includes:
and inputting the target test case set into the interface to be tested to obtain an output result, and comparing the output result with an expected result to obtain a test result.
The test result comprises problems existing in the interface and parameters output when the interface is tested.
In some embodiments of the present application, before inputting the target test case set into the interface to be tested to obtain the test result of the interface to be tested, the method shown in fig. 1 further includes: analyzing the interface document address to obtain the interface address of the interface to be tested or obtain the interface address input by the user; and calling the interface to be tested through the interface address.
In the process, the interface address can be obtained by inputting or analyzing the interface document address by the user, and further the automatic test of the interface to be tested can be realized by the interface address.
In some embodiments of the present application, before inputting the target test case set into the interface to be tested to obtain the test result of the interface to be tested, the method shown in fig. 1 further includes: generating a test tag according to the generation time of the target test case set and the parameters of the test case; and storing the target test case set and the test tag in a database so as to obtain the target test case set from the database when the interface to be tested is tested again.
In the process, when the interface test is performed on the interface to be tested again, the target test case set can be quickly obtained through the generated test tag, so that the effect of quickly testing the interface to be tested is achieved.
The test tag comprises the contents of the generation time of the target test case set, the parameter types of the test cases and the like. The target test case can be exported as data in a preset format, and then stored in a database, wherein the preset format can be CSV or Json.
In some embodiments of the present application, after inputting the target test case set into the interface to be tested to obtain the test result of the interface to be tested, the method shown in fig. 1 further includes: and generating a test report based on the test result, wherein the test report comprises a plurality of test cases and the test result corresponding to each test case.
In the process, the test result corresponding to each test case can be rapidly checked according to the generated test report, so that the effect of rapidly checking the interface problem is achieved.
In one embodiment, inputting the target test case set into the interface to be tested, and obtaining the test result of the interface to be tested includes:
and using the DDT data processing mode, simulating an interface request by using the generated target test case set through pytest (a test framework) and requests (a request mode), generating a test report and verifying a test result.
In the process shown in fig. 1, the method acquires interface parameter information of an interface to be tested, where the interface parameter information includes: whether the interface parameter name, the interface parameter type and the interface parameter need to be filled; acquiring test parameters of an interface to be tested according to the interface parameter information; processing the test parameters to obtain a target test case set; and inputting the target test case set into the interface to be tested to obtain a test result of the interface to be tested. The method can be used for achieving the effect of improving the efficiency of interface test by avoiding wasting a large amount of time caused by generating the test parameter test interface through a manual test interface or manual programming like the prior art.
The method for implementing the interface test according to the embodiment of the present application is described in detail below with reference to fig. 2.
Referring to fig. 2, fig. 2 is a flowchart of a method for implementing an interface test according to an embodiment of the present application, where the method for implementing an interface test shown in fig. 2 includes:
step 201: whether to resolve the interface document address.
Specific: according to the instruction input by the user, judging whether to analyze the interface document address, if yes, entering step 202, and if not, entering step 203.
Step 202: and analyzing the document address of the interface to obtain the interface parameter information.
Specific: the interface address is obtained by parsing the interface document address, the interface parameter information is obtained by the interface address, and the process proceeds to step 204.
Step 203: and acquiring interface parameter information input by a user.
Specific: and acquiring interface parameter information directly input by a user or acquiring interface parameter information input by the user in advance into a system.
Step 204: whether to generate the test parameters.
Specific: whether the test parameters need to be generated or not is judged, the step 205 is executed if the test parameters need to be generated, and the step 206 is executed if the test parameters do not need to be generated.
Step 205: and screening interface parameters corresponding to the interface parameter types as test parameters.
Specific: and screening part of parameters from the parameters of the interface to be tested stored in the system database according to the parameter types as test parameters, and proceeding to step 207.
Step 206: and acquiring test parameters through a preset parameter range.
Specific: and acquiring test parameters input by a user according to a preset parameter range or a parameter range automatically given by the system.
Step 207: and processing the test parameters to obtain a target test case set.
Specific: testing parameters through a preset testing method to obtain a plurality of test case sets; and aggregating a plurality of test case sets and removing repeated test cases to obtain a target test case set.
Step 208: whether to execute the target test case set.
Specific: whether the target test case set is executed to test the interface to be tested is determined, the step 209 is executed, and the step 211 is executed if not.
Step 209: an interface address is obtained.
Specific: the analysis interface document address obtains an interface address of an interface to be tested or obtains an interface address input by a user; and calling the interface to be tested through the interface address.
Step 210: and executing the target test case set to obtain a test result.
Specific: and inputting the target test case set into the interface to be tested to obtain an output result, comparing the output result with an expected result to obtain a test result, and ending the flow.
Step 211: and outputting the target test case set and storing the target test case set in a database.
Specific: generating a test tag according to the generation time of the target test case set and the parameters of the test case; and storing the target test case set and the test tag in a database so as to obtain the target test case set from the database and finish the flow when the interface to be tested is tested again.
In addition, the specific method and steps shown in fig. 2 may refer to the method shown in fig. 1, and will not be described in detail herein.
The method of interface testing is described above with reference to fig. 1, and the apparatus for interface testing is described below with reference to fig. 3-4.
Referring to fig. 3, a schematic block diagram of an apparatus 300 for testing an interface according to an embodiment of the present application is shown, where the apparatus 300 may be a module, a program segment, or a code on an electronic device. The apparatus 300 corresponds to the embodiment of the method of fig. 1 described above, and is capable of performing the steps involved in the embodiment of the method of fig. 1. Specific functions of the apparatus 300 will be described below, and detailed descriptions thereof will be omitted herein as appropriate to avoid redundancy.
Optionally, the apparatus 300 includes:
the first obtaining module 310 is configured to obtain interface parameter information of an interface to be tested, where the interface parameter information includes: whether the interface parameter name, the interface parameter type and the interface parameter need to be filled;
a second obtaining module 320, configured to obtain test parameters of the interface to be tested according to the interface parameter information;
the processing module 330 is configured to process the test parameters to obtain a target test case set;
and the test module 340 is configured to input the target test case set into the interface to be tested, and obtain a test result of the interface to be tested.
Optionally, the first obtaining module is specifically configured to:
and acquiring interface parameter information input by a user or acquiring the interface parameter information by analyzing an interface document address.
Optionally, the second obtaining module is specifically configured to:
determining whether to generate a test parameter;
when determining to generate test parameters, screening interface parameters corresponding to the interface parameter types as the test parameters; and when the test parameters are determined not to be generated, acquiring the test parameters through a preset parameter range.
Optionally, the processing module is specifically configured to:
testing parameters through a preset testing method to obtain a plurality of test case sets, wherein the testing method comprises the following steps: at least one of an orthogonal theory method, an equivalence class test theory method and a boundary value test theory method; and aggregating a plurality of test case sets and removing repeated test cases to obtain a target test case set.
Optionally, the apparatus further includes:
the calling module is used for analyzing the interface document address to acquire the interface address of the interface to be tested or acquiring the interface address input by a user before the testing module inputs the target test case set into the interface to be tested to acquire the test result of the interface to be tested; and calling the interface to be tested through the interface address.
Optionally, the apparatus further includes:
the storage module is used for generating a test tag according to the generation time of the target test case set and the parameters of the test case before the test module inputs the target test case set into the interface to be tested to obtain the test result of the interface to be tested; and storing the target test case set and the test tag in a database so as to obtain the target test case set from the database when the interface to be tested is tested again.
Optionally, the apparatus further includes:
the generating module is used for generating a test report based on the test result after the test module inputs the target test case set into the interface to be tested to obtain the test result of the interface to be tested, wherein the test report comprises a plurality of test cases and the test result corresponding to each test case.
Referring to fig. 4, a schematic structural diagram of an apparatus for testing an interface according to an embodiment of the application may include a memory 410 and a processor 420. Optionally, the apparatus may further include: a communication interface 430 and a communication bus 440. The apparatus corresponds to the embodiment of the method of fig. 1 described above, and is capable of performing the steps involved in the embodiment of the method of fig. 1, and specific functions of the apparatus may be found in the following description.
In particular, the memory 410 is used to store computer readable instructions.
The processor 420, which processes the readable instructions stored in the memory, is capable of performing the various steps in the method of fig. 1.
Communication interface 430 is used for signaling or data communication with other node devices. For example: for communication with a server or terminal, or with other device nodes, although embodiments of the application are not limited in this regard.
A communication bus 440 for enabling direct connection communication of the above-described components.
The communication interface 430 of the device in the embodiment of the present application is used for performing signaling or data communication with other node devices. The memory 410 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. Memory 410 may also optionally be at least one storage device located remotely from the aforementioned processor. The memory 410 has stored therein computer readable instructions which, when executed by the processor 420, perform the method process described above in fig. 1. Processor 420 may be used on apparatus 300 and to perform functions in the present application. By way of example, the processor 420 described above may be a general purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, and the embodiments of the application are not limited in this regard.
Embodiments of the present application also provide a readable storage medium, which when executed by a processor, performs a method process performed by an electronic device in the method embodiment shown in fig. 1.
It will be clear to those skilled in the art that, for convenience and brevity of description, reference may be made to the corresponding procedure in the foregoing method for the specific working procedure of the apparatus described above, and this will not be repeated here.
In summary, the embodiments of the present application provide a method, an apparatus, an electronic device, and a readable storage medium for testing an interface, where the method includes obtaining interface parameter information of an interface to be tested, where the interface parameter information includes: whether the interface parameter name, the interface parameter type and the interface parameter need to be filled; acquiring test parameters of an interface to be tested according to the interface parameter information; processing the test parameters to obtain a target test case set; and inputting the target test case set into the interface to be tested to obtain a test result of the interface to be tested. The method can achieve the effect of improving the efficiency of interface test.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The apparatus embodiments described above are merely illustrative, for example, of the flowcharts and block diagrams in the figures that illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and variations will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application. It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A method of interface testing, comprising:
obtaining interface parameter information of an interface to be tested, wherein the interface parameter information comprises: whether the interface parameter name, the interface parameter type and the interface parameter need to be filled;
acquiring test parameters of the interface to be tested according to the interface parameter information;
processing the test parameters to obtain a target test case set;
and inputting the target test case set into the interface to be tested to obtain a test result of the interface to be tested.
2. The method according to claim 1, wherein the obtaining interface parameter information of the interface to be tested includes:
and acquiring the interface parameter information input by a user or acquiring the interface parameter information by analyzing an interface document address.
3. The method according to claim 1 or 2, wherein the obtaining the test parameters of the interface to be tested according to the interface parameter information includes:
determining whether to generate the test parameters;
screening interface parameters corresponding to the interface parameter types as the test parameters when determining to generate the test parameters;
and when the test parameters are determined not to be generated, acquiring the test parameters through a preset parameter range.
4. The method according to claim 1 or 2, wherein the processing the test parameters to obtain a target test case set includes:
testing the testing parameters through a preset testing method to obtain a plurality of testing case sets, wherein the testing method comprises the following steps: at least one of an orthogonal theory method, an equivalence class test theory method and a boundary value test theory method;
and aggregating the plurality of test case sets and removing repeated test cases to obtain the target test case set.
5. The method according to claim 1 or 2, wherein before the inputting the target test case set into the interface to be tested, obtaining a test result of the interface to be tested, the method further comprises:
analyzing an interface document address to acquire an interface address of the interface to be tested or acquire the interface address input by a user;
and calling the interface to be tested through the interface address.
6. The method according to claim 1 or 2, wherein before the inputting the target test case set into the interface to be tested, obtaining a test result of the interface to be tested, the method further comprises:
generating a test tag according to the generation time of the target test case set and parameters of the test case;
and storing the target test case set and the test tag in a database so as to acquire the target test case set from the database when the interface to be tested is tested again.
7. The method according to claim 1 or 2, wherein after the inputting the target test case set into the interface to be tested, obtaining a test result of the interface to be tested, the method further comprises:
and generating a test report based on the test result, wherein the test report comprises a plurality of test cases and the test result corresponding to each test case.
8. An apparatus for interface testing, comprising:
the first obtaining module is configured to obtain interface parameter information of an interface to be tested, where the interface parameter information includes: whether the interface parameter name, the interface parameter type and the interface parameter need to be filled;
the second acquisition module is used for acquiring the test parameters of the interface to be tested according to the interface parameter information;
the processing module is used for processing the test parameters to obtain a target test case set;
and the test module is used for inputting the target test case set into the interface to be tested to obtain a test result of the interface to be tested.
9. An electronic device, comprising:
a memory and a processor, the memory storing computer readable instructions that, when executed by the processor, perform the steps in the method of any of claims 1-7.
10. A computer-readable storage medium, comprising:
computer program which, when run on a computer, causes the computer to perform the method according to any of claims 1-7.
CN202310790710.8A 2023-06-29 2023-06-29 Interface testing method, device, equipment and readable storage medium Pending CN116795713A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310790710.8A CN116795713A (en) 2023-06-29 2023-06-29 Interface testing method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310790710.8A CN116795713A (en) 2023-06-29 2023-06-29 Interface testing method, device, equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN116795713A true CN116795713A (en) 2023-09-22

Family

ID=88045805

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310790710.8A Pending CN116795713A (en) 2023-06-29 2023-06-29 Interface testing method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN116795713A (en)

Similar Documents

Publication Publication Date Title
CN110018955B (en) Generating automated test scripts by transforming manual test cases
US10387292B2 (en) Determining application test results using screenshot metadata
CN107562610B (en) Method, device, terminal and medium for acquiring page loading time
CN107436844B (en) Method and device for generating interface use case aggregate
CN111176996A (en) Test case generation method and device, computer equipment and storage medium
US10175954B2 (en) Method of processing big data, including arranging icons in a workflow GUI by a user, checking process availability and syntax, converting the workflow into execution code, monitoring the workflow, and displaying associated information
CN109828906B (en) UI (user interface) automatic testing method and device, electronic equipment and storage medium
CN109684008B (en) Card rendering method, device, terminal and computer readable storage medium
CN110955409B (en) Method and device for creating resources on cloud platform
US10043107B2 (en) On demand testing as a service for base text direction verification testing
CN108228443B (en) Web application testing method and device
CN110990274A (en) Data processing method, device and system for generating test case
CN110968314B (en) Page generation method and device
CN111143551A (en) Text preprocessing method, classification method, device and equipment
CN113778864A (en) Test case generation method and device, electronic equipment and storage medium
CN117009248A (en) Machine learning model testing method and device, electronic equipment and storage medium
CN112052157A (en) Test message construction method, device and system
CN111142871A (en) Front-end page development system, method, equipment and medium
CN116795713A (en) Interface testing method, device, equipment and readable storage medium
CN112988776B (en) Method, device and equipment for updating text parsing rule and readable storage medium
CN111125605B (en) Page element acquisition method and device
CN114371866A (en) Version reconfiguration test method, device and equipment of service system
CN111143189A (en) Method and apparatus for application program interface API testing
CN115543227B (en) Cross-system data migration method, system, electronic device and storage medium
CN113504912B (en) Real-time task processing method and device, storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination