CN107391379B - Automatic interface testing method and device - Google Patents

Automatic interface testing method and device Download PDF

Info

Publication number
CN107391379B
CN107391379B CN201710630085.5A CN201710630085A CN107391379B CN 107391379 B CN107391379 B CN 107391379B CN 201710630085 A CN201710630085 A CN 201710630085A CN 107391379 B CN107391379 B CN 107391379B
Authority
CN
China
Prior art keywords
script
interface
tested
test case
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.)
Active
Application number
CN201710630085.5A
Other languages
Chinese (zh)
Other versions
CN107391379A (en
Inventor
谭敏
侯明
张文明
陈少杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201710630085.5A priority Critical patent/CN107391379B/en
Publication of CN107391379A publication Critical patent/CN107391379A/en
Application granted granted Critical
Publication of CN107391379B publication Critical patent/CN107391379B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

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 provides an automatic interface test method and a device, wherein the method comprises the following steps: acquiring the type of an interface to be tested and input parameters of the interface to be tested, and taking the input parameters as first parameters; processing the first parameter to obtain a second parameter with a data format matched with the type; generating a test case script based on a preset script template and the second parameter and storing the test case script into a test case script set of the interface to be tested; displaying each test case script in the test case script set of the interface to be tested; and responding to a first operation, selecting a target script corresponding to the first operation from the test case scripts to execute, and generating a first test report based on an execution result of the target script. Therefore, the test system can obtain reliable test results through automatic test of the interface to be tested without being limited by the self level of a test programmer.

Description

Automatic interface testing method and device
Technical Field
The invention relates to the technical field of software testing, in particular to an automatic interface testing method and device.
Background
The existing interface test is usually performed by a programmer according to the actual condition programming of the interface to be tested. However, the programmer level varies, which results in insufficient reliability of the test results obtained by running the written test code. Even, some personnel with a low programming level cannot perform functional testing on the interface to be tested.
Disclosure of Invention
In view of the above, the present invention provides an automatic interface testing method and apparatus to improve the above problems.
In order to achieve the above object, an embodiment of the present invention provides an interface automatic testing method, including:
acquiring the type of an interface to be tested and input parameters of the interface to be tested, and taking the input parameters as first parameters;
processing the first parameter to obtain a second parameter with a data format matched with the type;
generating a test case script based on a preset script template and the second parameter and storing the test case script into a test case script set of the interface to be tested;
displaying each test case script in the test case script set of the interface to be tested;
and responding to a first operation, selecting a target script corresponding to the first operation from the test case scripts to execute, and generating a first test report based on an execution result of the target script.
Optionally, in the above method, the method further comprises:
responding to a second operation, and acquiring each test case script in the test case script set of the interface to be tested;
generating an autoregressive script based on each test case script;
and executing the autoregressive script every preset time interval and generating a second test report based on an execution result.
Optionally, in the method, the step of generating an auto-regression script based on each test case script includes:
generating a first script file, and associating the first script file with the interface to be tested;
and adding each test case script into the first script file to obtain the auto-regression script.
Optionally, in the method, the step of generating the test case script based on the preset script template and the second parameter includes:
generating a second script file, and associating the second script file with the interface to be tested;
adding the preset script template into the second script file, and associating the test instruction in the preset script template with the interface to be tested;
and transmitting the second parameter to the preset script template to obtain a test case script based on the second parameter.
Optionally, in the method, the step of generating a first test report based on the execution result of the target script includes:
obtaining an expected execution result of the target script, and comparing an actual execution result of the target script with the expected execution result;
generating the first test report based on the result of the comparison and the actual execution result.
An embodiment of the present invention further provides an automatic interface testing device, where the automatic interface testing device includes:
the device comprises a first acquisition module, a second acquisition module and a first comparison module, wherein the first acquisition module is used for acquiring the type of an interface to be tested and input parameters of the interface to be tested and taking the input parameters as first parameters;
the format processing module is used for processing the first parameter to obtain a second parameter of which the data format is matched with the type;
the first script generation module is used for generating a test case script based on a preset script template and the second parameter and storing the test case script into a test case script set of the interface to be tested;
the display module is used for displaying each test case script in the test case script set of the interface to be tested;
and the first execution module is used for responding to a first operation, selecting a target script corresponding to the first operation from the test case scripts to execute, and generating a first test report based on an execution result of the target script.
Optionally, in the above apparatus, a manner that the second script generating module generates an auto-regression script based on each test case script includes:
generating a first script file, and associating the first script file with the interface to be tested;
and adding each test case script into the first script file to obtain the auto-regression script.
Optionally, in the apparatus, a manner that the first script generating module generates the test case script based on a preset script template and the second parameter includes:
generating a second script file, and associating the second script file with the interface to be tested;
adding the preset script template into the second script file, and associating the test instruction in the preset script template with the interface to be tested;
and transmitting the second parameter to the preset script template to obtain a test case script based on the second parameter.
Optionally, in the above apparatus, a manner that the first execution module generates the first test report based on the execution result of the target script includes:
obtaining an expected execution result of the target script, and comparing an actual execution result of the target script with the expected execution result;
generating the first test report based on the result of the comparison and the actual execution result.
The interface automatic test method and the interface automatic test device provided by the embodiment of the invention can generate the test case script of the interface to be tested according to the acquired type of the interface to be tested and the input parameters of the interface to be tested, and select the test case script in the test case script set of the interface to be tested to automatically execute based on the first operation. Through the design, the limit of the self level of a test programmer is not needed, and a reliable test result can be obtained through the automatic test of the interface to be tested.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the solution of the embodiment of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is a part of the embodiment of the present invention, but not a whole embodiment. 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.
Fig. 1 is a block diagram of an electronic terminal according to an embodiment of the present invention.
Fig. 2 is a schematic flowchart of an automatic interface testing method according to an embodiment of the present invention.
Fig. 3 is a schematic view of the substeps of step S103 shown in fig. 2.
Fig. 4 is a schematic flowchart of another method for automatically testing an interface according to an embodiment of the present invention.
Fig. 5 is a functional block diagram of an automatic interface testing device according to an embodiment of the present invention.
Icon: 100-an electronic terminal; 110-interface automatic test equipment; 111-a first acquisition module; 112-format processing module; 113-a first script generation module; 114-a display module; 115-a first execution module; 116-a second acquisition module; 117-second script generation module; 118-a second execution module; 120-a memory; 130-a processor; 140-display unit.
Detailed Description
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 only a part of the embodiments of the present invention, and not all of the embodiments. The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present invention, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Fig. 1 is a block diagram of an electronic terminal 100 according to an embodiment of the present invention. The electronic terminal 100 may be any device having a data processing function, such as a Personal Computer (PC), a smart phone, a tablet computer, a Personal Digital Assistant (PDA), a Mobile Internet Device (MID), and the like. The electronic terminal 100 includes an interface automatic test device 110, a memory 120, a processor 130 and a display unit 140.
The memory 120, the processor 130 and the display unit 140 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The interface automatic test device 110 includes at least one software function module that can be solidified in the form of software or firmware (firmware) in an Operating System (OS) of the electronic terminal 100. The processor 130 is used for executing executable modules stored in the memory 120, such as software functional modules and computer programs included in the automatic interface testing device 110.
The Memory 120 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like.
The processor 130 may be an integrated circuit chip having signal processing capabilities. The Processor 130 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and so on. But may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The display unit 140 is used for establishing an interactive interface between the electronic terminal 100 and a user or displaying data to be displayed (e.g., test case scripts, test reports, etc.). In this embodiment, the display unit 140 may be, but is not limited to, a liquid crystal display or a touch display.
It should be understood that the configuration shown in fig. 1 is merely illustrative, and the electronic terminal 100 may have more or fewer components than shown in fig. 1, or may have a different configuration than shown in fig. 1. Wherein the components shown in fig. 1 may be implemented by software, hardware, or a combination thereof.
An interface refers to a point of interaction between systems or between modules in a system. The interface test is mainly used for detecting whether the data interaction, transmission and logic functions of the interaction point are correct, essentially, the interface test is to send a Request message to a server to Request an interface to be tested, receive a Response message returned by the server Response, and analyze whether the function of the interface to be tested is correctly realized based on the Response message. It should be understood that the server described herein refers to the system in which the interface to be tested is located.
In practical application, the interface test is realized by a test script. Generally, a tester determines a test case according to a test requirement of an interface to be tested, and writes a test case script based on the test case to transmit input parameters required by the interface to be tested to the interface to be tested, so that the interface to be tested executes based on the received input parameters and returns an execution result. Finally, the tester judges whether the service function of the interface to be tested is correctly realized according to the execution result and the data information generated in the execution process.
However, the inventor finds that writing a test script requires a tester to be familiar with the test method, have programming capability, and the like. Moreover, different test cases are determined by testers at different levels, and different test scripts are compiled, so that the finally obtained test result can not effectively reflect the actual situation of the interface to be tested.
The automatic interface test method and the automatic interface test device provided by the embodiment of the invention can automatically generate the test case script, realize the automatic test of the interface and avoid the problem that the test result cannot really test the interface condition caused by different levels of testers.
Fig. 2 is a schematic flowchart of an interface automatic testing method according to an embodiment of the present invention, and the method may be implemented based on the electronic terminal 100 shown in fig. 1. The specific process and steps of the method shown in FIG. 1 will be described in detail below.
Step S101, obtaining the type of an interface to be tested and an input parameter of the interface to be tested, and taking the input parameter as a first parameter.
In practical applications, there are many types of interfaces, for example, json type, xml type, etc., and different types of interfaces have different requirements for the data format of the input parameters. In this embodiment, the data format processing code of each type of interface may be stored in advance, so as to process the acquired input parameter into data in the data format required by the type of interface.
Optionally, for the data format processing code of each type of interface, a corresponding relationship between the data format processing code and the type of interface may be established. As an embodiment, the data format handling code of each type of interface may be identified by a tag.
And step S102, processing the first parameter to obtain a second parameter with a data format matched with the type.
In implementation, a data format processing code corresponding to the type may be called to process the first parameter.
And S103, generating a test case script based on a preset script template and the second parameter and storing the test case script into the test case script set of the interface to be tested.
In this embodiment, the electronic terminal 100 may store a preset script template of the test case script in advance. In implementation, the second parameter obtained by processing is transmitted to the preset script template, so that a test case script can be obtained, wherein the obtained test case script is based on the second parameter, that is, the test case script with the second parameter as an input parameter.
Optionally, a test case script based on the second parameter may be generated through the steps shown in fig. 3, and the step S103 may include three substeps, i.e., step S201, step S202, and step S203.
Step S201, generating a second script file, and associating the second script file with the interface to be tested.
After the input first parameter is processed to obtain a second parameter, a second script file can be generated for bearing a corresponding test code. In this embodiment, there may be a plurality of types of association between the second script file and the interface to be tested. As an embodiment, the generated second script file may be named by using the name of the interface to be tested as a tag. For example, if the interface to be tested is a user information acquisition interface, and the name of the user information acquisition interface is userInfoGet, the userInfoGet may be used as a keyword to name the second script file corresponding to the user information acquisition interface, for example, the second script file may be named userInfoGet _ test. The above process may also be understood as generating a script file and naming the generated script file as userInfoGet _ test.
Step S202, adding the preset script template into the second script file, and associating the test instruction in the preset script template with the interface to be tested.
The preset script template may include a test instruction. The test instruction in the preset script template can be named by the keyword userInfoGet, and then the association between the test instruction in the preset script template and the interface to be tested is established.
And step S203, transmitting the second parameter to the preset script template to obtain a test case script based on the second parameter.
Through the design, the test case script associated with the interface to be tested can be generated, and then the test case script is represented to be used for testing the interface to be tested, so that the test case script is prevented from being confused with the test case scripts of other interfaces to be tested.
And step S104, displaying each test case script in the test case script set of the interface to be tested.
Optionally, in this embodiment, the user may directly import the written test case script into the electronic terminal 100 and store the test case script into the test case script set of the interface tested by the test case script. When a user needs to perform interface test, the user can input test case information by himself to generate a new test case script, and can also select a required target script in the test case script set of the interface to be tested to execute.
Step S105, in response to a first operation, selecting a target script corresponding to the first operation from the test case scripts to execute, and generating a first test report based on an execution result of the target script.
In this embodiment, the first operation is an operation of selecting a target script from a plurality of test case scripts by a user.
Optionally, during the execution of the target script, the electronic terminal 100 may capture and record data generated during the execution, and generate the first test report based on the execution result and the recorded data when the execution is completed. Wherein, the data generated in the execution process comprises abnormal data thrown in the execution process.
Optionally, in this embodiment, the step S105 may include the following steps.
And obtaining an expected execution result of the target script, comparing an actual execution result of the target script with the expected execution result, and generating the first test report based on the comparison result and the actual execution result.
Optionally, for each test case script of each interface to be tested, an expected execution result of the test case script may be stored in the electronic terminal 100. It should be noted that the expected execution result may be input by the user when inputting the input parameters of the interface to be tested, or may be stored in the electronic terminal 100 in advance.
Optionally, as shown in fig. 4, the interface automatic test method may further include step S106, step S107, and step S108.
And step S106, responding to the second operation, and acquiring each test case script in the test case script set of the interface to be tested.
In this embodiment, the second operation is an operation of determining that an auto-regression script needs to be generated. Optionally, in the process of inputting the input parameters required by the interface to be tested by the user, the electronic terminal 100 may provide an option for the user to select whether the auto-regressive script needs to be generated. And if the user selects to generate, automatically acquiring all test case scripts in the test case script set of the interface to be tested.
And S107, generating an autoregressive script based on each test case script.
Alternatively, in this embodiment, step S107 can be implemented by the following steps:
generating a first script file and associating the first script file with the interface to be tested. And adding each test case script into the first script file to obtain the auto-regression script.
As an embodiment, the name of the interface to be tested may be named as the name of the first script file, and then an association between the first script file and the interface to be tested is established.
In this embodiment, when the user selects the auto-regression script of the interface to be tested, the electronic terminal 100 extracts all the test case scripts stored in the test case script set of the interface to be tested, and adds the extracted test case scripts to the first script file to generate the auto-regression script of the interface to be tested.
In other words, the autoregressive script tests the interface to be tested based on all test cases in the test case script set of the interface to be tested.
And S108, executing the autoregressive script at preset time intervals and generating a second test report based on an execution result.
Optionally, an execution cycle with a preset duration may be set for the auto-regression script, and the auto-regression script may be triggered to execute periodically according to the execution cycle. The preset duration can be flexibly set according to actual conditions.
Optionally, in this embodiment, the script related to the foregoing content may be written in a scripting language such as Python language.
As shown in fig. 5, an interface automatic testing apparatus 110 according to an embodiment of the present invention may be implemented based on the electronic terminal 100 shown in fig. 1. The interface automatic test apparatus 110 includes a first obtaining module 111, a format processing module 112, a first script generating module 113, a display module 114, and a first executing module 115.
The first obtaining module 111 is configured to obtain a type of an interface to be tested and an input parameter of the interface to be tested, and use the input parameter as a first parameter.
In this embodiment, the description of the first obtaining module 111 may specifically refer to the detailed description of step S101 shown in fig. 2, that is, step S101 may be executed by the first obtaining module 111.
The format processing module 112 is configured to process the first parameter to obtain a second parameter with a data format matching the type.
In this embodiment, the description of the format processing module 112 may specifically refer to the detailed description of step S102 shown in fig. 2, that is, step S102 may be executed by the format processing module 112.
The first script generating module 113 is configured to generate a test case script based on a preset script template and the second parameter, and store the test case script to the test case script set of the interface to be tested.
In this embodiment, the description of the first script generating module 113 may specifically refer to the detailed description of step S103 shown in fig. 2, that is, step S103 may be executed by the first script generating module 113.
Optionally, the manner in which the first script generating module 113 generates the test case script based on the preset script template and the second parameter may include:
and generating a second script file, and associating the second script file with the interface to be tested. And adding the preset script template into the second script file, and associating the test instruction in the preset script template with the interface to be tested. And transmitting the second parameter to the preset script template to obtain a test case script based on the second parameter.
The display module 114 is configured to display each test case script in the test case script set of the interface to be tested.
In the present embodiment, the description of the display module 114 may specifically refer to the detailed description of step S104 shown in fig. 2, that is, the step S104 may be executed by the display module 114.
The first execution module 115 is configured to respond to a first operation, select a target script corresponding to the first operation from the test case scripts to execute, and generate a first test report based on an execution result of the target script.
In this embodiment, the description about the first executing module 115 may specifically refer to the detailed description about the step S105 shown in fig. 2, that is, the step S104 may be executed by the first executing module 115.
Optionally, in this embodiment, a manner that the first execution module 115 generates the first test report based on the execution result of the target script may include:
and obtaining an expected execution result of the target script, comparing an actual execution result of the target script with the expected execution result, and generating the first test report based on the comparison result and the actual execution result.
Optionally, referring to fig. 5 again, the interface automatic test device 110 may further include a second obtaining module 116, a second script generating module 117, and a second executing module 118.
The second obtaining module 116 is configured to respond to a second operation to obtain each test case script in the test case script set of the interface to be tested.
In this embodiment, the detailed description of the step S201 shown in fig. 3 may be specifically referred to for the description of the second obtaining module 116, that is, the step S201 may be executed by the second obtaining module 116.
The second script generating module 117 is configured to generate an auto-regression script based on the test case scripts.
In this embodiment, the detailed description of the step S202 shown in fig. 3 may be specifically referred to for the description of the second script generating module 117, that is, the step S202 may be executed by the second script generating module 117.
Optionally, in this embodiment, a manner that the second script generating module 117 generates an auto-regression script based on each test case script may include:
generating a first script file, associating the first script file with the interface to be tested, and adding each test case script into the first script file to obtain the auto-regression script.
The second execution module 118 is configured to execute the auto-regressive script every preset time interval and generate a second test report based on the execution result.
In this embodiment, the description of the second execution module 118 may specifically refer to the detailed description of step S203 shown in fig. 3, that is, the step S203 may be executed by the second execution module 118.
In summary, the method and the apparatus for automatically testing an interface according to the embodiments of the present invention can generate a test case script of the interface to be tested according to the obtained type of the interface to be tested and the input parameter of the interface to be tested, and select the test case script in the test case script set of the interface to be tested based on the first operation to automatically execute the test case script. Through the design, the limit of the self level of a test programmer is not needed, and a reliable test result can be obtained through the automatic test of the interface to be tested.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes. It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
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 claims.

Claims (6)

1. An automatic interface testing method is characterized by comprising the following steps:
acquiring the type of an interface to be tested and input parameters of the interface to be tested, and taking the input parameters as first parameters;
processing the first parameter to obtain a second parameter with a data format matched with the type;
generating a second script file, and associating the second script file with the interface to be tested, wherein specifically, the name of the interface to be tested is carried in the name of the second script file;
adding a preset script template into the second script file, and associating a test instruction in the preset script template with the interface to be tested;
transmitting the second parameter to the preset script template to obtain a test case script based on the second parameter and storing the test case script to the test case script set of the interface to be tested;
displaying each test case script in the test case script set of the interface to be tested;
responding to a first operation, selecting a target script corresponding to the first operation from the test case scripts to execute, and generating a first test report based on an execution result of the target script;
responding to a second operation, and acquiring each test case script in the test case script set of the interface to be tested;
generating an autoregressive script based on each test case script;
and executing the autoregressive script every preset time interval and generating a second test report based on an execution result.
2. The method for automatically testing an interface according to claim 1, wherein the step of generating an auto-regression script based on each test case script comprises:
generating a first script file, and associating the first script file with the interface to be tested;
and adding each test case script into the first script file to obtain the auto-regression script.
3. The automatic interface test method according to any one of claims 1 to 2, wherein the step of generating a first test report based on the execution result of the target script comprises:
obtaining an expected execution result of the target script, and comparing an actual execution result of the target script with the expected execution result;
generating the first test report based on the result of the comparison and the actual execution result.
4. An automatic interface test device, comprising:
the device comprises a first acquisition module, a second acquisition module and a first comparison module, wherein the first acquisition module is used for acquiring the type of an interface to be tested and input parameters of the interface to be tested and taking the input parameters as first parameters;
the format processing module is used for processing the first parameter to obtain a second parameter of which the data format is matched with the type;
the first script generation module is used for generating a second script file and associating the second script file with the interface to be tested, and specifically, the name of the interface to be tested is carried in the name of the second script file;
adding a preset script template into the second script file, and associating a test instruction in the preset script template with the interface to be tested;
transmitting the second parameter to the preset script template to obtain a test case script based on the second parameter and storing the test case script to the test case script set of the interface to be tested;
the display module is used for displaying each test case script in the test case script set of the interface to be tested;
the first execution module is used for responding to a first operation, selecting a target script corresponding to the first operation from the test case scripts to execute, and generating a first test report based on an execution result of the target script;
the automatic interface testing device further comprises:
the second obtaining module is used for responding to a second operation and obtaining each test case script in the test case script set of the interface to be tested;
the second script generation module is used for generating an autoregressive script based on each test case script;
and the second execution module is used for executing the autoregressive script at preset time intervals and generating a second test report based on an execution result.
5. The interface automatic test device according to claim 4, wherein the manner in which the second script generation module generates an autoregressive script based on each of the test case scripts includes:
generating a first script file, and associating the first script file with the interface to be tested;
and adding each test case script into the first script file to obtain the auto-regression script.
6. The automatic interface test device according to any one of claims 4 to 5, wherein the manner in which the first execution module generates the first test report based on the execution result of the target script includes:
obtaining an expected execution result of the target script, and comparing an actual execution result of the target script with the expected execution result;
generating the first test report based on the result of the comparison and the actual execution result.
CN201710630085.5A 2017-07-28 2017-07-28 Automatic interface testing method and device Active CN107391379B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710630085.5A CN107391379B (en) 2017-07-28 2017-07-28 Automatic interface testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710630085.5A CN107391379B (en) 2017-07-28 2017-07-28 Automatic interface testing method and device

Publications (2)

Publication Number Publication Date
CN107391379A CN107391379A (en) 2017-11-24
CN107391379B true CN107391379B (en) 2021-01-01

Family

ID=60341861

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710630085.5A Active CN107391379B (en) 2017-07-28 2017-07-28 Automatic interface testing method and device

Country Status (1)

Country Link
CN (1) CN107391379B (en)

Families Citing this family (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108153670B (en) * 2017-11-30 2021-07-30 北京奇艺世纪科技有限公司 Interface testing method and device and electronic equipment
CN108170604B (en) * 2017-12-29 2021-01-15 成都市共维科技有限公司 Test method, test device, computer equipment and storage medium
CN110022239A (en) * 2018-01-08 2019-07-16 深圳市中兴微电子技术有限公司 A kind of detection method, equipment and storage medium
CN108388514B (en) * 2018-02-24 2021-02-23 平安科技(深圳)有限公司 Interface automation test method, device, equipment and computer readable storage medium
CN110502420A (en) * 2018-05-17 2019-11-26 北京京东尚科信息技术有限公司 A kind of method and apparatus for realizing test script selfreparing
CN108959067B (en) * 2018-05-31 2023-04-07 康键信息技术(深圳)有限公司 Method and device for testing search engine and computer readable storage medium
CN110737575B (en) * 2018-07-20 2023-09-01 北京金山云网络技术有限公司 Interface testing method and device, electronic equipment and storage medium
CN109032015B (en) * 2018-08-01 2020-04-17 惠州志顺电子实业有限公司 MCU interface control method and device
CN109032956B (en) * 2018-09-11 2022-03-22 郑州云海信息技术有限公司 Interface testing method and device
CN109408370A (en) * 2018-09-18 2019-03-01 深圳壹账通智能科技有限公司 Interface testing document generating method, device, computer equipment and storage medium
CN109522211B (en) * 2018-09-29 2023-07-18 中国平安人寿保险股份有限公司 Interface parameter transmission method and device, electronic equipment and storage medium
CN109558290B (en) * 2018-11-12 2023-06-02 平安科技(深圳)有限公司 Server, interface automatic test method and storage medium
CN109655706A (en) * 2018-12-11 2019-04-19 中国航空工业集团公司成都飞机设计研究所 A kind of remote interface units automatic test equipment
CN109710532A (en) * 2018-12-28 2019-05-03 北京金山安全软件有限公司 Test case management method and device and electronic equipment
CN109710537B (en) * 2019-01-02 2022-02-18 郑州云海信息技术有限公司 Intelligent automatic testing method and system
CN109871314A (en) * 2019-01-02 2019-06-11 石化盈科信息技术有限责任公司 The automatic generation method of test script
CN109933531A (en) * 2019-03-19 2019-06-25 湖南国科微电子股份有限公司 Automatic testing method, device and electronic equipment
CN109933535B (en) * 2019-03-26 2022-09-13 北京金山云网络技术有限公司 Test case generation method and device and server
CN112395184A (en) * 2019-08-19 2021-02-23 中移(苏州)软件技术有限公司 Information acquisition method, equipment and computer storage medium
CN110750442B (en) * 2019-09-06 2022-08-19 深圳平安医疗健康科技服务有限公司 Test case generation method, device, equipment and storage medium
CN110955600B (en) * 2019-11-27 2023-11-10 中国银行股份有限公司 Interface testing method and device
CN110968517B (en) * 2019-12-04 2023-05-12 上海华兴数字科技有限公司 Automatic test method, apparatus, platform and computer readable storage medium
CN111786855B (en) * 2020-06-30 2022-06-28 曙光信息产业(北京)有限公司 Network card pressure testing method and device, electronic equipment and storage medium
CN111782533A (en) * 2020-07-01 2020-10-16 江苏云柜网络技术有限公司 Test method, test device, electronic equipment and storage medium
CN113377669A (en) * 2021-06-29 2021-09-10 南京苏宁软件技术有限公司 Automatic testing method and device, computer equipment and storage medium
CN113360408A (en) * 2021-07-15 2021-09-07 中国工商银行股份有限公司 Automatic testing method and device based on dragging type machine learning platform
CN113886221B (en) * 2021-09-13 2022-09-23 前海飞算云智软件科技(深圳)有限公司 Test script generation method and device, storage medium and electronic equipment

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8893087B2 (en) * 2011-08-08 2014-11-18 Ca, Inc. Automating functionality test cases
CN103150249B (en) * 2011-12-07 2015-12-16 北京新媒传信科技有限公司 A kind of method and system of automatic test
US8949673B2 (en) * 2012-05-23 2015-02-03 Sap Se Software systems testing interface
US9218269B2 (en) * 2012-09-07 2015-12-22 Red Hat Israel, Ltd. Testing multiple target platforms
CN105117335B (en) * 2015-08-26 2017-11-10 卡斯柯信号有限公司 A kind of automatic Verification and regression testing method for software unit
CN105335293B (en) * 2015-11-30 2019-08-30 努比亚技术有限公司 A kind of automatization test system and method based on interface concurrent
CN106815140A (en) * 2015-12-02 2017-06-09 北京奇虎科技有限公司 A kind of interface test method and device
CN105824926A (en) * 2016-03-17 2016-08-03 浪潮通用软件有限公司 Method for dynamically selecting and calling external system interface

Also Published As

Publication number Publication date
CN107391379A (en) 2017-11-24

Similar Documents

Publication Publication Date Title
CN107391379B (en) Automatic interface testing method and device
US10606731B2 (en) Code component debugging in an application program
US10346282B2 (en) Multi-data analysis based proactive defect detection and resolution
CN108388514B (en) Interface automation test method, device, equipment and computer readable storage medium
US10452525B2 (en) Utilizing semantic clusters to predict software defects
Wei et al. Understanding and detecting fragmentation-induced compatibility issues for android apps
CN109901968A (en) A kind of automation page data method of calibration and device
CN108134708B (en) Method and device for monitoring third-party interface
CN109358975A (en) A kind of analysis method, device, electronic equipment and storage medium that software is operating abnormally
EP3796155A1 (en) Improving acquisition process of gui elements using user input
US11669423B2 (en) Systems and methods for monitoring application health in a distributed architecture
US20150186195A1 (en) Method of analysis application object which computer-executable, server performing the same and storage media storing the same
CN114996103A (en) Page abnormity detection method and device, electronic equipment and storage medium
CN114116496A (en) Automatic testing method, device, equipment and medium
CN111897723A (en) Method and device for testing application
CN110633220A (en) Debugging information display method and device, storage medium and electronic equipment
CN112817831A (en) Application performance monitoring method, device, computer system and readable storage medium
CN110688173A (en) Positioning method and device of components in cross-platform interface framework and electronic equipment
CN110990246B (en) Tracking processing method and device for large-scale cluster deployment delivery log
CN111274143B (en) Buried point test method, buried point test device, buried point test equipment and storage medium
CN111104328B (en) Use case generation method and device, computer equipment and readable storage medium
CN113868137A (en) Method, device and system for processing buried point data and server
CN112162954A (en) User operation log generation method, user operation log generation device
CN111078550A (en) Software testing method and device, computer device and storage medium
CN112416735A (en) Application program detection method and device, terminal equipment and storage medium

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