A test case generation method, device, equipment and storage medium

By automatically displaying and generating target reference information in the test case generation page, the problem of complexity and high error rate of parameter reference in the prior art is solved, and the efficiency and accuracy of test case generation are improved.

CN114385505BActive Publication Date: 2024-12-20LIANLIAN HANGZHOU INFORMATION TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210035865.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-12
Publication Date
2024-12-20
Estimated Expiration
2042-01-12

AI Technical Summary

Technical Problem

The design of parameter references in existing automated tests is complex, requiring human familiarity and memory rules, which leads to inefficiency and error proneness, and lacks convenient and accurate test case generation methods.

Method used

By displaying test cases generation page, including parameter reference and parameter addition operation information, automatically display and generate target reference information, avoid manual input, and improve the convenience and accuracy of parameter reference.

Benefits of technology

It realizes the generation of target reference information without manual input, improves the efficiency and accuracy of test case generation, and simplifies the process of parameter reference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114385505B_ABST
    Figure CN114385505B_ABST
Patent Text Reader

Abstract

The present application discloses a test case generation method, apparatus, device and storage medium, the method comprising: displaying a test case generation page, the test case generation page comprising parameter reference operation information and parameter addition operation information; in response to a parameter addition instruction triggered based on the parameter addition operation information, displaying first parameter information on the test case generation page; in response to a parameter reference instruction corresponding to the first parameter information triggered based on the parameter reference operation information, displaying at least one parameter information to be referenced corresponding to the first parameter information; in response to a reference confirmation instruction triggered based on any parameter information to be referenced, displaying target reference information in a parameter configuration area corresponding to the first parameter information; in response to a test case generation instruction, generating a target test case based on the first parameter information and the target reference information. The technical solution of the present application can improve the convenience and accuracy of parameter reference, thereby improving the convenience and efficiency of test case generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automated testing technology, and in particular to a test case generation method, apparatus, device and storage medium. Background Art

[0002] A scenario case in an automated test case usually consists of at least one step. There will be parameter passing references between steps and within steps. Parameter reference is a very common operation in scenario case configuration.

[0003] At present, the design of parameter references in the testing industry is relatively complicated, requiring people to be familiar with and remember the parameter reference rules and manually calculate the input parameter path. This is not only inefficient, but the manual calculation and input process is prone to errors. Therefore, a more convenient and accurate test case generation method is needed. Summary of the invention

[0004] The present application provides a test case generation method, apparatus, device and storage medium, which can automatically generate target reference information by the front end without manual input, improve the convenience and accuracy of parameter reference, and thus improve the convenience and efficiency of test case generation. The technical solution of the present application is as follows:

[0005] In one aspect, a test case generation method is provided, the method comprising:

[0006] Displaying a test case generation page, wherein the test case generation page includes parameter reference operation information and parameter addition operation information;

[0007] In response to a parameter adding instruction triggered based on the parameter adding operation information, displaying first parameter information on the test case generation page, the first parameter information being a parameter of a test step corresponding to the target test case;

[0008] In response to a parameter reference instruction corresponding to the first parameter information triggered based on the parameter reference operation information, displaying at least one parameter information to be referenced corresponding to the first parameter information;

[0009] In response to a reference confirmation instruction triggered based on any parameter information to be referenced, displaying target reference information in a parameter configuration area corresponding to the first parameter information, the target reference information representing the target reference parameter information corresponding to the reference confirmation instruction;

[0010] In response to a test case generation instruction, the target test case is generated based on the first parameter information and the target reference information.

[0011] On the other hand, a test case generation device is provided, the device comprising:

[0012] A test case generation page display module, used to display a test case generation page, wherein the test case generation page includes parameter reference operation information and parameter addition operation information;

[0013] A first parameter information display module, configured to display first parameter information on the test case generation page in response to a parameter adding instruction triggered based on the parameter adding operation information, wherein the first parameter information is a parameter of a test step corresponding to a target test case;

[0014] a to-be-referenced parameter information display module, configured to display at least one to-be-referenced parameter information corresponding to the first parameter information in response to a parameter reference instruction corresponding to the first parameter information triggered based on the parameter reference operation information;

[0015] A target reference information display module, configured to display target reference information in a parameter configuration area corresponding to the first parameter information in response to a reference confirmation instruction triggered based on any parameter information to be referenced, wherein the target reference information represents the target reference parameter information corresponding to the reference confirmation instruction;

[0016] The target test case generation module is used to generate the target test case based on the first parameter information and the target reference information in response to the test case generation instruction.

[0017] On the other hand, a test case generation device is provided, the device comprising a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the test case generation method as described above.

[0018] On the other hand, a computer-readable storage medium is provided, in which at least one instruction or at least one program is stored, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the test case generation method as described above.

[0019] The test case generation method, device, equipment and storage medium provided in this application have the following technical effects:

[0020] By utilizing the technical solution provided by the present application, a test case generation page is displayed, the test case generation page including parameter reference operation information and parameter addition operation information; then, in response to a parameter addition instruction triggered based on the parameter addition operation information, first parameter information is displayed on the test case generation page, the first parameter information being a parameter of a test step corresponding to a target test case; then, in response to a parameter reference instruction corresponding to the first parameter information triggered based on the parameter reference operation information, at least one to-be-referenced parameter information corresponding to the first parameter information is displayed; then, in response to a reference confirmation instruction triggered based on any to-be-referenced parameter information, target reference information is displayed in a parameter configuration area corresponding to the first parameter information, the target reference information representing the target reference parameter information corresponding to the reference confirmation instruction; finally, in response to a test case generation instruction, the target test case is generated based on the first parameter information and the target reference information, the target reference information can be automatically generated by the front end without manual input, thereby improving the convenience and accuracy of parameter reference, thereby improving the convenience and efficiency of test case generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 It is a flowchart of a test case generation method provided in an embodiment of the present application;

[0023] Figure 2 is a schematic diagram of a first parameter information display interface provided in an embodiment of the present application;

[0024] Figure 3 is a schematic diagram of at least one target test step information display interface provided in an embodiment of the present application;

[0025] Figure 4 is a schematic diagram of at least one to-be-referenced parameter information display interface provided by an embodiment of the present application;

[0026] Figure 5 It is a flow chart of displaying target reference information in a parameter configuration area corresponding to first parameter information in response to a reference confirmation instruction triggered based on any parameter information to be referenced provided by an embodiment of the present application;

[0027] Figure 6It is a flowchart of generating target reference information in response to a reference confirmation instruction provided by an embodiment of the present application;

[0028] Figure 7 It is a flowchart of generating a reference path of target reference parameter information based on second identification information of the target reference parameter information in an interface component corresponding to interface composition information provided by an embodiment of the present application;

[0029] Figure 8 is a schematic diagram of a target reference information display interface provided in an embodiment of the present application;

[0030] Fig. 9 It is a schematic diagram of a test case generation device provided in an embodiment of the present application;

[0031] Fig.10 It is a hardware structure block diagram of a server of a test case generation method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0034] The following describes a test case generation method provided by an embodiment of the present application. Figure 1A flowchart of a test case generation method provided for an embodiment of the present application. It should be noted that this specification provides method operation steps as described in the embodiment or flowchart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many orders, and does not represent the only order of execution. When the system or product is executed in practice, it can be executed in sequence or in parallel (for example, in a parallel processor or multi-threaded processing environment) according to the method shown in the embodiment or the accompanying drawings. Specifically, Figure 1 As shown, the above method may include:

[0035] S101, displaying a test case generation page, the test case generation page including parameter reference operation information and parameter addition operation information.

[0036] In the embodiment of the present specification, the parameter adding operation information may be an operation control for adding parameters, and the parameter referencing operation information may be an operation control for referencing parameters. Optionally, the parameter adding operation information may be expressed as a parameter adding operation button, and the parameter referencing operation information may be expressed as a parameter referencing operation button.

[0037] S102, in response to a parameter adding instruction triggered based on parameter adding operation information, displaying first parameter information on a test case generation page, where the first parameter information is a parameter of a test step corresponding to a target test case.

[0038] In an embodiment of the present specification, the test steps corresponding to the target test case may include at least one test step, each test step may include at least one parameter, and accordingly, the first parameter information may be any parameter of any test step in the at least one test step.

[0039] In a specific embodiment, when the test steps corresponding to the target test case include multiple test steps, the test case generation page may also include: test step adding operation information; in response to a test step adding instruction triggered based on the test step adding operation information, displaying first test step information on the test case generation page, and the first test step information may be the test step corresponding to the test step adding instruction; accordingly, the above-mentioned displaying the first parameter information on the test case generation page in response to the parameter adding instruction triggered based on the parameter adding operation information may include: in response to the parameter adding instruction triggered based on the parameter adding operation information, displaying the first parameter information in the configuration area corresponding to the first test step information.

[0040] In a specific embodiment, Figure 2 As shown, the parameter adding instruction may carry a parameter name, and in response to the parameter adding instruction, first parameter information including the parameter name is displayed on the test case generation page.

[0041] S103: In response to a parameter reference instruction corresponding to the first parameter information triggered based on the parameter reference operation information, display at least one to-be-referenced parameter information corresponding to the first parameter information.

[0042] In the embodiment of the present specification, the reference confirmation operation information may be an operation control for confirming the reference. Specifically, the reference confirmation operation information may be expressed in a reference confirmation operation button.

[0043] In an embodiment of the present specification, at least one parameter information to be referenced may be associated information of at least one parameter to be referenced. Specifically, the at least one parameter to be referenced may include at least one parameter of each target test step in at least one target test step, wherein at least one target test step may include at least one operation step from the first operation step in the target test case to the operation step corresponding to the first parameter information.

[0044] In a specific embodiment, the parameters of each target test step in at least one target test step may be displayed respectively. Specifically, in response to the parameter reference instruction corresponding to the first parameter information triggered based on the parameter reference operation information, displaying at least one parameter information to be referenced corresponding to the first parameter information may include:

[0045] 1) In response to the parameter reference instruction, display at least one target test step information in the test case generation page;

[0046] Specifically, each target test step information may include: identification information corresponding to each target test step, step name and test interface type.

[0047] 2) In response to a test step expansion instruction triggered based on any target test step information, display at least one interface composition information corresponding to the referenced step information, where the referenced step information may be a test step corresponding to the test step expansion instruction;

[0048] Specifically, the interface composition information may be the interface components defined by the test interface type corresponding to the reference step information. The test interface type corresponding to the reference step information may include, but is not limited to: Http, Dubbo, MySQL, Redis, Mongodb, and the interface components may include: request header Header, request parameters Params, request body Body, and request response Response. In an optional embodiment, when the test interface type corresponding to the reference step information is Http, the above-mentioned at least one interface composition information may include: request header, request parameters, request body, and request response; when the test interface type corresponding to the reference step information is Dubbo, the above-mentioned at least one interface composition information may include: request parameters and request response; when the test interface type corresponding to the reference step information is MySQL, the above-mentioned at least one interface composition information may include: request response.

[0049] 3) In response to an interface composition confirmation instruction triggered based on any interface composition information, at least one parameter information to be referenced corresponding to the target interface composition information is displayed, and the target interface composition information may be the interface composition information corresponding to the interface composition confirmation instruction.

[0050] For details, see Figure 3 , displaying at least one target test step information in the test case generation page may include: displaying at least one target test step information in a dialog box of the test case generation page; displaying at least one interface composition information corresponding to the referenced step information may include: displaying each interface composition information in each tab page of at least one tab page, and at least one tab page corresponds to at least one interface composition information one by one; see Figure 4 Displaying at least one parameter information to be referenced corresponding to the target interface composition information may include: displaying at least one parameter information to be referenced corresponding to the target interface composition information in the form of a list, wherein the list may include: a tree table Treetable and a table Table.

[0051] S104, in response to a reference confirmation instruction triggered based on any parameter information to be referenced, display target reference information in a parameter configuration area corresponding to the first parameter information, where the target reference information represents the target reference parameter information corresponding to the reference confirmation instruction.

[0052] In the embodiment of the present specification, the target reference parameter information may be the parameter value of the target reference parameter corresponding to the reference confirmation instruction, and the target reference information may be the reference address of the parameter value of the target reference parameter. Specifically, the reference address may include a reference rule and a reference path.

[0053] In a specific embodiment, the at least one parameter information to be referenced may include a parameter name, a parameter value and reference confirmation operation information corresponding to the at least one parameter to be referenced. Accordingly, the display of the at least one parameter information to be referenced corresponding to the first parameter information may include: displaying the reference confirmation operation information corresponding to the at least one parameter to be referenced; the display of the target reference information in the parameter configuration area corresponding to the first parameter information in response to a reference confirmation instruction triggered based on any parameter information to be referenced may include: displaying the target reference information in the parameter configuration area in response to a reference confirmation instruction triggered based on the reference confirmation operation information corresponding to any parameter to be referenced.

[0054] In a specific embodiment, Figure 5 As shown, in response to the reference confirmation instruction triggered based on any parameter information to be referenced, displaying the target reference information in the parameter configuration area corresponding to the first parameter information may include:

[0055] S501, generating target reference information in response to a reference confirmation instruction.

[0056] In a specific embodiment, Figure 6 As shown, in response to the reference confirmation instruction, generating the target reference information may include:

[0057] S601, generating a reference rule for the target reference parameter information based on first identification information of the reference step information corresponding to the target reference parameter information and interface composition information corresponding to the target reference parameter information in the reference step information.

[0058] In the embodiment of the present specification, the reference step information may be a test step to which the target reference parameter information belongs, the first identification information may be used to identify the reference step information, and the interface composition information is used to identify the interface component to which the target reference parameter information belongs.

[0059] In a specific embodiment, the reference rule may be "$a$.bc", where $a$ represents the reference identifier, a represents the first identification information of the reference step information, b represents the interface composition information, and c represents the reference path of the target reference parameter information; Figure 4 Taking the parameter value of any parameter in as an example, the reference rule of the target reference parameter information can be "$1$.request response.c".

[0060] S602: Generate a reference path of the target reference parameter information based on second identification information of the target reference parameter information in the interface component corresponding to the interface composition information.

[0061] In a specific embodiment, Figure 7As shown, the above-mentioned generation of the reference path of the target reference parameter information based on the second identification information of the target reference parameter information in the interface component corresponding to the interface composition information may include:

[0062] S701, based on the second identification information, determine the node position of the target parameter node corresponding to the target reference parameter information in the parameter data storage file corresponding to the interface component.

[0063] In the embodiments of the present specification, the file format of the parameter data storage file may include but is not limited to: json, array, string.

[0064] S702: Determine, based on the node positions, a multi-level parameter node from a target parameter node to a root parameter node in a parameter data storage file.

[0065] Specifically, the above-mentioned determination of the multi-level parameter nodes from the target parameter node to the root parameter node in the parameter data storage file based on the node position may include: traversing multiple parameter nodes in the parameter data storage file; after the traversal is completed, obtaining multiple parameter nodes of the target level, the target level being the upper level of the corresponding level of the target parameter node; determining the parent parameter node of the target parameter node from the multiple target level parameter nodes; updating the target parameter node based on the parent parameter node to obtain an updated target parameter node; based on the updated target parameter node, repeatedly executing the steps of traversing multiple parameter nodes in the parameter data storage file to updating the target parameter node based on the parent parameter node to obtain an updated target parameter node, until the current target parameter node is the root parameter node.

[0066] S703: Generate a reference path based on the node path corresponding to the multi-level parameter node.

[0067] S603, obtaining target reference information based on the reference rule and the reference path.

[0068] Specifically, the reference rule and the reference path are concatenated to obtain the target reference information.

[0069] In a specific embodiment, the target reference parameter information is Figure 4 Taking the parameter value of the parameter queue identifier as an example, the reference rule can be "$1$.request response.c", the node path corresponding to the multi-level parameter node can be "result-message queue-queue identifier", and the reference path can be "result.message queue.queue identifier". Correspondingly, the target reference information can be "$1$.request response.result.message queue.queue identifier".

[0070] It can be seen from the above embodiments that by automatically generating reference rules and reference paths to obtain target reference information, the generation efficiency and accuracy of the target reference information can be improved.

[0071] S502: Display target reference information in the parameter configuration area.

[0072] In an optional embodiment, displaying the target reference information in the parameter configuration area may include: adding the target reference information in the parameter configuration area in response to a reference information adding instruction triggered based on the parameter configuration area. Figure 8 Take as an example, add the target reference information in the parameter value input area in the parameter configuration area.

[0073] It can be seen from the above embodiments that in response to the reference information adding instruction, target reference information is added in the parameter configuration area without manual input, which can improve the efficiency and convenience of parameter reference.

[0074] S105 , in response to the test case generation instruction, generating a target test case based on the first parameter information and the target reference information.

[0075] In a specific embodiment, the test case generation page may further include test case generation operation information, and the generating the target test case based on the first parameter information and the target reference information in response to the test case generation instruction may include: generating the target test case based on the first parameter information and the target reference information in response to the test case generation instruction triggered by the test case generation operation information. Specifically, the test case generation operation information may be an operation control for generating a test case, and specifically, the test case generation operation information may be expressed as a test case generation operation button.

[0076] In a specific embodiment, the test steps corresponding to the target test case may include multiple test steps, each test step may include multiple parameters, and when each parameter of the current test step is configured, the parameter information and target reference information corresponding to each parameter are saved in response to the parameter save instruction; when the current test step is configured, the current test step is saved in response to the test step save instruction; when the test steps corresponding to the target test case are all configured, the target test case is generated based on the parameter information and target reference information corresponding to multiple parameters of multiple test steps in response to the test case generation instruction.

[0077] It can be seen from the technical solutions provided by the embodiments of the above specification that, on the one hand, by displaying a test case generation page including parameter reference operation information and parameter addition operation information, in response to a parameter addition instruction triggered based on the parameter addition operation information, the first parameter information is displayed on the test case generation page, and in response to a parameter reference instruction corresponding to the first parameter information triggered based on the parameter reference operation information, at least one parameter information to be referenced corresponding to the first parameter information is displayed, so that the parameter information to be referenced can be clearly displayed on the front end, thereby improving the operation experience; on the other hand, in response to a reference confirmation instruction triggered based on any parameter information to be referenced, based on the first identification information of the reference step information corresponding to the target reference parameter information and the interface composition information corresponding to the target reference parameter information in the reference step information, a reference rule for the target reference parameter information is generated, and based on the second identification information of the target reference parameter information in the interface component corresponding to the interface composition information, a reference path for the target reference parameter information is generated, thereby obtaining the target reference information based on the reference rule and the reference path, and displaying the target reference information in the parameter configuration area, so that the generation efficiency and accuracy of the target reference information can be improved, thereby improving the efficiency and convenience of parameter reference; on the other hand, in response to a test case generation instruction, a target test case is generated, which can improve the convenience and efficiency of test case generation.

[0078] The present application embodiment provides a test case generation device, such as Fig. 9 As shown, the above-mentioned device may include:

[0079] A test case generation page display module 910 is used to display a test case generation page, which includes parameter reference operation information and parameter addition operation information;

[0080] A first parameter information display module 920, for displaying first parameter information on a test case generation page in response to a parameter adding instruction triggered based on parameter adding operation information, the first parameter information being a parameter of a test step corresponding to a target test case;

[0081] The to-be-referenced parameter information display module 930 is used to display at least one to-be-referenced parameter information corresponding to the first parameter information in response to a parameter reference instruction corresponding to the first parameter information triggered based on the parameter reference operation information;

[0082] A target reference information display module 940 is used to display target reference information in a parameter configuration area corresponding to the first parameter information in response to a reference confirmation instruction triggered based on any parameter information to be referenced, wherein the target reference information represents target reference parameter information corresponding to the reference confirmation instruction;

[0083] The target test case generating module 950 is used to generate a target test case based on the first parameter information and the target reference information in response to the test case generating instruction.

[0084] In a specific embodiment, the target reference information display module 940 may include:

[0085] A target reference information generating unit, configured to generate target reference information in response to the reference confirmation instruction;

[0086] The target reference information display unit is used to display the target reference information in the parameter configuration area.

[0087] In a specific embodiment, the target reference information generating unit may include:

[0088] A reference rule generating unit, configured to generate a reference rule for the target reference parameter information based on the first identification information of the reference step information corresponding to the target reference parameter information and the interface composition information corresponding to the target reference parameter information in the reference step information;

[0089] A reference path generating unit, configured to generate a reference path of the target reference parameter information based on the second identification information of the target reference parameter information in the interface component corresponding to the interface composition information;

[0090] The target reference information unit is used to obtain target reference information based on reference rules and reference paths.

[0091] In a specific embodiment, the reference path generation unit may include:

[0092] A node position determination unit, configured to determine, based on the second identification information, a node position of a target parameter node corresponding to the target reference parameter information in a parameter data storage file corresponding to the interface component;

[0093] A multi-level parameter node determination unit, used to determine the multi-level parameter nodes from the target parameter node to the root parameter node in the parameter data storage file based on the node position;

[0094] The reference path unit is used to generate a reference path based on the node path corresponding to the multi-level parameter node.

[0095] In a specific embodiment, the target reference information display unit may include:

[0096] The target reference information adding unit is used to add the target reference information in the parameter configuration area in response to the reference information adding instruction triggered based on the parameter configuration area.

[0097] In a specific embodiment, the test case generation page may further include test case generation operation information, and the target test case generation module 950 may include:

[0098] The target test case generating unit is used to generate a target test case based on the first parameter information and the target reference information in response to a test case generating instruction triggered based on the test case generating operation information.

[0099] It should be noted that the device and method embodiments in the device embodiment are based on the same inventive concept.

[0100] An embodiment of the present application provides a test case generation device, which includes a processor and a memory, in which at least one instruction or at least one program is stored, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the test case generation method provided in the above method embodiment.

[0101] The memory can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required for functions, etc.; the data storage area can store data created according to the use of the above devices, etc. In addition, the memory can include a high-speed random access memory and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory can also include a memory controller to provide the processor with access to the memory.

[0102] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal, a server or a similar computing device, that is, the above-mentioned computer device can include a mobile terminal, a computer terminal, a server or a similar computing device. Taking running on a server as an example, Fig.10 1 is a hardware structure diagram of a server of a test case generation method provided in an embodiment of the present application. Fig.10As shown, the server 1000 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1010 (the processor 1010 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1030 for storing data, and one or more storage media 1020 (such as one or more mass storage devices) for storing application programs 1023 or data 1022. Among them, the memory 1030 and the storage medium 1020 can be short-term storage or permanent storage. The program stored in the storage medium 1020 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 1010 can be configured to communicate with the storage medium 1020 and execute a series of instruction operations in the storage medium 1020 on the server 1000. The server 1000 may also include one or more power supplies 1060, one or more wired or wireless network interfaces 1050, one or more input and output interfaces 1040, and / or one or more operating systems 1021, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0103] The input / output interface 1040 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the server 1000. In one example, the input / output interface 1040 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices through a base station so as to communicate with the Internet. In one example, the input / output interface 1040 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0104] It can be understood by ordinary technicians in this field that Fig.10 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig.10 More or fewer components as shown, or with Fig.10 Different configurations are shown.

[0105] An embodiment of the present application also provides a storage medium, which can be set in a server to store at least one instruction or at least one program related to a test case generation method for implementing one of the method embodiments. The at least one instruction or the at least one program is loaded and executed by the processor to implement the test case generation method provided by the above method embodiment.

[0106] Optionally, in this embodiment, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0107] It can be seen from the embodiments of the test case generation method, device, equipment or storage medium provided by the above-mentioned application that, by utilizing the technical solution provided by the embodiments of this specification, on the one hand, by displaying a test case generation page including parameter reference operation information and parameter addition operation information, in response to a parameter addition instruction triggered based on the parameter addition operation information, the first parameter information is displayed on the test case generation page, and in response to a parameter reference instruction corresponding to the first parameter information triggered based on the parameter reference operation information, at least one to-be-referenced parameter information corresponding to the first parameter information is displayed, so that the to-be-referenced parameter information can be clearly displayed on the front end, thereby improving the operation experience; on the other hand, in response to a reference confirmation instruction triggered based on any to-be-referenced parameter information, based on Based on the first identification information of the reference step information corresponding to the target reference parameter information and the interface composition information corresponding to the target reference parameter information in the reference step information, a reference rule for the target reference parameter information is generated, and based on the second identification information of the target reference parameter information in the interface component corresponding to the interface composition information, a reference path for the target reference parameter information is generated, so that based on the reference rule and the reference path, the target reference information is obtained, and the target reference information is displayed in the parameter configuration area, which can improve the generation efficiency and accuracy of the target reference information, thereby improving the efficiency and convenience of parameter reference; on the other hand, in response to the test case generation instruction, a target test case is generated, which can improve the convenience and efficiency of test case generation.

[0108] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of this specification are described. Other embodiments are within the scope of the attached claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0109] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0110] A person skilled in the art will appreciate that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by instructing the relevant hardware through a program, and the above program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0111] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A test case generation method, characterized in that: The method comprises: Displaying a test case generation page, wherein the test case generation page includes parameter reference operation information and parameter addition operation information; In response to a parameter adding instruction triggered based on the parameter adding operation information, displaying first parameter information on the test case generation page, the first parameter information being a parameter of a test step corresponding to the target test case; In response to a parameter reference instruction corresponding to the first parameter information triggered based on the parameter reference operation information, at least one parameter information to be referenced corresponding to the first parameter information is displayed, wherein the at least one parameter to be referenced corresponding to the at least one parameter information to be referenced includes at least one parameter of each target test step in at least one target test step, and the at least one target test step includes: at least one operation step from the first operation step in the target test case to the operation step corresponding to the first parameter information; In response to a reference confirmation instruction triggered based on any parameter information to be referenced, generating a reference rule for the target reference parameter information based on first identification information of the reference step information corresponding to the target reference parameter information and interface composition information corresponding to the target reference parameter information in the reference step information; Generate a reference path of the target reference parameter information based on the second identification information of the target reference parameter information in the interface component corresponding to the interface composition information; Based on the reference rule and the reference path, target reference information is obtained, wherein the target reference information represents target reference parameter information corresponding to the reference confirmation instruction; Displaying the target reference information in a parameter configuration area corresponding to the first parameter information; In response to a test case generation instruction, the target test case is generated based on the first parameter information and the target reference information.

2. The method according to claim 1, characterized in that The generating a reference path of the target reference parameter information based on the second identification information of the target reference parameter information in the interface component corresponding to the interface composition information comprises: Based on the second identification information, determine the node position of the target parameter node corresponding to the target reference parameter information in the parameter data storage file corresponding to the interface component; Based on the node position, determine a multi-level parameter node from the target parameter node to the root parameter node in the parameter data storage file; The reference path is generated based on the node path corresponding to the multi-level parameter node.

3. The method according to claim 1, characterized in that The displaying of the target reference information in the parameter configuration area corresponding to the first parameter information includes: In response to a reference information adding instruction triggered based on the parameter configuration area, the target reference information is added in the parameter configuration area.

4. The method according to any one of claims 1 to 3, characterized in that: The at least one parameter information to be referenced includes reference confirmation operation information corresponding to at least one parameter to be referenced, and the displaying of the at least one parameter information to be referenced corresponding to the first parameter information includes: Displaying reference confirmation operation information corresponding to the at least one parameter to be referenced; Accordingly, the method further includes: In response to the reference confirmation instruction triggered based on the reference confirmation operation information corresponding to any parameter to be referenced, the target reference information is displayed in the parameter configuration area.

5. The method according to any one of claims 1 to 3, characterized in that: The test case generation page also includes test case generation operation information, and the generating the target test case based on the first parameter information and the target reference information in response to the test case generation instruction includes: In response to the test case generation instruction triggered based on the test case generation operation information, the target test case is generated based on the first parameter information and the target reference information.

6. A test case generating device, characterized in that: The device comprises: A test case generation page display module, used to display a test case generation page, wherein the test case generation page includes parameter reference operation information and parameter addition operation information; A first parameter information display module, configured to display first parameter information on the test case generation page in response to a parameter adding instruction triggered based on the parameter adding operation information, wherein the first parameter information is a parameter of a test step corresponding to a target test case; a to-be-referenced parameter information display module, configured to display at least one to-be-referenced parameter information corresponding to the first parameter information in response to a parameter reference instruction corresponding to the first parameter information triggered based on the parameter reference operation information, wherein the at least one to-be-referenced parameter corresponding to the at least one to-be-referenced parameter information includes at least one parameter of each target test step in at least one target test step, and the at least one target test step includes: at least one operation step from the first operation step in the target test case to the operation step corresponding to the first parameter information; A reference rule generating module, configured to generate, in response to a reference confirmation instruction triggered based on any parameter information to be referenced, a reference rule for the target reference parameter information based on first identification information of the reference step information corresponding to the target reference parameter information and interface composition information corresponding to the target reference parameter information in the reference step information; A reference path generating module, configured to generate a reference path of the target reference parameter information based on the second identification information of the target reference parameter information in the interface component corresponding to the interface composition information; A target reference information generating module, used to obtain target reference information based on the reference rule and the reference path, wherein the target reference information represents target reference parameter information corresponding to the reference confirmation instruction; A target reference information display module, used to display the target reference information in a parameter configuration area corresponding to the first parameter information; The target test case generation module is used to generate the target test case based on the first parameter information and the target reference information in response to the test case generation instruction.

7. A test case generating device, characterized in that: The device includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the test case generation method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the test case generation method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Test case generation method and device

    CN113742238A