CN111538659A - Interface testing method and system for service scene, electronic device and storage medium - Google Patents

Interface testing method and system for service scene, electronic device and storage medium Download PDF

Info

Publication number
CN111538659A
CN111538659A CN202010317717.4A CN202010317717A CN111538659A CN 111538659 A CN111538659 A CN 111538659A CN 202010317717 A CN202010317717 A CN 202010317717A CN 111538659 A CN111538659 A CN 111538659A
Authority
CN
China
Prior art keywords
test case
test
post
interface
preposed
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.)
Granted
Application number
CN202010317717.4A
Other languages
Chinese (zh)
Other versions
CN111538659B (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.)
Shanghai Ctrip Business Co Ltd
Original Assignee
Shanghai Ctrip Business 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 Shanghai Ctrip Business Co Ltd filed Critical Shanghai Ctrip Business Co Ltd
Priority to CN202010317717.4A priority Critical patent/CN111538659B/en
Publication of CN111538659A publication Critical patent/CN111538659A/en
Application granted granted Critical
Publication of CN111538659B publication Critical patent/CN111538659B/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/3684Test management for test design, e.g. generating new test cases
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to the technical field of testing, and provides a method and a system for testing an interface of a service scene, electronic equipment and a storage medium. The interface testing method comprises the following steps: obtaining a test case of a service scene according to a test request of the service scene; judging whether the test case is associated with a preposed test case, if so, calling and executing the preposed test case, wherein an interface corresponding to the preposed test case is a preposed associated interface of an interface corresponding to the test case; circularly executing the test case according to the circular parameters of the test case; judging whether the test case is associated with a post-test case, if so, calling and executing the post-test case, wherein an interface corresponding to the post-test case is a post-associated interface of an interface corresponding to the test case; and verifying the test data of the test case according to the check point of the test case. The invention can meet the interface test requirement of the service scene, associate and execute each test case under the service scene, and realize the flexible configuration of the execution mode and the check point.

Description

Interface testing method and system for service scene, electronic device and storage medium
Technical Field
The present invention relates to the field of test technologies, and in particular, to a method and a system for testing an interface of a service scenario, an electronic device, and a storage medium.
Background
The interface test is a test for the interface between the system components, and is used for checking whether the functions of parameter transmission, result output and the like of the interface are normal.
The existing interface testing tool can only test a certain interface and cannot be associated with a plurality of interfaces. However, in a service scenario, multiple interfaces associated with each other are involved, and one interface test needs to be performed before and after depending on multiple interfaces to complete the test of the service scenario.
In addition, the existing interface test tool cannot dynamically change the behavior in the interface test execution, such as the execution mode, the setting of checkpoint, and the like. Therefore, the existing interface testing tool has single function and cannot meet the interface testing requirement in a service scene.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the invention and therefore may include information that does not constitute prior art that is already known to a person of ordinary skill in the art.
Disclosure of Invention
In view of this, the present invention provides an interface testing method, system, electronic device and storage medium for a service scenario, which can meet the interface testing requirements of the service scenario, perform each test case in the service scenario in a correlated manner, and implement flexible configuration of an execution mode and a check point.
One aspect of the present invention provides a method for testing an interface of a service scenario, including: obtaining a test case of a service scene according to a test request of the service scene; judging whether the test case is associated with a preposed test case, if so, calling and executing the preposed test case, wherein an interface corresponding to the preposed test case is a preposed associated interface of an interface corresponding to the test case; circularly executing the test case according to the circular parameters of the test case; judging whether the test case is associated with a post-test case, if so, calling and executing the post-test case, wherein an interface corresponding to the post-test case is a post-associated interface of an interface corresponding to the test case; and verifying the test data of the test case according to the check point of the test case.
In some embodiments, the checkpoint comprises one or more checkpoints configured in one or more test processes of the test case respectively; the step of verifying the test data of the test case comprises the following steps: based on a check point, verifying whether the test data of the test process before the check point conforms to the configuration data; if so, judging that the test data of the test process before the check point is normal; and if not, judging that the test data of the test process before the check point is abnormal, and positioning the test process corresponding to the abnormal test data.
In some embodiments, the pre-test cases include one or more pre-test cases, and according to the execution sequence of each pre-test case, each pre-test case is sequentially invoked and executed before the test case is executed; the step of calling and executing the preposed test case comprises the following steps: judging whether a preposed test case is associated with a preposed test case, if so, calling and executing the preposed test case before calling and executing the preposed test case; and judging whether the preposed test case is associated with a pre-post test case, if so, calling and executing the pre-post test case after calling and executing the preposed test case.
In some embodiments, the loop parameters include the number of loop executions and the wait time after each execution; and circularly executing the test case according to the circular execution times and the waiting time after each execution.
In some embodiments, the post test cases include one or more post test cases, and the execution of each post test case is sequentially called after the test cases are executed according to the execution sequence of each post test case; the step of calling and executing the post test case comprises the following steps: judging whether a post test case is associated with a pre-test case, if so, calling and executing the pre-test case before calling and executing the post test case; and judging whether the post test case is associated with a re-post test case, if so, calling and executing the re-post test case after calling and executing the post test case.
In some embodiments, the interface testing method further includes a step of configuring a pre-test case, where the step of configuring the pre-test case includes: acquiring a preposed correlation interface which is depended by the interface corresponding to the test case in the service scene according to the service scene; obtaining a test case of the preposed correlation interface as a preposed test case; and the preposed test case is configured into the test case in a correlation manner, and the execution sequence of the preposed test case is set to be earlier than that of the test case.
In some embodiments, the interface testing method further includes a step of configuring a post-configuration test case, where the step of configuring the post-configuration test case includes: according to the service scene, acquiring a post-correlation interface which is depended by the interface corresponding to the test case in the service scene; obtaining a test case of the post correlation interface as a post test case; and the post test case is configured into the test case in a correlation manner, and the execution sequence of the post test case is set to be later than that of the test case.
Another aspect of the present invention provides an interface testing system for a service scenario, including: the trigger module is used for obtaining a test case of a service scene according to a test request of the service scene; the preposed execution module is used for judging whether the test case is associated with a preposed test case, if so, the preposed test case is called and executed, and the interface corresponding to the preposed test case is a preposed associated interface of the interface corresponding to the test case; the test case execution module is used for circularly executing the test case according to the circular parameters of the test case; the post-execution module is used for judging whether the test case is associated with a post-test case or not, if so, the post-test case is called and executed, and the interface corresponding to the post-test case is a post-associated interface of the interface corresponding to the test case; and the verification module is used for verifying the test data of the test case according to the check point of the test case.
Yet another aspect of the present invention provides an electronic device, comprising: a processor; a memory having stored therein executable instructions of the processor; wherein the processor is configured to perform the steps of the interface testing method of the service scenario of any of the above embodiments via execution of the executable instructions.
Yet another aspect of the present invention provides a computer-readable storage medium for storing a program, wherein the program is configured to implement the steps of the interface testing method for a service scenario described in any of the above embodiments when executed.
Compared with the prior art, the invention has the beneficial effects that:
in the execution process of the test case, the pre-test case/the post-test case is called and executed to realize the associated calling between the test case and the test case of the associated interface of the corresponding interface;
executing and verifying the test case according to the circulating parameters and the check points of the test case, wherein the execution mode and the check points can be flexibly configured according to the requirements of a service scene;
therefore, the invention can realize the interface test of the whole service scene, associate each test case under the service scene, and realize the flexible configuration of the execution mode and the check point.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. It is obvious that the drawings described below are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
Fig. 1 is a schematic diagram illustrating steps of an interface testing method for a service scenario in an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating steps of a process for executing a pre-test case according to an embodiment of the present invention;
FIGS. 3 and 4 are page diagrams illustrating a configuration process of a pre-test case in the embodiment of the present invention;
FIGS. 5 and 6 are page diagrams illustrating a configuration process of loop parameters in an embodiment of the invention;
fig. 7 is a flowchart illustrating an interface testing method for a service scenario according to an embodiment of the present invention;
FIG. 8 is a block diagram of an interface test system for a service scenario in an embodiment of the present invention;
fig. 9 shows a schematic structural diagram of an electronic device in an embodiment of the invention; and
fig. 10 shows a schematic structural diagram of a computer-readable storage medium in an embodiment of the present invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar structures, and thus their repetitive description will be omitted.
Furthermore, the drawings are merely schematic illustrations of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
Fig. 1 shows main steps of an interface testing method for a service scenario in an embodiment, and referring to fig. 1, the interface testing method for a service scenario in this embodiment mainly includes: in step S110, a test case of the service scenario is obtained according to the test request of the service scenario; in step S120, determining whether the test case has an associated pre-test case, if so, executing step S120-2, and invoking and executing the pre-test case, where the interface corresponding to the pre-test case is a pre-associated interface of the interface corresponding to the test case; in step S130, the test case is executed in a loop according to the loop parameter of the test case; in step S140, judging whether the test case is associated with a post-test case, if so, executing step S140-2, calling and executing the post-test case, wherein an interface corresponding to the post-test case is a post-associated interface of an interface corresponding to the test case; and in step S150, verifying the test data of the test case according to the checkpoint of the test case.
In one test case, one or more check points can be configured according to the requirements of a service scene, and are respectively located in one-step or multi-step test processes of the test case. When the check point is configured in the middle test process of the test case, the test data of the test process which is executed before is verified in the middle test process of the test case; and when the check point is configured in the last test process of the test case, verifying the test data of all test processes after the test process of the test case is completed. Specifically, the step of verifying the test data of the test case includes: based on a check point, verifying whether the test data of the test process before the check point conforms to the configuration data; if so, judging that the test data of the test process before the check point is normal, and continuing to perform the subsequent test process; if not, judging that the test data of the test process before the check point is abnormal, positioning the test process corresponding to the abnormal test data, and skipping to the abnormal test process or marking the abnormal test process and then continuing the subsequent test process. By setting the check points, the abnormal problem of the interface can be found in time.
In the execution process of the test case, the pre-test case and the post-test case are called and executed to realize the associated calling between the test case and the test case of the associated interface of the corresponding interface, thereby realizing the interface test of the whole service scene. The pre-test cases and the post-test cases can be configured according to the requirements of a service scene, the pre-test cases and the post-test cases can comprise one or more, and in the interface test process of the service scene, the pre-test cases and the post-test cases are respectively called and executed in sequence before the test cases are executed according to the execution sequence of the pre-test cases; and sequentially calling and executing each post-test case after the test cases are executed according to the execution sequence of each post-test case. Each pre-test case can also be associated with the test case of the associated interface of the corresponding interface, so that the associated test case of the pre-test case is associated and called in the process of executing each pre-test case. Similarly, each post test case can also be associated with the test case of the associated interface of the corresponding interface, so as to realize that the associated test case of the post test case is associated and called in the process of executing each post test case. Therefore, the associated execution of each associated interface test case in the whole service scene is realized, and the complete service scene test is completed.
Specifically, referring to the execution process of the pre-test case shown in fig. 2, the process of invoking and executing a pre-test case in step S120-2 includes: step S120-21, judging whether the preposed test case is associated with a preposed test case, if so, executing step S120-22, and calling and executing the preposed test case; then executing step S120-23, calling and executing the preposed test case; and executing the step S120-24 after the preposed test case is called and executed, judging whether the preposed test case is associated with a pre-post test case, if so, executing the step S120-25, and calling and executing the pre-post test case to finish the calling and execution of the preposed test case and the associated test case. When the pre-prepositive test case and the pre-post test case are called and executed, the calling and the execution of the pre-prepositive test case/the pre-post test case and the associated test case are realized through similar associated calling steps.
Similarly, the step of calling and executing the post-test case comprises the following steps: judging whether a post test case is associated with a pre-test case, if so, calling and executing the pre-test case before calling and executing the post test case; and judging whether the post test case is associated with a re-post test case, if so, calling and executing the re-post test case after calling and executing the post test case so as to finish the calling and executing of the post test case and the associated test case. When the preposed test case and the postpositional test case are called and executed, the calling and the execution of the preposed test case/the postpositional test case and the associated test case are realized through similar associated calling steps.
When the related preposed test case needs to be added in the test case of the service scene, the configuration can be realized. The step of configuring the preposed test case specifically comprises the following steps: acquiring a preposed correlation interface which is depended by an interface corresponding to the test case in a service scene according to the service scene; obtaining a test case of the pre-correlation interface as a pre-test case; and the pre-test case is configured into the test case in a correlation manner, and the execution sequence of the pre-test case is set to be earlier than that of the test case. Similarly, when the interface corresponding to the test case in the service scenario has a dependent post-association interface, a post-test case corresponding to the post-association interface needs to be configured in the test case. The step of configuring the postposition test case specifically comprises the following steps: according to the service scene, acquiring a post-correlation interface which is depended on by an interface corresponding to the test case in the service scene; obtaining a test case of the post-correlation interface as a post-test case; and the post test case is configured into the test case in a correlation manner, and the execution sequence of the post test case is set to be later than that of the test case.
Fig. 3 and 4 show pages of configuration pre-test cases in the embodiment, and referring to fig. 3, in a specific configuration, in TestCenter (which is a test management tool), in a configuration page 310 of a current test case 31, which is identified as, for example, "Http use case [483478 ]", a tag 311 of configuration pre/post is selected, and a pre-test case 313, which is identified as, for example, "use case [482957 ]", is added through an "add" option 312. The type of the pre-test case 313 may be selected as "service _ action" or "service _ query," and in this embodiment, for example, the type of the pre-test case 313 is configured as "service _ action. In the configuration column of the pre-test case 313, the execution order thereof may also be configured, for example, the pre-test case 313 is selected to be executed before a certain step of the test case 31. Leading test case 313 may choose to execute before or after the checkpoint of test case 31. In the configuration column of the pre-test case 313, the pre-test case 313 may also be deleted by an "operation" item, or a pre-test case and/or a pre-post-test case may be reconfigured for the pre-test case 313. In configuration page 310, other parameters of test case 31 may also be configured in the column of tags through tags such as "input variable", "configuration checkpoint", "available environment variable", "output variable". Finally, clicking on the "execute" item 314 pops up the execution configuration page 3130 of the pre-test case 313 shown in FIG. 4. Referring to fig. 4, a pretest case 313 to be executed is selected, and the execution order of the pretest case 313 is set in a field 315 in which the execution order is set. Clicking the "execute" key 316 obtains the response content of the execution configuration of the pre-test case 313. Whether to generate the configuration or cancel the reconfiguration may be finally determined according to the response contents.
The configuration process of the post test case is the same as the configuration process of the pre test case shown in fig. 3 and 4, and therefore, the description is not repeated. The post test case is only required to be configured to be executed at a certain step after the test case, the type of the post test case is selected, for example, the type is 'service _ query', and the post test case is configured with the pre test case and/or the post test case according to the requirement. The problem that one interface in a service scene is associated with a plurality of interfaces is solved through the configuration of the front test case and the rear test case, the association of the one case with the plurality of cases is realized, the front and rear execution sequence of the plurality of test cases is configured according to the service scene, and finally the complete service scene test is realized.
Further, in the interface test of the service scenario, a certain test process needs to wait for a period of time before executing a subsequent test process or a checkpoint, or a certain test process needs to be repeatedly executed for multiple times before executing a subsequent associated interface test case and checkpoint. The interface test requirements of the service scene can be flexibly adapted by configuring the cycle parameters and the check points of the test cases. Configuration of checkpoints As previously described, one or more checkpoints may be configured during one or more steps of a test case according to the requirements of the business scenario. The cycle parameters of the test case specifically comprise cycle execution times and waiting time after each execution; and in the process of executing the test case, circularly executing the test case according to the circular execution times and the waiting time after each execution.
Fig. 5 and 6 illustrate the configuration process of Loop parameters in the embodiment, and referring to fig. 5, in the configuration page 310 of the test case 31 (identified as "Http case [470054 ]"), Loop configuration is added in the "input variable" tag 317 to solve the problem that repeated execution is required in the interface test. The input variables can be singly increased or edited in batches. If some input variable refers to the parameters in the configured preposed test case, the copy can be directly referred to. On the configuration column of the input variables, selecting type "Loop" 318, i.e., Loop, may pop up the configuration page 3180 of the Loop parameter shown in fig. 6. In fig. 5, other parameters of the input variables, such as variable names, default values, and the like, may also be configured. Referring to fig. 6, in the Loop parameter configuration page 3180, the required execution times are input in the "execution times" box, a specific time value is input in the "wait time after each execution" box, and Loop parameter configuration is completed after determination. Loop parameter configuration realizes that interface test needs repeated execution under some scenes and needs to wait for a period of time after each execution is finished. For example, after the interface test is executed, it takes a while for the data to fall into the database before the SQL query type verification can be performed.
Through the configuration of the pre-test case/post-test case and the cyclic parameter, in a specific application example, referring to the flowchart shown in fig. 7, in the interface regression test after the configuration is completed, first, step S710 triggers the test case a according to a trigger condition, where the trigger condition may be a timing task or a related trigger by test cases of other interfaces. Then, step S720-1 executes the Service _ action 1 configured in the test case A, and calls the preposed test case B through step S720-2. Next, step S720-3 executes the Service _ action 2 configured in the test case A, and step S720-4 calls the pre-test case C. After the calling and execution of each pre-test case is completed, step S730-1 configures according to the Loop parameter, for example, "execute circularly for 2 times, wait for 3 seconds after each execution", and complete the execution of test case a by executing test case a in step S730-2 and waiting for two cycles of 3 seconds after executing test case a in step S730-3. And then calling each post test case configured for executing the test case A, wherein the method specifically comprises the following steps: step S740-1 executes the Service _ query 1 configured in the test case A, and calls the post-test case D through step S740-2. Next, step S740-3 executes the Service _ query 2 configured in the test case A, and step S740-4 calls the post-test case E. Finally, the check point configured in the test case A is verified through the step S750, and the execution and verification of the test case A and the related test case are completed, so that the interface test of the whole service scene is completed.
According to the interface testing method, the front test case and/or the rear test case of the test case are/is related and called in the execution process of the test case in the service scene, the correlation dependence of the interface test corresponding to the test case and the interface test corresponding to the front test case and/or the rear test case based on the service scene is realized, and therefore the test of the whole service scene is realized. The front test case, the rear test case, the cycle parameters and the check points of the test cases can be flexibly configured, and the execution sequence, the cycle execution times and the waiting time after the execution of each test case are set so as to meet the requirements of service scenes.
The embodiment of the invention also provides an interface test system of the service scene, which is used for realizing the interface test method of the service scene described in each embodiment. Fig. 8 shows main modules of an interface test system of a service scenario in the embodiment, and referring to fig. 8, the interface test system of the service scenario in the embodiment mainly includes: the triggering module 510 is configured to obtain a test case of a service scenario according to the test request of the service scenario. The triggering module 510 may be configured to implement the triggering step of the test case described in the embodiment of the interface testing method in any service scenario. The pre-execution module 520 is configured to determine whether the test case has a pre-associated test case, and if so, call and execute the pre-associated test case, where an interface corresponding to the pre-associated test case is a pre-associated interface of an interface corresponding to the test case. The pre-execution module 520 may be configured to implement the call execution step of the pre-test case described in the embodiment of the interface test method in any service scenario. The test case executing module 530 is configured to execute the test case in a loop according to the loop parameter of the test case. The test case execution module 530 may be configured to implement the execution steps of the test case described in the embodiment of the interface testing method in any service scenario. And the post-execution module 540 is configured to determine whether the test case is associated with a post-test case, and if so, call and execute the post-test case, where an interface corresponding to the post-test case is a post-associated interface of an interface corresponding to the test case. The post-execution module 540 may be configured to implement the call execution step of the post-test case described in the embodiment of the interface test method in any service scenario. And a verification module 550, configured to verify the test data of the test case according to the checkpoint of the test case. The verification module 550 can be used to implement the verification steps of the test data described in the interface test method embodiments of any service scenario above.
According to the interface test system, the front test case and/or the rear test case of the test case are/is related and called in the execution process of the test case in the service scene, the correlation dependence of the interface test corresponding to the test case and the interface test corresponding to the front test case and/or the rear test case based on the service scene is realized, and therefore the test of the whole service scene is realized. The front test case, the rear test case, the cycle parameters and the check points of the test cases can be flexibly configured, and the execution sequence, the cycle execution times and the waiting time after the execution of each test case are set so as to meet the requirements of service scenes.
The embodiment of the present invention further provides an electronic device, which includes a processor and a memory, where the memory stores executable instructions, and the processor is configured to execute the steps of the interface testing method of the service scenario in the foregoing embodiment by executing the executable instructions.
As described above, the electronic device of the present invention can implement correlation calling of the pre-test case and/or the post-test case for executing the test case in the execution process of the test case in the service scenario, and implement correlation dependence between the interface test corresponding to the test case and the interface test corresponding to the pre-test case and/or the post-test case based on the service scenario, thereby implementing the test in the whole service scenario. The front test case, the rear test case, the cycle parameters and the check points of the test cases can be flexibly configured, and the execution sequence, the cycle execution times and the waiting time after the execution of each test case are set so as to meet the requirements of service scenes.
Fig. 9 is a schematic structural diagram of an electronic device in an embodiment of the present invention, and it should be understood that fig. 9 only schematically illustrates various modules, and these modules may be virtual software modules or actual hardware modules, and the combination, the splitting, and the addition of the remaining modules of these modules are within the scope of the present invention.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" platform.
The electronic device 600 of the present invention is described below with reference to fig. 9. The electronic device 600 shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 9, the electronic device 600 is embodied in the form of a general purpose computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one memory unit 620, a bus 630 connecting the different platform components (including the memory unit 620 and the processing unit 610), a display unit 640, etc.
The storage unit stores program codes, and the program codes can be executed by the processing unit 610, so that the processing unit 610 executes the steps of the interface testing method of the service scenario described in the above embodiment. For example, processing unit 610 may perform the steps shown in fig. 1, 2, and 7.
The storage unit 620 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)6201 and/or a cache memory unit 6202, and may further include a read-only memory unit (ROM) 6203.
The memory unit 620 may also include programs/utilities 6204 including one or more program modules 6205, such program modules 6205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 630 may be one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 600 may also communicate with one or more external devices 700, and the external devices 700 may be one or more of a keyboard, a pointing device, a bluetooth device, and the like. The external devices 700 enable a user to interactively communicate with the electronic device 600. The electronic device 600 may also be capable of communicating with one or more other computing devices, including routers, modems. Such communication may occur via an input/output (I/O) interface 650. Also, the electronic device 600 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via the network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 via the bus 630. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms, to name a few.
The embodiment of the present invention further provides a computer-readable storage medium, which is used for storing a program, and when the program is executed, the steps of the interface testing method for the service scenario described in the foregoing embodiment are implemented. In some possible embodiments, the various aspects of the present invention may also be implemented in the form of a program product, which includes program code for causing a terminal device to perform the steps of the interface testing method for a service scenario described in the above embodiments, when the program product is run on the terminal device.
As described above, the computer-readable storage medium of the present invention can implement associating and calling a pre-test case and/or a post-test case for executing a test case in an execution process of the test case in a service scenario, and implement that an interface test corresponding to the test case and an interface test corresponding to the pre-test case and/or the post-test case are dependent on the service scenario, thereby implementing a test in the whole service scenario. The front test case, the rear test case, the cycle parameters and the check points of the test cases can be flexibly configured, and the execution sequence, the cycle execution times and the waiting time after the execution of each test case are set so as to meet the requirements of service scenes.
Fig. 10 is a schematic structural diagram of a computer-readable storage medium of the present invention. Referring to fig. 10, a program product 800 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of readable storage media include, but are not limited to: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device, such as through the internet using an internet service provider.
The foregoing is a more detailed description of the invention in connection with specific preferred embodiments and it is not intended that the invention be limited to these specific details. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.

Claims (10)

1. An interface testing method for a service scenario is characterized by comprising the following steps:
obtaining a test case of a service scene according to a test request of the service scene;
judging whether the test case is associated with a preposed test case, if so, calling and executing the preposed test case, wherein an interface corresponding to the preposed test case is a preposed associated interface of an interface corresponding to the test case;
circularly executing the test case according to the circular parameters of the test case;
judging whether the test case is associated with a post-test case, if so, calling and executing the post-test case, wherein an interface corresponding to the post-test case is a post-associated interface of an interface corresponding to the test case; and
and verifying the test data of the test case according to the check point of the test case.
2. The interface testing method of claim 1, wherein the check point includes one or more check points respectively configured in one or more test processes of the test case;
the step of verifying the test data of the test case comprises the following steps:
based on a check point, verifying whether the test data of the test process before the check point conforms to the configuration data;
if so, judging that the test data of the test process before the check point is normal; and
if not, judging that the test data of the test process before the check point is abnormal, and positioning the test process corresponding to the abnormal test data.
3. The interface testing method according to claim 1, wherein the pre-test cases include one or more pre-test cases, and according to the execution sequence of each pre-test case, each pre-test case is sequentially invoked and executed before the test case is executed;
the step of calling and executing the preposed test case comprises the following steps:
judging whether a preposed test case is associated with a preposed test case, if so, calling and executing the preposed test case before calling and executing the preposed test case; and
and judging whether the pre-test case is associated with a pre-post test case, if so, calling and executing the pre-test case and then calling and executing the pre-post test case.
4. The interface test method of claim 1, wherein the loop parameters include a number of loop executions and a wait time after each execution;
and circularly executing the test case according to the circular execution times and the waiting time after each execution.
5. The interface testing method according to claim 1, wherein the post-test cases include one or more post-test cases, and the execution of each post-test case is sequentially invoked after the test case is executed according to the execution sequence of each post-test case;
the step of calling and executing the post test case comprises the following steps:
judging whether a post test case is associated with a pre-test case, if so, calling and executing the pre-test case before calling and executing the post test case; and
and judging whether the post test case is associated with a re-post test case, if so, calling and executing the re-post test case after calling and executing the post test case.
6. The interface testing method of claim 1, further comprising the step of configuring a pre-test case, the step of configuring the pre-test case comprising:
acquiring a preposed correlation interface which is depended by the interface corresponding to the test case in the service scene according to the service scene;
obtaining a test case of the preposed correlation interface as a preposed test case;
and the preposed test case is configured into the test case in a correlation manner, and the execution sequence of the preposed test case is set to be earlier than that of the test case.
7. The interface testing method of claim 1, further comprising the step of configuring a post-placement test case, the step of configuring a post-placement test case comprising:
according to the service scene, acquiring a post-correlation interface which is depended by the interface corresponding to the test case in the service scene;
obtaining a test case of the post correlation interface as a post test case;
and the post test case is configured into the test case in a correlation manner, and the execution sequence of the post test case is set to be later than that of the test case.
8. An interface test system for a service scenario, comprising:
the trigger module is used for obtaining a test case of a service scene according to a test request of the service scene;
the preposed execution module is used for judging whether the test case is associated with a preposed test case, if so, the preposed test case is called and executed, and the interface corresponding to the preposed test case is a preposed associated interface of the interface corresponding to the test case;
the test case execution module is used for circularly executing the test case according to the circular parameters of the test case;
the post-execution module is used for judging whether the test case is associated with a post-test case or not, if so, the post-test case is called and executed, and the interface corresponding to the post-test case is a post-associated interface of the interface corresponding to the test case; and
and the verification module is used for verifying the test data of the test case according to the check point of the test case.
9. An electronic device, comprising:
a processor;
a memory having stored therein executable instructions of the processor;
wherein the processor is configured to perform the steps of the interface testing method of the traffic scenario of any of claims 1 to 7 via execution of the executable instructions.
10. A computer-readable storage medium storing a program, characterized in that the program, when executed, implements the steps of the interface testing method of a service scenario according to any of claims 1 to 7.
CN202010317717.4A 2020-04-21 2020-04-21 Interface testing method, system, electronic equipment and storage medium of business scene Active CN111538659B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010317717.4A CN111538659B (en) 2020-04-21 2020-04-21 Interface testing method, system, electronic equipment and storage medium of business scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010317717.4A CN111538659B (en) 2020-04-21 2020-04-21 Interface testing method, system, electronic equipment and storage medium of business scene

Publications (2)

Publication Number Publication Date
CN111538659A true CN111538659A (en) 2020-08-14
CN111538659B CN111538659B (en) 2024-03-01

Family

ID=71953521

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010317717.4A Active CN111538659B (en) 2020-04-21 2020-04-21 Interface testing method, system, electronic equipment and storage medium of business scene

Country Status (1)

Country Link
CN (1) CN111538659B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181845A (en) * 2020-10-13 2021-01-05 湖南快乐阳光互动娱乐传媒有限公司 Interface testing method and device
CN112463588A (en) * 2020-11-02 2021-03-09 北京健康之家科技有限公司 Automatic test system and method, storage medium and computing equipment
CN112579455A (en) * 2020-12-23 2021-03-30 安徽航天信息有限公司 Interface automatic testing method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140172512A1 (en) * 2012-12-14 2014-06-19 International Business Machines Corporation Efficiently generating test cases
CN107844421A (en) * 2017-10-31 2018-03-27 平安科技(深圳)有限公司 Interface test method, device, computer equipment and storage medium
CN107861870A (en) * 2017-11-02 2018-03-30 平安科技(深圳)有限公司 Interface testing and test data generating method, device, terminal and storage medium
CN108153670A (en) * 2017-11-30 2018-06-12 北京奇艺世纪科技有限公司 A kind of interface test method, device and electronic equipment
CN108491322A (en) * 2018-03-06 2018-09-04 平安科技(深圳)有限公司 Automated testing method, device and storage medium
CN110287117A (en) * 2019-06-27 2019-09-27 江苏满运软件科技有限公司 RESTful interface test method, system, equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140172512A1 (en) * 2012-12-14 2014-06-19 International Business Machines Corporation Efficiently generating test cases
CN107844421A (en) * 2017-10-31 2018-03-27 平安科技(深圳)有限公司 Interface test method, device, computer equipment and storage medium
CN107861870A (en) * 2017-11-02 2018-03-30 平安科技(深圳)有限公司 Interface testing and test data generating method, device, terminal and storage medium
CN108153670A (en) * 2017-11-30 2018-06-12 北京奇艺世纪科技有限公司 A kind of interface test method, device and electronic equipment
CN108491322A (en) * 2018-03-06 2018-09-04 平安科技(深圳)有限公司 Automated testing method, device and storage medium
CN110287117A (en) * 2019-06-27 2019-09-27 江苏满运软件科技有限公司 RESTful interface test method, system, equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
LARRY V. KIRKLAND ETC.: "Recurrent TPS development issues or ascertaining the excellence of an automated unit test", 2016 IEEE AUTOTESTCON, 13 October 2016 (2016-10-13) *
卓欣欣;白晓颖;许静;李恩鹏;刘喻;康介恢;宋文莉;: "服务接口测试自动化工具的研究", no. 02 *
李俊蒂: "一种通用型配网管理终端自动调试及检验系统的研发", 中国优秀硕士论文电子期刊网, 15 January 2018 (2018-01-15) *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181845A (en) * 2020-10-13 2021-01-05 湖南快乐阳光互动娱乐传媒有限公司 Interface testing method and device
CN112463588A (en) * 2020-11-02 2021-03-09 北京健康之家科技有限公司 Automatic test system and method, storage medium and computing equipment
CN112579455A (en) * 2020-12-23 2021-03-30 安徽航天信息有限公司 Interface automatic testing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111538659B (en) 2024-03-01

Similar Documents

Publication Publication Date Title
CN108415832B (en) Interface automation test method, device, equipment and storage medium
CN106649084B (en) The acquisition methods and device of function call information, test equipment
CN111538659B (en) Interface testing method, system, electronic equipment and storage medium of business scene
CN109683953A (en) A kind of method and device carrying out configuration file processing based on visualization interface
US8024721B2 (en) System and method for implementing a safe framework
CN112765023B (en) Test case generation method and device
CN107729246B (en) Auxiliary test method, device and equipment for target application and storage medium
US20120159446A1 (en) Verification framework for business objects
US10382313B2 (en) Test building for testing server operation
CN111552633A (en) Interface abnormal call testing method and device, computer equipment and storage medium
CN106843901B (en) Page rendering and verification method and device
CN114546738B (en) Universal test method, system, terminal and storage medium for server
US8661414B2 (en) Method and system for testing an order management system
CN110673936A (en) Breakpoint continuous operation method and device for arranging service, storage medium and electronic equipment
CN115328759A (en) Form verification method and device
CN112395182A (en) Automatic testing method, device, equipment and computer readable storage medium
US20080059949A1 (en) System and method for implementing a safe framework
CN108427599A (en) Method, apparatus and storage medium is uniformly processed in asynchronous task
CN113609014A (en) Interface field checking method and device, storage medium and electronic equipment
CN113935847A (en) Online process risk processing method, device, server and medium
CN113986768A (en) Application stability testing method, device, equipment and medium
CN110221952B (en) Service data processing method and device and service data processing system
CN114371866A (en) Version reconfiguration test method, device and equipment of service system
CN113220586A (en) Automatic interface pressure test execution method, device and system
CN112667491A (en) Function test method and device of virtual machine

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