CN113238965B - Interface test script generation method, system and storage medium - Google Patents
Interface test script generation method, system and storage medium Download PDFInfo
- Publication number
- CN113238965B CN113238965B CN202110678024.2A CN202110678024A CN113238965B CN 113238965 B CN113238965 B CN 113238965B CN 202110678024 A CN202110678024 A CN 202110678024A CN 113238965 B CN113238965 B CN 113238965B
- Authority
- CN
- China
- Prior art keywords
- interface test
- interface
- information
- tested
- item
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3696—Methods or tools to render software testable
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/50—Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a method, a system and a storage medium for generating an interface test script, wherein the method comprises the following steps: the front-end equipment acquires a proxy port of the item to be tested and sends an HTTP request of the item to be tested to a proxy server through the proxy port; the HTTP request contains interface information; the proxy server receives the HTTP request, determines the project information of the project to be tested according to the port number of the proxy port, and sends the HTTP request and the project information to the interface test platform; and the interface test platform generates an interface test script of the item to be tested by using the HTTP request and the item information. The invention distributes the proxy port of the proxy server to the project to be tested, can ensure that the interface test platform obtains the configured interface information in the project to be tested through the proxy server, further directly utilizes the interface information to automatically generate the interface test script, does not need to manually configure the interface information, and can effectively improve the interface information configuration efficiency.
Description
Technical Field
The present invention relates to the field of interface testing, and in particular, to a method, a system, and a storage medium for generating an interface test script.
Background
The interface is a data interaction point between systems or between sub-modules in the system. In the development process of a network project, in order to ensure that data interaction can be normally performed between modules in the project through interfaces, the interfaces need to be tested.
In the related art, a tester can generate an interface test script by using a general interface test tool, and perform interface test on a project to be tested by using the interface test script, but a developer needs to manually configure interface information for generating the interface test script, when the number of interfaces to be tested and the interface information are large, or when the interface information of the project to be tested frequently changes, the manual configuration and modification mode is very complicated, and the test efficiency of the developer is reduced.
Disclosure of Invention
The invention aims to provide an interface test script generation method, an interface test script generation system and a storage medium, wherein an interface test platform can directly acquire configured interface information in a project to be tested through a proxy server, and further automatically generate an interface test script by using the interface information without manually configuring the interface information, so that the interface information configuration efficiency can be effectively improved.
In order to solve the above technical problem, the present invention provides an interface test script generating method, including:
the front-end equipment acquires a proxy port of a project to be tested and sends an HTTP request of the project to be tested to a proxy server through the proxy port; the HTTP request contains interface information;
the proxy server receives the HTTP request, determines the project information of the project to be tested according to the port number of the proxy port, and sends the HTTP request and the project information to an interface test platform;
and the interface test platform generates an interface test script of the item to be tested by using the HTTP request and the item information.
Optionally, before the front-end device obtains the proxy port of the item to be tested, the method further includes:
the interface test platform creates the item to be tested and the corresponding item information, and establishes a corresponding relation between the port number corresponding to the idle agent port and the item information, so as to set the idle agent port as the agent port of the item to be tested.
Optionally, the sending the HTTP request and the item information to an interface test platform includes:
the proxy server stores the project information and the HTTP request to a corresponding area of the project to be tested in a request database;
and the interface testing platform acquires the HTTP request and the item information of the item to be tested in the request database.
Optionally, after the interface test platform generates an interface test script of the item to be tested by using the HTTP request and the item information, the method further includes:
and the interface test platform performs interface test on the item to be tested by using the interface test script and generates an interface test report according to an interface test result.
Optionally, the proxy server is a mitmpropy proxy server.
Optionally, the interface test platform generates an interface test script of the item to be tested by using the HTTP request and the item information, including:
the interface test platform searches an interface test script of the item to be tested in a script database according to the item information, compares the HTTP request with the interface test script and determines the interface change information in the HTTP request;
and the interface test platform updates the interface test script in the script database by using the changed interface information.
Optionally, after determining the change interface information in the HTTP request, the method further includes:
the interface test platform outputs the changed interface information;
when the interface test platform receives the confirmation data, the step of updating the interface test script in the script database by using the changed interface information is executed;
and when the interface test platform receives the modified change interface information, the step of updating the interface test script in the script database by using the change interface information is executed by using the modified change interface information.
The invention also provides an interface test script generating system, which comprises: front-end equipment, a proxy server and an interface test platform, wherein,
the front-end equipment is used for acquiring a proxy port of a project to be tested and sending an HTTP request of the project to be tested to the proxy server through the proxy port; the HTTP request contains interface information;
the proxy server is used for receiving the HTTP request, determining the project information of the project to be tested according to the port number of the proxy port, and finally sending the HTTP request and the project information to the interface test platform;
and the interface test platform is used for generating an interface test script of the item to be tested by utilizing the HTTP request and the item information.
Optionally, the interface testing platform is further configured to create the item to be tested and the corresponding item information, and establish a corresponding relationship between a port number corresponding to an idle proxy port and the item information, so as to set the idle proxy port as the proxy port of the item to be tested.
The invention also provides a storage medium, wherein the storage medium stores computer-executable instructions, and the computer-executable instructions are loaded and executed by a processor to realize the interface test script generation method.
The invention provides an interface test script generation method, which comprises the following steps: the front-end equipment acquires a proxy port of a project to be tested and sends an HTTP request of the project to be tested to a proxy server through the proxy port; the HTTP request contains interface information; the proxy server receives the HTTP request, determines the project information of the project to be tested according to the port number of the proxy port, and sends the HTTP request and the project information to an interface test platform; and the interface test platform generates an interface test script of the item to be tested by utilizing the HTTP request and the item information.
The interface test platform can directly acquire the HTTP request in the item to be tested from the front-end equipment through the proxy server, and generate the interface test script by using the HTTP request, and because the HTTP request contains the interface information, in other words, the interface test platform can directly and automatically generate the interface test script by using the configured interface information in the item to be tested, the interface information does not need to be manually configured, the problems of complicated configuration and low test efficiency in the related technology can be effectively avoided, and the configuration efficiency and the test efficiency of the interface information are improved; meanwhile, the invention configures a corresponding proxy port for the item to be tested, and the proxy server can determine the item information corresponding to the HTTP request through the port number of the proxy port, thereby ensuring that the interface test platform can generate an interface test script for the corresponding item to be tested according to the item information, and effectively improving the management efficiency of the interface test script. The invention also provides an interface test script generation system and a storage medium, which have the beneficial effects.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for generating an interface test script according to an embodiment of the present invention;
fig. 2a is a block diagram of an interface test script generating system according to an embodiment of the present invention;
FIG. 2b is a block diagram of another interface test script generation system according to an embodiment of the present invention;
fig. 2c is a block diagram of a structure of another interface test script generation system according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the related art, a tester can generate an interface test script by using a general interface test tool and perform interface test on a project to be tested by using the interface test script, but a developer needs to manually configure interface information for generating the interface test script, when the number of interfaces to be tested and the interface information are large, or when the interface information of the project to be tested is frequently changed, the manual configuration and modification mode is very complicated, and the test efficiency of the developer is reduced. In view of this, embodiments of the present invention provide a method for generating an interface test script, where an interface test platform may directly obtain configured interface information in a to-be-tested project through a proxy server, and then automatically generate an interface test script using the interface information, without manually configuring the interface information, so as to effectively improve interface information configuration efficiency. Referring to fig. 1, fig. 1 is a flowchart of a method for generating an interface test script according to an embodiment of the present invention, where the method includes:
s101, front-end equipment acquires a proxy port of a project to be tested and sends an HTTP request of the project to be tested to a proxy server through the proxy port; the HTTP request contains interface information.
In the embodiment of the present invention, the front-end device refers to a device running a network front-end application. In the existing network application project, a front-end application generally interacts with a back-end application (e.g., a database) through various Web interfaces (network application interfaces), in other words, the Web interfaces are important channels for the front-end application to perform data interaction with the back-end application, and need to be specially tested. In the related art, a tester may use a general interface testing tool (e.g., a stress testing tool JMeter) to test the Web interfaces, but the tester needs to manually configure interface parameters for the interface testing tool, and when the number of interfaces and parameters to be tested is large and interface parameter adjustment frequently occurs in a project to be tested, the manual configuration and maintenance method will limit the testing efficiency of the tester. In order to solve the technical problems in the related art, in the embodiment of the present invention, a proxy server is set for a front-end device, the front-end device sends an HTTP request through the proxy server, and the proxy server sends the received HTTP request to an interface test platform, so that the interface test platform generates an interface test script using the HTTP request. In other words, the HTTP request sent by the front-end device includes interface information that has been configured in the item to be tested, and when the proxy server sends the HTTP request to the interface test platform, the interface test platform can acquire the configured interface information in the item to be tested, and then can automatically generate an interface test script by using the interface information, without manual configuration, which not only can improve the efficiency of the interface test platform in maintaining the interface information, but also can effectively improve the generation efficiency of the interface test script, and further effectively improve the working efficiency of testers.
It should be noted that the embodiment of the present invention is not limited to specific front-end devices, and may be, for example, mobile terminal devices, personal computers, and the like. It can be understood that the front-end device generally uses a browser to run the front-end application, and therefore, in the embodiment of the present invention, all devices that can run the browser application may be set as the front-end device. The embodiment of the invention does not limit the specific application of the browser, and can refer to the related technology of the browser. Further, it can be understood that the front-end device needs to configure a proxy port of the item to be tested, and then may send the HTTP request through the proxy server. The embodiment of the invention does not limit the mode of configuring the proxy port by the front-end equipment, and can refer to the related technology of proxy configuration.
Further, the embodiment of the present invention does not limit a specific proxy server, as long as the proxy server can forward the HTTP request to the interface test platform, and reference may be made to the related art of the proxy server. In one possible scenario, mitmpropy, which is an open source interactive HTTPS proxy, may be selected as the proxy server. The embodiment of the invention also does not limit whether the Mitmproxy proxy server and the interface test platform are arranged in the same device, namely the Mitmproxy proxy server is used as a sub-service in the interface test platform. In order to improve the functionality of the interface test platform, the mitmprox proxy server and the interface test platform may be disposed in the same device, and the mitmprox proxy server may be used as a sub-service of the interface test platform. Further, it can be understood that the front-end device needs to set a proxy port in order to send an HTTP request through the proxy server, and it can also be understood that a front-end application in the front-end device is an item to be tested. The embodiment of the present invention is not limited to the way of allocating the proxy port to the item to be tested, and for example, a fixed proxy port may be set for the item to be tested, and certainly, an idle proxy port may also be set for the item to be tested. In order to improve the utilization rate of the effective proxy port and avoid the situation that a plurality of items to be tested use the same proxy port at the same time, in the embodiment of the invention, an idle proxy port can be set for the items to be tested. The embodiment of the invention is not limited to the time for setting the agent port for the item to be tested, for example, when the interface test platform needs to generate an interface test script, an idle agent port can be set for the item to be tested; of course, when the interface test platform creates the item to be tested, a free agent port may be set for the item to be tested. In order to ensure that the interface test platform effectively manages the agent port, a free agent port can be set for the item to be tested when the interface test platform creates the item to be tested. It is understood that item information (e.g., an item ID) for distinguishing the identifiers may be set for the items to be tested, and the item information and the port number are associated to each other, so that the proxy port and the items to be tested are associated to each other.
In a possible case, before the front-end device obtains the proxy port of the item to be tested, the method may further include:
step 11: the interface test platform creates a project to be tested and corresponding project information, and stores the idle agent: and establishing a corresponding relation between the port number corresponding to the port and the project information so as to set the idle agent port as the agent port of the project to be tested.
It should be noted that the embodiment of the present invention does not limit specific item information, and may be, for example, an item ID, a service domain name of an item, or a port number of the item, or may adopt a combination of a plurality of items of information. In the embodiment of the present invention, in consideration that the service domain name and the port number can effectively distinguish each item to be tested, in the embodiment of the present invention, the item information may be a combination of the service domain name and the port number.
Further, the embodiment of the present invention does not limit specific interface information, for example, the specific interface information may be a protocol name, a request method, a request parameter, an interface address, and the like, and may be set according to actual application requirements. The invention also does not limit the specific form of the HTTP request, and can be set according to the actual application requirements.
S102, the proxy server receives the HTTP request, determines the project information of the project to be tested according to the port number of the proxy port, and sends the HTTP request and the project information to the interface testing platform.
Because the port number establishes a corresponding relation with the project information, in the embodiment of the invention, the proxy server can directly determine the project information of the project to be detected according to the port number, and further can send the HTTP request and the project information to the interface test platform, so that the interface test platform can generate the corresponding interface test script.
Further, considering that the HTTP request is important data for generating the interface test script and needs to be managed properly, the proxy server may also send the project information and the HTTP request to the database for storage, and the interface test platform may query the database for corresponding data.
In one possible case, sending the HTTP request and the item information to the interface test platform may include:
step 21: the proxy server stores the project information and the HTTP request to a corresponding area of the project to be tested in a request database;
step 22: the interface testing platform acquires the HTTP request and the item information of the item to be tested in the request database.
It is understood that the request database is a database storing HTTP requests and item information. It should be noted that, the embodiment of the present invention does not limit the type of the database specifically selected by the request database, and may be set according to the actual application requirement.
S103, the interface test platform generates an interface test script of the item to be tested by using the HTTP request and the item information.
It should be noted that the embodiment of the present invention does not limit the application environment on which the interface test script is based, for example, the interface test script may be generated based on Requests in a Python environment, or may be generated based on other development environments, and may be set according to actual application requirements. The embodiment of the invention also does not limit the specific generation process of the interface test script, and can refer to the related technology of script generation.
Furthermore, considering that the interface test script is an important data file in the interface test link, in order to avoid repeatedly generating the script file and improve the management efficiency of the script file, the interface test platform can use an independent script database to store the interface test script. The embodiment of the invention does not limit the type of the database specifically selected by the script database, and can be set according to the actual application requirements. Further, when the interface test platform has generated an interface test script for the item to be tested, if the platform receives the HTTP request of the item again, in order to avoid repeatedly generating a script file, at this time, the HTTP request may be compared with the interface test script, to determine the changed interface information in the HTTP request, and then the changed interface test script is updated by using the changed interface information, thereby improving the management efficiency of the interface test script.
In one possible case, the interface test platform generates an interface test script of the item to be tested by using the HTTP request and the item information, and may include:
step 31: the interface test platform searches an interface test script of the item to be tested in a script database according to the item information, compares the HTTP request with the interface test script and determines the interface change information in the HTTP request;
step 32: and the interface test platform updates the interface test script in the script database by using the changed interface information.
It can be understood that the interface test platform may perform the comparison between the HTTP request and the interface test script through string comparison or regular expression. The embodiment of the invention does not limit the specific mode of character string comparison and the regular expression required by the comparison, can refer to the related technology and can carry out setting according to the actual application requirement.
Furthermore, the embodiment of the present invention does not limit whether the interface test platform periodically performs the comparison between the HTTP request and the interface test script, and if the interface test platform can ensure the comparison efficiency, that is, the comparison operation is performed when the interface test script needs to be used, the comparison operation does not need to be performed periodically when the higher execution efficiency can be ensured; when the application efficiency of the interface test script needs to be improved, the comparison operation can be periodically executed, so that the interface test script in the script database is ensured to be kept up to date. In the embodiment of the present invention, in order to improve the application efficiency of the interface test script, the comparison operation may be periodically performed. The embodiment of the invention does not limit the specific value of the execution period of the comparison operation, and can be set according to the actual application requirement.
Further, in consideration of the possibility of a comparison error occurring when the HTTP request is compared with the interface test script, the changed interface information obtained by the comparison may be output to the display device for the tester to check and confirm. It can be understood that the tester can modify the output change interface information, and at this time, the interface test platform can update the interface test script by using the modified change interface information.
In one possible case, after determining the change interface information in the HTTP request, the method may further include:
step 41: the interface testing platform outputs the information of the changed interface;
step 42: when the interface test platform receives the confirmation data, the step of updating the interface test script in the script database by using the interface change information is executed;
step 43: and when the interface test platform receives the modified change interface information, the step of updating the interface test script in the script database by using the change interface information is executed by using the modified change interface information.
Of course, considering that the tester may not be able to determine the change interface information in time, the temporary script database may be separately configured to store the change interface information.
Finally, it can be understood that the interface test platform can utilize the interface test script to perform interface test on the item to be tested. The embodiment of the invention does not limit the specific interface test process, and can refer to the related technology of the interface test.
In a possible case, after the interface test platform generates an interface test script of the item to be tested by using the HTTP request and the item information, the method may further include:
step 51: the interface test platform utilizes the interface test script to carry out interface test on the project to be tested, and generates an interface test report according to the interface test result.
Based on the above embodiment, the interface test platform in the invention can directly obtain the HTTP request in the item to be tested from the front-end device through the proxy server, and generate the interface test script by using the HTTP request, because the HTTP request includes the interface information, in other words, the interface test platform in the invention can directly automatically generate the interface test script by using the configured interface information in the item to be tested, without manually configuring the interface information, which can effectively avoid the problems of complicated configuration and low test efficiency in the related art, and improve the configuration efficiency and test efficiency of the interface information; meanwhile, the corresponding proxy port is configured for the item to be tested, the proxy server can determine the item information corresponding to the HTTP request through the port number of the proxy port, and therefore the interface test platform can generate the interface test script for the corresponding item to be tested according to the item information, and the management efficiency of the interface test script can be effectively improved.
In the following, the interface test script generating system and the storage medium provided in the embodiments of the present invention are introduced, and the interface test script generating system and the storage medium described below and the interface test script generating method described above may be referred to correspondingly.
Referring to fig. 2a, fig. 2a is a block diagram of an interface test script generating system according to an embodiment of the present invention, where the system may include: a front-end 201, a proxy server 202 and an interface test platform 203, wherein,
the front-end equipment 201 is used for acquiring a proxy port of the item to be tested and sending an HTTP request of the item to be tested to the proxy server 202 through the proxy port; the HTTP request contains interface information;
the proxy server 202 is used for receiving the HTTP request, determining the project information of the project to be tested according to the port number of the proxy port, and finally sending the HTTP request and the project information to the interface testing platform 203;
and the interface test platform 203 is used for generating an interface test script of the item to be tested by using the HTTP request and the item information.
It should be noted that, the embodiment of the present invention does not limit whether the proxy server 202 and the interface test platform 203 can be disposed in the same device, and the configuration may be performed according to actual application requirements.
Optionally, the interface testing platform 203 is further configured to create an item to be tested and corresponding item information, and establish a corresponding relationship between a port number corresponding to the idle agent port and the item information, so as to set the idle agent port as an agent port of the item to be tested.
Optionally, referring to fig. 2b, fig. 2b is a block diagram of a structure of another interface test script generating system provided in the embodiment of the present invention, where the system may further include: request database 204, wherein
The proxy server 202 may further be configured to store the item information and the HTTP request to a corresponding area of the item to be tested in the request database 204;
the interface test platform 203 may further be configured to obtain an HTTP request and item information of the item to be tested in the request database 204.
The request database 204 is used for storing the HTTP request and the item information.
Optionally, the interface test platform may be further configured to perform an interface test on the item to be tested by using the interface test script, and generate an interface test report according to an interface test result.
Optionally, the proxy server 202 is a mitmpropy proxy server.
Optionally, referring to fig. 2c, fig. 2c is a block diagram of a structure of another interface test script generating system provided in an embodiment of the present invention, where the system may further include: a script database 205, wherein,
the interface test platform 203 can also be used for searching an interface test script of the item to be tested in the script database 205 according to the item information, comparing the HTTP request with the interface test script, and determining the change interface information in the HTTP request; updating the interface test script with the change interface information in the script database 205;
and the script database 205 is used for storing the interface test script.
Optionally, the interface test platform may be further configured to output the changed interface information; when receiving the confirmation data, executing the step of updating the interface test script in the script database by using the changed interface information; and when the modified change interface information is received, executing the step of updating the interface test script in the script database by using the change interface information by using the modified change interface information.
The embodiment of the present invention further provides a storage medium, where a computer program is stored on the storage medium, and when the computer program is executed by a processor, the steps of the interface test script generation method according to any of the above embodiments are implemented.
Since the embodiment of the storage medium portion corresponds to the embodiment of the interface test script generation method portion, please refer to the description of the embodiment of the interface test script generation method portion for the embodiment of the storage medium portion, which is not repeated here.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative components and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the components and steps of the various examples have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The interface test script generation method, system and storage medium provided by the present invention are introduced in detail above. The principles and embodiments of the present invention have been described herein using specific examples, which are presented only to assist in understanding the method and its core concepts of the present invention. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.
Claims (8)
1. An interface test script generation method, comprising:
the front-end equipment acquires a proxy port of a project to be tested and sends an HTTP request of the project to be tested to a proxy server through the proxy port; the HTTP request contains interface information;
the proxy server receives the HTTP request, determines the project information of the project to be tested according to the port number of the proxy port, and sends the HTTP request and the project information to an interface test platform; the proxy server is a Mitmpproxy server;
the interface test platform generates an interface test script of the item to be tested by using the HTTP request and the item information;
the sending the HTTP request and the item information to an interface test platform comprises:
the proxy server stores the project information and the HTTP request to a corresponding area of the project to be tested in a request database;
and the interface testing platform acquires the HTTP request and the item information of the item to be tested in the request database.
2. The method for generating interface test scripts according to claim 1, before the front-end device obtains the proxy port of the item to be tested, further comprising:
the interface test platform creates the item to be tested and the corresponding item information, and establishes a corresponding relation between the port number corresponding to the idle agent port and the item information, so as to set the idle agent port as the agent port of the item to be tested.
3. The method for generating an interface test script according to claim 1, wherein after the interface test platform generates an interface test script of the item to be tested by using the HTTP request and the item information, the method further comprises:
and the interface test platform performs interface test on the item to be tested by using the interface test script and generates an interface test report according to an interface test result.
4. The interface test script generating method according to any one of claims 1 to 3, wherein the interface test platform generates the interface test script of the item to be tested by using the HTTP request and the item information, and includes:
the interface test platform searches an interface test script of the item to be tested in a script database according to the item information, compares the HTTP request with the interface test script and determines the changed interface information in the HTTP request;
and the interface test platform updates the interface test script in the script database by using the changed interface information.
5. The interface test script generating method of claim 4, after determining the changed interface information in the HTTP request, further comprising:
the interface test platform outputs the changed interface information;
when the interface test platform receives the confirmation data, the step of updating the interface test script in the script database by using the changed interface information is executed;
and when the interface test platform receives the modified change interface information, the step of updating the interface test script in the script database by using the change interface information is executed by using the modified change interface information.
6. An interface test script generating system, comprising: front-end equipment, a proxy server and an interface test platform, wherein,
the front-end equipment is used for acquiring a proxy port of a project to be tested and sending an HTTP request of the project to be tested to the proxy server through the proxy port; the HTTP request contains interface information;
the proxy server is used for receiving the HTTP request, determining the project information of the project to be tested according to the port number of the proxy port, and finally sending the HTTP request and the project information to the interface test platform; the proxy server is a Mitmpproxy server;
the interface test platform is used for generating an interface test script of the item to be tested by utilizing the HTTP request and the item information;
the proxy server is also used for storing the project information and the HTTP request to a corresponding area of the project to be tested in a request database;
the interface testing platform is further used for acquiring the HTTP request and the item information of the item to be tested in the request database.
7. The interface test script generating system of claim 6, wherein the interface test platform is further configured to create the item to be tested and corresponding item information, and establish a corresponding relationship between a port number corresponding to an idle proxy port and the item information, so as to set the idle proxy port as the proxy port of the item to be tested.
8. A storage medium having stored thereon computer-executable instructions which, when loaded and executed by a processor, implement the interface test script generation method of any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110678024.2A CN113238965B (en) | 2021-06-18 | 2021-06-18 | Interface test script generation method, system and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110678024.2A CN113238965B (en) | 2021-06-18 | 2021-06-18 | Interface test script generation method, system and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113238965A CN113238965A (en) | 2021-08-10 |
CN113238965B true CN113238965B (en) | 2023-04-07 |
Family
ID=77140456
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110678024.2A Active CN113238965B (en) | 2021-06-18 | 2021-06-18 | Interface test script generation method, system and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113238965B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114328274A (en) * | 2022-03-07 | 2022-04-12 | 深圳开源互联网安全技术有限公司 | Test template generation method and device, computer equipment and storage medium |
CN116016255B (en) * | 2022-12-29 | 2023-08-15 | 天津大学 | Universal blockchain performance evaluation method based on dynamic proxy and intelligent contract |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1657634A2 (en) * | 2004-11-12 | 2006-05-17 | Empirix Inc. | Test agent architecture |
CN112231209A (en) * | 2020-10-10 | 2021-01-15 | 金蝶医疗软件科技有限公司 | Parameter acquisition method and device, computer equipment and storage medium |
CN112286815A (en) * | 2020-10-30 | 2021-01-29 | 深圳壹账通智能科技有限公司 | Interface test script generation method and related equipment thereof |
CN112395184A (en) * | 2019-08-19 | 2021-02-23 | 中移(苏州)软件技术有限公司 | Information acquisition method, equipment and computer storage medium |
CN112463586A (en) * | 2020-10-29 | 2021-03-09 | 苏州浪潮智能科技有限公司 | Method and medium for automatically generating application program interface test case |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040199818A1 (en) * | 2003-03-31 | 2004-10-07 | Microsoft Corp. | Automated testing of web services |
US10754761B2 (en) * | 2016-11-11 | 2020-08-25 | Atlassian Pty Ltd | Systems and methods for testing source code |
CN109344071A (en) * | 2018-10-11 | 2019-02-15 | 四川长虹电器股份有限公司 | The method for automatically generating LoadRunner performance test script |
CN111190827A (en) * | 2019-12-30 | 2020-05-22 | 航天信息股份有限公司 | Interface automation test method and device, storage medium and electronic equipment |
CN112181813A (en) * | 2020-09-17 | 2021-01-05 | 的卢技术有限公司 | Interface automation test method, system and computer readable storage medium |
CN112817867A (en) * | 2021-02-25 | 2021-05-18 | 平安消费金融有限公司 | Interface test script generation method and device, computer equipment and medium |
-
2021
- 2021-06-18 CN CN202110678024.2A patent/CN113238965B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1657634A2 (en) * | 2004-11-12 | 2006-05-17 | Empirix Inc. | Test agent architecture |
CN112395184A (en) * | 2019-08-19 | 2021-02-23 | 中移(苏州)软件技术有限公司 | Information acquisition method, equipment and computer storage medium |
CN112231209A (en) * | 2020-10-10 | 2021-01-15 | 金蝶医疗软件科技有限公司 | Parameter acquisition method and device, computer equipment and storage medium |
CN112463586A (en) * | 2020-10-29 | 2021-03-09 | 苏州浪潮智能科技有限公司 | Method and medium for automatically generating application program interface test case |
CN112286815A (en) * | 2020-10-30 | 2021-01-29 | 深圳壹账通智能科技有限公司 | Interface test script generation method and related equipment thereof |
Also Published As
Publication number | Publication date |
---|---|
CN113238965A (en) | 2021-08-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110442524B (en) | Method and device for testing web service interface with authentication authorization | |
US20240064058A1 (en) | Implementation of compliance settings by a mobile device for compliance with a configuration scenario | |
US20200117586A1 (en) | Method, device and computer program product for executing test cases | |
US10884826B2 (en) | System and method for establishing common request processing | |
US11102081B1 (en) | Quantitative network testing framework for 5G and subsequent generation networks | |
CN105159833A (en) | Automatic testing device and method | |
CN110933095A (en) | Message parsing method and device | |
CN113238965B (en) | Interface test script generation method, system and storage medium | |
CN110011875B (en) | Dial testing method, device, equipment and computer readable storage medium | |
CN108255708B (en) | Method, device, storage medium and equipment for accessing production file in test environment | |
CN106339273A (en) | Application program restoration method, terminal and server | |
US20170060728A1 (en) | Program Lifecycle Testing | |
CN113342560A (en) | Fault processing method, system, electronic equipment and storage medium | |
CN112650689A (en) | Test method, test device, electronic equipment and storage medium | |
CN112699034A (en) | Virtual login user construction method, device, equipment and storage medium | |
CN112131095B (en) | Pressure testing method and device | |
CN113127335A (en) | System testing method and device | |
CN111930625B (en) | Log acquisition method, device and system based on cloud service platform | |
CN105868058A (en) | Cross-machine room test method and apparatus | |
CN111949536A (en) | JAVA application program testing method and system based on bytecode technology | |
CN110233842A (en) | A kind of method of calibration and relevant apparatus of request | |
CN110825538A (en) | MQ-based method for dynamically interacting data by self-defining data types | |
CN115407981A (en) | Front-end data mock method and system based on middleware adaptation | |
CN114615176B (en) | Message testing method and device and electronic equipment | |
US10203970B2 (en) | Dynamic configuration of native functions to intercept |
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 |