CN108733569B - Interface automatic testing method and device, storage medium and equipment - Google Patents

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

Info

Publication number
CN108733569B
CN108733569B CN201810516596.9A CN201810516596A CN108733569B CN 108733569 B CN108733569 B CN 108733569B CN 201810516596 A CN201810516596 A CN 201810516596A CN 108733569 B CN108733569 B CN 108733569B
Authority
CN
China
Prior art keywords
interface
test
verification
tested
script
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.)
Active
Application number
CN201810516596.9A
Other languages
Chinese (zh)
Other versions
CN108733569A (en
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 58 Information Technology Co Ltd
Original Assignee
Beijing 58 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 58 Information Technology Co Ltd filed Critical Beijing 58 Information Technology Co Ltd
Priority to CN201810516596.9A priority Critical patent/CN108733569B/en
Publication of CN108733569A publication Critical patent/CN108733569A/en
Application granted granted Critical
Publication of CN108733569B publication Critical patent/CN108733569B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Abstract

The invention discloses an interface automatic test method, a device, a storage medium and equipment, comprising: adding a test set of an interface to be tested in a hypertext transfer protocol (HTTP) request simulation tool; creating a set of interface verification functions within the test set; verifying an interface return parameter of the interface to be tested by using the interface verification function set to obtain an interface verification script and an environment variable; and integrating the interface verification script and the environment variable on a continuous integration tool, and carrying out automatic verification test on the interface to be tested by using the continuous integration tool. The interface verification method has the advantages that the interface is automatically verified and tested, so that the automatic real-time monitoring of the interface is realized, the human resources are saved, the interface verification is not easy to make mistakes or miss testing, and the testing efficiency of the interface verification is improved.

Description

Interface automatic testing method and device, storage medium and equipment
Technical Field
The invention relates to the technical field of computers, in particular to an interface automatic testing method, an interface automatic testing device, a storage medium and equipment.
Background
At present, the steps of manually testing and verifying the interface return state, returning response time, returning result and the like are as follows:
1. configuring the agent and the port through a packet capturing tool Fiddler or Charles and the like;
2. opening a specific application program to access a specific page;
3. after capturing a specific interface request, checking interface request results such as interface return state Code, interface return Response Time, interface return result Body and the like;
4. and verifying the number and format types of return values in the interface request result by comparing the interface document.
However, for millions of application programs, the stability of the online interface is crucial, but manual testing verifies the return state, the return time, the return result, and the like of the interface, which are time-consuming, labor-consuming, and prone to error or missing, and greatly affects the testing progress and efficiency of the product tester QA.
Disclosure of Invention
The embodiment of the invention provides an interface automatic testing method, device, storage medium and equipment, which are used for solving the problems that manual testing and verification of an interface in the prior art are time-consuming, labor-consuming, low in efficiency and prone to errors or missing testing.
In a first aspect, an embodiment of the present invention provides an interface automation test method, including:
adding a test set of an interface to be tested in a hypertext transfer protocol (HTTP) request simulation tool;
creating a set of interface verification functions within the test set;
verifying the interface return parameters of the interface to be tested by using the interface verification function set to obtain an interface verification script and an environment variable;
and integrating the interface verification script and the environment variable on a continuous integration tool, and carrying out automatic verification test on the interface to be tested by using the continuous integration tool.
Optionally, after the test set of the interface to be tested is added, the method further includes:
configuring an interface request parameter for requesting the interface to be tested to return the parameter to the interface in the test set;
and initiating a request to the interface to be tested through the interface request parameter so as to obtain the interface return parameter fed back by the interface to be tested.
Optionally, the utilizing the continuous integration tool to perform an automatic verification test on the interface to be tested includes:
performing variable configuration on the environment variables in the continuous integration tool; wherein the configured variables include: testing a variable and a script path of the interface verification script;
and determining the interface verification script according to the script path, and executing the interface verification script according to the test variable to realize the automatic verification test of the interface to be tested.
Optionally, the test variables include one or more of the following variables:
a test execution command;
testing the execution frequency; and
and the notification parameter is used for notifying the interface of a failure message of the execution process of the verification script.
Optionally, the interface return parameter includes one or more of the following parameters:
the interface returns to the status Response Code;
the interface returns a Response Time; and
the interface returns a result Response Body.
In a second aspect, an embodiment of the present invention provides an interface automation test apparatus, including:
the adding module is used for adding a test set of the interface to be tested in a hypertext transfer protocol (HTTP) request simulation tool;
the creating module is used for creating an interface verification function set in the test set;
the verification module is used for verifying the interface return parameters of the interface to be tested by using the interface verification function set so as to obtain an interface verification script and an environment variable;
and the test module is used for integrating the interface verification script and the environment variable into a continuous integration tool and utilizing the continuous integration tool to carry out automatic verification test on the interface to be tested.
Optionally, the method further includes:
a configuration module, configured to configure, in the test set, an interface request parameter for requesting the interface to be tested for the interface return parameter;
and the request module is used for initiating a request to the interface to be tested through the interface request parameter so as to acquire the interface return parameter fed back by the interface to be tested.
Optionally, the test module includes:
the variable configuration unit is used for carrying out variable configuration on the environment variables in the continuous integration tool; wherein the configured variables include: testing a variable and a script path of the interface verification script;
and the execution unit is used for determining the interface verification script according to the script path and executing the interface verification script according to the test variable so as to realize automatic verification test on the interface to be tested.
Optionally, the test variable includes one or more of the following parameters:
a test execution command;
testing the execution frequency; and
and the notification parameter is used for notifying the interface of a failure message of the execution process of the verification script.
Optionally, the interface return parameter includes one or more of the following parameters:
the interface returns to the status Response Code;
the interface returns a Response Time; and
the interface returns a result Response Body.
In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the following method steps:
adding a test set of an interface to be tested in a hypertext transfer protocol (HTTP) request simulation tool;
creating a set of interface verification functions within the test set;
verifying the interface return parameters of the interface to be tested by using the interface verification function set to obtain an interface verification script and an environment variable;
and integrating the interface verification script and the environment variable on a continuous integration tool, and carrying out automatic verification test on the interface to be tested by using the continuous integration tool.
In a fourth aspect, an embodiment of the present invention provides a computer device, where the computer device includes: memory, a processor and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the method:
adding a test set of an interface to be tested in a hypertext transfer protocol (HTTP) request simulation tool;
creating a set of interface verification functions within the test set;
verifying the interface return parameters of the interface to be tested by using the interface verification function set to obtain an interface verification script and an environment variable;
and integrating the interface verification script and the environment variable on a continuous integration tool, and carrying out automatic verification test on the interface to be tested by using the continuous integration tool.
The embodiment of the invention has the beneficial effects that:
according to the embodiment of the invention, the automatic verification test is carried out on the interface, so that the automatic real-time monitoring of the interface is realized, the human resources are saved, the error or test missing of the interface verification is not easy to occur, and the test efficiency of the interface verification is improved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various additional advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart of an interface automated testing method according to a first embodiment of the present invention;
FIG. 2 is a flowchart of an automated interface testing method according to a second embodiment of the present invention;
FIG. 3 is a flowchart of an automated interface testing method according to a third embodiment of the present invention;
FIG. 4 is a block diagram of an interface automatic testing apparatus according to a fourth, a fifth and a sixth embodiment of the present invention;
FIG. 5 is a flowchart of a seventh method for automated testing of an interface according to the present invention;
in the figure: 1-adding module, 2-creating module, 3-verifying module, 4-testing module, 41-variable configuration unit, 42-executing unit, 5-configuration module and 6-requesting module.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
A first embodiment of the present invention provides an automated interface testing method, as shown in fig. 1, including the following specific steps:
step S11, adding a test set of the interface to be tested in a hypertext transfer protocol HTTP request simulation tool; optionally, the HTTP request simulation tool may be an extensible hypertext transfer request XmlHttpRequest or a load testing tool loadrunner or Postman that predicts system behavior and performance, and may be specifically selected according to requirements of an actual test project. When the HTTP request simulation tool in the embodiment of the invention adopts a Postman tool, a test set Collections of the interfaces to be tested are added on the Postman tool.
Step S12, creating an interface verification function set in the test set; optionally, in the actual test engineering, the interface verification function set may exist in the form of an interface verification code, for example, the interface verification code may be written under Collections added on the Postman tool.
Step S13, verifying the interface return parameters of the interface to be tested by using the interface verification function set to obtain an interface verification script and an environment variable; in an alternative embodiment of the present invention, the interface return parameters include an interface return status Response Code, an interface return Response Time, and an interface return result Response Body, so that the number and format types of the interface return parameters can be compared by using the interface verification function set.
And step S14, integrating the interface verification script and the environment variable onto the continuous integration tool, and performing automatic verification test on the interface to be tested by using the continuous integration tool. Optionally, in the embodiment of the present invention, the continuous integration tool may adopt a Jenkins tool, the Jenkins tool is used to implement an automatic monitoring interface verification test process, the stability of the online interface can be monitored in real time, the disadvantage that manual testing is time-consuming and easy to make mistakes and miss testing can be avoided, the cost for code language learning and compiling of testers can be saved, the time cost of testing is greatly reduced compared with a fast iterative project, the testing quality and efficiency are improved, and human resources are saved.
A second embodiment of the present invention provides an interface automated testing method, as shown in fig. 2, including the following specific steps:
s21, adding a test set of the interface to be tested in a hypertext transfer protocol (HTTP) request simulation tool;
s22, creating an interface verification function set in the test set;
s23, configuring interface request parameters for returning parameters to the interface request interface to be tested in the test set; optionally, when the Postman tool is used, the interface request parameters are configured in the test set Collections added to the Postman tool.
It should be noted that the sequence of step S22 and step S23 in the embodiment of the present invention may be determined according to actual test engineering conditions, and the embodiment of the present invention is not limited herein.
S24, initiating a request to the interface to be tested through the interface request parameter to obtain an interface return parameter fed back by the interface to be tested; in an alternative embodiment of the present invention, the interface return parameters include an interface return status Response Code, an interface return Response Time, and an interface return result Response Body.
And S25, verifying the interface return parameters of the interface to be tested by using the interface verification function set to obtain an interface verification script and an environment variable.
And S26, integrating the interface verification script and the environment variable onto a continuous integration tool, and performing automatic verification test on the interface to be tested by using the continuous integration tool.
Therefore, the embodiment of the invention automatically sends the request to the interface to be tested to obtain the interface return parameters through the interface request parameters arranged in the test set, does not need to rely on a bale catching tool, integrates the obtained interface verification script and the environment variable to a continuous integration tool such as a Jenkins tool after verifying the interface return parameters by using the interface verification function set, and performs automatic verification test on the interface to be tested by using the Jenkins tool, thereby realizing automatic real-time monitoring on the interface, saving human resources, preventing the interface from being easily subjected to error or missing test, and improving the test efficiency of the interface verification.
A third embodiment of the present invention provides an interface automated testing method, as shown in fig. 3, including the following specific steps:
s31, adding a test set of the interface to be tested in a hypertext transfer protocol (HTTP) request simulation tool;
s32, creating an interface verification function set in the test set;
s33, configuring interface request parameters for returning parameters to the interface request interface to be tested in the test set;
s34, initiating a request to the interface to be tested through the interface request parameter to obtain an interface return parameter fed back by the interface to be tested; in an optional embodiment of the present invention, the interface return parameters include an interface return state Response Code, an interface return Response Time and an interface return result Response Body;
s35, verifying the interface return parameters of the interface to be tested by using the interface verification function set to obtain an interface verification script and an environment variable;
s36, integrating the interface verification script and the environment variable into a continuous integration tool, such as integrating the interface verification script and the environment variable into a Jenkins tool;
s37, carrying out variable configuration on the environment variables in the continuous integration tool; wherein the configured variables include: testing a script path of the variable and interface verification script;
s38, determining an interface verification script according to the script path, and executing the interface verification script according to the test variable to realize the automatic verification test of the interface to be tested; in an optional embodiment of the present invention, the test variable includes a test execution command, a test execution frequency, and a notification parameter, where the notification parameter is used to notify an interface of a failure message in the process of verifying the script execution, and optionally, the notification may be performed in a manner of an email or in a manner of a pop-up window when the failure message is notified, which is not limited herein. Therefore, in the optional embodiment of the invention, the determined interface verification script is executed according to the test variable, the interface verification script is executed at intervals according to the test execution frequency in the process of executing the interface verification script, and the failure message generated in the execution process of the interface verification script is notified through the set notification parameter, so that a product tester can find the problem in the verification process in time, and the test quality and efficiency are ensured.
A fourth embodiment of the present invention provides an interface automation test apparatus, as shown in fig. 4, including:
the adding module 1 is used for adding a test set of an interface to be tested in a hypertext transfer protocol (HTTP) request simulation tool; optionally, the HTTP request simulation tool may be an extensible hypertext transfer request XmlHttpRequest or a load testing tool loadrunner or Postman that predicts system behavior and performance, and may be specifically selected according to requirements of an actual test project. When the HTTP request simulation tool in the embodiment of the invention adopts the Postman tool, the test set Collections of the interfaces to be tested are added on the Postman tool through the adding module 1.
The creating module 2 is used for creating an interface verification function set in the test set; optionally, in the actual test engineering, the interface verification function set may exist in the form of an interface verification code, for example, the interface verification code is written by the creation module 2 under the Collections added by the addition module 1 on the Postman tool.
The verification module 3 is used for verifying the interface return parameters of the interface to be tested by using the interface verification function set so as to obtain an interface verification script and an environment variable; in an alternative embodiment of the present invention, the interface return parameters include an interface return state Response Code, an interface return Response Time, and an interface return result Response Body, so that the number and format types of the interface return parameters can be compared by the verification module 3 using the interface verification function set.
And the test module 4 is used for integrating the interface verification script and the environment variable into the continuous integration tool and carrying out automatic verification test on the interface to be tested by using the continuous integration tool. Optionally, in the embodiment of the present invention, the continuous integration tool may adopt a Jenkins tool, and the test module 4 uses the Jenkins tool to realize an automatic monitoring of the interface verification test process, so that the stability of the on-line interface can be monitored in real time, the defects that manual testing is time consuming, error prone and test missing are avoided, the cost of code language learning and compiling of testers can be saved, time cost is greatly reduced compared with a fast iterative project, the test quality and efficiency are improved, and human resources are saved. The script is easy to compile, the tester is fast to operate, the subsequent regression verification is convenient, the script is easy to maintain, and the efficiency of the whole verification project is improved to a certain extent.
A fifth embodiment of the present invention provides an interface automation test apparatus, as shown in fig. 4, including:
the adding module 1 is used for adding a test set of an interface to be tested in a hypertext transfer protocol (HTTP) request simulation tool; optionally, the HTTP request simulation tool in the embodiment of the present invention may adopt a Postman tool, and add the test set Collections of the interfaces to be tested on the Postman tool through the adding module 1.
The creating module 2 is used for creating an interface verification function set in the test set; optionally, in the actual test engineering, the interface verification function set may exist in the form of an interface verification code, for example, the interface verification code is written by the creation module 2 under the Collections added by the addition module 1 on the Postman tool.
A configuration module 5, configured to configure, in the test set, an interface request parameter for requesting the interface to be tested to return the parameter; optionally, when the Postman tool is used, the interface request parameter and the interface variable corresponding to the interface request parameter are configured in the test set Collections added to the Postman tool through the configuration module 5.
The request module 6 is used for initiating a request to the interface to be tested through the interface request parameter so as to obtain an interface return parameter fed back by the interface to be tested; in an alternative embodiment of the present invention, the interface return parameters include an interface return status Response Code, an interface return Response Time, and an interface return result Response Body.
The verification module 3 is used for verifying the interface return parameters of the interface to be tested by using the interface verification function set so as to obtain an interface verification script and an environment variable; namely, the verification module 3 compares the number and format types of the parameters returned by each interface by using the interface verification function set.
And the test module 4 is used for integrating the interface verification script and the environment variable into the continuous integration tool and carrying out automatic verification test on the interface to be tested by using the continuous integration tool. Optionally, in the embodiment of the present invention, the continuous integration tool may adopt a Jenkins tool, and the test module 4 implements an automatic monitoring interface verification test process by using the Jenkins tool.
It can be seen that in the embodiment of the present invention, the configuration module 5 sets the interface request parameter in the test set, and the request module 6 automatically initiates a request to the interface to be tested to obtain the interface return parameter, and after verifying the interface return parameter by using the interface verification function set, the obtained interface verification script and the environment variable are integrated into a continuous integration tool such as Jenkins, and the Jenkins tool is used to perform an automatic verification test on the interface to be tested, thereby implementing automatic real-time monitoring on the interface, saving human resources, preventing errors or missing in interface verification, and improving the test efficiency of interface verification.
A sixth embodiment of the present invention provides an interface automation test apparatus, as shown in fig. 4, including:
the adding module 1 is used for adding a test set of an interface to be tested in a hypertext transfer protocol (HTTP) request simulation tool; optionally, the HTTP request simulation tool in the embodiment of the present invention may adopt a Postman tool, and add the test set Collections of the interfaces to be tested on the Postman tool through the adding module 1.
The creating module 2 is used for creating an interface verification function set in the test set; optionally, in the actual test engineering, the interface verification function set may exist in the form of an interface verification code, for example, the interface verification code is written by the creation module 2 under the Collections added by the addition module 1 on the Postman tool.
A configuration module 5, configured to configure, in the test set, an interface request parameter for requesting the interface to be tested to return the parameter; optionally, when the Postman tool is used, the interface request parameters are configured through the configuration module 5 in the test set Collections added to the Postman tool.
The request module 6 is used for initiating a request to the interface to be tested through the interface request parameter so as to obtain an interface return parameter fed back by the interface to be tested without depending on a packet capturing tool; in an alternative embodiment of the present invention, the interface return parameters include an interface return status Response Code, an interface return Response Time, and an interface return result Response Body.
The verification module 3 is used for verifying the interface return parameters of the interface to be tested by using the interface verification function set so as to obtain an interface verification script and an environment variable; namely, the verification module 3 compares the number and format types of the parameters returned by each interface by using the interface verification function set.
And the test module 4 is used for integrating the interface verification script and the environment variable into the continuous integration tool and carrying out automatic verification test on the interface to be tested by using the continuous integration tool. Optionally, in an embodiment of the present invention, the continuous integration tool may be a Jenkins tool.
Optionally, the test module 4 includes:
a variable configuration unit 41, configured to perform variable configuration on the environment variables in the persistent integration tool; wherein the configured variables include: testing a script path of the variable and interface verification script;
and the execution unit 42 is used for determining the interface verification script according to the script path, and executing the interface verification script according to the test variable to realize the automatic verification test of the interface to be tested. In an optional embodiment of the present invention, the test variable includes a test execution command, a test execution frequency, and a notification parameter, and therefore, in the optional embodiment of the present invention, the execution unit 42 executes the interface verification script according to the configuration of the test variable by the variable configuration unit 41, and in a process of executing the interface verification script by the execution unit 42, how often the interface verification script is executed is determined by the test execution frequency set by the variable configuration unit 41, and meanwhile, a failure message generated in the execution process of the interface verification script is notified by the notification parameter set by the variable configuration unit 41, optionally, the failure message may be notified by a mail, or may be notified by a pop-up window, which is not limited uniquely herein. Therefore, product testers can find problems in the verification process in time, and the testing quality and efficiency are guaranteed.
A seventh embodiment of the present invention is, on the basis of the above six embodiments, described with reference to fig. 5, an application example of the present invention, which takes an HTTP request simulation tool Postman and a persistent integration tool Jenkins as examples.
The installation and configuration of Postman and Jenkins tools in the embodiments of the present invention are not described herein in detail.
1. Adding a tested interface test set Collections on a Postman tool, then configuring request parameters and variables corresponding to the request parameters under the Collections, and writing an interface verification Code, wherein the interface verification Code can perform quick verification by aiming at a corresponding test method of an interface return state Response Code, an interface return Response Time and an interface return result Response Body, so that the coverage is comprehensive and effective, and the test omission can be avoided.
2. Exporting a required environment variable JSON file and a monitored interface script JSON file by using a Postman tool;
3. newly building a task on a Jenkins tool, and configuring environment variables such as automatic execution frequency, execution commands, mail notification and the like;
4. and checking an online monitoring result through a report automatically constructed by Jenkins and analyzing the report.
Compared with a manual test verification interface or verification of a compiling interface of code languages such as Python, Java and the like, the invention integrates the advantages of two schemes, relevant personnel only need to export a script file on Postman and configure an automatic execution command, execution frequency and failure mail notification on Jenkins by compiling a simple verification interface script generated by a Tests script code through a template in a Postman tool, and the stability of an online interface can be monitored in real time. The method can avoid the defects that manual testing is time-consuming and easy to make mistakes and miss testing, can find problems in time and save the cost of code language learning and compiling of testers, greatly reduces the cost of testing time relative to a fast iterative project, and simultaneously ensures the testing quality and efficiency.
Therefore, the embodiment of the invention solves the problems that the manual test verifies that the interface is low in efficiency and can be missed to be tested, and the problem is not found timely, the functional test is covered comprehensively, the test efficiency is improved, the automatic real-time monitoring can be realized, and the human resources are liberated; the script is easy to compile, the tester is fast to operate, the subsequent regression verification is convenient, the script is easy to maintain, the test quality is guaranteed aiming at the fast iterative project, and the efficiency of the whole project is improved to a certain extent.
An eighth embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, implementing the steps of the method comprising:
step S11, adding a test set of the interface to be tested in a hypertext transfer protocol HTTP request simulation tool;
step S12, creating an interface verification function set in the test set;
step S13, verifying the interface return parameters of the interface to be tested by using the interface verification function set to obtain an interface verification script and an environment variable;
and step S14, integrating the interface verification script and the environment variable onto the continuous integration tool, and performing automatic verification test on the interface to be tested by using the continuous integration tool.
The specific embodiment of the above method steps can be referred to in the second to third embodiments, and the detailed description of this embodiment is not repeated here.
A ninth embodiment of the present invention provides a computer apparatus including: a memory, a processor and a computer program stored on the memory and executable on the processor, the computer program when executed by the processor implementing the steps of the method of:
step S11, adding a test set of the interface to be tested in a hypertext transfer protocol (HTTP) request simulation tool;
step S12, creating an interface verification function set in the test set;
step S13, verifying the interface return parameters of the interface to be tested by using the interface verification function set to obtain an interface verification script and an environment variable;
and step S14, integrating the interface verification script and the environment variable onto the continuous integration tool, and performing automatic verification test on the interface to be tested by using the continuous integration tool.
The specific embodiment of the above method steps can be referred to in the second to third embodiments, and the detailed description of this embodiment is not repeated here.
It should be noted that, in this document, 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 an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that the invention can be practiced without departing from the spirit of the invention and the scope of the appended claims
In the context of the present invention, many forms may be made which are within the scope of the present invention.

Claims (12)

1. An automated interface testing method, comprising:
adding a test set of an interface to be tested in a hypertext transfer protocol (HTTP) request simulation tool;
creating a set of interface verification functions within the test set;
verifying the interface return parameters of the interface to be tested by using the interface verification function set to obtain an interface verification script and an environment variable;
integrating the interface verification script and the environment variable onto a continuous integration tool, and performing automatic verification test on the interface to be tested by using the continuous integration tool;
utilize last integrated tool is right the interface that awaits measuring carries out automatic verification test, include:
performing variable configuration on the environment variables in the continuous integration tool; wherein the configured variables include: the interface verifies a script path of the script;
and determining the interface verification script according to the script path.
2. The method for automated testing of interfaces of claim 1, wherein after adding the test set of interfaces to be tested, further comprising:
configuring an interface request parameter for requesting the interface to be tested to return the parameter to the interface in the test set;
and initiating a request to the interface to be tested through the interface request parameter so as to obtain the interface return parameter fed back by the interface to be tested.
3. The method for automated interface testing according to claim 1,
in configuring variables for the environment variables within the persistent integration tool, the configured variables further include: testing variables;
and executing the interface verification script according to the test variable to realize the automatic verification test of the interface to be tested.
4. The method for automated testing of interfaces of claim 3, wherein the test variables include one or more of the following variables:
a test execution command;
testing the execution frequency; and
and the notification parameter is used for notifying the interface of a failure message of the execution process of the verification script.
5. The method for automated testing of interfaces of claim 1 or 2, wherein the interface return parameters include one or more of the following parameters:
the interface returns to the Response Code;
the interface returns a Response Time; and
the interface returns a result Response Body.
6. An automated interface testing device, comprising:
the adding module is used for adding a test set of the interface to be tested in a hypertext transfer protocol (HTTP) request simulation tool;
the creating module is used for creating an interface verification function set in the test set;
the verification module is used for verifying the interface return parameters of the interface to be tested by using the interface verification function set so as to obtain an interface verification script and an environment variable;
the test module is used for integrating the interface verification script and the environment variable onto a continuous integration tool and carrying out automatic verification test on the interface to be tested by using the continuous integration tool;
the test module includes:
the variable configuration unit is used for carrying out variable configuration on the environment variables in the continuous integration tool; wherein the configured variables include: the interface verifies a script path of the script;
and the execution unit is used for determining the interface verification script according to the script path.
7. The interface automation test device of claim 6 further comprising:
a configuration module, configured to configure, in the test set, an interface request parameter for requesting the interface to be tested for the interface return parameter;
and the request module is used for initiating a request to the interface to be tested through the interface request parameter so as to acquire the interface return parameter fed back by the interface to be tested.
8. The interface automated test apparatus of claim 6,
the configured variables further include test variables;
the execution unit is further used for executing the interface verification script according to the test variables, and realizing automatic verification test of the interface to be tested.
9. The interface automation test device of claim 8 wherein the test variables include one or more of the following variables:
a test execution command;
testing the execution frequency; and
and the notification parameter is used for notifying the interface of a failure message of the execution process of the verification script.
10. The interface automation test device of claim 6 or 7 wherein the interface return parameters include one or more of the following parameters:
the interface returns to the Response Code;
the interface returns a Response Time; and
the interface returns a result Response Body.
11. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
12. A computer device, characterized in that the computer device comprises: memory, processor and computer program stored on the memory and executable on the processor, which computer program, when executed by the processor, carries out the steps of the method according to any one of claims 1 to 5.
CN201810516596.9A 2018-05-25 2018-05-25 Interface automatic testing method and device, storage medium and equipment Active CN108733569B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810516596.9A CN108733569B (en) 2018-05-25 2018-05-25 Interface automatic testing method and device, storage medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810516596.9A CN108733569B (en) 2018-05-25 2018-05-25 Interface automatic testing method and device, storage medium and equipment

Publications (2)

Publication Number Publication Date
CN108733569A CN108733569A (en) 2018-11-02
CN108733569B true CN108733569B (en) 2022-09-02

Family

ID=63936242

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810516596.9A Active CN108733569B (en) 2018-05-25 2018-05-25 Interface automatic testing method and device, storage medium and equipment

Country Status (1)

Country Link
CN (1) CN108733569B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109800170B (en) * 2019-01-25 2022-02-22 郑州云海信息技术有限公司 Test method, test equipment and readable storage medium based on API test platform
CN111651342A (en) * 2019-03-04 2020-09-11 复旦大学 HTTP interface automation testing framework based on Charles recording session
CN110287099B (en) * 2019-05-21 2023-11-21 平安银行股份有限公司 Simplified Loadrunner performance test method, server and computer readable storage medium
CN111555928A (en) * 2020-04-14 2020-08-18 珠海格力电器股份有限公司 Method and device for monitoring system abnormity, computer equipment and storage medium
CN111930635B (en) * 2020-09-17 2021-06-29 深圳微品致远信息科技有限公司 Swagger-based rapid automatic testing method and system
CN112596966B (en) * 2020-12-17 2022-11-01 海光信息技术股份有限公司 Chip verification method, device, equipment and storage medium
CN112650686A (en) * 2020-12-30 2021-04-13 北京华胜天成科技股份有限公司 Method and device for obtaining test result, electronic equipment and storage medium
CN113094263A (en) * 2021-03-30 2021-07-09 四川新网银行股份有限公司 Method for generating automatic interface test based on template

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6002871A (en) * 1997-10-27 1999-12-14 Unisys Corporation Multi-user application program testing tool
WO2003021444A2 (en) * 2001-08-29 2003-03-13 Silas Technologies, Inc. System and method for monitoring a computer based system
CN106155891A (en) * 2015-04-02 2016-11-23 阿里巴巴集团控股有限公司 Interface test method, interface description data library generating method and device
CN107368412A (en) * 2017-07-03 2017-11-21 上海前隆信息科技有限公司 Automated testing method/system, computer-readable recording medium and electronic equipment
CN107992421A (en) * 2017-12-07 2018-05-04 畅捷通信息技术股份有限公司 Interface test method and its device and computer installation and its readable storage medium storing program for executing

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050229162A1 (en) * 2004-03-31 2005-10-13 Microsoft Corporation Systems and methods for providing multi-environment test automation
WO2011054024A1 (en) * 2009-11-06 2011-05-12 Toby Biddle A usability testing tool
CN105786696B (en) * 2014-12-26 2018-10-09 阿里巴巴集团控股有限公司 A kind of test method and device
CN104601403A (en) * 2015-01-07 2015-05-06 上海瀚之友信息技术服务有限公司 Automatic test system
CN106383786B (en) * 2016-09-27 2019-05-17 北京金山安全软件有限公司 Interface pressure performance testing method and device and electronic equipment
CN107729243B (en) * 2017-10-12 2020-06-16 上海携程金融信息服务有限公司 Application programming interface automatic test method, system, equipment and storage medium
CN107832217A (en) * 2017-11-09 2018-03-23 政采云有限公司 A kind of automated testing method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6002871A (en) * 1997-10-27 1999-12-14 Unisys Corporation Multi-user application program testing tool
WO2003021444A2 (en) * 2001-08-29 2003-03-13 Silas Technologies, Inc. System and method for monitoring a computer based system
CN106155891A (en) * 2015-04-02 2016-11-23 阿里巴巴集团控股有限公司 Interface test method, interface description data library generating method and device
CN107368412A (en) * 2017-07-03 2017-11-21 上海前隆信息科技有限公司 Automated testing method/system, computer-readable recording medium and electronic equipment
CN107992421A (en) * 2017-12-07 2018-05-04 畅捷通信息技术股份有限公司 Interface test method and its device and computer installation and its readable storage medium storing program for executing

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Novel Test Infrastructure and Methodology Used for Accelerated Bring-Up and In-System Characterization of the Multi-Gigahertz Interfaces on the Cell Processor;P. Yeung;《2007 Design, Automation & Test in Europe Conference & Exhibition》;20070529;第I-III节 *
面向网络游戏的自动化接口测试系统设计;周绍凯;《现代计算机》;20180410;81-84 *

Also Published As

Publication number Publication date
CN108733569A (en) 2018-11-02

Similar Documents

Publication Publication Date Title
CN108733569B (en) Interface automatic testing method and device, storage medium and equipment
CN103973858B (en) The Auto-Test System of mobile terminal
CN109324975B (en) Continuous integration method based on mobile cloud measurement platform
CN110659198A (en) Application program test case execution method and device and software test system
CN112131129B (en) Application program testing method and system
CN109543417B (en) Vulnerability mining method and device based on Qemu platform
CN112115051A (en) Page traversal detection method, device and equipment for application and readable storage medium
CN111124911A (en) Automatic testing method, device, equipment and readable storage medium
CN112000582A (en) Server-side automatic test early warning method, device, equipment and storage medium
CN112911283B (en) Smart television testing method and device
CN112543478B (en) WiFi module automatic test method and device, computer equipment and storage medium
CN117493188A (en) Interface testing method and device, electronic equipment and storage medium
CN115576810A (en) Automatic testing method, system, medium and computing device for real-time alarm
CN116230067A (en) Automatic testing method, system, equipment and medium for solid state disk
CN111581081B (en) Automatic test system and method
CN109614337B (en) Performance test system and test tool based on linux system
CN111722997B (en) Abnormality detection method for automated test and computer-readable storage medium
CN109800170B (en) Test method, test equipment and readable storage medium based on API test platform
CN113127884A (en) Virtualization-based vulnerability parallel verification method and device
CN112416807A (en) System and method for analyzing and correlating test case results
US20230216727A1 (en) Identification of root causes in data processing errors
CN112346994A (en) Test information correlation method and device, computer equipment and storage medium
CN109062810B (en) Application program testing method and device, electronic equipment and storage medium
CN116893977B (en) Automatic deployment method, device, equipment and medium for distributed simulation test environment
CN107102938B (en) Test script updating method and 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
GR01 Patent grant
GR01 Patent grant