CN113836014A - Interface testing method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN113836014A
CN113836014A CN202111098322.0A CN202111098322A CN113836014A CN 113836014 A CN113836014 A CN 113836014A CN 202111098322 A CN202111098322 A CN 202111098322A CN 113836014 A CN113836014 A CN 113836014A
Authority
CN
China
Prior art keywords
interface
engine
template
assertion
target
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
CN202111098322.0A
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.)
Qingdao Zhongke Shuguang Technology Service Co ltd
Original Assignee
Qingdao Zhongke Shuguang Technology Service 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 Qingdao Zhongke Shuguang Technology Service Co ltd filed Critical Qingdao Zhongke Shuguang Technology Service Co ltd
Priority to CN202111098322.0A priority Critical patent/CN113836014A/en
Publication of CN113836014A publication Critical patent/CN113836014A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Abstract

The embodiment of the invention discloses an interface testing method, an interface testing device, electronic equipment and a storage medium, wherein the method comprises the following steps: in response to the template selection instruction, displaying parameter item information of the target interface template; the parameter item information comprises an interface test parameter item, an engine identification item and an engine execution parameter item; filling the completed target interface template according to the parameter item information, and acquiring interface test parameters, a first target engine and engine execution parameters; and executing the interface test through the first target engine according to the interface test parameters and the engine execution parameters, and acquiring an interface test result according to the interface feedback information. The technical scheme provided by the embodiment of the invention realizes the universality test of the multi-service interface under the interface test system, improves the interface test efficiency, avoids the development of a plurality of interface test systems, and reduces the time cost and the labor cost of system development.

Description

Interface testing method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the field of software development, in particular to an interface testing method and device, electronic equipment and a storage medium.
Background
With the rapid development of network technology, more and more application services come into the sight of people, and business systems providing the application services are continuously updated iteratively, so that the interface test requirements of each business system become very frequent.
In an existing interface test system, a Django frame based on Python language or an SSM (Spring + Spring mvc + MyBatis) frame is generally selected as a development frame of the interface test system, and thus, the interface test of a service system is realized.
However, the above interface test method can only realize the test of a single type of interface, for example, the RESTful interface or the Dubbo interface, and the functionality is single, and for the service interfaces under different service systems, different interface test systems need to be respectively established, and interface tests are respectively performed under each interface test system, which not only makes the interface test flow complicated, but also consumes a lot of time cost and labor cost for the development of the interface test systems.
Disclosure of Invention
The embodiment of the invention provides an interface test method, an interface test device, interface test equipment and a storage medium, and realizes interface test execution through an engine based on interface test parameters and engine execution parameters.
In a first aspect, an embodiment of the present invention provides an interface testing method, including:
in response to the template selection instruction, displaying parameter item information of the target interface template; wherein the parameter item information comprises an interface test parameter item, an engine identification item and an engine execution parameter item;
acquiring interface test parameters, a first target engine and engine execution parameters according to the target interface template which is filled in according to the parameter item information;
and executing the interface test through the first target engine according to the interface test parameters and the engine execution parameters, and acquiring an interface test result according to interface feedback information.
The interface testing method further comprises the following steps: in response to the template newly-increased instruction, displaying an interface template editing template to obtain an edited newly-increased interface template; and/or in response to the first engine addition instruction is acquired, displaying the engine editing template to acquire the edited first addition engine. The newly added interface template and the newly added engine template ensure the test support of the interface test system to the newly added service interface and realize the universal support to the service interfaces of different service systems; the phenomenon that the user uploads the engine to be identified due to different editing formats of the engine is avoided by editing the template by the engine.
After the template is edited by the display interface template, the method further comprises the following steps: if an engine selection instruction is acquired through the interface template editing template, displaying an engine execution parameter item of a second target engine in the interface template editing template; and if a second engine newly-added instruction is obtained through the interface template editing template, displaying the engine editing template in the interface template editing template to obtain a second newly-added engine after editing. The method and the device have the advantages that the selection of the existing engine and the editing function of the newly added engine are provided in the interface template editing template, so that a tester can use the existing engine or the new engine stored in the interface testing system when writing the interface template, the editing flexibility of the interface template is improved, and the editing efficiency of the interface template is improved.
The parameter item information also comprises an assertion mode item and an assertion execution parameter item; after the parameter item information of the target interface template is displayed, the method further comprises the following steps: acquiring an assertion mode and an assertion execution parameter according to the target interface template filled with the parameter item information; the obtaining of the interface test result according to the interface feedback information includes: and acquiring an interface assertion result according to the interface feedback information, the assertion mode and the assertion execution parameter. The interface assertion result is obtained through the interface feedback information, the assertion mode and the assertion execution parameter, the assertion test of the service interface is realized, the code accuracy of the service interface is verified, and the service performance of the interface is improved.
After the target interface template completed according to the parameter item information is obtained, interface test parameters, a first target engine and engine execution parameters are obtained, the method further comprises the following steps: creating and storing an interface test task according to the interface test parameters, the first target engine and the engine execution parameters; or creating and storing an interface test task according to the interface test parameters, the first target engine, the engine execution parameters, the assertion mode and the assertion execution parameters; and executing the target interface test task in response to the acquired task selection instruction. The multiplexing of the interface testing task is realized, the retest of the service interface is facilitated for the tester, the operation convenience of the tester is improved, and the complicated process that the tester repeatedly fills in the parameter item information is avoided.
The assertion manner comprises at least one of equal value assertion, greater than assertion, less than assertion, range assertion, null assertion and regular assertion. The interface test system can carry out personalized test on different service interfaces through diversified assertion modes, and testers can select different assertion modes according to the data characteristics of different service interfaces, so that the accuracy and the matching of test results are improved.
Before obtaining an interface assertion result according to the interface feedback information, the assertion mode and the assertion execution parameter, the method comprises the following steps: if the data format of the interface feedback information is Json format, analyzing the interface feedback information through JsonPath; and if the data format of the interface feedback information is an Xml format, analyzing the interface feedback information through XPath. Through the use of JsonPath and XPath, Json assertion and Xml assertion of a service interface are realized, data diversity of interface testing is ensured, and test support of service interfaces with different data formats is realized.
In a second aspect, an embodiment of the present invention provides an interface testing apparatus, including:
the target interface template display module is used for responding to the acquired template selection instruction and displaying the parameter item information of the target interface template; wherein the parameter item information comprises an interface test parameter item, an engine identification item and an engine execution parameter item;
the parameter acquisition module is used for acquiring interface test parameters, a first target engine and engine execution parameters according to the target interface template which is filled in according to the parameter item information;
and the interface test result acquisition module is used for executing the interface test through the first target engine according to the interface test parameters and the engine execution parameters and acquiring an interface test result according to interface feedback information.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the interface testing method according to any embodiment of the present invention.
In a fourth aspect, the embodiments of the present invention further provide a storage medium containing computer-executable instructions, which when executed by a computer processor implement the interface testing method according to any embodiment of the present invention.
According to the technical scheme provided by the embodiment of the invention, the interface test parameters and the engine execution parameters filled by the user are obtained by displaying the interface test parameter item, the engine identification item and the engine execution parameter item of the target interface template, and the interface test is executed according to the first target engine matched with the target interface template, so that the universality test of the multi-service interface under the interface test system is realized, the interface test efficiency is improved, the development of a plurality of interface test systems is avoided, and the time cost and the labor cost of system development are reduced.
Drawings
Fig. 1 is a flowchart of an interface testing method according to an embodiment of the present invention;
fig. 2 is a flowchart of an interface testing method according to a second embodiment of the present invention;
fig. 3 is a block diagram of an interface test system according to a third embodiment of the present invention;
fig. 4 is a block diagram of an interface testing apparatus according to a fourth embodiment of the present invention;
fig. 5 is a block diagram of an electronic device according to a fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of an interface testing method according to an embodiment of the present invention, where this embodiment is applicable to execute an interface test by an engine according to an interface test parameter item and an engine execution parameter item filled by a tester, and the interface testing method may be executed by an interface testing apparatus according to an embodiment of the present invention, where the apparatus may be implemented by software and/or hardware and integrated in an interface testing system, and may typically be integrated in an electronic device carrying the interface testing system, and the method specifically includes the following steps:
s110, responding to the acquired template selection instruction, and displaying parameter item information of the target interface template; wherein the parameter item information comprises an interface test parameter item, an engine identification item and an engine execution parameter item.
The interface test system is accessed to service interfaces under a plurality of service systems, and each interface template corresponds to a service interface under different service systems; the interface test system can display each interface template stored in the system in the form of an interface template list; the interface template is a parameter item set of parameters required by the service interface during interface test, and each interface template comprises a plurality of pieces of parameter item information to be filled; the interface test parameter item is a parameter requirement of data information sent to the service interface by the interface test system, and may include one or more of an interface name, a calling protocol type, a request parameter format, a request body structure, and a return result format.
Specifically, the calling Protocol type is a type of a communication Protocol supported by a Service interface, for example, HTTP (Hyper Text Transfer Protocol), Web Service (World Wide Web Service) Protocol, and Dubbo Protocol; the request parameter format is a parameter format of a request sent to a service interface by an interface test system, for example, an integer format, a floating point format, a character string format, a Key-Value format (i.e., a keyword Value), a Json format, an Xml format, and the like; the request body structure is a self-defined request structure of a tester, corresponds to a request parameter format, and is given by the tester to be input if the request parameter format is a Key-Value format, a Json format or an Xml format, for example, if the request parameter format is a Key-Value format, the request body structure can be an appointed 'Key' name, and if the request parameter format is a Json format and an Xml format, the request body structure can be an appointed node name; the returned result format is a parameter format of data information returned to the interface test system by the service interface, and may include integer, floating point, character string, Key-Value format, JSON format, XML format, and the like.
The Engine (Engine) is a program component of the interface test system, the interface test system calls the interface through the Engine, and simultaneously, the Engine sends test data to the interface; the engines are compiled in advance by testers and stored in the interface test system, and different engines correspond to different service interfaces and send different test data; the engine identification item represents the number of the engine used by the interface template, and when the interface template is created, the interface template is associated with the engine according to the engine selected by a tester; when a template selection instruction is acquired and parameter item information of a target interface template is displayed to a tester, an interface test system displays an engine identifier corresponding to the target interface template according to the recorded incidence relation between the interface template and the engine; particularly, after the target interface template is displayed, if an engine identifier modification instruction sent by a tester is obtained, the modified engine identifier is used as the engine identifier corresponding to the target interface template.
The engine execution parameter item is addressing information when the interface test system tests the interface through the engine, namely the identity and the position of the interface to be tested are determined according to the engine execution parameter item; the engine execution parameter items comprise connection timeout time and reading timeout time; connection timeout time, namely the maximum connection time with an interface when the engine calls the interface; reading the overtime, namely reading the maximum reading time of interface feedback information when the engine calls the interface; particularly, if the engine tests the interface based on the HTTP Protocol, the engine execution parameter item further includes an interface IP (Internet Protocol ) address, an interface request port, a calling mode, an interface path, and a Header parameter; wherein, the calling mode can be set as "POST" (creation), "DELETE" (deletion), "PUT" (update) and "GET" (view); if the engine tests the interface based on the Web Service protocol, the engine execution parameter item also comprises Url (Uniform Resource Locator) information and an interface name; if the engine tests the interface based on the Dubbo protocol, the engine execution parameter items also include an interface definition file (e.g., library package in Java format) and an interface configuration file.
And S120, acquiring interface test parameters, a first target engine and engine execution parameters according to the target interface template filled in by the parameter item information.
The data information filled by the testers in the interface test parameter item is the interface test parameter, the data information filled by the testers in the engine execution parameter item is the engine test parameter, the engine identifier represents the number of the engine used by the interface template, and the first target engine can be determined according to the engine identifier.
S130, according to the interface test parameters and the engine execution parameters, executing the interface test through the first target engine, and acquiring an interface test result according to interface feedback information.
According to the engine execution parameters, a target interface to be tested in a plurality of service interfaces of the access interface test system can be determined; the engine includes a complete service execution logic, for example, the service execution logic is to send a value 100 to the interface, that is, the engine itself already includes a program code related to the action of executing "sending the value 100", and since the interface test parameter reflects the parameter requirement of the data information sent to the interface, the engine executes the action according to the acquired parameter requirement; after the data fed back by the service interface is obtained, according to the interface feedback information, the interface response time, the packet loss rate of the interface response and the data volume of the interface response can be determined.
Optionally, in this embodiment of the present invention, the interface testing method further includes: in response to the template newly-increased instruction, displaying an interface template editing template to obtain an edited newly-increased interface template; and/or in response to the first engine addition instruction is acquired, displaying the engine editing template to acquire the edited first addition engine. The interface test system has an expansion function of an interface template, and by displaying the interface template editing template, a tester can compile parameter items in the interface template according to test requirements of different service interfaces so as to adapt to the test requirements of the different service interfaces; the interface template editing template comprises a plurality of preset optional parameter items so as to be convenient for a tester to select and use, and new parameter items appearing in each newly added interface template can be added into the optional parameter items so as to ensure the integrity of the optional parameter items; the interface test system also has an engine expansion function, and by displaying the engine editing template, testers can compile different functional engines according to different business data, and meanwhile, the engine editing template also avoids the phenomenon that the engine uploaded by a user cannot be identified due to different editing formats of the engines; the newly added interface template and the newly added engine template ensure the test support of the interface test system to the newly added service interface and realize the universal support to the service interfaces of different service systems.
Optionally, in the embodiment of the present invention, after the displaying the interface template editing template, the method further includes: if an engine selection instruction is acquired through the interface template editing template, displaying an engine execution parameter item of a second target engine in the interface template editing template; and if a second engine newly-added instruction is obtained through the interface template editing template, displaying the engine editing template in the interface template editing template to obtain a second newly-added engine after editing. The method and the device have the advantages that the selection of the existing engine and the editing function of the newly added engine are provided in the interface template editing template, so that a tester can use the existing engine or the new engine stored in the interface testing system when writing the interface template, the editing flexibility of the interface template is improved, and the editing efficiency of the interface template is improved.
Optionally, in this embodiment of the present invention, after the target interface template completed according to the parameter item information is filled, and an interface test parameter, a first target engine, and an engine execution parameter are obtained, the method further includes: creating and storing an interface test task according to the interface test parameters, the first target engine and the engine execution parameters; and executing the target interface test task in response to the acquired task selection instruction. The interface testing system creates and stores the interface testing task according to the parameter item information filled by the user, so that the multiplexing of the interface testing task is realized, the tester can conveniently retest the service interface, the operation convenience of the tester is improved, and the complicated process that the tester repeatedly fills the parameter item information is avoided.
According to the technical scheme provided by the embodiment of the invention, the interface test parameters and the engine execution parameters filled by the user are obtained by displaying the interface test parameter item, the engine identification item and the engine execution parameter item of the target interface template, and the interface test is executed according to the first target engine matched with the target interface template, so that the universality test of the multi-service interface under the interface test system is realized, the interface test efficiency is improved, the development of a plurality of interface test systems is avoided, and the time cost and the labor cost of system development are reduced.
Example two
Fig. 2 is a flowchart of an interface testing method according to a second embodiment of the present invention, which is embodied on the basis of the foregoing technical solutions, in which in this embodiment, an assertion mode item and an assertion execution parameter item in parameter item information are used to obtain an interface assertion result, and the method specifically includes:
s210, responding to the acquired template selection instruction, and displaying parameter item information of the target interface template; the parameter item information comprises an interface test parameter item, an engine identification item, an engine execution parameter item, an assertion mode and an assertion execution parameter.
Assertion is a debugging mechanism, which is composed of one or more Boolean expressions and is used for verifying whether the program code of the service interface meets the expectation of a coder or not; an assertion mode, namely a specific verification mode, wherein the assertion execution parameter is an assertion value matched with the assertion mode, namely an expected value of the verification mode; optionally, in this embodiment of the present invention, the assertion manner includes at least one of an equal value assertion, a greater than assertion, a less than assertion, a range assertion, a null assertion, and a regular assertion. The equivalence assertion is to judge whether the interface feedback information is equal to an assertion value, and the assertion value is a specific numerical value; if the value is greater than the assertion, judging whether the interface feedback information is greater than the assertion value, wherein the assertion value is also a specific numerical value; if the value is less than the assertion value, judging whether the interface feedback information is less than the assertion value, wherein the assertion value is also a specific numerical value; the scope assertion is to judge whether the interface feedback information is in a given scope interval or in a given enumeration value, and the assertion value is the scope interval or an enumeration set; empty assertion, namely judging whether the interface feedback information is empty or not, wherein an assertion value is correspondingly empty; and the regular assertion is to judge whether the interface feedback information is matched with a given regular expression, and the assertion value is the regular expression.
In particular, the assertion manner may also be a composite assertion, i.e., a combination of the above-mentioned multiple assertion manners, for example, the "and" relationship is represented by the symbol "& &", i.e., two or more assertion manners are satisfied simultaneously; the "or" relationship is represented by the symbol "|", that is, any of two or more assertion ways satisfies one; by the symbol! "represents a" not "relationship, i.e., as opposed to an asserted value; the "priority" relationship is represented by the symbol "()", i.e., the manner of assertion within the symbol is calculated preferentially; the interface test system can carry out personalized test on different service interfaces through diversified assertion modes, and testers can select different assertion modes according to the data characteristics of different service interfaces, so that the accuracy and the matching of test results are improved.
S220, acquiring interface test parameters, a first target engine, engine execution parameters, an assertion mode and assertion execution parameters according to the target interface template filled with the parameter item information.
After the interface test parameters, the first target engine, the engine execution parameters, the assertion mode and the assertion execution parameters are obtained, the interface test tasks are created and stored, and therefore multiplexing of the interface test tasks is achieved.
And S230, executing an interface test through the first target engine according to the interface test parameters and the engine execution parameters.
S240, obtaining an interface assertion result according to the interface feedback information, the assertion mode and the assertion execution parameter.
After the result data fed back by the interface is obtained, matching the result data with the assertion execution parameters according to the assertion mode to judge whether the result data conforms to the assertion execution parameters, namely whether the result data conforms to expected data; if the interface assertion result is not in line, the service interface is indicated to have code defects, and an error alarm is sent out.
Optionally, in this embodiment of the present invention, before obtaining an interface assertion result according to the interface feedback information, the assertion manner, and the assertion execution parameter, the method includes: if the data format of the interface feedback information is Json format, analyzing the interface feedback information through JsonPath; and if the data format of the interface feedback information is an Xml format, analyzing the interface feedback information through XPath. According to the return result format in the interface test parameter item, the data format of the obtained interface feedback information can be determined; JsonPath is an analysis tool of Json format data, is used as an information extraction class library, and can extract specified information from Json format texts; XPath is an analysis tool of data in an Xml format and is used for extracting specified information from a text in the Xml format; after analyzing the interface feedback information through JsonPath or XPath, matching the analysis result with an assertion execution parameter according to an assertion mode to judge whether the interface feedback information conforms to the assertion execution parameter; through the use of JsonPath and XPath, Json assertion and Xml assertion of a service interface are realized, data diversity of interface testing is ensured, and test support of service interfaces with different data formats is realized.
According to the technical scheme provided by the embodiment of the invention, after the assertion mode and the assertion execution parameter are obtained according to the assertion mode item and the assertion execution parameter item in the parameter item information, the interface assertion result is obtained through the interface feedback information, the assertion mode and the assertion execution parameter, so that the assertion test of the service interface is realized, whether the code of the service interface is accurate or not is verified, the service processing performance of the interface is improved, and meanwhile, the test support of the service interfaces with different data formats is also ensured due to the data diversity of the interface test.
EXAMPLE III
Fig. 3 is a block diagram of an interface test system disclosed in the third embodiment of the present invention, which specifically includes: an interaction execution module 310, an interface template management module 320, an engine management module 330, a configuration execution module 340, a call execution module 350, a result analysis module 360, and a storage module 370.
The interactive execution module 310 is configured to acquire a template selection instruction, and in response to acquiring the template selection instruction, display parameter item information of the target interface template; acquiring a template newly-increased instruction, and displaying an interface template editing template in response to the acquisition of the template newly-increased instruction so as to acquire an edited newly-increased interface template; acquiring a first engine newly-added instruction, and displaying an engine editing template in response to the acquisition of the first engine newly-added instruction so as to acquire an edited first newly-added engine; obtaining an engine selection instruction through an interface template editing template, and displaying an engine execution parameter item of a second target engine in the interface template editing template; acquiring a second engine newly-added instruction through the interface template editing template, and displaying the engine editing template in the interface template editing template to acquire a second newly-added engine after editing; acquiring a task selection instruction, and executing a target interface test task by calling an execution module in response to the acquisition of the task selection instruction; and displaying the interface assertion result.
The interface template management module 320 is configured to obtain a matched target interface template in the storage module 370 according to the template selection instruction sent by the interaction execution module 310, and send the target interface template to the interaction execution module 310; according to the template adding instruction sent by the interactive execution module 310, an interface template editing template is obtained in the storage module 370, and the interface template editing template is sent to the interactive execution module 310; and sending the edited newly added interface template to the storage module 370.
The engine management module 330 is configured to obtain an engine edit template in the storage module 370 according to the first engine addition instruction or the second engine addition instruction sent by the interactive execution module 310, and send the engine edit template to the interactive execution module 310; sending the edited first and second added engines to the storage module 370; the engine execution parameter item of the second target engine is obtained through parsing according to the engine selection instruction sent by the interactive execution module 310, and the engine execution parameter item of the second target engine is sent to the interactive execution module 310.
The configuration execution module 340 is configured to obtain an interface test parameter, a first target engine and an engine execution parameter according to the target interface template filled with the parameter item information; or acquiring interface test parameters, a first target engine, engine execution parameters, an assertion mode and assertion execution parameters according to the target interface template which is filled according to the parameter item information.
The execution module 350 is invoked for executing the interface test through the first target engine in the storage module 370 according to the interface test parameters and the engine execution parameters.
The result analysis module 360 is configured to obtain an interface test result according to the interface feedback information sent by the first target engine; or obtaining the interface assertion result according to the interface feedback information, the assertion mode and the assertion execution parameter.
The storage module 370 is used for storing interface templates, interface template editing templates, engines, engine editing templates, interface testing tasks and interface assertion results.
According to the technical scheme provided by the embodiment of the invention, the interface test system displays the interface test parameter item, the engine identification item and the engine execution parameter item of the target interface template through the interactive execution module, acquires the interface test parameters and the engine execution parameters filled by a user through the configuration execution module, and executes the interface test by calling the execution module and the first target engine matched with the target interface template, so that the universality test of a multi-service interface under the interface test system is realized, the interface test efficiency is improved, the development of a plurality of interface test systems is avoided, and the time cost and the labor cost of system development are reduced.
Example four
Fig. 4 is a block diagram of an interface testing apparatus according to a fourth embodiment of the present invention, where the apparatus specifically includes: a target interface template display module 410, a parameter acquisition module 420 and an interface test result acquisition module 430;
a target interface template display module 410, configured to display parameter item information of a target interface template in response to obtaining the template selection instruction; wherein the parameter item information comprises an interface test parameter item, an engine identification item and an engine execution parameter item;
a parameter obtaining module 420, configured to obtain an interface test parameter, a first target engine, and an engine execution parameter according to the target interface template filled with the parameter item information;
and an interface test result obtaining module 430, configured to execute an interface test through the first target engine according to the interface test parameters and the engine execution parameters, and obtain an interface test result according to interface feedback information.
According to the technical scheme provided by the embodiment of the invention, the interface test parameters and the engine execution parameters filled by the user are obtained by displaying the interface test parameter item, the engine identification item and the engine execution parameter item of the target interface template, and the interface test is executed according to the first target engine matched with the target interface template, so that the universality test of the multi-service interface under the interface test system is realized, the interface test efficiency is improved, the development of a plurality of interface test systems is avoided, and the time cost and the labor cost of system development are reduced.
Optionally, on the basis of the above technical solution, the interface testing apparatus further includes:
the interface template editing template display module is used for displaying the interface template editing template in response to the template newly-increased instruction so as to obtain an edited newly-increased interface template;
and/or the engine editing template display module is used for displaying the engine editing template in response to the acquisition of the first engine newly added instruction so as to acquire the edited first newly added engine.
Optionally, on the basis of the above technical solution, the interface template editing template display module further includes:
the engine selection instruction acquisition unit is used for displaying an engine execution parameter item of a second target engine in the interface template editing template if the engine selection instruction is acquired through the interface template editing template;
and the second engine newly-added instruction acquisition unit is used for displaying the engine editing template in the interface template editing template to acquire the edited second newly-added engine if the second engine newly-added instruction is acquired through the interface template editing template.
Optionally, on the basis of the above technical solution, the parameter item information further includes an assertion mode item and an assertion execution parameter item.
Optionally, on the basis of the above technical solution, the parameter obtaining module is further specifically configured to obtain an assertion manner and an assertion execution parameter according to the target interface template that is filled in by the parameter item information.
Optionally, on the basis of the above technical solution, the interface test result obtaining module is specifically configured to obtain the interface assertion result according to the interface feedback information, the assertion manner, and the assertion execution parameter.
Optionally, on the basis of the above technical solution, the interface testing apparatus further includes:
the interface test task storage module is used for creating and storing an interface test task according to the interface test parameters, the first target engine and the engine execution parameters; or creating and storing an interface test task according to the interface test parameters, the first target engine, the engine execution parameters, the assertion mode and the assertion execution parameters.
Optionally, on the basis of the above technical solution, the interface testing apparatus further includes:
and the task selection instruction acquisition module is used for responding to the acquired task selection instruction and executing the target interface test task.
Optionally, on the basis of the above technical solution, the assertion manner includes at least one of an equal value assertion, a greater value assertion, a smaller value assertion, a range assertion, a null assertion, and a regular assertion.
Optionally, on the basis of the above technical solution, the interface testing apparatus further includes:
the first analysis execution module is used for analyzing the interface feedback information through JsonPath if the data format of the interface feedback information is Json format;
and the second analysis execution module is used for analyzing the interface feedback information through XPath if the data format of the interface feedback information is the Xml format.
The device can execute the interface test method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method. For technical details not described in detail in this embodiment, reference may be made to the method provided in any embodiment of the present invention.
EXAMPLE five
Fig. 5 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention. FIG. 5 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 5 is only an example and should not bring any limitation to the function and the scope of use of the embodiment of the present invention.
As shown in FIG. 5, electronic device 12 is embodied in the form of a general purpose computing device. The components of electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a memory 28, and a bus 18 that couples various system components including the memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, and commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with electronic device 12, and/or with any devices (e.g., network card, modem, etc.) that enable electronic device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing, for example, implementing the interface test method provided by the embodiment of the present invention, by executing the program stored in the memory 28. Namely: in response to the template selection instruction, displaying parameter item information of the target interface template; wherein the parameter item information comprises an interface test parameter item, an engine identification item and an engine execution parameter item; acquiring interface test parameters, a first target engine and engine execution parameters according to the target interface template which is filled in according to the parameter item information; and executing the interface test through the first target engine according to the interface test parameters and the engine execution parameters, and acquiring an interface test result according to interface feedback information.
EXAMPLE six
The sixth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the interface testing method according to any embodiment of the present invention; the method comprises the following steps:
in response to the template selection instruction, displaying parameter item information of the target interface template; wherein the parameter item information comprises an interface test parameter item, an engine identification item and an engine execution parameter item;
acquiring interface test parameters, a first target engine and engine execution parameters according to the target interface template which is filled in according to the parameter item information;
and executing the interface test through the first target engine according to the interface test parameters and the engine execution parameters, and acquiring an interface test result according to interface feedback information.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. An interface test method is applied to an interface test system, and comprises the following steps:
in response to the template selection instruction, displaying parameter item information of the target interface template; wherein the parameter item information comprises an interface test parameter item, an engine identification item and an engine execution parameter item;
acquiring interface test parameters, a first target engine and engine execution parameters according to the target interface template which is filled in according to the parameter item information;
and executing the interface test through the first target engine according to the interface test parameters and the engine execution parameters, and acquiring an interface test result according to interface feedback information.
2. The method of claim 1, wherein the interface testing method further comprises:
in response to the template newly-increased instruction, displaying an interface template editing template to obtain an edited newly-increased interface template;
and/or in response to the first engine addition instruction is acquired, displaying the engine editing template to acquire the edited first addition engine.
3. The method of claim 2, after the exposing the interface template editing template, further comprising:
if an engine selection instruction is acquired through the interface template editing template, displaying an engine execution parameter item of a second target engine in the interface template editing template;
and if a second engine newly-added instruction is obtained through the interface template editing template, displaying the engine editing template in the interface template editing template to obtain a second newly-added engine after editing.
4. The method of claim 1, wherein the parameter item information further comprises an assertion manner item and an assertion execution parameter item;
after the parameter item information of the target interface template is displayed, the method further comprises the following steps:
acquiring an assertion mode and an assertion execution parameter according to the target interface template filled with the parameter item information;
the obtaining of the interface test result according to the interface feedback information includes:
and acquiring an interface assertion result according to the interface feedback information, the assertion mode and the assertion execution parameter.
5. The method as claimed in claim 4, wherein after the target interface template completed according to the parameter item information is filled in, interface test parameters, a first target engine and engine execution parameters are obtained, the method further comprises:
creating and storing an interface test task according to the interface test parameters, the first target engine and the engine execution parameters;
or creating and storing an interface test task according to the interface test parameters, the first target engine, the engine execution parameters, the assertion mode and the assertion execution parameters;
and executing the target interface test task in response to the acquired task selection instruction.
6. The method of claim 4, wherein the manner of assertion comprises at least one of an equal value assertion, a greater than assertion, a less than assertion, a range assertion, a null assertion, and a regular assertion.
7. The method according to claim 6, before obtaining the interface assertion result according to the interface feedback information, the assertion manner, and the assertion execution parameter, comprising:
if the data format of the interface feedback information is Json format, analyzing the interface feedback information through JsonPath;
and if the data format of the interface feedback information is an Xml format, analyzing the interface feedback information through XPath.
8. An interface testing device, which is applied to an interface testing system, comprises:
the target interface template display module is used for responding to the acquired template selection instruction and displaying the parameter item information of the target interface template; wherein the parameter item information comprises an interface test parameter item, an engine identification item and an engine execution parameter item;
the parameter acquisition module is used for acquiring interface test parameters, a first target engine and engine execution parameters according to the target interface template which is filled in according to the parameter item information;
and the interface test result acquisition module is used for executing the interface test through the first target engine according to the interface test parameters and the engine execution parameters and acquiring an interface test result according to interface feedback information.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the interface testing method of any one of claims 1-7.
10. A storage medium containing computer-executable instructions for performing the interface testing method of any one of claims 1-7 when executed by a computer processor.
CN202111098322.0A 2021-09-18 2021-09-18 Interface testing method and device, electronic equipment and storage medium Pending CN113836014A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111098322.0A CN113836014A (en) 2021-09-18 2021-09-18 Interface testing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111098322.0A CN113836014A (en) 2021-09-18 2021-09-18 Interface testing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113836014A true CN113836014A (en) 2021-12-24

Family

ID=78959915

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111098322.0A Pending CN113836014A (en) 2021-09-18 2021-09-18 Interface testing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113836014A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115002014A (en) * 2022-05-16 2022-09-02 青岛海尔科技有限公司 Method and device for determining test result, storage medium and electronic device
CN115827497A (en) * 2023-02-16 2023-03-21 江西汉辰信息技术股份有限公司 Test sample generation method and device, readable storage medium and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021090A (en) * 2016-05-04 2016-10-12 上海瀚银信息技术有限公司 Software interface test system and method
CN110674047A (en) * 2019-09-26 2020-01-10 北京字节跳动网络技术有限公司 Software testing method and device and electronic equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021090A (en) * 2016-05-04 2016-10-12 上海瀚银信息技术有限公司 Software interface test system and method
CN110674047A (en) * 2019-09-26 2020-01-10 北京字节跳动网络技术有限公司 Software testing method and device and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
SMARTBEAR: "soapui", Retrieved from the Internet <URL:https://github.com/SmartBear/soapui/tree/release-5.5.0> *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115002014A (en) * 2022-05-16 2022-09-02 青岛海尔科技有限公司 Method and device for determining test result, storage medium and electronic device
CN115002014B (en) * 2022-05-16 2024-03-22 青岛海尔科技有限公司 Method and device for determining test result, storage medium and electronic device
CN115827497A (en) * 2023-02-16 2023-03-21 江西汉辰信息技术股份有限公司 Test sample generation method and device, readable storage medium and electronic equipment
CN115827497B (en) * 2023-02-16 2023-05-05 江西汉辰信息技术股份有限公司 Test sample generation method and device, readable storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
US11822919B2 (en) Auto-generation of API documentation via implementation-neutral analysis of API traffic
CN109302522B (en) Test method, test device, computer system, and computer medium
US7877732B2 (en) Efficient stress testing of a service oriented architecture based application
CN110543297B (en) Method and apparatus for generating source code
CN110688142A (en) Method, device and storage medium for publishing application programming interface
CN113900958A (en) Test case script generation method, system, medium and electronic device
CN113032244B (en) Interface test method, device, computer system and computer readable storage medium
US11741002B2 (en) Test automation systems and methods using logical identifiers
CN113836014A (en) Interface testing method and device, electronic equipment and storage medium
CN111694561A (en) Interface management method, device, equipment and storage medium
CN110780874A (en) Method and apparatus for generating information
CN113778897A (en) Automatic test method, device, equipment and storage medium of interface
CN110888641B (en) Script automatic generation method and device, server and storage medium
CN111078529B (en) Client writing module testing method and device and electronic equipment
CN111666201A (en) Regression testing method, device, medium and electronic equipment
CN113238940B (en) Interface test result comparison method, device, equipment and storage medium
CN115421770A (en) Resource information processing method and device, storage medium and electronic equipment
CN112131611B (en) Data correctness verification method, device, equipment, system and storage medium
CN109062797B (en) Method and device for generating information
CN112860584A (en) Test method and device based on workflow model
CN113485927A (en) Test data generation method, device, equipment and storage medium
CN113641575A (en) Test method, device, equipment and storage medium
CN112948266B (en) Database grammar testing system, method, device, equipment and storage medium
CN112988593B (en) Code analysis method, device, computer equipment and storage medium
Mengistu Distributed Microservice Tracing Systems: Open-source tracing implementation for distributed Microservices build in Spring framework

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