CN113468065A - Test case operation method and device - Google Patents
Test case operation method and device Download PDFInfo
- Publication number
- CN113468065A CN113468065A CN202110814363.9A CN202110814363A CN113468065A CN 113468065 A CN113468065 A CN 113468065A CN 202110814363 A CN202110814363 A CN 202110814363A CN 113468065 A CN113468065 A CN 113468065A
- Authority
- CN
- China
- Prior art keywords
- variable
- test case
- target variable
- target
- reset
- 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
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 292
- 238000000034 method Methods 0.000 title claims abstract description 74
- 230000004044 response Effects 0.000 claims abstract description 54
- 230000008569 process Effects 0.000 claims abstract description 33
- 238000004590 computer program Methods 0.000 claims description 10
- 238000010586 diagram Methods 0.000 description 13
- 230000006870 function Effects 0.000 description 9
- 238000004891 communication Methods 0.000 description 7
- 230000003287 optical effect Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 239000000835 fiber Substances 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000012938 design process Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000011056 performance test Methods 0.000 description 1
- 238000011076 safety test Methods 0.000 description 1
- 230000000391 smoking effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The application discloses a test case operation method and device. One embodiment of the method comprises: in the process of running the first test case, responding to the first recognition of a preset mark representing and replacing a target variable in the first test case, generating a variable value of the target variable, and replacing the target variable through the variable value; determining whether a reset condition of the target variable is satisfied; in response to determining that the reset condition of the target variable is satisfied, the variable value of the target variable is reset to run the test case. The application provides the running method of the test case for automatically resetting the target variable according to the resetting condition, and the flexibility and the testing efficiency of the test case are improved.
Description
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method and a device for running a test case.
Background
The automation platform can realize the interface automation through graphical operation, thereby reducing the threshold of the interface automation and improving the efficiency of finishing the interface automation. At present, when an automation platform realizes code-free interface automation, some basic global variables can be usually added in a test case, and the global variables are replaced by variable values of the global variables in the running process of the test case. Because the test case generally needs to be run for many times, in the running process of the test case in the automation platform, the variable needs to be changed manually for many times to run the test case.
Disclosure of Invention
The embodiment of the application provides a method and a device for running a test case.
In a first aspect, an embodiment of the present application provides a method for running a test case, including: in the process of running the first test case, responding to the first recognition of a preset mark representing and replacing a target variable in the first test case, generating a variable value of the target variable, and replacing the target variable through the variable value; determining whether a reset condition of the target variable is satisfied; in response to determining that the reset condition of the target variable is satisfied, the variable value of the target variable is reset to run the test case.
In some embodiments, the reset condition comprises: resetting the variable value of the target variable between different test steps in the same test case; and resetting the variable value of the target variable in response to determining that the reset condition of the target variable is satisfied to run the test case, comprising: in response to determining that the current test step in the test case is completed, the variable values of the target variables are reset to run the next test step of the test case.
In some embodiments, the reset condition comprises: resetting the variable value of the target variable among different test cases; and resetting the variable value of the target variable in response to determining that the reset condition of the target variable is satisfied to run the test case, comprising: in response to determining that the current test case is completed, the variable values of the target variables are reset to run the next test case.
In some embodiments, the reset condition comprises: resetting the variable value of the target variable among different test case sets; and resetting the variable value of the target variable in response to determining that the reset condition of the target variable is satisfied to run the test case, comprising: in response to determining that the current set of test cases is completed, the variable values of the target variables are reset to run test cases in the next set of test cases.
In some embodiments, in the running of the first test case, in response to first identifying a preset identifier that characterizes and replaces a target variable in the first test case, generating a variable value of the target variable, and replacing the target variable by the variable value includes: in the process of running the first test case, in response to the first recognition of a preset identification representing and replacing a target variable in the first test case, a variable value is generated based on the customized information of the target variable, and the target variable is replaced by the variable value.
In some embodiments, before, in the process of running the first test case, in response to first identifying a preset identifier characterizing and replacing a target variable in the first test case, generating a variable value based on the customized information of the target variable, and replacing the target variable by the variable value, the method further includes: according to the customization setting request aiming at the target variable, the customization information and the resetting condition of the target variable are determined.
In a second aspect, an embodiment of the present application provides an apparatus for running a test case, including: the replacing unit is configured to respond to the first recognition of a preset identification representing and replacing the target variable in the first test case in the process of running the first test case, generate a variable value of the target variable and replace the target variable through the variable value; a first determination unit configured to determine whether a reset condition of a target variable is satisfied; a reset unit configured to reset a variable value of the target variable to run the test case in response to determining that the reset condition of the target variable is satisfied.
In some embodiments, the reset condition comprises: resetting the variable value of the target variable between different test steps in the same test case; and a reset unit further configured to: in response to determining that the current test step in the test case is completed, the variable values of the target variables are reset to run the next test step of the test case.
In some embodiments, the reset condition comprises: resetting the variable value of the target variable among different test cases; and a reset unit further configured to: in response to determining that the current test case is completed, the variable values of the target variables are reset to run the next test case.
In some embodiments, the reset condition comprises: resetting the variable value of the target variable among different test case sets; and a reset unit further configured to: in response to determining that the current set of test cases is completed, the variable values of the target variables are reset to run test cases in the next set of test cases.
In some embodiments, the replacement unit is further configured to: in the process of running the first test case, in response to the first recognition of a preset identification representing and replacing a target variable in the first test case, a variable value is generated based on the customized information of the target variable, and the target variable is replaced by the variable value.
In some embodiments, the above apparatus further comprises: a second determination unit configured to determine the customization information and the reset condition of the target variable according to the customization setting request for the target variable.
In a third aspect, the present application provides a computer-readable medium, on which a computer program is stored, where the program, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
In a fourth aspect, an embodiment of the present application provides an electronic device, including: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement a method as described in any implementation of the first aspect.
According to the method and the device for running the test case, in the process of running the first test case, the variable value of the target variable is generated in response to the first recognition of the preset mark representing and replacing the target variable in the first test case, and the target variable is replaced by the variable value; determining whether a reset condition of the target variable is satisfied; the variable value of the target variable is reset in response to the fact that the reset condition of the target variable is met, so that the test case is run, the test case running method capable of automatically resetting the target variable according to the reset condition is provided, and flexibility and test efficiency of the test case are improved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for running test cases in accordance with the present application;
FIG. 3 is a schematic illustration of a graphical interface for setting customized information according to the present application;
FIG. 4 is a schematic diagram of an application scenario of a test case operation method according to the present embodiment;
FIG. 5 is a flow diagram of yet another embodiment of a method of running test cases according to the present application;
FIG. 6 is a block diagram of one embodiment of a device for running test cases according to the present application;
FIG. 7 is a block diagram of a computer system suitable for use in implementing embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary architecture 100 to which the test case execution method and apparatus of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The communication connections between the terminal devices 101, 102, 103 form a topological network, and the network 104 serves to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The terminal devices 101, 102, 103 may be hardware devices or software that support network connections for data interaction and data processing. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices supporting network connection, information acquisition, interaction, display, processing, and the like, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
The server 105 may be a server that provides various services, such as a backend server running test cases. In the running process of the test case, the server automatically resets the target variable according to the reset condition of the target variable in the test case so as to run the test case. Also, the server may receive a customization setting request transmitted by a user through the terminal devices 101, 102, 103, determine customization information and a reset condition of the target variable, and generate a variable value of the target variable according to the customization information. As an example, the server 105 may be a cloud server.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be further noted that the running method of the test case provided by the embodiment of the present application may be executed by a server, may also be executed by a terminal device, and may also be executed by the server and the terminal device in cooperation with each other. Accordingly, each part (for example, each unit) included in the test case execution apparatus may be entirely provided in the server, may be entirely provided in the terminal device, and may be provided in the server and the terminal device, respectively.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. When the electronic device on which the running method of the test case runs does not need to perform data transmission with other electronic devices, the system architecture may only include the electronic device (e.g., a server or a terminal device) on which the running method of the test case runs.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for running test cases is shown, comprising the steps of:
In this embodiment, an execution subject (for example, a terminal device or a server in fig. 1) of the test case running method may generate a variable value of a target variable in response to first recognition of a preset identifier representing and replacing the target variable in a first test case in a process of running the first test case, and replace the target variable with the variable value.
A test case is a set of document data that consists of preconditions, inputs, execution conditions, expected results, etc. to complete a test on a particular requirement or goal. In this embodiment, the test cases may be various test cases. The method is divided according to development stages and comprises test cases for unit test, integration test, system test, regression test, smoking test, acceptance test and the like. And based on whether the code is checked, the test cases comprise black box test, white box test, gray box test and the like. And dividing the test cases according to the test objects, wherein the test cases comprise service test types, interface test types, compatibility test types, safety test types, performance test types and the like.
Based on the test requirements, a plurality of target variables can be added in the test cases, so that the variable values of the target variables can be changed among different steps, different test cases or different test case sets of the test cases, and the test cases are run for a plurality of times. As an example, the target variable may be a date, a timestamp, a random number, or the like type of variable.
The preset marks correspond to the target variables one by one and are used for indicating variable values of the generated target variables and replacing the corresponding target variables by the generated variable values. As an example, the preset flag is ^ target variable ^ target.
In some cases, the target application is tested by multiple test cases in a set of test cases. At this time, the test case running first in the test case set may be considered as the first test case. In some cases, the target application is tested by one test case. At this time, the test case may be considered as the first test case. In some cases, the target application is tested by executing one test case in a loop. At this time, the test case that is run for the first time in the process of executing the test case in a loop may be regarded as the first test case.
At step 202, it is determined whether a reset condition of the target variable is satisfied.
In this embodiment, the execution subject may determine whether a reset condition of the target variable is satisfied.
The reset condition is used to determine when the target variable resets the variable value. In the running process of the test case, the execution main body can determine whether the reset condition of the target variable is met in real time.
It should be noted that the reset condition of the target variable can be flexibly set according to the operation requirement of the test case to which the target variable belongs. The reset conditions for different target variables may be the same or different, and are not limited herein.
Specifically, the resetting condition includes resetting the variable value of the target variable between different testing steps of the same test case; resetting the variable value of the target variable among different test cases; the variable values of the target variables are reset between different test sets. The test case set comprises a plurality of test cases.
It can be understood that when the reset condition is that the variable value of the target variable is reset between different test steps of the same test case, the variable value of the target variable is kept unchanged in the same test step; when the reset condition is that the variable value of the target variable is reset among different test cases, the variable value of the target variable is kept unchanged in the same test case; when the reset condition is that the variable value of the target variable is reset between different test case sets, the variable value of the target variable is kept unchanged in the same test case set.
It should be noted that, based on actual operation requirements, the above reset conditions may be combined to obtain new reset conditions.
In this embodiment, the execution subject resets the variable value of the target variable in response to determining that the reset condition of the target variable is satisfied, so as to run the test case.
The variable value at which the target variable is reset may be generated based on the manner in which the variable value of the target variable is first generated. Taking a target variable of a random number type as an example, the execution main body may generate a variable value of the target variable again, so that when a preset identifier representing a replacement target variable occurs again in the running process of the test case, the target variable is reset through the generated variable value, and the subsequent test case is run.
In some optional implementations of the present implementation, for a case where the reset condition is that the variable value of the target variable is reset between different test steps in the same test case, the execution main body may execute the step 203 by: in response to determining that the current test step in the test case is completed, the variable values of the target variables are reset to run the next test step of the test case.
In this implementation, when the preset identifier representing the replacement target variable appears for the first time in the next test step, the target variable is replaced by the reset variable value, and the next test step of the test case is executed.
In some optional implementations of the present implementation, for a case where the reset condition is that the variable value of the target variable is reset between different test cases, the execution main body may execute the step 203 by: in response to determining that the current test case is completed, the variable values of the target variables are reset to run the next test case.
In this implementation, when the preset identifier representing the replacement target variable appears in the next test case for the first time, the target variable is replaced by the reset variable value, and the next test case is run.
In some optional implementations of the present implementation, for a case where the reset condition is that the variable value of the target variable is reset between different test case sets, the execution main body may execute the step 203 by: in response to determining that the current set of test cases is completed, the variable values of the target variables are reset to run test cases in the next set of test cases.
In this implementation manner, when the preset identifier representing the replacement target variable appears in the test case in the next test case set for the first time, the target variable is replaced by the reset variable value, and the test case in the next test case set is run.
In the design process of the test case, different reset conditions can be set for different target variables according to different test requirements, so that the variable values of the target variables can be automatically reset in the running process of the test case, the purpose of automatically and flexibly running the test case is achieved, and the running flexibility and efficiency of the test case are improved.
In order to further improve the flexibility and the practicability of the test case, in some optional implementations of this embodiment, the execution subject may also customize the setting target variable. Specifically, the execution body determines the customization information and the reset condition of the target variable according to the customization setting request for the target variable.
By way of example, for a target variable of the random number type, the customization information includes, but is not limited to, information such as a random number name, a minimum length, a maximum length, a splice head, a splice tail, random number description information, and the like. The minimum length and the maximum length represent the length range of the generated random number, the splicing head and the splicing tail respectively represent the prefix and the suffix of the generated random number, and the random number description information is used for describing and remarking the function of the random number.
For the target variable of the date type, the customized information includes, but is not limited to, date name, date format, date time difference, date description information, and the like. The date format is used for setting display formats of time units such as year, month, day, hour, minute, second and the like, the date time difference is used for representing a time difference value between the date and the date corresponding to the date variable, and the date description information is used for describing and remarking functions of the date variable. For example, the date represents the user's order date, which is 22/6/2021, and when the date time difference is "-10 days", the date of the target variable is actually 12/6/2021.
The date and time difference is set, so that the test flexibility of the test case related to the date variable is improved. For example, in some application scenarios, information corresponding to a certain time before the target time or a certain time after the target time needs to be acquired, and the information can be flexibly set through the date-time difference to meet the requirements.
For target variables of the timestamp type, the customized information includes, but is not limited to, timestamp name, splice head, splice tail, timestamp time difference, timestamp description information, and the like. The splicing head and the splicing tail respectively represent prefixes and suffixes of the time stamps, the time difference of the time stamps is used for representing the time difference value of the time stamps corresponding to the distance time stamp variables, and the time stamp description information is used for describing and remarking functions of the time stamp variables.
In this implementation manner, the execution body may present a graphical interface for setting the customized information to a user, so as to receive operations such as input and clicking of the user, and determine the customized information of the target variable. For example, referring to FIG. 3, a graphical interface 300 of customized information corresponding to a set date is shown. The graphical interface 300 includes an input box 301 corresponding to a date name, a marquee box 302 corresponding to a variable type, an input box 303 corresponding to a date and time difference, an input box 304 corresponding to a date format, a marquee box 305 corresponding to a reset condition, and an input box 306 corresponding to date description information.
In some optional implementation manners of this embodiment, when a user sets customization information of a target variable, in an operation process of a test case, the execution main body generates a variable value based on the customization information of the target variable in response to recognizing a preset identifier representing a replacement target variable, and replaces the target variable with the variable value.
In this embodiment, when resetting the variable value of the target variable, the execution body generates the variable value based on the customization information of the target variable, and resets the target variable by the variable value.
With continued reference to fig. 4, fig. 4 is a schematic diagram 400 of an application scenario of the test case operation method according to the embodiment. In the application scenario of fig. 4, a plurality of test cases in a test case set 402 of an automation platform are run by a server 401. For the test case set 402, the reset condition is to reset the variable values of the target variables between different test cases. For a plurality of test cases in the test case set 402, in the process of running the first test case, in response to the first recognition of a preset identifier representing and replacing a target variable in the first test case, generating a variable value of the target variable, and replacing the target variable by the variable value. In the subsequent testing process, the server 402 determines whether the reset condition of the target variable is met in real time; in response to determining that the reset condition of the target variable is satisfied, the variable value of the target variable is reset to run the test case. Specifically, each time a test case is run, the server resets the variable value of the target variable to run the next test case.
In the method provided by the embodiment of the application, in the process of running the first test case, the variable value of the target variable is generated in response to the first recognition of the preset identification for representing and replacing the target variable in the first test case, and the target variable is replaced by the variable value; determining whether a reset condition of the target variable is satisfied; the variable value of the target variable is reset in response to the fact that the reset condition of the target variable is met, so that the test case is run, the test case running method capable of automatically resetting the target variable according to the reset condition is provided, and flexibility and test efficiency of the test case are improved.
With continuing reference to FIG. 5, a schematic flow chart 500 illustrating one embodiment of a method for running test cases in accordance with the present application is shown that includes the following steps:
And 502, in the process of running the first test case, responding to the first recognition of a preset identifier representing and replacing a target variable in the first test case, generating a variable value based on the customized information of the target variable, and replacing the target variable through the variable value.
In step 503, it is determined whether a reset condition of the target variable is satisfied.
Wherein the reset condition includes: resetting the variable value of the target variable between different test steps in the same test case; resetting the variable value of the target variable among different test cases; and resetting the variable value of the target variable among different test case sets.
And 504, when the reset condition is that the variable value of the target variable is reset among different test steps in the same test case, responding to the determination of finishing the current test step in the test case, and resetting the variable value of the target variable so as to run the next test step of the test case.
And 505, when the reset condition is that the variable value of the target variable is reset between different test cases, responding to the determination of the completion of the current test case, and resetting the variable value of the target variable to run the next test case.
As can be seen from this embodiment, compared with the embodiment corresponding to fig. 2, the flow 500 of the test case operation method in this embodiment specifically illustrates a determination process of the customized information and the reset condition, and an operation process of the test case based on variable value reset further improves flexibility and test efficiency of the test case.
With continuing reference to fig. 6, as an implementation of the method shown in the above-mentioned figures, the present application provides an embodiment of a device for running test cases, where the embodiment of the device corresponds to the embodiment of the method shown in fig. 2, and the device may be specifically applied to various electronic devices.
As shown in fig. 6, the apparatus for running a test case includes: the replacing unit 601 is configured to generate a variable value of a target variable in response to first recognition of a preset identifier representing and replacing the target variable in a first test case during running of the first test case, and replace the target variable by the variable value; a first determination unit 602 configured to determine whether a reset condition of a target variable is satisfied; a reset unit 603 configured to reset a variable value of the target variable to run the test case in response to determining that the reset condition of the target variable is satisfied.
In some embodiments, the reset condition comprises: resetting the variable value of the target variable between different test steps in the same test case; and a reset unit 603, further configured to: in response to determining that the current test step in the test case is completed, the variable values of the target variables are reset to run the next test step of the test case.
In some embodiments, the reset condition comprises: resetting the variable value of the target variable among different test cases; and a reset unit 603, further configured to: in response to determining that the current test case is completed, the variable values of the target variables are reset to run the next test case.
In some embodiments, the reset condition comprises: resetting the variable value of the target variable among different test case sets; and a reset unit 603, further configured to: in response to determining that the current set of test cases is completed, the variable values of the target variables are reset to run test cases in the next set of test cases.
In some embodiments, the replacing unit 601 is further configured to: in the process of running the first test case, in response to the first recognition of a preset identification representing and replacing a target variable in the first test case, a variable value is generated based on the customized information of the target variable, and the target variable is replaced by the variable value.
In some embodiments, the above apparatus further comprises: and a second determination unit (not shown in the figure) configured to determine the customization information and the reset condition of the target variable according to the customization setting request for the target variable.
In this embodiment, in the process of running the first test case, the replacing unit in the test case running device generates a variable value of the target variable in response to first recognition of a preset identifier representing and replacing the target variable in the first test case, and replaces the target variable by the variable value; the first determination unit determines whether a reset condition of the target variable is satisfied; the reset unit resets the variable value of the target variable in response to determining that the reset condition of the target variable is satisfied, so as to run the test case.
Referring now to FIG. 7, shown is a block diagram of a computer system 700 suitable for use in implementing devices of embodiments of the present application (e.g., devices 101, 102, 103, 105 shown in FIG. 1). The apparatus shown in fig. 7 is only an example, and should not bring any limitation to the function and the scope of use of the embodiments of the present application.
As shown in fig. 7, the computer system 700 includes a processor (e.g., CPU, central processing unit) 701, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data necessary for the operation of the system 700 are also stored. The processor 701, the ROM702, and the RAM703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program, when executed by the processor 701, performs the above-described functions defined in the method of the present application.
It should be noted that the computer readable medium of the present application can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer 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 the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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. In the present application, a computer 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. In this application, however, a computer readable signal medium may include a propagated data signal with computer 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 computer readable signal medium may also be any computer readable medium that is not a computer 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 computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, 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 client computer, partly on the client computer, as a stand-alone software package, partly on the client computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the client computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a replacement unit, a first determination unit, and a reset unit. Where the names of the cells do not in some cases constitute a limitation on the cells themselves, for example, resetting a cell may also be described as "a cell that resets a variable value of a target variable to run a test case in response to determining that a reset condition of the target variable is satisfied".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the computer device to: in the process of running the first test case, responding to the first recognition of a preset mark representing and replacing a target variable in the first test case, generating a variable value of the target variable, and replacing the target variable through the variable value; determining whether a reset condition of the target variable is satisfied; in response to determining that the reset condition of the target variable is satisfied, the variable value of the target variable is reset to run the test case.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.
Claims (14)
1. A method for running a test case comprises the following steps:
in the process of running a first test case, responding to the first recognition of a preset mark representing and replacing a target variable in the first test case, generating a variable value of the target variable, and replacing the target variable through the variable value;
determining whether a reset condition of the target variable is satisfied;
resetting the variable value of the target variable to run the test case in response to determining that the reset condition of the target variable is satisfied.
2. The method of claim 1, wherein the reset condition comprises: resetting the variable value of the target variable between different test steps in the same test case; and
the resetting the variable value of the target variable to run the test case in response to determining that the reset condition of the target variable is satisfied includes:
in response to determining that the current test step in the test case is completed, the variable values of the target variables are reset to run a next test step of the test case.
3. The method of claim 1, wherein the reset condition comprises: resetting the variable value of the target variable among different test cases; and
the resetting the variable value of the target variable to run the test case in response to determining that the reset condition of the target variable is satisfied includes:
in response to determining that the current test case is completed, the variable values of the target variables are reset to run a next test case.
4. The method of claim 1, wherein the reset condition comprises: resetting the variable value of the target variable among different test case sets; and
the resetting the variable value of the target variable to run the test case in response to determining that the reset condition of the target variable is satisfied includes:
in response to determining that the current set of test cases is completed, the variable values of the target variables are reset to run test cases in a next set of test cases.
5. The method of claim 1, wherein, in the process of running the first test case, in response to first identifying a preset identifier representing a target variable replacing the first test case, generating a variable value of the target variable, and replacing the target variable by the variable value, comprises:
in the process of running the first test case, responding to the first recognition of a preset mark representing and replacing a target variable in the first test case, generating the variable value based on the customized information of the target variable, and replacing the target variable through the variable value.
6. The method of claim 5, wherein, in the running of the first test case, before, in response to first identifying a preset identifier that characterizes a target variable in the first test case for replacement, generating the variable value based on the customized information of the target variable, and replacing the target variable by the variable value, further comprising:
and according to the customization setting request aiming at the target variable, determining the customization information and the reset condition of the target variable.
7. An apparatus for running a test case, comprising:
the replacing unit is configured to respond to the first recognition of a preset identifier representing and replacing a target variable in a first test case in the process of running the first test case, generate a variable value of the target variable, and replace the target variable through the variable value;
a first determination unit configured to determine whether a reset condition of the target variable is satisfied;
a reset unit configured to reset a variable value of the target variable to run a test case in response to determining that a reset condition of the target variable is satisfied.
8. The apparatus of claim 7, wherein the reset condition comprises: resetting the variable value of the target variable between different test steps in the same test case; and
the reset unit further configured to:
in response to determining that the current test step in the test case is completed, the variable values of the target variables are reset to run a next test step of the test case.
9. The apparatus of claim 7, wherein the reset condition comprises: resetting the variable value of the target variable among different test cases; and
the reset unit further configured to:
in response to determining that the current test case is completed, the variable values of the target variables are reset to run a next test case.
10. The apparatus of claim 7, wherein the reset condition comprises: resetting the variable value of the target variable among different test case sets; and
the reset unit further configured to:
in response to determining that the current set of test cases is completed, the variable values of the target variables are reset to run test cases in a next set of test cases.
11. The apparatus of claim 7, wherein the replacement unit is further configured to:
in the process of running the first test case, responding to the first recognition of a preset mark representing and replacing a target variable in the first test case, generating the variable value based on the customized information of the target variable, and replacing the target variable through the variable value.
12. The apparatus of claim 11, further comprising:
a second determination unit configured to determine the customization information and the reset condition of the target variable according to a customization setting request for the target variable.
13. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-6.
14. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110814363.9A CN113468065B (en) | 2021-07-19 | Test case operation method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110814363.9A CN113468065B (en) | 2021-07-19 | Test case operation method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113468065A true CN113468065A (en) | 2021-10-01 |
CN113468065B CN113468065B (en) | 2024-08-16 |
Family
ID=
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090125976A1 (en) * | 2007-11-08 | 2009-05-14 | Docomo Communications Laboratories Usa, Inc. | Automated test input generation for web applications |
CN103186457A (en) * | 2011-12-29 | 2013-07-03 | 阿里巴巴集团控股有限公司 | Method and device for automatically generating test case |
KR101334806B1 (en) * | 2013-04-04 | 2013-11-29 | 비티에스테크놀로지스(주) | Method of proudcing input sets of test case in test case generating system |
JP2014006643A (en) * | 2012-06-22 | 2014-01-16 | Fujitsu Ltd | Program, test case generation method, and test case generation apparatus |
US20170024310A1 (en) * | 2015-07-21 | 2017-01-26 | International Business Machines Corporation | Proactive Cognitive Analysis for Inferring Test Case Dependencies |
CN110134589A (en) * | 2019-04-17 | 2019-08-16 | 深圳壹账通智能科技有限公司 | Generation method, device, computer equipment and the storage medium of interface testing use-case |
CN110162468A (en) * | 2019-04-26 | 2019-08-23 | 腾讯科技(深圳)有限公司 | A kind of test method, device and computer readable storage medium |
CN111475410A (en) * | 2020-03-31 | 2020-07-31 | 北京经纬恒润科技有限公司 | Test case generation method and device |
CN113127347A (en) * | 2021-04-14 | 2021-07-16 | 广联达科技股份有限公司 | Interface testing method, device, equipment and readable storage medium |
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090125976A1 (en) * | 2007-11-08 | 2009-05-14 | Docomo Communications Laboratories Usa, Inc. | Automated test input generation for web applications |
CN103186457A (en) * | 2011-12-29 | 2013-07-03 | 阿里巴巴集团控股有限公司 | Method and device for automatically generating test case |
JP2014006643A (en) * | 2012-06-22 | 2014-01-16 | Fujitsu Ltd | Program, test case generation method, and test case generation apparatus |
KR101334806B1 (en) * | 2013-04-04 | 2013-11-29 | 비티에스테크놀로지스(주) | Method of proudcing input sets of test case in test case generating system |
US20170024310A1 (en) * | 2015-07-21 | 2017-01-26 | International Business Machines Corporation | Proactive Cognitive Analysis for Inferring Test Case Dependencies |
CN110134589A (en) * | 2019-04-17 | 2019-08-16 | 深圳壹账通智能科技有限公司 | Generation method, device, computer equipment and the storage medium of interface testing use-case |
CN110162468A (en) * | 2019-04-26 | 2019-08-23 | 腾讯科技(深圳)有限公司 | A kind of test method, device and computer readable storage medium |
CN111475410A (en) * | 2020-03-31 | 2020-07-31 | 北京经纬恒润科技有限公司 | Test case generation method and device |
CN113127347A (en) * | 2021-04-14 | 2021-07-16 | 广联达科技股份有限公司 | Interface testing method, device, equipment and readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109359194B (en) | Method and apparatus for predicting information categories | |
EP4195108A1 (en) | Method and apparatus for generating and applying deep learning model based on deep learning framework | |
CN112988583A (en) | Method and device for testing syntax compatibility of database | |
CN113010405A (en) | Application program testing method and device | |
CN114675820A (en) | Service arrangement data processing method and device, electronic equipment and storage medium | |
CN107229565B (en) | Test method and device | |
CN116737662A (en) | Method, device, electronic equipment and storage medium for processing business data | |
CN115454956A (en) | Log generation method and device, electronic equipment and storage medium | |
CN114021133A (en) | Code processing method and device, electronic equipment and storage medium | |
CN113468065A (en) | Test case operation method and device | |
CN112084114B (en) | Method and apparatus for testing interfaces | |
CN111125163A (en) | Method and apparatus for processing data | |
CN113656050B (en) | Method and apparatus for generating version number | |
CN108287792B (en) | Method and apparatus for outputting information | |
CN109308299B (en) | Method and apparatus for searching information | |
CN113312900A (en) | Data verification method and device | |
CN115442420A (en) | Block chain cross-chain service management method and device | |
CN113760695A (en) | Method and device for positioning problem code | |
CN109376023B (en) | Method and equipment for generating calling information and issuing return code group | |
CN113129049B (en) | File configuration method and system for model training and application | |
CN111460269B (en) | Information pushing method and device | |
CN112988528B (en) | Log processing method, device and container group | |
CN109710293B (en) | File processing method and device, electronic equipment and storage medium | |
CN117951542A (en) | Method and device for processing signboard data, electronic equipment and storage medium | |
CN113590483A (en) | Case operation method and device |
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 |