CN115905008A - Method, device, equipment and storage medium for automatically generating test case - Google Patents

Method, device, equipment and storage medium for automatically generating test case Download PDF

Info

Publication number
CN115905008A
CN115905008A CN202211634467.2A CN202211634467A CN115905008A CN 115905008 A CN115905008 A CN 115905008A CN 202211634467 A CN202211634467 A CN 202211634467A CN 115905008 A CN115905008 A CN 115905008A
Authority
CN
China
Prior art keywords
interface
information
test
test case
automatically
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211634467.2A
Other languages
Chinese (zh)
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 Bank Co Ltd
Original Assignee
Ping An Bank 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 Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202211634467.2A priority Critical patent/CN115905008A/en
Publication of CN115905008A publication Critical patent/CN115905008A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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

Landscapes

  • Telephone Function (AREA)

Abstract

The application discloses a method, a device, equipment and a storage medium for automatically generating a test case, wherein at least one group of interface message information corresponding to the interface information is obtained through new interface information issued by a monitoring platform, and the interface test case and an execution test file of the interface information are generated based on a request message and a response message of the interface message information, so that the key steps of automatically completing the interface test case of the new interface information and executing the test are automatically completed, the efficiency and the degree of automation of the interface automatic test are greatly improved, and the technical problems of low efficiency, high manual intervention degree, high labor cost and the like of the test case generation of a bank system are solved.

Description

Method, device, equipment and storage medium for automatically generating test case
Technical Field
The application relates to the technical field of financial science and technology, in particular to a method, a device, equipment and a storage medium for automatically generating a test case.
Background
In the field of testing, the trend is to flexibly apply automatic testing. Compared with manual testing, automatic testing has the advantages of high efficiency and low cost, manual execution of manual driving is converted into machine execution by developing an automatic tool, the testing efficiency is improved, the labor cost is reduced, and the accuracy is improved. After the complicated testing task is automatically executed, the tester has more energy and time to process the testing condition which is not suitable for the automatic tool to execute the test, thereby improving the overall testing efficiency.
At present, the automation degree of test case generation aiming at a bank system is still low, the manual intervention degree is too high, and the technical problems of low efficiency and high labor cost exist.
Disclosure of Invention
The application provides a method, a device, equipment and a storage medium for automatically generating test cases, and solves the technical problems that the automation degree of the test case generation of a bank system is still low, the manual intervention degree is too high, the existing efficiency is low and the labor cost is high.
In view of this, a first aspect of the present application provides a method for automatically generating a test case, where the method includes:
s1, when monitoring that a platform releases new interface information, automatically capturing the interface information;
s2, acquiring at least one group of interface message information based on the interface information, wherein the interface message information comprises request message information and return message information;
and S3, generating an interface test case of the interface information and executing a test file based on at least one group of interface message information.
Optionally, between step S2 and step S3, further comprising:
and judging whether the message format of the interface message information is abnormal or not, if so, automatically adjusting the format of the interface message information until no abnormity exists, and if not, executing the step S3.
Optionally, the step S3 is followed by:
receiving a modification instruction of target information in the interface test case;
and updating the target information in the interface test case according to the modification instruction.
Optionally, the execution test file includes entry data of at least one test scenario of the interface test case.
Optionally, the step S3 is followed by:
receiving a composite scene test instruction, wherein the composite scene test instruction carries information of two or more interfaces to be tested;
and combining the interface test cases corresponding to two or more pieces of interface information to be tested according to the composite scene test instruction, and generating a composite execution test file taking one of the interface test cases as a main calling class.
Optionally, the step S3 is followed by:
and automatically executing the interface test case based on the execution test file to generate a test result.
Optionally, after the generating the test result, the method further includes:
and generating an excel file according to the input parameter data of the execution test file and the result information in the test result for storage.
A second aspect of the present application provides an apparatus for automatically generating test cases, the apparatus including:
the capturing unit is used for automatically capturing the interface information when monitoring that the platform releases new interface information;
an obtaining unit, configured to obtain at least one set of interface packet information based on the interface information, where the interface packet information includes request packet information and return packet information;
and the processing unit is used for generating an interface test case of the interface information and executing a test file based on at least one group of the interface message information.
A third aspect of the present application provides an apparatus for automatically generating test cases, the apparatus comprising a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to execute the steps of the automatic test case generation method according to the first aspect, according to instructions in the program code.
A fourth aspect of the present application provides a computer-readable storage medium for storing program code for performing the method of the first aspect.
According to the technical scheme, the embodiment of the application has the following advantages:
the application provides a method, a device, equipment and a storage medium for automatically generating a test case, at least one group of interface message information corresponding to the interface information is obtained through new interface information issued by a monitoring platform, the interface test case of the interface information and an execution test file are generated based on a request message and a response message of the interface message information, and therefore the key steps of automatically completing the interface test case of the new interface information and executing the test are automatically completed, the efficiency and the degree of automation of the interface automatic test are greatly improved, and the technical problems that the automation degree of the test case generation of a bank system is still low, the manual intervention degree is too high, the existing efficiency is low, and the labor cost is high are solved.
Drawings
FIG. 1 is a flowchart illustrating a first method for automatically generating test cases according to an embodiment of the present disclosure;
FIG. 2 is a flowchart illustrating a second method for automatically generating test cases according to an embodiment of the present disclosure;
FIG. 3 is a flow chart of a third method of automatically generating test cases in an embodiment of the present application;
FIG. 4 is a schematic structural diagram of an automatic test case generation apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an automatic test case generation device in an embodiment of the present application.
Detailed Description
In order to make those skilled in the art better understand the technical solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
The application designs a method, a device, equipment and a storage medium for automatically generating test cases, and solves the technical problems that the automation degree of the test case generation of a bank system is still low, the manual intervention degree is too high, the existing efficiency is low and the labor cost is high.
For easy understanding, please refer to fig. 1, in which fig. 1 is a flowchart illustrating a first method of an automatic test case generation method according to an embodiment of the present application, and as shown in fig. 1, the method specifically includes:
s1, automatically capturing interface information when monitoring that a platform releases new interface information;
it should be noted that when the platform issues new interface information, the interface information will be automatically captured, and the interface information includes, but is not limited to, interface name, brief description, url of the request, request mode (GET/POST, etc.), request parameters (parameter name, necessity, parameter type, description), return data format, return parameter description (parameter name, type, description), and revision information (version, date, description).
S2, acquiring at least one group of interface message information based on the interface information, wherein the interface message information comprises request message information and return message information;
it should be noted that at least one group of interface message information is obtained by analyzing the interface information, and the group of interface message information includes the request message information and the corresponding return message information, that is, the request message information of what content is sent by the interface is known, and how to obtain the corresponding return message information.
And S3, generating an interface test case of the interface information and executing a test file based on at least one group of interface message information.
It should be noted that, based on at least one set of interface message information, an interface test case of the interface information and an execution test file can be generated.
The contents such as database connection, external system connection, interface basic information and the like required in the interface test case are packaged into objects and can be directly called without repeatedly filling in codes of the type.
In addition, the interface test case determines response parameters corresponding to the entry parameters based on at least one interface message, so as to construct a response matching mode, if the entry parameters based on the interface test case send a request message, and the response parameters in the obtained return message are not matched, there is an exception, the test is not passed, and if the response parameters are consistent, the test is passed.
The execution test file is a start file of the interface test case, and the test can be automatically executed by calling the execution test file and using the parameters contained in the execution test file as the entry parameters of the interface test case.
Furthermore, the parameter input data of a plurality of scenes can be input in the execution test file, and the parameter input data is executed in batch in the interface test case, so that the rapid test of the plurality of scenes is realized, and the test efficiency is obviously improved.
Further, between step S2 and step S3, the method further includes:
and judging whether the message format of the interface message information is abnormal or not, if so, automatically adjusting the format of the interface message information until no abnormity exists, and if not, executing the step S3.
It should be noted that, when the interface message information is identified, if the interface message information cannot be automatically converted into an interface test case and a test file is executed due to an abnormal message format, all abnormal points are processed in a circulating manner, and the format is automatically adjusted to ensure that the interface message information can be successfully converted.
Referring to fig. 2, fig. 2 is a flowchart illustrating a second method of automatically generating a test case according to an embodiment of the present application, as shown in fig. 2, specifically:
s1, automatically capturing interface information when monitoring that a platform releases new interface information;
it should be noted that when the platform publishes new interface information, the interface information will be automatically captured, and the interface information includes, but is not limited to, interface name, brief description, url of request, request mode (GET/POST, etc.), request parameters (parameter name, necessity, parameter type, description), return data format, return parameter description (parameter name, type, description) and revision information (version, date, description).
S2, acquiring at least one group of interface message information based on the interface information, wherein the interface message information comprises request message information and return message information;
it should be noted that at least one group of interface message information is obtained by analyzing the interface information, and the group of interface message information includes the request message information and the corresponding return message information, that is, the request message information of what content is sent by the interface is known, and how to obtain the corresponding return message information.
S3, generating an interface test case of the interface information and an execution test file based on at least one group of interface message information;
it should be noted that, based on at least one set of interface message information, an interface test case of the interface information and an execution test file can be generated.
The contents such as database connection, external system connection, interface basic information and the like required in the interface test case are packaged into objects and can be directly called without repeatedly filling in codes of the type.
In addition, the interface test case determines response parameters corresponding to the entry parameters based on at least one interface message, so as to establish a response matching mode, if the entry parameters based on the interface test case send a request message, and the response parameters in the obtained return message are not matched, there is an exception, the test is failed, and if the entry parameters are consistent, the test is passed.
The execution test file is a start file of the interface test case, and the test can be automatically executed by calling the execution test file and using parameters contained in the execution test file as the input parameters of the interface test case to execute the test.
Furthermore, the parameter input data of a plurality of scenes can be input in the execution test file, and the parameter input data is executed in batch in the interface test case, so that the plurality of scenes can be quickly tested, and the test efficiency is obviously improved.
S4, receiving a modification instruction of target information in the interface test case;
and S5, updating the target information in the interface test case according to the modification instruction.
It should be noted that, for automatically generating the target information, such as the teller information and the environment information, the target information may be replaced with the desired content based on the modification instruction.
Referring to fig. 3, fig. 3 is a flowchart illustrating a third method of automatically generating a test case in an embodiment of the present application, and as shown in fig. 3, the third method specifically includes:
s1, automatically capturing interface information when monitoring that a platform releases new interface information;
it should be noted that when the platform issues new interface information, the interface information will be automatically captured, and the interface information includes, but is not limited to, interface name, brief description, url of the request, request mode (GET/POST, etc.), request parameters (parameter name, necessity, parameter type, description), return data format, return parameter description (parameter name, type, description), and revision information (version, date, description).
S2, acquiring at least one group of interface message information based on the interface information, wherein the interface message information comprises request message information and return message information;
it should be noted that at least one group of interface message information is obtained by analyzing the interface information, and the group of interface message information includes the request message information and the corresponding return message information, that is, the request message information of what content is sent by the interface is known, and how to obtain the corresponding return message information.
S3, generating an interface test case of the interface information and an execution test file based on at least one group of interface message information;
it should be noted that, based on at least one set of interface message information, an interface test case of the interface information and an execution test file can be generated.
The contents such as database connection, external system connection, interface basic information and the like required in the interface test case are packaged into objects and can be directly called without repeatedly filling in codes of the type.
In addition, the interface test case determines response parameters corresponding to the entry parameters based on at least one interface message, so as to construct a response matching mode, if the entry parameters based on the interface test case send a request message, and the response parameters in the obtained return message are not matched, there is an exception, the test is not passed, and if the response parameters are consistent, the test is passed.
The execution test file is a start file of the interface test case, and the test can be automatically executed by calling the execution test file and using the parameters contained in the execution test file as the entry parameters of the interface test case.
Furthermore, the parameter input data of a plurality of scenes can be input in the execution test file, and the parameter input data is executed in batch in the interface test case, so that the rapid test of the plurality of scenes is realized, and the test efficiency is obviously improved.
S6, receiving a composite scene test instruction, wherein the composite scene test instruction carries information of two or more interfaces to be tested;
and S7, combining the interface test cases corresponding to the information of the two or more interfaces to be tested according to the composite scene test instruction, and generating a composite execution test file taking one of the interface test cases as a main calling class.
It should be noted that, since the composite scenario test involves multiple interfaces, on the premise that interface test cases are respectively generated for multiple interfaces, one interface test case can be selected as a main calling class according to a test emphasis, and other interface test cases are called in the class, so as to realize the test of the composite scenario.
Furthermore, after the test operation is finished, the generated Excel file stores the information such as the input data, the transaction result, the transaction code and the like of the interface test case, and a tester can conveniently check the result.
Furthermore, a plurality of interface test cases can be combined into a test set, and the interface test cases with the same function or version are put into the unified test set, so that the subsequent regression test is facilitated, and the test efficiency is improved.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an automatic test case generation apparatus in an embodiment of the present application, as shown in fig. 4, specifically, the automatic test case generation apparatus includes:
the capturing unit 401 is configured to automatically capture interface information when it is monitored that the platform issues new interface information;
an obtaining unit 402, configured to obtain at least one set of interface message information based on the interface information, where the interface message information includes request message information and return message information;
a processing unit 403, configured to generate an interface test case of the interface information and execute the test file based on the at least one set of interface message information.
The embodiment of the present application further provides another automatic test case generating device, as shown in fig. 5, for convenience of description, only the parts related to the embodiment of the present application are shown, and specific technical details that are not disclosed are referred to in the method part of the embodiment of the present application. The terminal may be any terminal device including a mobile phone, a tablet computer, a Personal Digital Assistant (PDA), a sales terminal (POS), a vehicle-mounted computer, and the like, where the terminal is a mobile phone:
fig. 5 is a block diagram illustrating a partial structure of a mobile phone related to a terminal provided in an embodiment of the present application. Referring to fig. 5, the handset includes: radio Frequency (RF) circuit 1010, memory 1020, input unit 1030, display unit 1040, sensor 1050, audio circuit 1060, wireless fidelity (WiFi) module 1070, processor 1080, and power source 1090. Those skilled in the art will appreciate that the handset configuration shown in fig. 5 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following specifically describes each constituent component of the mobile phone with reference to fig. 5:
RF circuit 1010 may be used for receiving and transmitting signals during a message transmission or a call, and in particular, for receiving downlink information from a base station and processing the received downlink information to processor 1080; in addition, the data for designing uplink is transmitted to the base station. In general, RF circuit 1010 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LowNoiseAmplifier, LNA), a duplexer, and the like. In addition, the RF circuitry 1010 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to global system for mobile communications (GSM), general Packet Radio Service (GPRS), code Division Multiple Access (CDMA), wideband Code Division Multiple Access (WCDMA), long Term Evolution (LTE), e-mail, short Message Service (SMS), etc.
The memory 1020 can be used for storing software programs and modules, and the processor 1080 executes various functional applications and data processing of the mobile phone by operating the software programs and modules stored in the memory 1020. The memory 1020 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 1020 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 1030 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the cellular phone. Specifically, the input unit 1030 may include a touch panel 1031 and other input devices 1032. The touch panel 1031, also called a touch screen, may collect a touch operation performed by a user on or near the touch panel 1031 (e.g., an operation performed by a user on or near the touch panel 1031 using any suitable object or accessory such as a finger, a stylus, etc.) and drive the corresponding connection device according to a predetermined program. Optionally, the touch panel 1031 may include two parts, namely a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 1080, and can receive and execute commands sent by the processor 1080. In addition, the touch panel 1031 may be implemented by various types such as resistive, capacitive, infrared, and surface acoustic wave. The input unit 1030 may include other input devices 1032 in addition to the touch panel 1031. In particular, other input devices 1032 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a track ball, a mouse, a joystick, or the like.
The display unit 1040 may be used to display information input by a user or information provided to the user and various menus of the cellular phone. The display unit 1040 may include a display panel 1041, and optionally, the display panel 1041 may be configured in the form of a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), or the like. Further, the touch panel 1031 can cover the display panel 1041, and when the touch panel 1031 detects a touch operation on or near the touch panel 1031, the touch operation is transmitted to the processor 1080 to determine the type of the touch event, and then the processor 1080 provides a corresponding visual output on the display panel 1041 according to the type of the touch event. Although in fig. 5, the touch panel 1031 and the display panel 1041 are two independent components to implement the input and output functions of the mobile phone, in some embodiments, the touch panel 1031 and the display panel 1041 may be integrated to implement the input and output functions of the mobile phone.
The handset may also include at least one sensor 1050, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1041 according to the brightness of ambient light, and the proximity sensor may turn off the display panel 1041 and/or the backlight when the mobile phone moves to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the gesture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
Audio circuitry 1060, speaker 1061, microphone 1062 may provide an audio interface between the user and the handset. The audio circuit 1060 can transmit the electrical signal converted from the received audio data to the speaker 1061, and the electrical signal is converted into a sound signal by the speaker 1061 and output; on the other hand, the microphone 1062 converts the collected sound signals into electrical signals, which are received by the audio circuit 1060 and converted into audio data, which are then processed by the audio data output processor 1080 and then sent to another mobile phone via the RF circuit 1010, or output to the memory 1020 for further processing.
WiFi belongs to short-distance wireless transmission technology, and the mobile phone can help the user to send and receive e-mail, browse web pages, access streaming media, etc. through the WiFi module 1070, which provides wireless broadband internet access for the user. Although fig. 5 shows the WiFi module 1070, it is understood that it does not belong to the essential constitution of the handset, and can be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 1080 is a control center of the mobile phone, connects various parts of the whole mobile phone by using various interfaces and lines, and executes various functions of the mobile phone and processes data by operating or executing software programs and/or modules stored in the memory 1020 and calling data stored in the memory 1020, thereby integrally monitoring the mobile phone. Optionally, processor 1080 may include one or more processing units; preferably, the processor 1080 may integrate an application processor, which primarily handles operating systems, user interfaces, application programs, etc., and a modem processor, which primarily handles wireless communications. It is to be appreciated that the modem processor described above may not be integrated into processor 1080.
The handset also includes a power supply 1090 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 1080 via a power management system that may be used to manage charging, discharging, and power consumption.
Although not shown, the mobile phone may further include a camera, a bluetooth module, etc., which are not described herein.
In the embodiment of the present application, the processor 1080 included in the terminal further has the following functions:
s1, when monitoring that a platform releases new interface information, automatically capturing the interface information;
s2, acquiring at least one group of interface message information based on the interface information, wherein the interface message information comprises request message information and return message information;
and S3, generating an interface test case of the interface information and executing a test file based on at least one group of interface message information.
The present application further provides a computer-readable storage medium for storing a program code, where the program code is configured to execute any one implementation of an XX method in the foregoing embodiments.
In the embodiment of the application, a method, a device, equipment and a storage medium for automatically generating a test case are provided, at least one group of interface message information corresponding to the interface information is obtained through new interface information issued by a monitoring platform, the interface test case of the interface information and an execution test file are generated based on a request message and a response message of the interface message information, and therefore the key steps of automatically completing the interface test case of the new interface information and executing the test are completed, the efficiency and the degree of automation of the interface automatic test are greatly improved, and the technical problems of low automation degree, high manual intervention degree, low efficiency and high labor cost of test case generation of a bank system are solved.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The terms "first," "second," "third," "fourth," and the like (if any) in the description of the present application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b and c may be single or plural.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A method for automatically generating test cases is characterized by comprising the following steps:
s1, when monitoring that a platform releases new interface information, automatically capturing the interface information;
s2, acquiring at least one group of interface message information based on the interface information, wherein the interface message information comprises request message information and return message information;
and S3, generating an interface test case of the interface information and executing a test file based on at least one group of interface message information.
2. The method for automatically generating test cases according to claim 1, wherein between the step S2 and the step S3, further comprising:
and judging whether the message format of the interface message information is abnormal or not, if so, automatically adjusting the format of the interface message information until no abnormality exists, and if not, executing the step S3.
3. The method for automatically generating test cases according to claim 1, wherein the step S3 is followed by further comprising:
receiving a modification instruction of target information in the interface test case;
and updating the target information in the interface test case according to the modification instruction.
4. The method as claimed in claim 1, wherein the execution test file includes entry data of at least one test scenario of the interface test case.
5. The method for automatically generating test cases according to claim 1, wherein the step S3 is followed by further comprising:
receiving a composite scene test instruction, wherein the composite scene test instruction carries information of two or more interfaces to be tested;
and combining the interface test cases corresponding to two or more pieces of interface information to be tested according to the composite scene test instruction, and generating a composite execution test file taking one of the interface test cases as a main calling class.
6. The method for automatically generating test cases according to claim 1, wherein the step S3 is followed by further comprising:
and automatically executing the interface test case based on the execution test file to generate a test result.
7. The method for automatically generating test cases according to claim 6, wherein the step of generating test results further comprises:
and generating an excel file according to the input parameter data of the execution test file and the result information in the test result for storage.
8. An automatic test case generation device, comprising:
the capturing unit is used for automatically capturing the interface information when monitoring that the platform releases new interface information;
an obtaining unit, configured to obtain at least one set of interface packet information based on the interface information, where the interface packet information includes request packet information and return packet information;
and the processing unit is used for generating an interface test case of the interface information and executing a test file based on at least one group of interface message information.
9. An apparatus for automatic test case generation, the apparatus comprising a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to execute the method for automatically generating test cases according to any one of claims 1 to 7 according to instructions in the program code.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium is configured to store program code for executing the method for automatic test case generation of any of claims 1-7.
CN202211634467.2A 2022-12-19 2022-12-19 Method, device, equipment and storage medium for automatically generating test case Pending CN115905008A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211634467.2A CN115905008A (en) 2022-12-19 2022-12-19 Method, device, equipment and storage medium for automatically generating test case

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211634467.2A CN115905008A (en) 2022-12-19 2022-12-19 Method, device, equipment and storage medium for automatically generating test case

Publications (1)

Publication Number Publication Date
CN115905008A true CN115905008A (en) 2023-04-04

Family

ID=86487951

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211634467.2A Pending CN115905008A (en) 2022-12-19 2022-12-19 Method, device, equipment and storage medium for automatically generating test case

Country Status (1)

Country Link
CN (1) CN115905008A (en)

Similar Documents

Publication Publication Date Title
CN111078556B (en) Application testing method and device
CN110378107B (en) Method and related device for detecting installation package
CN112148579A (en) User interface testing method and device
CN115904950A (en) Test case generation method, device, equipment and storage medium
CN112415367A (en) Drive chip abnormality detection method and device, electronic equipment and readable storage medium
CN112131093A (en) Chaos test-based test case automatic generation method and device
CN111177612B (en) Page login authentication method and related device
CN116303085A (en) Test reason analysis method, device, equipment and storage medium
CN115794654A (en) Test case distribution processing method, system, equipment and storage medium
CN115328770A (en) Application program testing method and device, electronic equipment and storage medium
CN112069079B (en) Performance test method, related device and storage medium
CN109783379B (en) Script execution exception determining method and device
CN115905008A (en) Method, device, equipment and storage medium for automatically generating test case
CN106657278B (en) Data transmission method and device and computer equipment
CN113961380A (en) Cross-application repair method, device, equipment and storage medium
CN113012267A (en) Method and related device for testing special effect animation
CN112667868A (en) Data detection method and device
CN111163221A (en) Group address book updating method and device, storage medium and terminal equipment
CN112214699A (en) Page processing method and related device
CN112418835A (en) Method and related device for testing online bank payment process
CN115543805A (en) Case test environment switching method, device, equipment and storage medium
CN116303060A (en) ESB call request processing method, device, system, equipment and storage medium
CN115618139A (en) Link parameter dynamic configuration method, device, system, equipment and storage medium
CN107066116B (en) Character string generation method, character analysis method and device
CN115878670A (en) Dynamic parameter matching mock processing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination