CN113778895A - Automatic interface testing method and device - Google Patents
Automatic interface testing method and device Download PDFInfo
- Publication number
- CN113778895A CN113778895A CN202111101915.8A CN202111101915A CN113778895A CN 113778895 A CN113778895 A CN 113778895A CN 202111101915 A CN202111101915 A CN 202111101915A CN 113778895 A CN113778895 A CN 113778895A
- Authority
- CN
- China
- Prior art keywords
- interface
- information
- types
- interface information
- test
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 55
- 238000000034 method Methods 0.000 claims abstract description 22
- 230000008859 change Effects 0.000 claims abstract description 7
- 238000013515 script Methods 0.000 claims description 10
- 238000012544 monitoring process Methods 0.000 claims description 3
- 230000008676 import Effects 0.000 abstract description 6
- 238000010998 test method Methods 0.000 abstract description 4
- 230000000007 visual effect Effects 0.000 abstract description 4
- 238000004590 computer program Methods 0.000 description 10
- 238000010586 diagram Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 6
- 230000008569 process Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000006467 substitution reaction Methods 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
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/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
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)
- User Interface Of Digital Computer (AREA)
Abstract
The invention relates to an automatic interface test method and a device, wherein the method comprises the steps of accessing interface information; analyzing the interface information, judging a request mode to obtain request parameters and types, and generating an interface information list corresponding to rules according to an analysis result; and outputting the interface test case. The invention provides a visual interface to realize interface import or configuration, can configure keywords of the interface, generate interface test cases in batches, support various types of participation, and automatically synchronize interface change information to the test cases.
Description
Technical Field
The invention belongs to the technical field of internet, and particularly relates to an automatic interface testing method and device.
Background
With the popularization of computers and the increasing number of systems with various application functions, in order to ensure the stability of system operation, the interface is usually required to be tested in the development process. The interface test is a test for testing interfaces among system components, and is mainly used for detecting interaction points between an external system and a system and between internal subsystems. The key point of the test is to check the exchange of data, transfer and control management processes, mutual logic dependency relationship between systems and the like.
In the related art, the conventional interface testing tool has the following problems, for example: both the jmeter and the postman need to manually compile test scripts, configure corresponding methods, paths and request parameters, a user needs to design the test scripts according to interface description documents, time and labor are wasted, when a full number of interfaces need to return in a project test process, the test scripts need to be designed one by one, and test cases need to be manually intervened and synchronized after interface information is updated. The above problems lead to time and labor consuming interface testing, resulting in higher cost.
Disclosure of Invention
In view of the above, the present invention provides an automatic interface testing method and apparatus to overcome the shortcomings in the prior art, so as to solve the problem of high cost caused by time and labor consuming interface testing in the prior art.
In order to achieve the purpose, the invention adopts the following technical scheme: an interface automation test method comprises the following steps:
accessing interface information;
analyzing the interface information, judging a request mode to obtain request parameters and types, and generating an interface information list corresponding to rules according to an analysis result;
and outputting the interface test case.
Further, the access interface data includes:
and importing an interface file or a configuration link in a preset format.
Further, the preset format includes: json, html, and xml, csv/xls types output by swagger or yapi platforms;
the configuration link includes: configuring url links or uploading jar packets according to the interface storage addresses and configuring keywords to be captured; wherein the key includes an interface type, method, path, or parameter.
Further, monitoring the interface during link configuration so as to synchronize the interface state to the test script in real time;
the interface state comprises interface abandonment, interface addition and parameter change.
The embodiment of the application provides an automatic testing arrangement of interface, includes:
the access module is used for accessing the interface information;
the analysis module is used for analyzing the interface information, judging a request mode to obtain request parameters and types and generating an interface information list corresponding to rules according to an analysis result;
and the output module is used for outputting the interface test case.
By adopting the technical scheme, the invention can achieve the following beneficial effects:
the invention provides an automatic interface testing method and device, wherein the method comprises the steps of accessing interface information; analyzing the interface information, judging a request mode to obtain request parameters and types, and generating an interface information list corresponding to rules according to an analysis result; and outputting the interface test case. The invention provides a visual interface to realize interface import or configuration, can configure keywords of the interface, generate interface test cases in batches, support various types of participation, and automatically synchronize interface change information to the test cases.
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 some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic diagram illustrating steps of an automated interface testing method according to the present invention;
FIG. 2 is a schematic structural diagram of an interface automatic test device according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail below. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the examples given herein without any inventive step, are within the scope of the present invention.
A specific method for testing an interface automatically provided in the embodiment of the present application is described below with reference to the accompanying drawings.
As shown in fig. 1, the interface automation test method provided in the embodiment of the present application includes:
s101, accessing interface information;
s102, analyzing the interface information, judging a request mode to obtain request parameters and types, and generating an interface information list corresponding to rules according to an analysis result;
and S103, outputting the interface test case.
Preferably, the access interface data includes:
and importing an interface file or a configuration link in a preset format.
Specifically, the preset format includes: json, html, and xml, csv/xls types output by swagger or yapi platforms;
the configuration link includes: configuring url links or uploading jar packets according to the interface storage addresses and configuring keywords to be captured; wherein the key includes an interface type, method, path, or parameter.
Preferably, the interface is monitored during link configuration so as to synchronize the interface state to the test script in real time;
the interface state comprises interface abandonment, interface addition and parameter change.
As a specific embodiment, the method comprises the following implementation steps:
1, constructing an interface one-stop service, which consists of three parts of data acquisition, analysis and output.
2, data acquisition, namely access interface information, is divided into two forms: one for user import and one for configuration links. User import support: json, html, xml, csv/xls, and the like, output by the swagger or yapi platform. The configuration parameters are as follows: and configuring url links or uploading jar packets by the user according to the interface storage address. And then configuring keywords to be captured, such as interface types, methods, paths, parameters and the like.
And 3, interface feature analysis, namely analyzing an interface file according to the collected user interface features, judging a request mode, acquiring request parameters and types, and generating an interface information list corresponding to rules after intelligently analyzing the floor interface data according to user configuration parameters.
And 4, outputting the interface test case required by the user. And the automatic test script integrated by the plug-in and the test script with a fixed format are supported.
And 5, when the user configures the link, providing an interface monitoring function, and automatically synchronizing the latest state of the interface to the test script by one-key updating. Such as interface abandonment, interface addition and automatic synchronization when parameters are changed, and unchanged test cases are not changed.
According to the interface automatic testing method, interface import or configuration of keywords of the configurable acquisition interface is achieved through the visual interface, interface test cases are generated in batches, various types of participation are supported, and interface change information is automatically synchronized to the test cases. Finally, one-stop interface testing is realized, and batch interface testing script management is realized.
As shown in fig. 2, an embodiment of the present application provides an interface automation test apparatus, including:
an access module 201, configured to access interface information;
the analysis module 202 is used for analyzing the interface information, judging a request mode to obtain request parameters and types, and generating an interface information list corresponding to rules according to an analysis result;
and the output module 203 is used for outputting the interface test case.
The working principle of the interface automatic testing device is as follows: referring to fig. 2, the access module 201 accesses interface information; the analysis module 202 analyzes the interface information, judges a request mode to obtain request parameters and types, and generates an interface information list corresponding to rules according to an analysis result; the output module 203 outputs the interface test case.
The embodiment of the application provides computer equipment, which comprises a processor and a memory connected with the processor;
the memory is used for storing a computer program, and the computer program is used for executing the interface automation test method provided by any one of the above embodiments;
the processor is used to call and execute the computer program in the memory.
In summary, the present invention provides a method and an apparatus for automatically testing an interface, where the method includes accessing interface information; analyzing the interface information, judging a request mode to obtain request parameters and types, and generating an interface information list corresponding to rules according to an analysis result; and outputting the interface test case. The invention provides a visual interface to realize interface import or configuration, can configure keywords of the interface, generate interface test cases in batches, support various types of participation, and automatically synchronize interface change information to the test cases.
It is to be understood that the embodiments of the method provided above correspond to the embodiments of the apparatus described above, and the corresponding specific contents may be referred to each other, which is not described herein again.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.
Claims (5)
1. An automated interface testing method, the method comprising:
accessing interface information;
analyzing the interface information, judging a request mode to obtain request parameters and types, and generating an interface information list corresponding to rules according to an analysis result;
and outputting the interface test case.
2. The method of claim 1, wherein the access interface data comprises:
and importing an interface file or a configuration link in a preset format.
3. The method according to claim 1 or 2,
the preset format comprises: json, html, and xml, csv/xls types output by swagger or yapi platforms;
the configuration link includes: configuring url links or uploading jar packets according to the interface storage addresses and configuring keywords to be captured; wherein the key includes an interface type, method, path, or parameter.
4. The method of claim 3,
monitoring the interface during link configuration so as to synchronize the interface state to the test script in real time;
the interface state comprises interface abandonment, interface addition and parameter change.
5. An automated interface testing device, comprising:
the access module is used for accessing the interface information;
the analysis module is used for analyzing the interface information, judging a request mode to obtain request parameters and types and generating an interface information list corresponding to rules according to an analysis result;
and the output module is used for outputting the interface test case.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111101915.8A CN113778895A (en) | 2021-09-18 | 2021-09-18 | Automatic interface testing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111101915.8A CN113778895A (en) | 2021-09-18 | 2021-09-18 | Automatic interface testing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113778895A true CN113778895A (en) | 2021-12-10 |
Family
ID=78852266
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111101915.8A Pending CN113778895A (en) | 2021-09-18 | 2021-09-18 | Automatic interface testing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113778895A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20030055850A (en) * | 2001-12-27 | 2003-07-04 | 한국전자통신연구원 | Apparatus and method for testing interfaces of enterprise javabeans components |
CN110532169A (en) * | 2019-07-08 | 2019-12-03 | 平安科技(深圳)有限公司 | Interface testing case generation method, device, computer equipment and storage medium |
CN112286815A (en) * | 2020-10-30 | 2021-01-29 | 深圳壹账通智能科技有限公司 | Interface test script generation method and related equipment thereof |
CN113220566A (en) * | 2021-04-26 | 2021-08-06 | 深圳市云网万店科技有限公司 | Interface performance test script generation method and device and computer equipment |
-
2021
- 2021-09-18 CN CN202111101915.8A patent/CN113778895A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20030055850A (en) * | 2001-12-27 | 2003-07-04 | 한국전자통신연구원 | Apparatus and method for testing interfaces of enterprise javabeans components |
CN110532169A (en) * | 2019-07-08 | 2019-12-03 | 平安科技(深圳)有限公司 | Interface testing case generation method, device, computer equipment and storage medium |
CN112286815A (en) * | 2020-10-30 | 2021-01-29 | 深圳壹账通智能科技有限公司 | Interface test script generation method and related equipment thereof |
CN113220566A (en) * | 2021-04-26 | 2021-08-06 | 深圳市云网万店科技有限公司 | Interface performance test script generation method and device and computer equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10387011B2 (en) | System and method to capture and document cross-product compatibility status information for industrial devices | |
US9762454B2 (en) | System and method to capture and document cross-product compatibility status information for industrial devices | |
CN109302522A (en) | Test method, device and computer system and medium | |
CN108628748B (en) | Automatic test management method and automatic test management system | |
CN101924656A (en) | Method and device for realizing network equipment CLI (Command Line Interface for batch scripti) based on dynamic configuration | |
CN112130993A (en) | Power edge Internet of things agent edge calculation method and system based on graphical modeling | |
CN110990269A (en) | Interface testing method, device and system | |
CN111209203B (en) | Model verification method based on source code | |
CN105786695A (en) | Data test method and system | |
CN110647471A (en) | Interface test case generation method, electronic device and storage medium | |
CN114328250A (en) | Automatic self-checking method, medium and device for software system | |
CN114172978A (en) | Multi-protocol equipment access method and related device | |
CN111414154A (en) | Method and device for front-end development, electronic equipment and storage medium | |
CN110868341A (en) | In-place protection intelligent management unit testing method and device | |
CN113778895A (en) | Automatic interface testing method and device | |
Jamro et al. | Communication performance tests in distributed control systems | |
CN113608996B (en) | Mirror image compiling test method, system, device and readable storage medium | |
CN117370203B (en) | Automatic test method, system, electronic equipment and storage medium | |
CN118152250A (en) | Application programming interface test method, apparatus, device, medium and program product | |
CN117370203A (en) | Automatic test method, system, electronic equipment and storage medium | |
CN114968700A (en) | Service logic abnormity warning method based on system function log and related equipment | |
CN117519098A (en) | Device diagnosis method, device, and readable storage medium | |
CN117762434A (en) | Native application packaging method and device, electronic equipment and storage medium | |
CN117640364A (en) | Cluster deployment method and device of message system and electronic equipment | |
CN117827630A (en) | Method and device for generating test script |
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 |