CN109726134B - Interface test method and system - Google Patents

Interface test method and system Download PDF

Info

Publication number
CN109726134B
CN109726134B CN201910039801.1A CN201910039801A CN109726134B CN 109726134 B CN109726134 B CN 109726134B CN 201910039801 A CN201910039801 A CN 201910039801A CN 109726134 B CN109726134 B CN 109726134B
Authority
CN
China
Prior art keywords
test
interface
task
case
request
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
CN201910039801.1A
Other languages
Chinese (zh)
Other versions
CN109726134A (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.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China 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 Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN201910039801.1A priority Critical patent/CN109726134B/en
Publication of CN109726134A publication Critical patent/CN109726134A/en
Application granted granted Critical
Publication of CN109726134B publication Critical patent/CN109726134B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application relates to an interface testing method and system. The interface testing method comprises the following steps: the tested equipment takes out the test task from the task queue to be tested to obtain a test task identifier; interacting with the storage equipment according to the test task identification to obtain each test case corresponding to the test task identification; executing each test case to obtain an interface test result of each interface in the test case; and obtaining a task test result of the test task according to the test result of each interface. On one hand, the method stores the test cases in the storage device, the test tasks are executed by the test terminal, and the execution main bodies of the storage and the test are separately deployed, so that a foundation is provided for interface testing of the large-scale service.

Description

Interface test method and system
Technical Field
The present application relates to the field of test technologies, and in particular, to a method and a system for testing an interface.
Background
Interface testing is a test that tests an interface between components of a system. The interface test is mainly used for detecting interaction points between external systems 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.
The traditional interface test method mainly aims at a single interface or a small module, and is not convenient for carrying out interface automatic test on large-scale services, so that the application range of the traditional interface test method is narrow.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an interface testing method and system capable of improving the application range.
An interface testing method, the method comprising:
the tested equipment takes out the test task from the task queue to be tested to obtain a test task identifier;
the tested device interacts with a storage device according to the test task identifier, and each test case corresponding to the test task identifier is obtained from the storage device according to the corresponding relation between the test task identifier and each test case;
the tested equipment executes each test case to obtain an interface test result of each interface in the test case;
and the tested equipment obtains the task test result of the test task according to the test result of each interface.
In one embodiment, the step of the tested device interacting with the storage device according to the test task identifier and obtaining each test case corresponding to the test task identifier from the storage device according to the correspondence between the test task identifier and each test case includes:
the tested device sends a search instruction carrying the test task identifier to the storage device, wherein the search instruction is used for indicating the storage device to search for the test case identifier corresponding to the test task identifier and acquiring each interface test script corresponding to the test case identifier to obtain a test case;
and the tested device receives each test case returned by the storage device.
In one embodiment, the method further comprises:
the method comprises the steps that a tested device receives a task test request sent by a test host, wherein the task test request comprises a test task identifier;
the tested device analyzes the test task request and verifies whether the test task request is legal or not;
and if the test task request is verified to be legal, the tested device sends the test task identifier of the test task request to a storage device and stores the test task identifier into a test task queue.
In one embodiment, after the step of obtaining the task test result of the test task by the device under test according to the test result of each interface, the method further includes:
and the tested device sends the interface test result and the task test result to a storage device, and the storage device updates the corresponding test result and the interface test result of each interface according to the task identifier.
In one embodiment, the method comprises:
the test host acquires a test task creating request and generates a test task identifier according to the creating request;
the test host loads a test case list according to the test task creation request;
the test host responds to the selection operation of the user on the test case list to obtain the selected test case identification;
the test host loads each interface test script of the test case identification to obtain each test case corresponding to the test task identification;
the test host establishes a corresponding relation between the test task identification and each test case;
and the test host sends the test case and the corresponding relation to a storage device for storage.
In one embodiment, the method further comprises:
the test host obtains a test case creation request,
the test host loads an interface test list according to the test case creating request;
and the test host responds to the selection operation of the user on the interface test list, acquires each interface test script selected by the interface test list, and obtains each interface test script of the test case.
In one embodiment, the method further comprises:
the test host receives an interface test newly-increased request;
and the test host acquires the request body and the response body of the interface test by using a packet capturing tool to obtain a newly-added interface test script.
An interface test system comprises a device to be tested and a storage device connected with the device to be tested, wherein the device to be tested is provided with the following components:
the task acquisition module is used for taking out the test tasks from the task queue to be tested to obtain test task identifiers;
the test case acquisition module interacts with the storage device according to the test task identifier, and acquires each test case corresponding to the test task identifier from the storage device according to the corresponding relation between the test task identifier and each test case;
the test module is used for executing each test case to obtain an interface test result of each interface in the test case;
and the result acquisition module is used for acquiring a task test result of the test task according to the test result of each interface.
In one embodiment, the test case obtaining module is configured to send a search instruction carrying the test task identifier to the storage device, where the search instruction is used to instruct the storage device to search for the test case identifier corresponding to the test task identifier, obtain each interface test script corresponding to the test case identifier, obtain a test case, and receive each test case returned by the storage device.
In one embodiment, the system further includes a test host connected to the test terminal and the storage device, respectively, and the test host includes:
the task creating and acquiring module is used for acquiring a test task creating request and generating a test task identifier according to the creating request;
the test case list loading module is used for loading a test case list according to the test task request;
the selection acquisition module is used for responding to the selection operation of the user on the test case list and acquiring the selected test case identifier;
the test case processing module is used for responding to user operation, and importing the test scripts of the interfaces of the selected test case identifications from the test cases to obtain the test cases corresponding to the test task identifications;
the relation establishing module is used for establishing the corresponding relation between the test task identifier and each test case;
and the storage processing module is used for sending the test cases and the corresponding relations to the storage equipment for storage.
According to the interface test method and the system, the tested equipment interacts with the storage equipment according to the test task identification to obtain each corresponding test case, executes the test case to obtain the interface test result of each interface of the test case, and obtains the task test result according to the interface test result. On one hand, the method stores the test case in the storage device, the test task is executed by the test terminal, and the execution main bodies of the storage and the test are separately deployed, so that a foundation is provided for the interface test of the large-scale service.
Drawings
FIG. 1 is a diagram illustrating an exemplary implementation of a method for testing an interface;
FIG. 2 is a flow chart illustrating a method for testing an interface according to an embodiment;
FIG. 3 is a flowchart illustrating steps of configuring test cases corresponding to test tasks at a test host according to an embodiment;
FIG. 4 is a flowchart illustrating an interface testing method according to another embodiment;
FIG. 5 is a block diagram of an interface test apparatus according to an embodiment;
FIG. 6 is a block diagram of an interface test configuration apparatus according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The interface testing method provided by the present application can be applied to the application environment shown in fig. 1, including the device under test 102, the storage device 104, and the test host 106. The device under test 102 is connected to the test host 106, the device under test is connected to the storage device 104, and the test host 106 is connected to the storage device 104. The test host 106 is configured to, in a configuration stage, input test materials for Interface testing, where the test materials include a CGI (Common Gateway Interface) and a test script of an API (Application Programming Interface), and write a test case for Interface testing by referring to service logic, and store the test case in the storage device. In the testing stage, the test case is selected by the test host 106 to generate a test task, and the test task is sent to the device under test 104. The tested device 104 obtains the test case corresponding to the test task from the device according to the test task, executes the test case to obtain a test result, sends the test result to the storage device, and updates the test result of the interface test task by the storage device. The device under test 102 and the test host 106 may be, but are not limited to, various personal computers, laptops, smart phones, tablets, and portable wearable devices.
In one embodiment, as shown in fig. 2, there is provided an interface testing method, including the steps of:
s202, the tested device takes out the test task from the task queue to be tested to obtain a test task identifier.
Specifically, the test task is configured by the test host and sent to the device under test to be executed. The device under test has a control process and an execution process. The control process receives a test task sent by the test host, analyzes the test task to obtain a test task identifier, and stores the test tasks in a task queue in sequence. And the execution process pulls the test task from the task queue to obtain a test task identifier.
The test task identifier is an identification identifier of the test task, and may specifically be a test task ID.
And S204, the tested device interacts with the storage device according to the test task identifier, and the test cases corresponding to the test task identifier are obtained from the storage device according to the corresponding relation between the test task identifier and the test cases.
Specifically, the test case is configured by the test host, and after the configuration is completed, the corresponding relationship between the test case, the test task identifier and the test case is stored in the storage device. And the test host interacts with the storage equipment according to the test task identifier, and obtains the test case corresponding to the test task identifier based on the corresponding relation between the test task identifier and the test case.
The test case is that the test host machine utilizes the written test material to complete the specific service function according to the service logic. In one embodiment, the test material includes built-in API material and CGI material. The built-in API material is a material of an application programming interface, and refers to some built-in function functions needed in the process of writing test cases, such as functions of extracting cookies, intercepting character strings and the like. The CGI material is a material of a universal gateway interface, and the CGI material is recorded through a fixdler or a similar tool. The test case can be considered to be assembled by the CGI material and the API material, and is intended to complete a specific business function. The test material comprises the execution script content of the interface.
The test task is formed by assembling one or more test cases by the test host. In this embodiment, the device to be tested interacts with the storage device to obtain a plurality of test cases corresponding to the test task identifiers, and the execution script content of each test case is obtained.
And S206, the tested device executes each test case to obtain the interface test result of each interface in the test case.
Specifically, the test case is composed of test materials of one or more interfaces, and the interface test result of the interface in the test case is obtained by sequentially executing the execution scripts of each interface in the test case.
And S208, the tested device obtains the task test result of the test task according to the test result of each interface.
Specifically, a task test result of the test task is obtained according to the test result of each interface of each test case.
According to the interface test method, the tested equipment interacts with the storage equipment according to the test task identification to obtain corresponding test cases, executes the test cases to obtain the interface test results of the interfaces of the test cases, and obtains the task test results according to the interface test results. On one hand, the method stores the test case in the storage device, the test task is executed by the test terminal, and the execution main bodies of the storage and the test are separately deployed, so that a foundation is provided for the interface test of the large-scale service.
In another embodiment, the step of the tested device interacting with the storage device according to the test task identifier and obtaining each test case corresponding to the test task identifier from the storage device according to the corresponding relationship between the test task identifier and each test case includes: the tested equipment sends a search instruction carrying a test task identifier to the storage equipment, the search instruction is used for indicating the storage equipment to search for a test case identifier corresponding to the test task identifier, and obtaining each interface test script corresponding to the test case identifier to obtain a test case; and the tested device receives each test case returned by the storage device.
Specifically, the test case is obtained by assembling test contents of one or more interfaces, and is used for completing a specific service function. For example, taking the bill generation service function as an example, a database query interface is required to search service data of a user, a bill generation interface generates a bill according to the service data, and a communication interface sends the bill. The test case corresponding to the billing task can be obtained by assembling the test contents of the three interfaces. The test content of each interface is an execution script of the interface test. The execution script includes the execution code of the requesting entity and the responding entity of the interface.
The test host configures test cases, one or more test cases are assembled into a test task, and the corresponding relation between the test task identifier and the test case identifier and the execution script of the test cases are stored in the storage device. The tested equipment interacts with the storage equipment according to the test task identification, various test case identifications corresponding to the test task identification are searched through the storage equipment, various interface test scripts corresponding to the test case identifications are obtained, execution scripts of the test cases are obtained, and the searched test case scripts are returned to the tested equipment through the storage equipment.
The method stores the test case in the storage device, the test task is executed by the test terminal, and the execution main bodies of the storage and the test are separately deployed, so that a foundation is provided for the interface test of the large-scale service.
In another embodiment, the interface testing method further includes: the tested device receives a task test request sent by the test host, the task test request comprises a test task identifier, the tested device analyzes the test task request and verifies whether the test task request is legal, if the test task request is verified to be legal, the tested device sends the test task identifier of the test task request to the storage device and stores the test task identifier into the test task queue.
Specifically, the test task is sent by the test host, the test host can be connected with a plurality of tested terminals, the test task of each tested terminal is configured through the test host, and a task test request is sent to the tested terminal.
The tested device analyzes the test task request, verifies whether the test task request is legal, and particularly verifies whether the test task request is sent by a legal test host. Specifically, the tested device prestores information of the legal test host, including the name, the IP address and the like of the legal test host. And when the test task request is received, comparing the information of the test host carried by the test task request with the prestored information of the legal test host, and if the comparison is consistent, passing the verification.
After the verification is passed, the test task requests are stored into the task queue of the control process according to the received sequence, and the execution process of the tested terminal pulls the test tasks from the task queue in sequence to carry out interface test. Meanwhile, the tested device also sends the test task identifier to the storage device for storing the information of the test task.
In another embodiment, after the step of obtaining the task test result of the test task by the device under test according to the test result of each interface, the method further includes: and the tested equipment sends the interface test result and the task test result to the storage equipment, and the storage equipment updates the corresponding test result and the interface test result of each interface according to the task identifier.
The test terminal can store the test result and the interface test result of each interface in the storage device by sending the interface test result and the task test result to the storage device.
In the embodiment, a system architecture of the storage device, the tested terminal and the test host is utilized, the test host configures the test tasks and the test cases, the storage device stores the execution codes of the test cases, and the tested terminal executes the test tasks, so that the test host can manage the interface tests of a plurality of tested devices, and the storage, test and configuration execution main bodies are separately deployed to provide a foundation for the interface tests of large-scale services. In one embodiment, the interface test method further comprises the step of configuring at the test host. The step of configuring the test case corresponding to the test task at the test host is shown in fig. 3, and includes:
s302, the test host acquires a test task creating request and generates a test task identifier according to the creating request.
Specifically, a task is created by the test subject, and the test task identifier is an identification identifier of the test task, and may specifically be a test task ID.
S304, the test host loads a test case list according to the test task request.
Specifically, a test case list is loaded on a display interface according to a test task creation request. The test case list may correspond to the service module. The user can select the service module first, and then the testing host loads the testing list of the service module. The test case list of each service module can be configured by the test host in advance.
Specifically, the test case is that the test host machine completes a specific service function according to service logic by using a written test material. In one embodiment, the test material includes built-in API material and CGI material. The built-in API material is a material of an application programming interface, and refers to some built-in function functions needed in the process of writing test cases, such as functions of extracting cookies, intercepting character strings and the like. The CGI material is a material of a common gateway interface, and the CGI material is recorded through a fixdler or a similar tool. The test case can be considered to be assembled by the CGI material and the API material, and is intended to complete a specific business function. The test material comprises the execution script content of the interface. The test task is formed by assembling one or more test cases by the test host.
S306, the test host responds to the selection operation of the user on the test case list to obtain the selected test case identification.
Specifically, the test case identifier selected by the user is obtained in response to the selection operation of the user operation on the test case list.
S308, the test host loads the test scripts of the interfaces of the test case identifications to obtain the test cases corresponding to the test task identifications.
Specifically, the test case completes a specific service function according to the service logic, and is obtained by combining test scripts of a plurality of interfaces in advance. And when the test case identification selected by the user is obtained, loading each interface test script corresponding to the test case identification to obtain each test case corresponding to the test identification.
S310, the test host establishes a corresponding relation between the test task identification and each test case.
The test host establishes the corresponding relation between the test task identifier and each test case, and can acquire each corresponding test case after acquiring the test task identifier based on the corresponding relation.
And S312, the test host sends the test case and the corresponding relation to the storage device for storage.
Specifically, the test case is configured by the test host, and after the configuration is completed, the test case is stored in the storage device, and the test case and the corresponding relationship are stored in the storage device.
When the test task is configured, the execution time of the test task can be configured, timing test can be selected, for example, the test can be executed at 24 points every day, and one-time execution can also be selected, namely, the test can be executed immediately after the configuration is completed.
According to the interface test method, after the test host receives the test task configuration request, the test case list is loaded, the selection operation of the user is responded, the interface test script of the selected test case identification is obtained, the test cases of the test task are obtained through combination, the corresponding relation between the test task identification and each test case is established and stored in the storage device, and therefore the separate deployment of the test host configured by the test task and the storage device of the storage device case is achieved, a foundation is provided for interface test of large-scale services, and the application range of the interface test is enlarged.
In another embodiment, the step of configuring the test case by the test host includes: the test host acquires a test case creation request, loads an interface test list according to the test case creation request, responds to the selection operation of a user on the interface test list, acquires each interface test script selected through the interface test list, and obtains each interface test script of the test case.
Specifically, the test case is obtained by assembling test contents of one or more interfaces, and is used for completing a specific service function. For example, taking the bill generation service function as an example, a database query interface is required to search service data of a user, a bill generation interface generates a bill according to the service data, and a communication interface sends the bill. The test case corresponding to the billing task can be obtained by assembling the test contents of the three interfaces. The test content of each interface is an execution script of the interface test. The execution script includes the execution code of the requesting entity and the responding entity of the interface.
Specifically, the test terminal obtains a test case creation request, and loads an interface test case table according to the request. And configuring an execution script of the built-in API interface or an execution script of the CGI interface by a worker in advance. Interface test scripts belonging to the same service module can be classified and stored according to the service module to obtain an interface test list, so that operation during test case configuration is facilitated. And acquiring the interface test script selected by the user from the list to obtain each interface test script of the test case.
In another embodiment, the step of testing the host configuration interface test script comprises: and the test host receives the new interface test request, and acquires a request body and a response body of the interface test by using the packet capturing tool to obtain a new interface test script.
Specifically, the interface includes a built-in API interface and a CPI interface. For the CPI interface, a tester can input a test script for obtaining the newly added CPI interface through a packet capturing tool, such as a Filler packet capturing tool, filling a request body and a response body for CPI interface test.
Now, a detailed description will be given of an interface testing method, which includes two phases, a configuration phase and a testing phase.
In the configuration stage, the test host manages and configures the test scripts of the interface. The interfaces include a built-in API interface and a CPI interface. For the CPI interface, a tester can enter a test script for obtaining the CPI interface by a packet-grabbing tool, such as a Filller packet grabbing, filling a request body and a response body for CPI interface testing.
According to the service processing logic, the test script of the CPI interface and the test script of the built-in API interface which are recorded in the configuration interface are combined, the test case is compiled, and the execution of the test case can be flexibly controlled through variables and expectations. The test case is used for completing the test of a specific service function.
And combining a plurality of test cases on a configuration interface of the test task according to the service logic to obtain the test task.
Through the method, the test host completes the configuration of the execution script, the test case and the test task of the interface.
As shown in fig. 4, the testing phase includes the following steps:
step 1, a test host sends a test task request to a tested terminal.
And 2, the tested device receives a task test request sent by the test host, the task test request comprises a test task identifier, the test task request is analyzed, and whether the test task request is legal or not is verified. And if the verification is legal, the tested device stores the test task identifier into the test task queue.
And 3, the tested device sends the test task identifier of the test task request to the storage device.
And 4, taking out the test task from the task queue to be tested by the tested equipment to obtain a test task identifier.
And 5, the tested device sends a search instruction carrying the test task identifier to the storage device, wherein the search instruction is used for indicating the storage device to search the test case identifier corresponding to the test task identifier, and acquiring the test scripts of each interface corresponding to the test case identifier to obtain the test case.
And 6, the tested device receives each test case returned by the storage device.
And 7, executing each test case by the tested equipment to obtain an interface test result of each interface in the test case, and obtaining a task test result of the test task according to the interface test result.
And 8, the tested device sends the interface test result and the task test result to the storage device, and the storage device updates the corresponding test result and the interface test result of each interface according to the task identifier.
And 9, generating an alarm for the identified interface test abnormal result by the test host to prompt a tester to process.
According to the interface testing method, the CGI and the API are recorded by the testing host, the service logic is referred, the testing case of a specific interface is compiled, the compiled case is selected, the testing task is generated, the testing case corresponding to the testing task is stored in the storage terminal, the testing task is sent to the tested equipment, the tested equipment executes the test, and the testing case is obtained from the storage equipment, so that the interface testing is realized. The method can directly manage and maintain the interface, use case, plan and the like on the platform. On one hand, the method stores the test case in the storage device, the test task is executed by the test terminal, and the execution main bodies of the storage and the test are separately deployed, so that a foundation is provided for the interface test of the large-scale service.
It should be understood that although the various steps in the flow charts of fig. 2-3 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-3 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
In an embodiment, an interface testing system is provided, which includes a device under test and a storage device connected to the device under test, where the device under test is provided with an interface testing apparatus, as shown in fig. 5, the interface testing apparatus includes a task obtaining module, a test case obtaining module, a testing module, and a result obtaining module, where:
the task obtaining module 502 is configured to take out a test task from the task queue to be tested, and obtain a test task identifier.
The test case obtaining module 504 interacts with the storage device according to the test task identifier, and obtains each test case corresponding to the test task identifier from the storage device according to the corresponding relationship between the test task identifier and each test case.
The test module 506 is configured to execute each test case to obtain an interface test result of each interface in the test case.
And the result obtaining module 508 is configured to obtain a task test result of the test task according to the test result of each interface.
According to the interface testing device, the tested equipment interacts with the storage equipment according to the testing task identification to obtain corresponding test cases, executes the test cases to obtain interface testing results of the interfaces of the test cases, and obtains task testing results according to the interface testing results. On one hand, the method stores the test case in the storage device, the test task is executed by the test terminal, and the execution main bodies of the storage and the test are separately deployed, so that a foundation is provided for the interface test of the large-scale service.
In another embodiment, the test case obtaining module 504 is configured to send a search instruction carrying a test task identifier to the storage device, where the search instruction is used to instruct the storage device to search for a test case identifier corresponding to the test task identifier, obtain each interface test script corresponding to the test case identifier, obtain a test case, and receive each test case returned by the storage device.
In another embodiment, an interface test apparatus includes: :
and the request receiving module is used for receiving a task test request sent by the test host, wherein the task test request comprises a test task identifier.
And the analysis module is used for analyzing the test task request and verifying whether the test task request is legal or not.
And the queue control module is used for sending the test task identifier of the test task request to the storage device and storing the test task identifier into the test task queue if the test task request is verified to be legal.
In another embodiment, the test device further includes an updating module, configured to send the interface test result and the task test result to the storage device, and the storage device updates the corresponding test result and the interface test result of each interface according to the task identifier.
For the specific definition of the oral test device, reference may be made to the definition of the oral test method above, which is not described in detail here. The various modules in the port testing device described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In another embodiment, the interface test system further includes a test host connected to the test terminal and the storage device, respectively, and the test host has an interface test configuration apparatus, as shown in fig. 6, the interface test configuration apparatus includes:
a task creating and acquiring module 602, configured to acquire a test task creating request, and generate a test task identifier according to the creating request.
And a test case list loading module 604, configured to load the test case list according to the test task request.
And a selection obtaining module 606, configured to respond to a selection operation of the user on the test case list, and obtain the selected test case identifier.
The test case processing module 608 is configured to respond to a user operation, and import each interface test script of the selected test case identifier from the test case to obtain each test case corresponding to the test task identifier.
The relationship establishing module 610 is configured to establish a corresponding relationship between the test task identifier and each test case.
And the storage processing module 612 is configured to send the test case and the corresponding relationship to the storage device for storage. According to the interface test method, after the test host receives the test task configuration request, the test case list is loaded, the selection operation of a user is responded, the interface test script of the selected test case identification is obtained, the test cases of the test task are obtained through combination, the corresponding relation between the test task identification and each test case is established and stored in the storage device, and therefore the test host configured by the test task and the storage device of the storage device case are separately deployed, a foundation is provided for interface test of large-scale services, and the application range of the interface test is widened. .
In another embodiment, the interface test configuration apparatus further includes:
and the case creation obtaining module is used for obtaining the test case creation request.
The loading module is used for loading the interface test list according to the test case creation request;
and the test script acquisition module is used for responding to the selection operation of the user on the interface test list, acquiring each interface test script selected by the interface test list and obtaining each interface test script of the test case.
In another embodiment, the interface test configuration apparatus further includes:
the interface newly-added acquisition module is used for receiving an interface test newly-added request;
and the script acquisition module is used for acquiring the request body and the response body of the interface test by using the packet capturing tool to obtain the newly added interface test script.
For specific limitations of the interface testing apparatus and the interface testing configuration apparatus, reference may be made to the above limitations of the interface testing method, which are not described herein again. The various modules described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. An interface testing method, the method comprising:
in the configuration stage, the test host sends the corresponding relation between the test tasks and the test cases to the storage device for storage; the storage device is deployed separately from the test host;
in the testing stage, the testing host sends a testing task to the tested equipment;
the method comprises the steps that a tested device receives a test task request sent by a test host, wherein the test task request comprises a test task identifier;
the tested device analyzes the test task request and verifies whether the test task request is legal or not;
if the test task request is verified to be legal, the tested device sends the test task identifier of the test task request to a storage device and stores the test task identifier into a test task queue;
the tested equipment takes out the test task from the task queue to be tested to obtain a test task identifier;
the tested device sends a search instruction carrying the test task identifier to the storage device, wherein the search instruction is used for indicating the storage device to search for the test case identifier corresponding to the test task identifier and acquiring each interface test script corresponding to the test case identifier to obtain a test case;
the tested device receives each test case returned by the storage device; the tested equipment executes each test case to obtain an interface test result of each interface in the test case;
the tested equipment obtains a task test result of the test task according to the test result of each interface;
and the tested device sends the interface test result and the task test result to a storage device, and the storage device updates the corresponding test result and the interface test result of each interface according to the test task identifier.
2. The method according to claim 1, wherein in the configuration phase, the test host sends the correspondence between the test tasks and the test cases to the storage device for storage, and the method includes:
the test host acquires a test task creation request and generates a test task identifier according to the test task creation request;
the test host loads a test case list according to the test task creation request;
the test host responds to the selection operation of the user on the test case list to obtain the selected test case identification;
the test host loads each interface test script of the test case identification to obtain each test case corresponding to the test task identification;
the test host establishes a corresponding relation between the test task identification and each test case;
and the test host sends the test case and the corresponding relation to a storage device for storage.
3. The method of claim 2, further comprising:
the test host obtains a test case creation request,
the test host loads an interface test list according to the test case creation request;
and the test host responds to the selection operation of the user on the interface test list, acquires each interface test script selected by the interface test list, and obtains each interface test script of the test case.
4. The method of claim 3, further comprising:
the test host receives an interface test newly-increased request;
and the test host acquires the request body and the response body of the interface test by using a packet capturing tool to obtain a newly-added interface test script.
5. The method of claim 4, wherein the interface comprises an API interface and a CPI interface.
6. An interface test system is characterized by comprising a tested device, a storage device connected with the tested device and a test host connected with the tested device and the storage device respectively, wherein the tested device is provided with an interface test device, and the test host is provided with an interface test configuration device; the storage device is deployed separately from the test host;
the interface test configuration device is used for sending the corresponding relation between the test task and each test case and the test cases to the storage equipment for storage by the test host computer in the configuration stage; the test host is also used for sending a test task to the tested equipment in the test stage;
the interface test device includes:
the request receiving module is used for receiving a test task request sent by a test host, wherein the test task request comprises a test task identifier;
the analysis module is used for analyzing the test task request and verifying whether the test task request is legal or not;
the queue control module is used for sending the test task identifier of the test task request to the storage device and storing the test task identifier into the test task queue if the test task request is verified to be legal;
the task acquisition module is used for taking out the test tasks from the task queue to be tested to obtain test task identifiers;
the test case acquisition module is used for sending a search instruction carrying the test task identifier to the storage device, wherein the search instruction is used for indicating the storage device to search the test case identifier corresponding to the test task identifier, acquiring each interface test script corresponding to the test case identifier to obtain a test case, and receiving each test case returned by the storage device;
the test module is used for executing each test case to obtain an interface test result of each interface in the test case;
the result acquisition module is used for acquiring a task test result of the test task according to the test result of each interface;
and the updating module is used for sending the interface test result and the task test result to the storage equipment, and the storage equipment updates the corresponding test result and the interface test result of each interface according to the test task identifier.
7. The system of claim 6, further comprising a test host connected to the test terminal and the storage device, respectively, wherein the test host is provided with an interface test configuration device, and the interface test configuration device comprises:
the task creating and acquiring module is used for acquiring a test task creating request and generating a test task identifier according to the test task creating request;
the test case list loading module is used for loading a test case list according to the test task request;
the selection acquisition module is used for responding to the selection operation of the user on the test case list and acquiring the selected test case identification;
the test case processing module is used for responding to user operation, and importing the test scripts of the interfaces of the selected test case identifications from the test cases to obtain the test cases corresponding to the test task identifications;
the relation establishing module is used for establishing the corresponding relation between the test task identifier and each test case;
and the storage processing module is used for sending the test cases and the corresponding relations to the storage equipment for storage.
8. The system of claim 7, wherein the interface test configuration means further comprises:
the case creation obtaining module is used for obtaining a test case creation request;
the loading module is used for loading an interface test list according to the test case creating request;
and the test script acquisition module is used for responding to the selection operation of the user on the interface test list, acquiring each interface test script selected by the interface test list and obtaining each interface test script of the test case.
9. The system of claim 8, wherein the interface test configuration means further comprises:
the interface newly-added acquisition module is used for receiving an interface test newly-added request;
and the script acquisition module is used for acquiring the request body and the response body of the interface test by using a packet capturing tool to obtain a newly-added interface test script.
10. The system of claim 9, wherein the interface comprises an API interface and a CPI interface.
CN201910039801.1A 2019-01-16 2019-01-16 Interface test method and system Active CN109726134B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910039801.1A CN109726134B (en) 2019-01-16 2019-01-16 Interface test method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910039801.1A CN109726134B (en) 2019-01-16 2019-01-16 Interface test method and system

Publications (2)

Publication Number Publication Date
CN109726134A CN109726134A (en) 2019-05-07
CN109726134B true CN109726134B (en) 2023-02-07

Family

ID=66299037

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910039801.1A Active CN109726134B (en) 2019-01-16 2019-01-16 Interface test method and system

Country Status (1)

Country Link
CN (1) CN109726134B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457205A (en) * 2019-07-05 2019-11-15 深圳壹账通智能科技有限公司 Interface test method, device, computer equipment and storage medium
CN113127335A (en) * 2020-01-16 2021-07-16 北京京东振世信息技术有限公司 System testing method and device
CN112286806B (en) * 2020-10-28 2023-10-03 成都佰维存储科技有限公司 Automatic test method and device, storage medium and electronic equipment
CN113760716A (en) * 2020-11-23 2021-12-07 北京沃东天骏信息技术有限公司 Interface testing method and tool, service arrangement flow engine and storage medium
CN113377668A (en) * 2021-06-29 2021-09-10 南京苏宁软件技术有限公司 Automatic testing method and device for service interface and computer equipment
CN114500348B (en) * 2021-12-22 2023-06-23 天翼云科技有限公司 CDN gateway testing method and system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102156673A (en) * 2011-04-20 2011-08-17 北京航空航天大学 Test case description oriented GUI (Graphical User Interface) automatic test system and test method thereof

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050268285A1 (en) * 2004-05-25 2005-12-01 International Business Machines Corporation Object oriented GUI test automation
CN107402880B (en) * 2016-05-20 2020-10-16 腾讯科技(北京)有限公司 Test method and electronic equipment
CN107547299B (en) * 2017-06-01 2020-12-25 新华三信息安全技术有限公司 Test method and system
CN107861876A (en) * 2017-11-16 2018-03-30 平安科技(深圳)有限公司 Method of testing, device, computer equipment and readable storage medium storing program for executing

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102156673A (en) * 2011-04-20 2011-08-17 北京航空航天大学 Test case description oriented GUI (Graphical User Interface) automatic test system and test method thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
模型驱动的3G网管接口测试系统的设计与实现;刘益畅;《中国优秀硕士学位论文全文数据库 (信息科技辑)》;20110315(第03期);I136-948 *

Also Published As

Publication number Publication date
CN109726134A (en) 2019-05-07

Similar Documents

Publication Publication Date Title
CN109726134B (en) Interface test method and system
CN109474578B (en) Message checking method, device, computer equipment and storage medium
CN108573371B (en) Data approval method, device, computer equipment and storage medium
CN109446068B (en) Interface test method, device, computer equipment and storage medium
CN110730107B (en) Test data generation method and device, computer equipment and storage medium
CN110290212B (en) Service call recording method, device, computer equipment and storage medium
CN108427613B (en) Abnormal interface positioning method and device, computer equipment and storage medium
CN109522218A (en) Interface test method, device, computer equipment and storage medium
CN108400978B (en) Vulnerability detection method and device, computer equipment and storage medium
CN110442756A (en) Data verification method, device, computer equipment and storage medium
CN109683982B (en) MES system control method, MES system control device, computer equipment, and storage medium
CN109361628B (en) Message assembling method and device, computer equipment and storage medium
CN110689232A (en) Workflow configuration optimization processing method and device and computer equipment
CN111475376A (en) Method and device for processing test data, computer equipment and storage medium
CN112395202B (en) Interface automation test method and device, computer equipment and storage medium
CN112637008B (en) Link simulation test method, device, system, computer equipment and storage medium
CN109039751A (en) Configure method, apparatus, computer equipment and the storage medium of routing
CN114416121A (en) Firmware burning method and device, burning equipment and firmware burning system
CN111726818A (en) Wireless chip testing method and device, computer equipment and storage medium
CN112380130A (en) Application testing method and device based on call dependency relationship
CN112527357A (en) Service hot loading updating method and device, computer equipment and storage medium
CN111277476B (en) Gateway controller function verification method, gateway controller function verification device, computer equipment and storage medium
CN110162310B (en) Plug-in interface test method and device, computer equipment and storage medium
CN113377669A (en) Automatic testing method and device, computer equipment and storage medium
CN112612706A (en) Automated testing method, computer device 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