WO2019196213A1 - 接口测试方法、装置、设备及计算机可读存储介质 - Google Patents

接口测试方法、装置、设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2019196213A1
WO2019196213A1 PCT/CN2018/094104 CN2018094104W WO2019196213A1 WO 2019196213 A1 WO2019196213 A1 WO 2019196213A1 CN 2018094104 W CN2018094104 W CN 2018094104W WO 2019196213 A1 WO2019196213 A1 WO 2019196213A1
Authority
WO
WIPO (PCT)
Prior art keywords
tested
http
interface
version number
sampler
Prior art date
Application number
PCT/CN2018/094104
Other languages
English (en)
French (fr)
Inventor
林小渝
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019196213A1 publication Critical patent/WO2019196213A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters

Definitions

  • a processing module configured to process the data to be tested according to the processing manner, to obtain the processed data to be tested
  • FIG. 1 is a schematic flowchart of a first embodiment of an interface testing method according to the present application.
  • FIG. 1 is a schematic flowchart of a first embodiment of an interface test method according to the present application.
  • the embodiments of the present application provide an embodiment of the interface testing method. It should be noted that although the logical order is shown in the flowchart, in some cases, the illustrated or described may be performed in an order different from the ones described herein. A step of.
  • Real-time detection detects whether a selection command to select the HTTP interface path to be tested is detected. After detecting the selection instruction of the selected path, the version number of the HTTP interface to be tested is obtained according to the selection instruction. It can be understood that the path of an HTTP interface to be tested corresponds to a version of the HTTP interface to be tested.
  • the selection instruction may be triggered by the user clicking on the path of the HTTP interface to be tested, or triggered by the user entering the path of the HTTP interface to be tested on a specific input interface.
  • step c the processed data to be tested is sent to the HTTP sampler, and the HTTP is obtained in a byte stream manner. The value corresponding to the data to be tested after processing in the sampler.
  • HTTP The sampler is a component that is specifically used to simulate the HTTP protocol interface, so when the data to be tested is sent to HTTP After the sampler, the data to be tested passes the HTTP interface to be tested. Since the byte stream can be used for any type of object, including binary objects, HTTP can be extracted through the byte stream. Any type of data to be tested in the sampler allows the interface test method to be used to test whether different types of data can successfully pass the HTTP interface.
  • Step d parsing the value, obtaining a plaintext corresponding to the value, and sending the plaintext to the HTTP
  • the test result of the HTTP interface to be tested is obtained by responding to the plaintext in the HTTP sampler.
  • the value is parsed according to the method corresponding to the data to be tested, and the corresponding plaintext is obtained, that is, the parsing process includes decryption operation and/or decompression. operating.
  • the Base64 algorithm is used to encrypt the test data and obtain the processed data to be tested, then the Base64 algorithm is used to decrypt the value, and the plaintext corresponding to the data to be tested is obtained, that is, the original data to be tested is obtained;
  • the DES algorithm encrypts the test data and compresses the test data using the LZ77 code. At this time, the DES algorithm is used to decrypt the value, and the LZ77 code is used to decompress the value to obtain the plaintext corresponding to the value.
  • step d includes:
  • Step e parsing the value, obtaining a plaintext corresponding to the value, and sending the plaintext to the HTTP
  • the result identifier of the HTTP interface test result to be tested is obtained by responding to the plaintext in the HTTP sampler.
  • Step f If the result is identified as the first identifier, determine that the HTTP interface to be tested is in a normal state.
  • Step g If the result is identified as the second identifier, it is determined that the HTTP interface to be tested is in an abnormal state.
  • the interface testing method further includes:
  • Step S41 Send the processed data to be tested to the HTTP by using the URL carrying the version number.
  • the test result of the HTTP interface to be tested is obtained by responding to the data to be tested in the HTTP sampler.
  • the processed data to be tested is sent to the HTTP by the URL carrying the version number.
  • the test result of the HTTP interface to be tested is obtained by responding to the processed data to be tested in the HTTP sampler.
  • the URL carrying the version number is obtained, and the URL carrying the version number is used to ensure that the data to be tested is successfully sent to the HTTP.
  • the test success rate of the test HTTP interface is improved.
  • setting a processing method corresponding to the version number smaller than the first preset version number according to the setting instruction is an encryption process.
  • the setting instruction can be triggered by the user as needed.
  • the first preset version number can be set according to specific needs, such as 2 or 3.
  • an encryption method corresponding to the encryption process may also be set. If the user does not set the encryption algorithm and/or the compression algorithm corresponding to the processing mode, the encryption algorithm and/or the compression algorithm are randomly selected during the test of the HTTP interface process to be tested.
  • Step S70 Set a processing mode corresponding to the version number greater than the first preset version number as an encryption process and a compression process according to the setting instruction.
  • the processing manner corresponding to setting the version number to be larger than the first preset version number is encryption processing and compression processing. Further, the same or different encryption algorithms and/or compression algorithms may be set for different version numbers.
  • the interface testing method further includes:
  • the processing method corresponding to setting the version number to be less than or equal to the second preset version number according to the setting instruction is to perform encryption processing by using a symmetric encryption algorithm.
  • setting a processing method corresponding to the version number less than or equal to the second preset version number according to the setting instruction is to perform encryption processing by using a symmetric encryption algorithm.
  • the second preset version number may be the same as or different from the first preset version number.
  • Symmetric encryption algorithms include but are not limited to DES, 3DES and TDEA (Triple Data Encryption Algorithm).
  • the processing method that the version number is greater than the second preset version number and is less than or equal to the third preset version number is an encryption process using an asymmetric encryption algorithm.
  • asymmetric encryption algorithms include, but are not limited to, RSA, Elgamal, and knapsack algorithms.
  • the third preset version number is greater than the second preset version number.
  • Step j Set a version number greater than a third preset version number according to the setting instruction, and a processing method corresponding to the fourth preset version number is an encryption process using an asymmetric encryption algorithm, and performing a lossy compression method. Compression processing.
  • the processing method that the version number is greater than the third preset version number and is less than or equal to the fourth preset version number is that the encryption processing is performed by using an asymmetric encryption algorithm, and the compression processing is performed by using a lossy compression method.
  • the fourth preset version number is greater than the third preset version number, and the second preset version, the third preset version number, and the fourth preset version number may be set by the user according to specific needs.
  • step k the processing manner corresponding to setting the version number to be greater than the fourth preset version number according to the setting instruction is to perform encryption processing by using an asymmetric encryption algorithm, and performing compression processing by using a lossless compression method.
  • mapping relationship between the interface version number and the processing mode may be set in other manners. In this embodiment, the setting is performed.
  • the specific implementation manner of the mapping relationship between the interface version number and the processing mode is not limited.
  • mapping relationship between the interface version number and the processing mode is set according to the setting instruction, so that the corresponding processing mode can be directly determined according to the interface version number in the process of testing the HTTP interface to be tested.
  • the obtaining module 10 is configured to obtain the version number of the HTTP interface to be tested after the data to be tested of the HTTP interface of the hypertext transfer protocol to be tested is obtained.
  • the determining module 20 is configured to determine, according to the mapping relationship between the version number of the HTTP interface to be tested and the processing manner of the data to be tested, the data to be tested according to the version number of the HTTP interface to be tested. Processing method
  • the processing module 30 is configured to process the data to be tested according to the processing manner, and obtain the processed data to be tested;
  • the sending module 40 is configured to send the processed data to be tested to the HTTP sampler sampler to be in the HTTP In the sampler, the test result of the HTTP interface to be tested is obtained by the processed data to be tested, and the front end processor and the back end processor of the stress test tool jmeter are integrated in the HTTP. Sampler.
  • the obtaining module 10 obtains the version number of the HTTP interface to be tested, and the determining module 20 determines the processing mode of the data to be tested according to the version number of the HTTP interface to be tested, and the processing module 30 processes the to-be-tested according to the processing manner determined by the determining module 20.
  • Data, the processed data to be tested is obtained, and the sending module 40 sends the processed data to be tested to the HTTP of the front-end processor and the back-end processor integrated with jmeter.
  • Sampler in response to the processed data to be tested in the HTTP sampler, via HTTP The sampler obtains the original data to be tested to test the HTTP interface to be tested. It avoids the need to perform a series of operations on the front-end processor and the back-end processor of the beanshell during the test of the HTTP interface, which simplifies the testing process of testing the HTTP interface and improves the testing efficiency of the HTTP interface.
  • the sending module 40 is further configured to send the processed data to be tested to the HTTP by using the URL carrying the version number.
  • the test result of the HTTP interface to be tested is obtained by responding to the data to be tested in the HTTP sampler.
  • the interface testing device further includes:
  • the interface testing device further includes:
  • a second setting module configured to: when the setting instruction for setting the mapping relationship is detected, set a processing mode corresponding to a version number less than or equal to a second preset version number according to the setting instruction to perform encryption processing by using a symmetric encryption algorithm And setting, according to the setting instruction, that the version number is greater than the second preset version number, and the processing manner corresponding to the third preset version number is: performing an encryption process by using an asymmetric encryption algorithm; setting a version according to the setting instruction;
  • the processing method corresponding to the third preset version number and less than or equal to the fourth preset version number is that the encryption processing is performed by using an asymmetric encryption algorithm, and the compression processing is performed by using a lossy compression method; and the version is set according to the setting instruction.
  • the processing method corresponding to the number greater than the fourth preset version number is an encryption process using an asymmetric encryption algorithm, and a compression process using a lossless compression method.
  • the sending module 40 includes:
  • a sending unit configured to send the processed data to be tested to an HTTP sampler
  • a parsing unit configured to parse the numerical value to obtain a plaintext corresponding to the numerical value
  • the sending unit is further configured to send the plaintext to the HTTP sampler to be in the HTTP
  • the test result of the HTTP interface to be tested is obtained by responding to the plaintext in the sampler.
  • the sending unit further includes:
  • a sending subunit configured to send the plaintext to the HTTP sampler to be in the HTTP Responding to the plaintext in the sampler, and obtaining a result identifier of the test result of the HTTP interface to be tested;
  • Determining the sub-unit if the result is identified as the first identifier, determining that the HTTP interface to be tested is in a normal state; if the result identifier is a second identifier, determining that the HTTP interface to be tested is in an abnormal state.
  • the obtaining module 10 includes:
  • a selection unit configured to display, on the display interface, a path of the HTTP interface to be tested that is to be tested after the data to be tested of the HTTP interface to be tested is obtained;
  • a second obtaining unit configured to acquire a version number of the HTTP interface to be tested according to the selection instruction, after detecting a selection instruction for selecting the path.
  • each embodiment of the interface testing device is substantially the same as the foregoing embodiments of the interface testing method, and details are not described herein again.
  • FIG. 5 is a schematic structural diagram of a hardware operating environment involved in an embodiment of the present application.
  • FIG. 5 can be a schematic structural diagram of a hardware operating environment of the interface test device.
  • the interface test device in this embodiment of the present application may be a terminal device such as a PC or a portable computer.
  • the interface test device can include a processor 1001, such as a CPU, a network interface 1004, a memory 1005, and a communication bus 1002.
  • the communication bus 1002 is used to implement connection communication between these components.
  • the memory 1005 may be a high speed RAM memory or a stable memory (non-volatile) Memory), such as disk storage.
  • the memory 1005 can also optionally be a storage device independent of the aforementioned processor 1001.
  • the interface test device structure shown in FIG. 5 does not constitute a limitation of the interface test device, and may include more or less components than those illustrated, or combine some components or different components. Arrangement.
  • an operating system and an interface test program may be included in the memory 1005 as a computer storage medium.
  • the operating system is a program that manages and controls the interface test device hardware and software resources, and supports the operation of the interface test program and other software or programs.
  • the processor 1001 can be used to call an interface test program stored in the memory 1005 and perform the steps of the interface test method as described above.
  • the embodiment of the present application further provides a computer readable storage medium, where the interface readable storage program is stored, and the interface test program is executed by the processor to implement the steps of the interface testing method as described above. .
  • the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better.
  • Implementation Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Computer And Data Communications (AREA)

Abstract

本申请公开了一种接口测试方法、装置、设备及计算机可读存储介质,该方法为:当获取到测试待测试HTTP接口的待测试数据后,获取待测试HTTP接口的版本号;基于待测试HTTP接口的版本号与针对待测试数据的处理方式之间的映射关系,根据待测试HTTP接口的版本号确定对待测试数据的处理方式;按照处理方式对待测试数据进行处理,将处理后的待测试数据发送至HTTP sampler中,以在HTTP sampler中响应处理后的待测试数据,得到待测试HTTP接口的测试结果,jmeter的前端处理器和后端处理器集成在HTTP sampler中。本申请简化了测试HTTP接口的测试流程,提高了HTTP接口的测试效率。

Description

接口测试方法、装置、设备及计算机可读存储介质
本申请要求于2018年4月12日提交中国专利局、申请号为201810330488.2、发明名称为“接口测试方法、装置、设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
技术领域
本申请涉及区块链技术领域,尤其涉及一种接口测试方法、装置、设备及计算机可读存储介质。
背景技术
现有的HTTP(Hyper Text Transfer Protocol,超文本传输协议)接口的测试方法为:beanshell的前置处理器将加密和/或压缩后的数据通过HTTP接口将数据传输给beanshell的后置处理器,后置处理器接收到加密和/或压缩后的数据后,对应解密和/或解压缩后该数据,得到对应的明文,并响应该明文。其中,beanshell是一个JAVA源码解释器,支持对象式的脚本语言特性,亦可嵌入到JAVA源代码中。当后置处理器响应明文后,将响应结果加密和/或压缩后通过HTTP接口返回给前置处理器。当前置处理器接收到响应结果后,需要进行对应的加密操作和/或解压缩操作才可以知道HTTP接口的测试结果。由此可知,现有的HTTP接口的测试方法操作流程繁琐。
发明内容
本申请的主要目的在于提供一种接口测试方法、装置、设备及计算机可读存储介质,旨在解决现有的HTTP接口测试流程繁琐的技术问题。
为实现上述目的,本申请提供一种接口测试方法,所述接口测试方法包括步骤:
当获取到测试待测试超文本传输协议HTTP接口的待测试数据后,获取所述待测试HTTP接口的版本号;
基于所述待测试HTTP接口的版本号与针对所述待测试数据的处理方式之间的映射关系,根据所述待测试HTTP接口的版本号确定对所述待测试数据的处理方式;
按照所述处理方式对所述待测试数据进行处理,得到处理后的所述待测试数据;
将处理后的所述待测试数据发送至HTTP取样器sampler中,以在所述HTTP sampler中响应处理后的所述待测试数据,得到所述待测试HTTP接口的测试结果,压力测试工具jmeter的前端处理器和后端处理器集成在所述HTTP sampler中。
此外,为实现上述目的,本申请还提供一种接口测试装置,所述接口测试装置包括:
获取模块,用于当获取到测试待测试超文本传输协议HTTP接口的待测试数据后,获取所述待测试HTTP接口的版本号;
确定模块,用于基于所述待测试HTTP接口的版本号与针对所述待测试数据的处理方式之间的映射关系,根据所述待测试HTTP接口的版本号确定对所述待测试数据的处理方式;
处理模块,用于按照所述处理方式对所述待测试数据进行处理,得到处理后的所述待测试数据;
发送模块,用于将处理后的所述待测试数据发送至HTTP取样器sampler中,以在所述HTTP sampler中响应处理后的所述待测试数据,得到所述待测试HTTP接口的测试结果,压力测试工具jmeter的前端处理器和后端处理器集成在所述HTTP sampler中。
此外,为实现上述目的,本申请还提供一种接口测试设备,所述接口测试设备包括存储器、微处理器和存储在所述存储器上并可在所述处理器上运行的接口测试程序,所述接口测试程序被所述微处理器执行时实现如上所述的接口测试方法的步骤。
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有接口测试程序,所述接口测试程序被处理器执行时实现如上所述的接口测试方法的步骤。
本申请通过获取待测试HTTP接口的版本号,根据待测试HTTP接口的版本号确定处理待测试数据的处理方式,得到处理后的待测试数据,将处理后的待测试数据发送至集成了jmeter的前端处理器和后端处理器的HTTP sampler中,以在HTTP sampler中响应处理后的待测试数据,通过 HTTP sampler获取原始的待测试数据,以测试待测试HTTP接口。避免了在测试HTTP接口过程中,需要在beanshell的前端处理器和后端处理器分别进行一系列的操作,简化了测试HTTP接口的测试流程,提高了HTTP接口的测试效率。
附图说明
图1为本申请接口测试方法第一实施例的流程示意图;
图2为本申请接口测试方法第二实施例的流程示意图;
图3为本申请接口测试方法第三实施例的流程示意图;
图4为本申请接口测试装置较佳实施例的功能示意图模块图;
图5是本申请实施例方案涉及的硬件运行环境的结构示意图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供一种接口测试方法,参照图1,图1为本申请接口测试方法第一实施例的流程示意图。
本申请实施例提供了接口测试方法的实施例,需要说明的是,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
接口测试方法可应用于接口测试设备,接口测试设备可为PC(personal computer,个人计算机),便携计算机等终端设备,以下以接口测试设备为执行主体描述本方案,为了简便,省略了接口测试设备这个执行主体。接口测试方法包括:
步骤S10,当获取到测试待测试超文本传输协议HTTP接口的待测试数据后,获取所述待测试HTTP接口的版本号。
当获取到测试待测试HTTP接口的待测试数据后,获取待测试HTTP接口的版本号。其中,待测试数据可为预先设置好的测试数据,或者在启动接口测试流程时由用户手动输入的。需要说明的是,用户在使用HTTP接口传输数据过程中,有些用户更新了HTTP接口,有的用户没有更新HTTP接口。因此,需要获取待测试HTTP接口的版本号来确定所测试的接口是哪个版本的HTTP接口。
进一步地,步骤S10包括:
步骤a,当获取到测试待测试HTTP接口的待测试数据后,在显示界面显示可供选择的所述待测试HTTP接口的路径。
进一步地,当获取到测试待测试HTTP接口的待测试数据后,在显示界面显示可供用户选择的待测试HTTP接口的路径。如在显示界面显示不同路径的待测试HTTP接口,或者在显示界面显示下拉按钮,当用户点击与该待测试HTTP接口对应的下拉按钮时,在显示界面显示出与该待测试HTTP接口对应的不同路径,供用户选择。
步骤b,当侦测到选择所述路径的选择指令后,根据所述选择指令获取所述待测试HTTP接口的版本号。
实时检测是否侦测到选择待测试HTTP接口路径的选择指令。当侦测到选择路径的选择指令后,根据选择指令获取待测试HTTP接口的版本号。可以理解的是,一个待测试HTTP接口的路径对应一种版本的待测试HTTP接口。该选择指令可由用户点击待测试HTTP接口的路径而触发,或者由用户在特定的输入界面输入待测试HTTP接口的路径而触发。
步骤S20,基于所述待测试HTTP接口的版本号与针对所述待测试数据的处理方式之间的映射关系,根据所述待测试HTTP接口的版本号确定对所述待测试数据的处理方式。
当获取到待测试HTTP接口的版本号后,获取预先存储的待测试HTTP接口的版本号与针对待测试数据的处理方式之间的映射关系,根据所获取的版本号,在映射关系中查找到处理待测试数据的处理方式。在本实施例中,处理方式包括两种,一种为需要对待测试数据进行加密处理,一种为需要对待测试数据进行加密处理以及压缩处理。可以理解的是,也可将处理方式设置为包括四种,除了上述两种处理方式外,处理方式还可包括对待测试数据进行压缩处理,以及对待测试数据不进行压缩处理,以及不进行加密处理。
待测试HTTP接口的版本号与针对待测试数据的处理方式之间的映射关系可根据具体需要而设置。处理方式为加密操作和压缩操作。需要说明的是,在映射关系中,对应的处理方式还包括具体的加密算法和/或压缩算法。如可将映射关系设置为:当某个待测试HTTP接口的版本号为1时,对应的处理方式为采用Base64算法进行加密;当版本号为2时,对应的处理方式为采用DES(Data Encryption Standard,数据加密标准)算法进行加密,以及采用LZ77编码进行压缩。其中,Base64是网络上最常见的用于传输8Bit字节码的编码方式之一,Base64就是一种基于64个可打印字符来表示二进制数据的方法。LZ77编码是一种基于字典的、“滑动窗”的无损压缩算法。
可以理解的是,除上述所提及的压缩算法和加密算法外,在本实施例中,加密算法包括但不限于RSA、AES(Advanced Encryption Standard,高级加密标准)、椭圆加密算法ECC、MD5(Message-Digest Algorithm 5,信息-摘要算法5)和SHA(Secure Hash Algorithm,安全散列算法),压缩算法包括但不限于gzip(GNUzip)和LZW(Lempel-Ziv-Welch Encoding,串表压缩算法)。
步骤S30,按照所述处理方式对所述待测试数据进行处理,得到处理后的所述待测试数据。
当确定处理待测试数据的处理方式后,按照所确定的处理方式处理待测试数据,得到处理后的待测试数据。如当确定的处理方式为加密操作和压缩操作,则采用通过映射关系确定的加密算法对待测试数据进行加密操作,以及采用通过映射关系确定的压缩算法对待测试数据进行压缩操作,得到加密加压后的待测试数据。
步骤S40,将处理后的所述待测试数据发送至超文本传输协议取样器HTTP sampler中,以在所述HTTP sampler中响应处理后的所述待测试数据,得到所述待测试HTTP接口的测试结果,压力测试工具jmeter的前端处理器和后端处理器集成在所述HTTP sampler中。
当得到处理后的待测试数据后,将处理后的待测试数据发送至HTTP sampler中,以在HTTP sampler中响应处理后的待测试数据,得到待测试HTTP接口的测试结果。其中,jmeter的前端处理器和后端处理器集成在HTTP sampler中,jmeter(apache-jmeter)是基于java语言开发的主要用来做接口跟压力测试的一种开源测试工具。HTTP sampler是jmeter里面的一个元件,中文名译为HTTP请求,专门用于模拟HTTP接口的元件。
进一步地,步骤S40包括:
步骤c,将处理后的所述待测试数据发送至HTTP sampler中,以字节流的方式获取所述HTTP sampler中处理后的所述待测试数据对应的数值。
进一步地,当得到处理后的待测试数据后,将处理后的待测试数据发送至HTTP sampler中,并以字节流的方式获取述HTTP sampler中处理后的待测试数据。其中,当将处理后的待测试数据发送至HTTP sampler中后,HTTP sampler会响应该处理后的待测试数据,得到该待测试数据对应的数值。
可以理解的是,HTTP sampler是专门用于模拟HTTP协议接口的元件,因此,当将待测试数据发送至HTTP sampler中后,相当于待测试数据经过了待测试HTTP接口。由于字节流可用于任何类型的对象,包括二进制对象,因此,通过字节流可提取HTTP sampler中任何类型的待测试数据,使该接口测试方法可用于测试不同类型数据是否可以成功通过HTTP接口。
步骤d,解析所述数值,得到所述数值对应的明文,并将所述明文发送至所述HTTP sampler中,以在所述HTTP sampler中响应所述明文,得到所述待测试HTTP接口的测试结果。
在从HTTP sampler中获取到待测试数据对应的数值后,解析该数值,得到该数值对应的明文,并将该明文重新发送至HTTP sampler中,以在HTTP sampler中响应该明文,得到待测试HTTP接口的测试结果。
可以理解的是,在根据该数值得到待测试数据对应的明文的过程中,根据处理待测试数据对应的方法解析该数值,可得到对应的明文,即解析的过程包括解密操作和/或解压缩操作。如若之前采用Base64算法对待测试数据进行加密,得到处理后的待测试数据,则此时也采用Base64算法进行解密该数值,得到待测试数据对应的明文,即得到原始的待测试数据;若之前采用DES算法对待测试数据进行加密,以及采用LZ77编码对待测试数据进行压缩,则此时也采用DES算法解密该数值,以及采用LZ77编码解压缩该数值,得到该数值对应的明文。
进一步地,步骤d包括:
步骤e,解析所述数值,得到所述数值对应的明文,并将所述明文发送至所述HTTP sampler中,以在所述HTTP sampler中响应所述明文,得到所述待测试HTTP接口测试结果的结果标识。
在从HTTP sampler中获取到待测试数据对应的数值后,解析该数值,得到该数值对应的明文,并将该明文重新发送至HTTP sampler中,以在HTTP sampler中响应该明文,得到待测试HTTP接口测试结果的结果标识。需要说明的是,结果标识包括两种,一种表示待测试结果处于正常状态,一种表示待测试HTTP接口处于异常状态。
步骤f,若所述结果标识为第一标识,则确定所述待测试HTTP接口处于正常状态。
若结果标识为第一标识,则确定待测试HTTP接口处于正常状态。其中,第一标识可以根据需要而设置,只要可以区分出待测试HTTP接口处于正常状态还是处于异常状态即可。如可将第一标识设置为“1”或者“11”等。
步骤g,若所述结果标识为第二标识,则确定所述待测试HTTP接口处于异常状态。
若结果标识为第二标识,则确定待测试HTTP接口处于异常状态。其中,第二标识可以根据需要而设置,只要可以区分第一标识和第二标识即可。如第二标识可以设置为“0”或者“00”等。
在得到测试结果的结果标识后,可将该结果标识显示在GUI(Graphical User Interface,图形用户接口)中,以供用户查看。
本实施例通过获取待测试HTTP接口的版本号,根据待测试HTTP接口的版本号确定处理待测试数据的处理方式,得到处理后的待测试数据,将处理后的待测试数据发送至集成了jmeter的前端处理器和后端处理器的HTTP sampler中,以在HTTP sampler中响应处理后的待测试数据,通过 HTTP sampler获取原始的待测试数据,以测试待测试HTTP接口,避免了在测试HTTP接口过程中,需要在beanshell的前端处理器和后端处理器分别进行一系列的操作,简化了测试HTTP接口的测试流程,提高了HTTP接口的测试效率。
进一步地,提出本申请接口测试方法第二实施例。
所述接口测试方法第二实施例与所述接口测试方法第一实施例的区别在于,参照图2,接口测试方法还包括:
步骤S50,获取所述待测试HTTP接口的统一资源定位符URL,拼接所述URL和所述版本号,得到携带版本号的所述URL。
在获取到待测试HTTP接口的版本号后,获取待测试HTTP接口的URL(Uniform Resource Locator,统一资源定位符),拼接所获取的URL和所获取的版本号,得到携带待测试HTTP接口版本号的URL。在本实施例中,拼接URL与版本号的方式为:在URL后面增加版本号。如若待测试HTTP接口的URL为“www.***.com”,版本号为“?V=2”,则拼接URL与版本号后得到的携带版本号的URL为“www.***.com?V=2”。在本实施例中,不限制待测试HTTP接口URL与版本号之间的拼接方式。
步骤S40包括:
步骤S41,通过携带版本号的所述URL将处理后的所述待测试数据发送至HTTP sampler中,以在所述HTTP sampler中响应处理后的所述待测试数据,得到所述待测试HTTP接口的测试结果。
当得到待测试HTTP接口携带版本号的URL后,通过携带版本号的URL将处理后的待测试数据发送至HTTP sampler中,以在HTTP sampler中响应处理后的待测试数据,得到待测试HTTP接口的测试结果。
本实施例通过将待测试HTTP接口的版本号与待测试HTTP接口的URL拼接,得到携带版本号的URL,通过携带版本号的URL确保成功将待测试数据发送至HTTP sampler中,提高了测试HTTP接口的测试成功率。
进一步地,提出本申请接口测试方法第三实施例。
所述接口测试方法第三实施例与所述接口测试方法第一或第二实施例的区别在于,参照图3,接口测试方法还包括:
步骤S60,当侦测到设置所述映射关系的设置指令后,根据所述设置指令设置版本号小于或者等于第一预设版本号对应的处理方式为加密处理。
检测是否侦测到设置接口版本号与处理方式之间的设置指令。当侦测到设置该映射关系的设置指令后,根据该设置指令设置版本号小于第一预设版本号对应的处理方式为加密处理。其中,该设置指令可由用户根据需要而触发。第一预设版本号可根据具体需要而设置,如可设置为2或者3。进一步地,还可设置加密处理对应的加密方法。若用户没有设置处理方式对应的加密算法和/或压缩算法,则在测试待测试HTTP接口过程,随机选择加密算法和/或压缩算法。
步骤S70,根据所述设置指令设置版本号大于所述第一预设版本号对应的处理方式为加密处理和压缩处理。
根据该设置指令设置版本号大于第一预设版本号对应的处理方式为加密处理和压缩处理。进一步地,还可为不同版本号设置相同或者不同的加密算法和/或压缩算法。
进一步地,接口测试方法还包括:
步骤h,当侦测到设置所述映射关系的设置指令后,根据所述设置指令设置版本号小于或者等于第二预设版本号对应的处理方式为采用对称加密算法进行加密处理。
进一步地,当侦测到设置映射关系的设置指令后,根据该设置指令设置版本号小于或者等于第二预设版本号对应的处理方式为采用对称加密算法进行加密处理。其中,第二预设版本号可与第一预设版本号相同或者不同。对称加密算法包括但不限于DES,3DES和 TDEA(Triple Data Encryption Algorithm)。
步骤i,根据所述设置指令设置版本号大于所述第二预设版本号,且小于或者等于第三预设版本号对应的处理方式为采用非对称加密算法进行加密处理。
根据设置指令设置版本号大于第二预设版本号,且小于或者等于第三预设版本号对应的处理方式为采用非对称加密算法进行加密处理。其中,非对称加密算法包括但不限于RSA、Elgamal和背包算法。第三预设版本号大于第二预设版本号。
步骤j,根据所述设置指令设置版本号大于第三预设版本号,且小于或者等于第四预设版本号对应的处理方式为采用非对称加密算法进行加密处理,以及采用有损压缩方式进行压缩处理。
根据设置指令设置版本号大于第三预设版本号,且小于或者等于第四预设版本号对应的处理方式为采用非对称加密算法进行加密处理,以及采用有损压缩方式进行压缩处理。其中,第四预设版本号大于第三预设版本号,第二预设版本、第三预设版本号和第四预设版本号可由用户根据具体需要而设置。
步骤k,根据所述设置指令设置版本号大于第四预设版本号对应的处理方式为采用非对称加密算法进行加密处理,以及采用无损压缩方式进行压缩处理。
根据设置指令设置版本号大于第四预设版本号对应的处理方式为采用非对称加密算法进行加密处理,以及采用无损压缩方式进行压缩处理。在本实施例中,并不限制对称加密算法、非对称加密算法、有损压缩方式和无损压缩方式的具体算法,用户可根据具体需要选择对称加密算法、非对称加密算法、有损压缩方式和无损压缩方式的具体算法。
需要说明的是,除了可以通过上述方式设置接口版本号与处理方式之间的映射关系以外,还可以通过其他方式来设置接口版本号与处理方式之间的映射关系,本实施例中,对于设置接口版本号与处理方式之间的映射关系的具体实现方式并不作限制。
本实施例通过根据设置指令设置接口版本号与处理方式之间的映射关系,以便于在测试待测试HTTP接口过程中,可以直接根据接口版本号确定对应的处理方式。
此外,参照图4,本申请还提供一种接口测试装置,接口测试装置包括:
获取模块10,用于当获取到测试待测试超文本传输协议HTTP接口的待测试数据后,获取所述待测试HTTP接口的版本号;
确定模块20,用于基于所述待测试HTTP接口的版本号与针对所述待测试数据的处理方式之间的映射关系,根据所述待测试HTTP接口的版本号确定对所述待测试数据的处理方式;
处理模块30,用于按照所述处理方式对所述待测试数据进行处理,得到处理后的所述待测试数据;
发送模块40,用于将处理后的所述待测试数据发送至HTTP取样器sampler中,以在所述HTTP sampler中响应处理后的所述待测试数据,得到所述待测试HTTP接口的测试结果,压力测试工具jmeter的前端处理器和后端处理器集成在所述HTTP sampler中。
本实施例通过获取模块10获取待测试HTTP接口的版本号,确定模块20根据待测试HTTP接口的版本号确定处理待测试数据的处理方式,处理模块30根据确定模块20确定的处理方式处理待测试数据,得到处理后的待测试数据,发送模块40将处理后的待测试数据发送至集成了jmeter的前端处理器和后端处理器的HTTP sampler中,以在HTTP sampler中响应处理后的待测试数据,通过 HTTP sampler获取原始的待测试数据,以测试待测试HTTP接口。避免了在测试HTTP接口过程中,需要在beanshell的前端处理器和后端处理器分别进行一系列的操作,简化了测试HTTP接口的测试流程,提高了HTTP接口的测试效率。
进一步地,获取模块10还用于获取所述待测试HTTP接口的统一资源定位符URL;
接口测试装置还包括:
拼接模块,用于拼接所述URL和所述版本号,得到携带版本号的所述URL;
发送模块40还用于通过携带版本号的所述URL将处理后的所述待测试数据发送至HTTP sampler中,以在所述HTTP sampler中响应处理后的所述待测试数据,得到所述待测试HTTP接口的测试结果。
进一步地,接口测试装置还包括:
第一设置模块,用于当侦测到设置所述映射关系的设置指令后,根据所述设置指令设置版本号小于或者等于第一预设版本号对应的处理方式为加密处理;根据所述设置指令设置版本号大于所述第一预设版本号对应的处理方式为加密处理和压缩处理。
进一步地,接口测试装置还包括:
第二设置模块,用于当侦测到设置所述映射关系的设置指令后,根据所述设置指令设置版本号小于或者等于第二预设版本号对应的处理方式为采用对称加密算法进行加密处理;根据所述设置指令设置版本号大于所述第二预设版本号,且小于或者等于第三预设版本号对应的处理方式为采用非对称加密算法进行加密处理;根据所述设置指令设置版本号大于第三预设版本号,且小于或者等于第四预设版本号对应的处理方式为采用非对称加密算法进行加密处理,以及采用有损压缩方式进行压缩处理;根据所述设置指令设置版本号大于第四预设版本号对应的处理方式为采用非对称加密算法进行加密处理,以及采用无损压缩方式进行压缩处理。
进一步地,发送模块40包括:
发送单元,用于将处理后的所述待测试数据发送至HTTP sampler中;
第一获取单元,用于以字节流的方式获取所述HTTP sampler中处理后的所述待测试数据对应的数值;
解析单元,用于解析所述数值,得到所述数值对应的明文;
所述发送单元还用于将所述明文发送至所述HTTP sampler中,以在所述HTTP sampler中响应所述明文,得到所述待测试HTTP接口的测试结果。
进一步地,所述发送单元还包括:
发送子单元,用于将所述明文发送至所述HTTP sampler中,以在所述HTTP sampler中响应所述明文,得到所述待测试HTTP接口测试结果的结果标识;
确定子单元,用于若所述结果标识为第一标识,则确定所述待测试HTTP接口处于正常状态;若所述结果标识为第二标识,则确定所述待测试HTTP接口处于异常状态。
进一步地,所述获取模块10包括:
选择单元,用于当获取到测试待测试HTTP接口的待测试数据后,在显示界面显示可供选择的所述待测试HTTP接口的路径;
第二获取单元,用于当侦测到选择所述路径的选择指令后,根据所述选择指令获取所述待测试HTTP接口的版本号。
需要说明的是,接口测试装置的各个实施例与上述接口测试方法的各实施例基本相同,在此不再详细赘述。
此外,本申请还提供一种接口测试设备。如图5所示,图5是本申请实施例方案涉及的硬件运行环境的结构示意图。
需要说明的是,图5即可为接口测试设备的硬件运行环境的结构示意图。本申请实施例接口测试设备可以是PC,便携计算机等终端设备。
如图5所示,该接口测试设备可以包括:处理器1001,例如CPU,网络接口1004,存储器1005,通信总线1002。其中,通信总线1002用于实现这些组件之间的连接通信。存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。
本领域技术人员可以理解,图5中示出的接口测试设备结构并不构成对接口测试设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
如图5所示,作为一种计算机存储介质的存储器1005中可以包括操作***以及接口测试程序。其中,操作***是管理和控制接口测试设备硬件和软件资源的程序,支持接口测试程序以及其它软件或程序的运行。
在图5所示的接口测试设备中,处理器1001可以用于调用存储器1005中存储的接口测试程序,并执行如上所述的接口测试方法的步骤。
本申请接口测试设备具体实施方式与上述接口测试方法各实施例基本相同,在此不再赘述。
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有接口测试程序,所述接口测试程序被处理器执行时实现如上所述的接口测试方法的步骤。
本申请计算机可读存储介质具体实施方式与上述接口测试方法各实施例基本相同,在此不再赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种接口测试方法,其特征在于,所述接口测试方法包括以下步骤:
    当获取到测试待测试超文本传输协议HTTP接口的待测试数据后,获取所述待测试HTTP接口的版本号;
    基于所述待测试HTTP接口的版本号与针对所述待测试数据的处理方式之间的映射关系,根据所述待测试HTTP接口的版本号确定对所述待测试数据的处理方式;
    按照所述处理方式对所述待测试数据进行处理,得到处理后的所述待测试数据;
    将处理后的所述待测试数据发送至HTTP取样器sampler中,以在所述HTTP sampler中响应处理后的所述待测试数据,得到所述待测试HTTP接口的测试结果,压力测试工具jmeter的前端处理器和后端处理器集成在所述HTTP sampler中。
  2. 如权利要求1所述的接口测试方法,其特征在于,所述将处理后的所述待测试数据发送至HTTP sampler中,以在所述HTTP sampler中响应处理后的所述待测试数据,得到所述待测试HTTP接口的测试结果的步骤之前,还包括:
    获取所述待测试HTTP接口的统一资源定位符URL,拼接所述URL和所述版本号,得到携带版本号的所述URL;
    所述将处理后的所述待测试数据发送至HTTP sampler中,以在所述HTTP sampler中响应处理后的所述待测试数据,得到所述待测试HTTP接口的测试结果的步骤包括:
    通过携带版本号的所述URL将处理后的所述待测试数据发送至HTTP sampler中,以在所述HTTP sampler中响应处理后的所述待测试数据,得到所述待测试HTTP接口的测试结果。
  3. 如权利要求1所述的接口测试方法,其特征在于,所述当获取到测试待测试HTTP接口的待测试数据后,获取所述待测试HTTP接口的版本号的步骤之前,还包括:
    当侦测到设置所述映射关系的设置指令后,根据所述设置指令设置版本号小于或者等于第一预设版本号对应的处理方式为加密处理;
    根据所述设置指令设置版本号大于所述第一预设版本号对应的处理方式为加密处理和压缩处理。
  4. 如权利要求1所述的接口测试方法,其特征在于,所述当获取到测试待测试HTTP接口的待测试数据后,获取所述待测试HTTP接口的版本号的步骤之前,还包括:
    当侦测到设置所述映射关系的设置指令后,根据所述设置指令设置版本号小于或者等于第二预设版本号对应的处理方式为采用对称加密算法进行加密处理;
    根据所述设置指令设置版本号大于所述第二预设版本号,且小于或者等于第三预设版本号对应的处理方式为采用非对称加密算法进行加密处理;
    根据所述设置指令设置版本号大于第三预设版本号,且小于或者等于第四预设版本号对应的处理方式为采用非对称加密算法进行加密处理,以及采用有损压缩方式进行压缩处理;
    根据所述设置指令设置版本号大于第四预设版本号对应的处理方式为采用非对称加密算法进行加密处理,以及采用无损压缩方式进行压缩处理。
  5. 如权利要求1所述的接口测试方法,其特征在于,所述将处理后的所述待测试数据发送至HTTP sampler中,以在所述HTTP sampler中响应处理后的所述待测试数据,得到所述待测试HTTP接口的测试结果的步骤包括:
    将处理后的所述待测试数据发送至HTTP sampler中,以字节流的方式获取所述HTTP sampler中处理后的所述待测试数据对应的数值;
    解析所述数值,得到所述数值对应的明文,并将所述明文发送至所述HTTP sampler中,以在所述HTTP sampler中响应所述明文,得到所述待测试HTTP接口的测试结果。
  6. 如权利要求5所述的接口测试方法,其特征在于,所述解析所述数值,得到所述数值对应的明文,并将所述明文发送至所述HTTP sampler中,以在所述HTTP sampler中响应所述明文,得到所述待测试HTTP接口的测试结果的步骤包括:
    解析所述数值,得到所述数值对应的明文,并将所述明文发送至所述HTTP sampler中,以在所述HTTP sampler中响应所述明文,得到所述待测试HTTP接口测试结果的结果标识;
    若所述结果标识为第一标识,则确定所述待测试HTTP接口处于正常状态;
    若所述结果标识为第二标识,则确定所述待测试HTTP接口处于异常状态。
  7. 如权利要求1所述的接口测试方法,其特征在于,所述当获取到测试待测试HTTP接口的待测试数据后,获取所述待测试HTTP接口的版本号的步骤包括:
    当获取到测试待测试HTTP接口的待测试数据后,在显示界面显示可供选择的所述待测试HTTP接口的路径;
    当侦测到选择所述路径的选择指令后,根据所述选择指令获取所述待测试HTTP接口的版本号。
  8. 如权利要求2所述的接口测试方法,其特征在于,所述当获取到测试待测试HTTP接口的待测试数据后,获取所述待测试HTTP接口的版本号的步骤包括:
    当获取到测试待测试HTTP接口的待测试数据后,在显示界面显示可供选择的所述待测试HTTP接口的路径;
    当侦测到选择所述路径的选择指令后,根据所述选择指令获取所述待测试HTTP接口的版本号。
  9. 如权利要求3所述的接口测试方法,其特征在于,所述当获取到测试待测试HTTP接口的待测试数据后,获取所述待测试HTTP接口的版本号的步骤包括:
    当获取到测试待测试HTTP接口的待测试数据后,在显示界面显示可供选择的所述待测试HTTP接口的路径;
    当侦测到选择所述路径的选择指令后,根据所述选择指令获取所述待测试HTTP接口的版本号。
  10. 如权利要求4所述的接口测试方法,其特征在于,所述当获取到测试待测试HTTP接口的待测试数据后,获取所述待测试HTTP接口的版本号的步骤包括:
    当获取到测试待测试HTTP接口的待测试数据后,在显示界面显示可供选择的所述待测试HTTP接口的路径;
    当侦测到选择所述路径的选择指令后,根据所述选择指令获取所述待测试HTTP接口的版本号。
  11. 如权利要求5所述的接口测试方法,其特征在于,所述当获取到测试待测试HTTP接口的待测试数据后,获取所述待测试HTTP接口的版本号的步骤包括:
    当获取到测试待测试HTTP接口的待测试数据后,在显示界面显示可供选择的所述待测试HTTP接口的路径;
    当侦测到选择所述路径的选择指令后,根据所述选择指令获取所述待测试HTTP接口的版本号。
  12. 如权利要求6所述的接口测试方法,其特征在于,所述当获取到测试待测试HTTP接口的待测试数据后,获取所述待测试HTTP接口的版本号的步骤包括:
    当获取到测试待测试HTTP接口的待测试数据后,在显示界面显示可供选择的所述待测试HTTP接口的路径;
    当侦测到选择所述路径的选择指令后,根据所述选择指令获取所述待测试HTTP接口的版本号。
  13. 一种接口测试装置,其特征在于,所述接口测试装置包括:
    获取模块,用于当获取到测试待测试超文本传输协议HTTP接口的待测试数据后,获取所述待测试HTTP接口的版本号;
    确定模块,用于基于所述待测试HTTP接口的版本号与针对所述待测试数据的处理方式之间的映射关系,根据所述待测试HTTP接口的版本号确定对所述待测试数据的处理方式;
    处理模块,用于按照所述处理方式对所述待测试数据进行处理,得到处理后的所述待测试数据;
    发送模块,用于将处理后的所述待测试数据发送至HTTP取样器sampler中,以在所述HTTP sampler中响应处理后的所述待测试数据,得到所述待测试HTTP接口的测试结果,压力测试工具jmeter的前端处理器和后端处理器集成在所述HTTP sampler中。
  14. 如权利要求13所述的接口测试装置,其特征在于,所述获取模块还用于获取所述待测试HTTP接口的统一资源定位符URL;
    接口测试装置还包括:拼接模块,用于拼接所述URL和所述版本号,得到携带版本号的所述URL;
    所述发送模块还用于通过携带版本号的所述URL将处理后的所述待测试数据发送至HTTP sampler中,以在所述HTTP sampler中响应处理后的所述待测试数据,得到所述待测试HTTP接口的测试结果。
  15. 如权利要求13所述的接口测试装置,其特征在于,所述接口测试装置还包括:
    第一设置模块,用于当侦测到设置所述映射关系的设置指令后,根据所述设置指令设置版本号小于或者等于第一预设版本号对应的处理方式为加密处理;根据所述设置指令设置版本号大于所述第一预设版本号对应的处理方式为加密处理和压缩处理。
  16. 如权利要求13所述的接口测试装置,其特征在于,所述接口测试装置还包括:
    第二设置模块,用于当侦测到设置所述映射关系的设置指令后,根据所述设置指令设置版本号小于或者等于第二预设版本号对应的处理方式为采用对称加密算法进行加密处理;根据所述设置指令设置版本号大于所述第二预设版本号,且小于或者等于第三预设版本号对应的处理方式为采用非对称加密算法进行加密处理;根据所述设置指令设置版本号大于第三预设版本号,且小于或者等于第四预设版本号对应的处理方式为采用非对称加密算法进行加密处理,以及采用有损压缩方式进行压缩处理;根据所述设置指令设置版本号大于第四预设版本号对应的处理方式为采用非对称加密算法进行加密处理,以及采用无损压缩方式进行压缩处理。
  17. 如权利要求13所述的接口测试装置,其特征在于,所述发送模块包括:
    发送单元,用于将处理后的所述待测试数据发送至HTTP sampler中;
    第一获取单元,用于以字节流的方式获取所述HTTP sampler中处理后的所述待测试数据对应的数值;
    解析单元,用于解析所述数值,得到所述数值对应的明文;
    所述发送单元还用于将所述明文发送至所述HTTP sampler中,以在所述HTTP sampler中响应所述明文,得到所述待测试HTTP接口的测试结果。
  18. 如权利要求17所述的接口测试装置,其特征在于,所述发送单元还包括:
    发送子单元,用于将所述明文发送至所述HTTP sampler中,以在所述HTTP sampler中响应所述明文,得到所述待测试HTTP接口测试结果的结果标识;
    确定子单元,用于若所述结果标识为第一标识,则确定所述待测试HTTP接口处于正常状态;若所述结果标识为第二标识,则确定所述待测试HTTP接口处于异常状态。
  19. 一种接口测试设备,其特征在于,所述接口测试设备包括存储器、微处理器和存储在所述存储器上并可在所述微处理器上运行的接口测试程序,所述已接入接口测试程序被所述微处理器执行时实现如权利要求1所述的接口测试方法的步骤。
  20. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有接口测试程序,所述已接入接口测试程序被处理器执行时实现如权利要求1所述的接口测试方法的步骤。
PCT/CN2018/094104 2018-04-12 2018-07-02 接口测试方法、装置、设备及计算机可读存储介质 WO2019196213A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810330488.2 2018-04-12
CN201810330488.2A CN108600048B (zh) 2018-04-12 2018-04-12 接口测试方法、装置、设备及计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2019196213A1 true WO2019196213A1 (zh) 2019-10-17

Family

ID=63622273

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/094104 WO2019196213A1 (zh) 2018-04-12 2018-07-02 接口测试方法、装置、设备及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN108600048B (zh)
WO (1) WO2019196213A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110750457A (zh) * 2019-10-21 2020-02-04 中国民航信息网络股份有限公司 一种基于内存数据库的自动化单元测试方法及装置
CN111078529A (zh) * 2019-11-15 2020-04-28 汉海信息技术(上海)有限公司 客户端写入模块测试方法、装置、电子设备
CN111782524A (zh) * 2020-06-29 2020-10-16 京东数字科技控股有限公司 应用测试方法和装置、存储介质和电子装置
CN112069078A (zh) * 2020-09-15 2020-12-11 平安银行股份有限公司 Esa接口压力测试方法、装置、测试设备及存储介质
CN117579531A (zh) * 2024-01-15 2024-02-20 云筑信息科技(成都)有限公司 一种需要动态加验签接口的压测方法

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109491900A (zh) * 2018-10-31 2019-03-19 北京车和家信息技术有限公司 接口测试方法、装置、电子设备及计算机可读存储介质
CN109828908A (zh) * 2018-12-15 2019-05-31 中国平安人寿保险股份有限公司 接口测试参数加密方法、装置、电子设备及存储介质
CN110109826A (zh) * 2019-04-12 2019-08-09 平安普惠企业管理有限公司 针对接口的线上预警方法及相关装置
CN111294359B (zh) * 2020-02-27 2023-09-05 平安养老保险股份有限公司 压力测试方法、装置、计算机设备和存储介质
CN111221743B (zh) * 2020-03-18 2023-07-14 时时同云科技(成都)有限责任公司 自动化测试方法及***
CN112667506A (zh) * 2020-12-26 2021-04-16 一城一家网络科技有限公司 一种接口测试方法及相关装置
CN112783787A (zh) * 2021-02-04 2021-05-11 中国工商银行股份有限公司 接口测试方法、装置、***和电子设备
CN113438083B (zh) * 2021-06-22 2023-04-07 中国工商银行股份有限公司 基于接口自动化测试的加验签方法及装置
CN114020319A (zh) * 2021-09-28 2022-02-08 深圳市潮流网络技术有限公司 接口调用的方法、装置、服务器及计算机可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7028223B1 (en) * 2001-08-13 2006-04-11 Parasoft Corporation System and method for testing of web services
CN105162646A (zh) * 2015-07-29 2015-12-16 北京京东尚科信息技术有限公司 一种多协议接口测试***及方法
CN107797911A (zh) * 2016-09-02 2018-03-13 北京京东尚科信息技术有限公司 用于测试http接口的方法和装置
CN107872355A (zh) * 2016-09-26 2018-04-03 平安科技(深圳)有限公司 接口模拟测试的方法及装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101075312A (zh) * 2007-02-15 2007-11-21 东华大学 一种政务信息资源交换***的标准符合性测试方法
US9396094B2 (en) * 2011-07-21 2016-07-19 International Business Machines Corporation Software test automation systems and methods
CN105005532B (zh) * 2015-08-05 2017-11-24 广东欧珀移动通信有限公司 一种自动化测试应用程序接口稳定性的***及方法
CN106886494B (zh) * 2017-03-07 2020-03-24 深圳国泰安教育技术有限公司 一种接口自动化测试方法及其***
CN107171897A (zh) * 2017-07-14 2017-09-15 上海瀚银信息技术有限公司 一种接口测试方法及数据接口测试***

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7028223B1 (en) * 2001-08-13 2006-04-11 Parasoft Corporation System and method for testing of web services
CN105162646A (zh) * 2015-07-29 2015-12-16 北京京东尚科信息技术有限公司 一种多协议接口测试***及方法
CN107797911A (zh) * 2016-09-02 2018-03-13 北京京东尚科信息技术有限公司 用于测试http接口的方法和装置
CN107872355A (zh) * 2016-09-26 2018-04-03 平安科技(深圳)有限公司 接口模拟测试的方法及装置

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110750457A (zh) * 2019-10-21 2020-02-04 中国民航信息网络股份有限公司 一种基于内存数据库的自动化单元测试方法及装置
CN110750457B (zh) * 2019-10-21 2023-11-10 中国民航信息网络股份有限公司 一种基于内存数据库的自动化单元测试方法及装置
CN111078529A (zh) * 2019-11-15 2020-04-28 汉海信息技术(上海)有限公司 客户端写入模块测试方法、装置、电子设备
CN111078529B (zh) * 2019-11-15 2023-07-14 汉海信息技术(上海)有限公司 客户端写入模块测试方法、装置、电子设备
CN111782524A (zh) * 2020-06-29 2020-10-16 京东数字科技控股有限公司 应用测试方法和装置、存储介质和电子装置
CN112069078A (zh) * 2020-09-15 2020-12-11 平安银行股份有限公司 Esa接口压力测试方法、装置、测试设备及存储介质
CN112069078B (zh) * 2020-09-15 2024-03-19 平安银行股份有限公司 Esa接口压力测试方法、装置、测试设备及存储介质
CN117579531A (zh) * 2024-01-15 2024-02-20 云筑信息科技(成都)有限公司 一种需要动态加验签接口的压测方法
CN117579531B (zh) * 2024-01-15 2024-05-28 云筑信息科技(成都)有限公司 一种需要动态加验签接口的压测方法

Also Published As

Publication number Publication date
CN108600048B (zh) 2021-10-08
CN108600048A (zh) 2018-09-28

Similar Documents

Publication Publication Date Title
WO2019196213A1 (zh) 接口测试方法、装置、设备及计算机可读存储介质
WO2019205280A1 (zh) 服务器的测试方法、装置、设备及计算机可读存储介质
WO2019192085A1 (zh) 银企直联通信方法、装置、设备及计算机可读存储介质
WO2018107610A1 (zh) 业务数据处理方法、***、设备及计算机可读存储介质
WO2019037396A1 (zh) 账户清结算方法、装置、设备及存储介质
WO2018228050A1 (zh) 防止敏感信息泄露的方法、装置及存储介质
WO2019100531A1 (zh) 数字签名生成、验证方法及其设备和存储介质
WO2019104876A1 (zh) 保险产品的推送方法、***、终端、客户终端及存储介质
WO2015172684A1 (en) Ap connection method, terminal, and server
WO2016192270A1 (zh) 媒体文件的快速启播方法及装置
WO2016165556A1 (zh) 一种视频流的数据处理方法、装置和***
WO2019161597A1 (zh) 基于即时通讯的信息发送方法、装置、设备和存储介质
WO2019051902A1 (zh) 终端控制方法、空调器及计算机可读存储介质
WO2018149300A1 (zh) 疾病概率的检测方法、装置、设备及计算机可读存储介质
WO2014187158A1 (zh) 终端数据云分享的控制方法、服务器及终端
WO2019041851A1 (zh) 家电售后咨询方法、电子设备和计算机可读存储介质
WO2018034491A1 (en) A primary device, an accessory device, and methods for processing operations on the primary device and the accessory device
WO2017071352A1 (zh) 密码的推送方法、推送***及终端设备
WO2016000560A1 (en) File transmission method, file transmission apparatus, and file transmission system
WO2016058258A1 (zh) 终端远程控制方法和***
WO2018188342A1 (zh) 脚本文件生成方法、装置、设备和计算机可读存储介质
WO2019161599A1 (zh) Im信息保护方法、装置、设备和计算机存储介质
WO2018201699A1 (zh) 客户评价方法、装置、设备以及计算机可读存储介质
WO2019085301A1 (zh) 座机未接来电的反馈方法、装置、设备及可读存储介质
WO2018006581A1 (zh) 智能电视的播放方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18914086

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 21.01.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18914086

Country of ref document: EP

Kind code of ref document: A1