CN109902003B - Test script generation method and device - Google Patents

Test script generation method and device Download PDF

Info

Publication number
CN109902003B
CN109902003B CN201910121285.7A CN201910121285A CN109902003B CN 109902003 B CN109902003 B CN 109902003B CN 201910121285 A CN201910121285 A CN 201910121285A CN 109902003 B CN109902003 B CN 109902003B
Authority
CN
China
Prior art keywords
test
interface
module
user
configuration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910121285.7A
Other languages
Chinese (zh)
Other versions
CN109902003A (en
Inventor
杨泽辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Advanced New Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201910121285.7A priority Critical patent/CN109902003B/en
Publication of CN109902003A publication Critical patent/CN109902003A/en
Application granted granted Critical
Publication of CN109902003B publication Critical patent/CN109902003B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the specification provides a method and a device for generating a test script, wherein the method comprises the following steps: establishing connection between a test frame and a target test interface; wherein the test frame is a modular test frame; responding to an instruction for generating a test script corresponding to the target test interface, and displaying a configuration interface for configuring the test script corresponding to the target test interface so that a user can configure the test script; and generating a test script aiming at the target test interface according to the configuration of the user on the configuration interface. The configuration interface comprises a first configuration interface used for enabling a user to configure the test module corresponding to the test framework and a second configuration interface used for enabling the user to configure the test parameters of the target test interface.

Description

Test script generation method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for generating a test script.
Background
With the rapid development of computer and internet technologies, a lot of software for providing services appears, and the software provides services to the outside through interfaces. To ensure that the software can provide services properly, testing of the software interface is typically required. When testing a software interface, it is generally necessary to generate a test script for the software interface first and then test the corresponding software interface by using the generated test script. In addition, in the process of software testing, a test script is generally generated according to a test framework, and then a software interface is tested. Currently, frequently used test frames are acts frame, ats frame, xtest frame, and the like.
Generally, a certain test framework includes a plurality of test procedures such as data preparation, test parameter preparation, mock preparation result verification, and the like, and the generated test script also includes a plurality of test procedures. However, in some cases, when testing an interface, it may not be necessary to execute all test flows corresponding to the test framework.
Therefore, when generating the test script, how to configure the test script according to the actual requirement makes the generated test script flexible and changeable to become the technical problem which needs to be solved at present.
Disclosure of Invention
The embodiment of the specification aims to provide a method and a device for generating a test script, a modularized test framework is adopted to test a target test interface, and when the test script is generated, a user can configure test modules corresponding to the test framework and test parameters of the target test interface according to actual requirements through a displayed test script configuration interface, so that the test script is configured or defined according to the actual requirements of the user, and the generated test script is flexible and changeable.
In order to solve the above technical problem, the embodiments of the present specification are implemented as follows:
An embodiment of the present specification provides a method for generating a test script, including:
establishing connection between a test frame and a target test interface; wherein the test frame is a modular test frame;
responding to an instruction for generating a test script corresponding to the target test interface, and displaying a configuration interface for configuring the test script corresponding to the target test interface so that a user can configure the test script; the configuration interface comprises a first configuration interface used for enabling the user to configure the test module corresponding to the test framework and a second configuration interface used for enabling the user to configure the test parameters of the target test interface;
and generating a test script aiming at the target test interface according to the configuration of the user on the configuration interface.
An embodiment of the present specification further provides a device for generating a test script, including:
the establishing module is used for establishing the connection between the testing frame and the target testing interface; wherein the test frame is a modular test frame;
the display module is used for responding to an instruction for generating the test script corresponding to the target test interface and displaying a configuration interface for configuring the test script corresponding to the target test interface so that a user can configure the test script; the configuration interface comprises a first configuration interface used for enabling the user to configure the test module corresponding to the test framework and a second configuration interface used for enabling the user to configure the test parameters of the target test interface;
And the generating module is used for generating a test script aiming at the target test interface according to the configuration of the user on the configuration interface.
An embodiment of the present specification further provides a device for generating a test script, including:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
establishing connection between a test frame and a target test interface; wherein the test frame is a modular test frame;
responding to an instruction for generating a test script corresponding to the target test interface, and displaying a configuration interface for configuring the test script corresponding to the target test interface so that a user can configure the test script; the configuration interface comprises a first configuration interface used for enabling the user to configure the test module corresponding to the test framework and a second configuration interface used for enabling the user to configure the test parameters of the target test interface;
and generating a test script aiming at the target test interface according to the configuration of the user on the configuration interface.
Embodiments of the present specification also provide a storage medium for storing computer-executable instructions, which when executed implement the following processes:
Establishing connection between a test frame and a target test interface; wherein the test frame is a modular test frame;
responding to an instruction for generating a test script corresponding to the target test interface, and displaying a configuration interface for configuring the test script corresponding to the target test interface so that a user can configure the test script; the configuration interface comprises a first configuration interface used for enabling the user to configure the test module corresponding to the test framework and a second configuration interface used for enabling the user to configure the test parameters of the target test interface;
and generating a test script aiming at the target test interface according to the configuration of the user on the configuration interface.
According to the technical scheme, the target test interface is tested by the modularized test framework, and when the test script is generated, a user can configure the test module corresponding to the test framework and the test parameters of the target test interface according to actual requirements through the displayed test script configuration interface, so that the test script is configured or customized according to the actual requirements of the user, and the generated test script is flexible and changeable.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flowchart of a method for generating a test script according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of a module structure of a test framework in a test script generation method provided in an embodiment of the present specification;
fig. 3 is one of interface schematic diagrams of a configuration interface for configuring a test script in a test script generation method provided in an embodiment of the present specification;
fig. 4 is a second interface schematic diagram of a configuration interface for configuring a test script in the method for generating a test script provided in the embodiment of the present specification;
fig. 5 is a second schematic diagram of a module structure of a test framework in the method for generating a test script according to the embodiment of the present disclosure;
fig. 6 is a third interface schematic diagram of a configuration interface for configuring a test script in the method for generating a test script provided in the embodiment of the present specification;
FIG. 7 is a second flowchart of a method for generating a test script according to an embodiment of the present disclosure;
fig. 8 is a schematic diagram illustrating a module composition of a test script generation apparatus provided in an embodiment of the present specification;
fig. 9 is a schematic structural diagram of a test script generation device provided in an embodiment of this specification.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The idea of the embodiment of the present specification is that the adopted test framework is a modular test framework, that is, each test flow corresponding to the test framework is respectively encapsulated in different modules to obtain a plurality of test modules, so that when configuring the test script corresponding to the target test interface, the test modules can be selected and configured according to actual requirements, thereby making the generated test script flexible and changeable; based on the idea, embodiments of the present specification provide a method, an apparatus, a device, and a storage medium for generating a test script. The following describes a method, an apparatus, a device, and a storage medium for generating a test script provided in an embodiment of the present specification in detail.
The method provided by the embodiment of the specification is applied to computers supporting windows and mac operating systems, including desktop computers or laptop computers. The execution subject of the method provided in the embodiments of the present specification is a computer, and specifically, the execution subject may be a test script generating apparatus installed on a computer.
Fig. 1 is a flowchart of a method for generating a test script according to an embodiment of the present disclosure, where the method shown in fig. 1 at least includes the following steps:
102, establishing connection between a test frame and a target test interface; wherein the test frame is a modular test frame.
The target test interface mentioned in step 102 is a software interface, which may be an application program interface, an interactive interface between a person and software, or the like. Of course, a few specific software interfaces are indicated and illustrated herein, the target test interface may also be another software interface, and the embodiment of the present specification does not limit the specific type of the software interface, and as long as the software interface belongs to the scope of the software interface, the test script may be generated by using the method provided by the embodiment of the present specification.
Generally, a test framework may perform a complete set of test procedures, which may include, for example, multiple test procedures such as data preparation, result verification, data cleaning, and so on. The modular test framework is to separate and package each test flow of the test framework to obtain independent test modules. If the above example is continued, the data preparation process, the result verification process, and the data cleaning process may be respectively split and packaged, so as to obtain separate modules, that is, the separate modules respectively correspond to the data preparation module, the result verification module, and the data cleaning module.
Certainly, in some cases, the test framework may be modularized in other manners, for example, if a certain test framework tests a login interface of a certain application program, a general login process includes user name input, password input, and multiple test procedures of determining to log in, so that when a test module is packaged, the user name input test procedure, the password input test procedure, the test procedure of determining to log in, and the like may be respectively split, so as to obtain separate modules, that is, the separate modules respectively correspond to the user name input test module, the password input test module, and the test module of determining to log in.
Of course, the above description only describes two modularization modes of the test framework by way of example, in addition, the test framework may be modularized in other modes, and the specific splitting rule according to which the test framework is split may be set according to the actual application scenario, which is not limited in the embodiment of this specification.
For the step 102, a possible implementation manner is that a user selects or inputs an identifier (such as a name, etc.) of a target test interface to be tested on a test interface displayed by the computer, so that the computer determines the target test interface to be connected with the test framework according to the selection or the input of the user.
In specific implementation, when a target test interface needs to be tested, entering a test interface on a computer, specifically, displaying a test interface list on the interface so that a user selects the target test interface needing to be tested currently from the test interface list; or, a test interface input box is displayed on the interface, so that a user inputs a target test interface needing to be tested currently in the test interface input box.
The above two specific implementation manners for determining the visual test interface are only listed, and the embodiments in this specification do not limit the specific manner for determining which interface the target test interface is.
In the embodiment of the present specification, the adopted test framework is a module modularization test framework, that is, each test module split by the test framework is an independent module, and is used for selecting a required test module according to actual requirements, so that a test script for the whole test framework is avoided being generated, that is, the generated test script is simplified, the maintenance and modification of the test script are facilitated, and meanwhile, the generated test script is flexible and changeable.
104, responding to an instruction for generating a test script corresponding to the target test interface, and displaying a configuration interface for configuring the test script corresponding to the target test interface so that a user can configure the test script; the configuration interface comprises a first configuration interface used for enabling a user to configure the test module corresponding to the test framework and a second configuration interface used for enabling the user to configure the test parameters of the target test interface.
In the step 104, the instruction for generating the test script corresponding to the target test interface may be triggered by the user on the computer through a mouse, or if the computer is a touch screen computer, the user may directly execute a corresponding operation (e.g., a click operation) on the computer interface to trigger the instruction for generating the test script.
For example, in a specific implementation manner, after the connection between the target test interface and the test framework is established, a user may execute a right click operation on the target test interface through a mouse of the computer, so as to pop up a pull-down menu for the target test interface, where the pull-down menu includes a "test script generation" option, and the user clicks the "test script generation" option in the pull-down menu through the mouse of the computer, so as to send an instruction for generating the test script to the computer.
In the embodiment of the present specification, the test script can be customized or configured according to the current test requirement, so that after the user triggers the instruction for generating the test script corresponding to the target test interface, the computer displays the configuration interface for configuring the test script to the user.
Specifically, when configuring the test script, the test module corresponding to the test frame may be generally configured, and the test parameters of the target test interface may also be configured, so that the configuration interface displayed to the user includes two interfaces, one is a first configuration interface for configuring the test module corresponding to the test framework, and the other is a second configuration interface for configuring the test parameters of the target test interface.
In specific implementation, the two configuration interfaces can be simultaneously displayed on a computer screen, when a user clicks a first configuration interface above the interfaces, the first configuration interface is displayed on the current screen, and when the user clicks a second configuration interface on the interfaces, the second configuration interface is displayed on the current screen; or when the configuration interface is displayed, the first configuration interface is displayed on the display screen, and when the user finishes configuring the test module, the second configuration interface is displayed to the user; of course, the second configuration interface may be displayed first, and then the first configuration interface may be displayed.
The above description is merely exemplary in nature and is not intended to limit the embodiments of the present disclosure.
In addition, the above-mentioned configuration of the test parameters of the target test interface is actually to generate a yaml file in the test script.
And 106, generating a test script for the target test interface according to the configuration of the user on the configuration interface.
After a configuration interface for configuring the test script is displayed for a user, the configuration interface is used for checking or inputting corresponding information, so that the test script is generated according to actual requirements. After the user executes the configuration of the test script on the configuration interface, the computer calls the test script to generate a plug-in according to the configuration item of the user on the test script on the configuration interface, and generates the test script aiming at the target test interface.
In the method for generating the test script provided in the embodiment of the present specification, because the adopted test framework is the modular test framework, each test module of the test framework can be configured, and the test module required to be used in the current test is selected according to actual requirements, so that the generated test script is flexible and changeable.
In order to facilitate understanding of the method for generating the test script provided in the embodiments of the present specification, a detailed implementation process of each step described above will be described in detail below.
In an embodiment of the present specification, the test framework at least includes one or more of the following test modules:
the device comprises a data preparation module, a result checking module and a data cleaning module;
wherein, the data preparation module comprises one or more of the following modules:
the system comprises a user initialization module, a data initialization module, a service initialization module and a mock initialization module.
Fig. 2 shows a possible test module division manner of a test framework in an embodiment of this specification, and in the test framework shown in fig. 2, the test modules included in the test framework are a user initialization module, a data initialization module, a server initialization module, a mock initialization module, a result verification module, and a data cleaning module.
In a specific implementation, in the step 104, in response to the instruction for generating the test script corresponding to the target test interface, a configuration interface for configuring the test script corresponding to the target test interface is displayed, which includes at least the following step (one) and step (two);
step one, responding to a command of generating a test script corresponding to a target test interface, and displaying a first configuration interface and a second configuration interface so that a user can execute a check operation of checking a test module on the first configuration interface and execute a check operation of checking a test parameter of the target test interface on the second configuration interface;
and (II) responding to the checking operation executed by the user on the first configuration interface, and displaying the module configuration sub-interface corresponding to the test module checked by the user so that the user can configure the corresponding test module on the module configuration sub-interface.
After a user triggers an instruction for generating a test script corresponding to a target test interface, a test script configuration interface is displayed to the user on a display screen of a computer, wherein the configuration interface comprises a first configuration interface for configuring a test module and a second configuration interface for configuring the input parameters of the target test interface.
Specifically, a user can select a test module to be used on the first configuration interface, and the user can select test parameters of the target test interface on the second configuration interface. One possible configuration interface for configuring a test script is shown in FIG. 3.
On the configuration interface shown in fig. 3, a user clicks a "first configuration interface" above the interface shown in fig. 3, so that the currently displayed configuration interface is the first configuration interface, test module options corresponding to a test frame are set on the configuration interface, the configuration interface includes a user initialization module, a data initialization module, a mock initialization module, a service initialization module, a result verification module and a data cleaning module, and a selection box is set in front of each test module, and the user selects the test module by clicking (mouse clicking or gesture operation) the selection box in front of the corresponding test module, for example, if the user needs to use the service initialization module when testing a target test interface, the user can click the selection box in front of the service initialization module, and after clicking by the user, a check occurs in the selection box, indicating that the user has selected the test module; of course, if the user selects incorrectly, the selection of the test module may be cancelled by clicking the selection box in front of the test module again.
In the same manner, the test parameters of the target test interface may be configured on the second configuration interface, and when the user clicks the "second configuration interface" above the interface shown in fig. 3, the current configuration interface jumps to the second configuration interface, that is, the interface configured for the test parameters of the target test interface, as shown in fig. 4.
On the configuration interface shown in fig. 4, a second configuration interface is currently displayed, a test parameter option of the target test interface is set on the configuration interface, all test parameters corresponding to the target test interface are listed on the configuration interface for the user to select according to the actual requirement, and in addition, if a certain test parameter corresponding to the target test interface is a reference type, all fields under the referenced test parameters are also displayed on the second configuration interface.
For example, as shown in fig. 4, if the test parameters corresponding to the current target test interface are Identifiers (IDs) showing all students, the test interface introduces "students", and all fields corresponding to the "students" need to be shown on the interface, such as student Name, student No, student Sex, student agent, and school Name.
If the parameter of 'student sex' needs to be selected, the user can click a selection box in front of the parameter of 'student sex' on the computer interface, and when the selection box displays 'check-up' in front of the selection box, the test parameter is selected.
In addition, in this embodiment of the present specification, when a user performs a check operation on a test module on the first configuration interface, the user checks which test module is checked, and automatically jumps to the module configuration sub-interface corresponding to the test module, so as to perform corresponding configuration on the test module.
Specifically, each test module is configured, and information such as corresponding data and test operation to be executed by the test module can be input into the test module. In particular implementation, each test module includes a plurality of functions, for example, the user initialization module may include functions of creating a new user, initializing an old user, and the like, and the data initialization module may include interface entry initialization, Database (DB) data initialization, and the like; the mock initialization module comprises the steps of inputting a precondition for using mock, an expected result of mock and the like; the service initialization module comprises the steps of defining the interface service to be tested, calling the interface service to be tested and the like; the result checking module comprises contents of interface return parameter checking, DB data checking, message checking and the like; the data cleaning module comprises functions of cleaning data preconditions, cleaning mock service, cleaning tair, cleaning DB data and the like. Therefore, a specific structural diagram of the test frame is shown in fig. 2. Of course, fig. 2 only exemplifies the test modules divided by the test framework and the corresponding functional items of each test module, and does not limit the embodiments of the present specification.
For example, if the user has checked the result checking module on the first configuration interface, the currently displayed interface will jump to the configuration sub-interface corresponding to the result checking module for configuration, as shown in fig. 5, and specifically, the user may check the corresponding checking content on the configuration sub-interface corresponding to the result checking module. Of course, on the configuration sub-interfaces corresponding to some test modules, a user may also input data or some parameters, and for different test modules, there is a difference in the corresponding configuration sub-interfaces, and fig. 5 above is only an exemplary illustration taking the result checking module as an example, and does not constitute a limitation to the embodiments of this specification.
In addition, it should be noted that, in order to implement the method provided by the embodiment of the present specification, before establishing the connection between the test framework and the target test interface, the method provided by the embodiment of the present specification further includes the following steps:
and splitting and packaging the test frame according to a set rule to obtain a plurality of test modules corresponding to the test frame.
Specifically, the set rule may be a test function or a corresponding test point, and a specific splitting manner for splitting the test frame has been described in the foregoing by way of example, and is not described herein again.
In addition, in the embodiment of the present specification, the generated test script is a rough framework, and after the test script is generated, data in a Comma-Separated Values (CSV) format may be filled in the generated test script according to an actual use case, for example, the filled data may be interface field information, some remark information, parameter information required for an interface field, and the like of the target test interface.
In addition, in the embodiment of the present specification, the remote server is associated in advance, so that after the test script for the target test interface is generated, the generated test script is sent to the server to be stored. In this way, the test script can also be run while continuing integration.
In addition, in the embodiment of the present specification, the target test interface may be packaged by using the framework, so that when the target test interface is tested, the problem of interface calling is not concerned any more, and the test efficiency may be improved.
In addition, in the embodiment of the present specification, writing formats in the code templates of the functions corresponding to the test modules are unified, so that the code formats of the test module parts in the generated test script are also unified, so that the writing formats of the entire codes in the test script are consistent, and the cascading between the test modules is facilitated.
Fig. 7 is a second flowchart of a method for generating a test script according to an embodiment of the present disclosure, where the method shown in fig. 7 at least includes the following steps:
step 702, receiving an instruction for testing a target test interface triggered by a user.
The instruction carries an identifier, such as a name, of the target test interface.
Step 704, establishing connection between the test frame and the target test interface; wherein the test frame is a modular test frame.
Step 706, receiving a test script instruction corresponding to the target test interface, triggered by the user, and displaying a first configuration interface and a second configuration interface for configuring the test script to the user.
Step 708, in response to the checking operation performed by the user on the first configuration interface, displaying the module configuration sub-interface corresponding to the test module checked by the user, so that the user configures the corresponding test module on the module configuration sub-interface.
Step 710, generating a test script for the target test interface according to the configuration operation executed by the user on the first configuration interface, the second configuration interface and the module configuration sub-interface.
The specific implementation process of each step in the embodiment corresponding to fig. 7 may refer to the specific implementation process of each step in the method embodiment corresponding to fig. 1 to fig. 6, and is not described herein again.
In the method for generating the test script provided in the embodiment of the present specification, a modularized test framework is used to test a target test interface, and when the test script is generated, a user can configure a test module corresponding to the test framework and test parameters of the target test interface according to actual requirements through a displayed test script configuration interface, so that the test script is configured or customized according to the actual requirements of the user, and the generated test script is flexible and changeable.
Corresponding to the method provided in the embodiment of the present specification, based on the same idea, an embodiment of the present specification provides a test script generation apparatus, configured to execute the method provided in the embodiment of the present specification for generating the test script, where fig. 8 is a schematic diagram of module compositions of the test script generation apparatus provided in the embodiment of the present specification, and the apparatus shown in fig. 8 includes:
an establishing module 802, configured to establish a connection between a test framework and a target test interface; wherein the test frame is a modular test frame;
the display module 804 is configured to display a configuration interface for configuring the test script corresponding to the target test interface in response to an instruction for generating the test script corresponding to the target test interface, so that a user configures the test script; the configuration interface comprises a first configuration interface and a second configuration interface, wherein the first configuration interface is used for enabling a user to configure the test module corresponding to the test framework, and the second configuration interface is used for enabling the user to configure the test parameters of the target test interface;
And a generating module 806, configured to generate a test script for the target test interface according to the configuration of the user in the configuration interface.
Optionally, the display module 804 includes:
the first display unit is used for responding to an instruction for generating a test script corresponding to the target test interface, and displaying a first configuration interface and a second configuration interface so that a user can execute the checking operation of checking the test module on the first configuration interface and execute the checking operation of checking the test parameters of the target test interface on the second configuration interface;
and the second display unit is used for responding to the checking operation executed by the user on the first configuration interface, and displaying the module configuration sub-interface corresponding to the test module checked by the user so that the user can configure the corresponding test module on the module configuration sub-interface.
Optionally, the test framework at least includes one or more of the following test modules:
the device comprises a data preparation module, a result checking module and a data cleaning module;
wherein, the data preparation module comprises one or more of the following test modules:
the system comprises a user initialization module, a data initialization module, a service initialization module and a mock initialization module.
Optionally, the apparatus provided in this specification further includes:
and the sending module is used for sending the generated test script to a server for storage.
Optionally, the apparatus provided in this specification further includes:
and the splitting module is used for splitting and packaging the test framework according to a set rule to obtain a plurality of test modules corresponding to the test framework.
The test script generating device in this description embodiment may also execute the method executed by the test script generating device in fig. 1 to fig. 7, and implement the functions of the test script generating device in the embodiments shown in fig. 1 to fig. 7, which are not described herein again.
The device for generating the test script provided in the embodiment of the present specification adopts the modularized test framework to test the target test interface, and when the test script is generated, a user can configure the test module corresponding to the test framework and the test parameters of the target test interface according to actual requirements through the displayed test script configuration interface, thereby implementing configuration or customization of the test script according to actual requirements of the user, and making the generated test script flexible and changeable.
Further, based on the methods shown in fig. 1 to fig. 7, an embodiment of the present specification further provides a device for generating a test script, as shown in fig. 9.
The test script generating device may have a relatively large difference due to different configurations or performances, and may include one or more processors 901 and a memory 902, where the memory 902 may store one or more stored applications or data. Memory 902 may be, among other things, transient storage or persistent storage. The application program stored in memory 902 may include one or more modules (not shown), each of which may include a series of computer-executable instruction information in a device for generating test scripts. Still further, the processor 901 may be configured to communicate with the memory 902 to execute a series of computer-executable instruction information in the memory 902 on a generating device of the test script. The generation apparatus of the test script may also include one or more power supplies 903, one or more wired or wireless network interfaces 904, one or more input-output interfaces 905, one or more keyboards 906, and the like.
In a particular embodiment, the test script generating apparatus comprises a memory, and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may comprise one or more modules, and each module may comprise a series of computer-executable instruction information for the test script generating apparatus, and the one or more programs configured to be executed by the one or more processors include computer-executable instruction information for:
Establishing connection between a test frame and a target test interface; wherein the test frame is a modular test frame;
responding to an instruction for generating a test script corresponding to the target test interface, and displaying a configuration interface for configuring the test script corresponding to the target test interface so that a user can configure the test script; the configuration interface comprises a first configuration interface and a second configuration interface, wherein the first configuration interface is used for enabling a user to configure the test module corresponding to the test framework, and the second configuration interface is used for enabling the user to configure the test parameters of the target test interface;
and generating a test script aiming at the target test interface according to the configuration of the user on the configuration interface.
Optionally, when executed, the computer executable instruction information shows, in response to an instruction for generating a test script corresponding to the target test interface, a configuration interface for configuring the test script corresponding to the target test interface, where the configuration interface includes:
responding to an instruction for generating a test script corresponding to the target test interface, and displaying a first configuration interface and a second configuration interface so that a user can execute a checking operation for checking a test module on the first configuration interface and execute a checking operation for checking test parameters of the target test interface on the second configuration interface;
And responding to the checking operation executed on the first configuration interface by the user, and displaying the module configuration sub-interface corresponding to the test module checked by the user so that the user configures the corresponding test module on the module configuration sub-interface.
Optionally, when the computer executable instruction information is executed, the test framework at least includes one or more of the following test modules:
the device comprises a data preparation module, a result checking module and a data cleaning module;
wherein, the data preparation module comprises one or more of the following test modules:
the system comprises a user initialization module, a data initialization module, a service initialization module and a mock initialization module.
Optionally, when the computer-executable instruction information is executed, after the test script for the target test interface is generated according to the configuration of the configuration interface by the user, the following steps may be further performed:
and sending the generated test script to a server for storage.
Optionally, when the computer-executable instruction information is executed, before the connection between the test framework and the target test interface is established, the following steps may be further performed:
and splitting and packaging the test framework according to a set rule to obtain a plurality of test modules corresponding to the test framework.
The test script generation device provided in the embodiments of the present specification adopts a modular test framework to test a target test interface, and when generating a test script, a user can configure a test module corresponding to the test framework and test parameters of the target test interface according to actual requirements through a displayed test script configuration interface, thereby implementing configuration or customization of the test script according to actual requirements of the user, and making the generated test script flexible and changeable.
Further, based on the methods shown in fig. 1 to fig. 7, in a specific embodiment, the storage medium may be a usb disk, an optical disk, a hard disk, or the like, and when executed by a processor, the storage medium stores computer-executable instruction information that implements the following processes:
establishing connection between a test frame and a target test interface; wherein the test frame is a modular test frame;
responding to an instruction for generating a test script corresponding to the target test interface, and displaying a configuration interface for configuring the test script corresponding to the target test interface so that a user can configure the test script; the configuration interface comprises a first configuration interface and a second configuration interface, wherein the first configuration interface is used for enabling a user to configure the test module corresponding to the test framework, and the second configuration interface is used for enabling the user to configure the test parameters of the target test interface;
And generating a test script aiming at the target test interface according to the configuration of the user on the configuration interface.
Optionally, when executed by the processor, the computer-executable instruction information stored in the storage medium, in response to an instruction for generating a test script corresponding to the target test interface, shows a configuration interface for configuring the test script corresponding to the target test interface, where the configuration interface includes:
responding to an instruction for generating a test script corresponding to the target test interface, and displaying a first configuration interface and a second configuration interface so that a user can execute a checking operation for checking a test module on the first configuration interface and execute a checking operation for checking test parameters of the target test interface on the second configuration interface;
and responding to the checking operation executed on the first configuration interface by the user, and displaying the module configuration sub-interface corresponding to the test module checked by the user so that the user configures the corresponding test module on the module configuration sub-interface.
Optionally, the storage medium stores computer-executable instruction information that, when executed by the processor, the testing framework includes at least one or more of the following testing modules:
the device comprises a data preparation module, a result checking module and a data cleaning module;
Wherein the data preparation module comprises one or more of the following test modules:
the system comprises a user initialization module, a data initialization module, a service initialization module and a mock initialization module.
Optionally, after the computer-executable instruction information stored in the storage medium is executed by the processor and a test script for the target test interface is generated according to the configuration of the configuration interface by the user, the following process may be further performed:
and sending the generated test script to a server for storage.
Optionally, before the computer-executable instruction information stored in the storage medium is executed by the processor and the connection between the test framework and the target test interface is established, the following process may be further performed:
and splitting and packaging the test framework according to a set rule to obtain a plurality of test modules corresponding to the test framework.
When the computer executable instruction information stored in the storage medium provided in the embodiment of the present specification is executed by the processor, the target test interface is tested by using the modular test framework, and when the test script is generated, a user can configure the test module corresponding to the test framework and the test parameters of the target test interface according to actual requirements through the displayed test script configuration interface, so that the test script is configured or customized according to the actual requirements of the user, and the generated test script is flexible and changeable.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry for implementing the logical method flows can be readily obtained by a mere need to program the method flows with some of the hardware description languages described above and into an integrated circuit.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the specification. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instruction information. These computer program instruction information may be provided to a processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing apparatus to produce a machine, such that the instruction information executed by the processor of the computer or other programmable data processing apparatus produce a means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instruction information may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instruction information stored in the computer-readable memory produce an article of manufacture including instruction information means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instruction information may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instruction information executed on the computer or other programmable apparatus provides steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instruction information, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The application may be described in the general context of computer-executable instruction information, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (12)

1. A method of generating a test script, the method comprising:
establishing connection between a test frame and a target test interface; wherein the test frame is a modular test frame; the modularized testing framework is a plurality of independent testing modules obtained by splitting and packaging each testing flow of the testing framework;
responding to an instruction for generating a test script corresponding to the target test interface, and displaying a configuration interface for configuring the test script corresponding to the target test interface so that a user can configure the test script; the configuration interface comprises a first configuration interface used for enabling the user to configure the test module corresponding to the test framework and a second configuration interface used for enabling the user to configure the test parameters of the target test interface;
And generating a test script aiming at the target test interface according to the configuration of the user on the configuration interface.
2. The method of claim 1, wherein the presenting, in response to the instruction for generating the test script corresponding to the target test interface, the configuration interface for configuring the test script corresponding to the target test interface comprises:
responding to an instruction for generating a test script corresponding to the target test interface, and displaying the first configuration interface and the second configuration interface so that the user can execute a checking operation for checking a test module on the first configuration interface and execute a checking operation for checking a test parameter of the target test interface on the second configuration interface;
and responding to the checking operation executed on the first configuration interface by the user, and displaying a module configuration sub-interface corresponding to the test module checked by the user so that the user configures the corresponding test module on the module configuration sub-interface.
3. The method of claim 1 or 2, the test framework comprising at least one or more of the following test modules:
the device comprises a data preparation module, a result checking module and a data cleaning module;
Wherein the data preparation module comprises one or more of the following test modules:
the system comprises a user initialization module, a data initialization module, a service initialization module and a mock initialization module.
4. The method of claim 1, after generating a test script for the target test interface according to the configuration of the configuration interface by the user, the method further comprising:
and sending the generated test script to a server for storage.
5. The method of claim 1, prior to establishing the connection of the test framework with the target test interface, the method further comprising:
and splitting and packaging the test framework according to a set rule to obtain a plurality of test modules corresponding to the test framework.
6. An apparatus for generating a test script, the apparatus comprising:
the establishing module is used for establishing the connection between the testing frame and the target testing interface; wherein the test frame is a modular test frame; the modularized testing framework is a plurality of independent testing modules obtained by splitting and packaging each testing flow of the testing framework;
the display module is used for responding to an instruction for generating the test script corresponding to the target test interface and displaying a configuration interface for configuring the test script corresponding to the target test interface so that a user can configure the test script; the configuration interface comprises a first configuration interface used for enabling the user to configure the test module corresponding to the test framework and a second configuration interface used for enabling the user to configure the test parameters of the target test interface;
And the generating module is used for generating a test script aiming at the target test interface according to the configuration of the user on the configuration interface.
7. The apparatus of claim 6, the display module, comprising:
the first display unit is used for responding to an instruction for generating a test script corresponding to the target test interface, displaying the first configuration interface and the second configuration interface, so that the user can execute the checking operation of checking the test module on the first configuration interface and execute the checking operation of checking the test parameters of the target test interface on the second configuration interface;
and the second display unit is used for responding to the checking operation executed by the user on the first configuration interface, and displaying the module configuration sub-interface corresponding to the test module checked by the user so as to enable the user to configure the corresponding test module on the module configuration sub-interface.
8. The apparatus of claim 6 or 7, the test framework comprising at least one or more of the following test modules:
the device comprises a data preparation module, a result checking module and a data cleaning module;
wherein the data preparation module comprises one or more of the following test modules:
The system comprises a user initialization module, a data initialization module, a service initialization module and a mock initialization module.
9. The apparatus of claim 6, further comprising:
and the sending module is used for sending the generated test script to a server for storage.
10. The apparatus of claim 6, further comprising:
and the splitting module is used for splitting and packaging the test framework according to a set rule to obtain a plurality of test modules corresponding to the test framework.
11. A test script generation apparatus, comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
establishing connection between a test frame and a target test interface; wherein the test frame is a modular test frame; the modularized testing framework is a plurality of independent testing modules obtained by splitting and packaging each testing flow of the testing framework;
responding to an instruction for generating a test script corresponding to the target test interface, and displaying a configuration interface for configuring the test script corresponding to the target test interface so that a user can configure the test script; the configuration interface comprises a first configuration interface used for enabling the user to configure the test module corresponding to the test framework and a second configuration interface used for enabling the user to configure the test parameters of the target test interface;
And generating a test script aiming at the target test interface according to the configuration of the user on the configuration interface.
12. A storage medium storing computer-executable instructions that, when executed, implement the following:
establishing connection between a test frame and a target test interface; wherein the test frame is a modular test frame; the modularized testing framework is a plurality of independent testing modules obtained by splitting and packaging each testing process of the testing framework;
responding to an instruction for generating a test script corresponding to the target test interface, and displaying a configuration interface for configuring the test script corresponding to the target test interface so that a user can configure the test script; the configuration interface comprises a first configuration interface and a second configuration interface, wherein the first configuration interface is used for enabling the user to configure the test module corresponding to the test framework, and the second configuration interface is used for enabling the user to configure the test parameters of the target test interface;
and generating a test script aiming at the target test interface according to the configuration of the user on the configuration interface.
CN201910121285.7A 2019-02-19 2019-02-19 Test script generation method and device Active CN109902003B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910121285.7A CN109902003B (en) 2019-02-19 2019-02-19 Test script generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910121285.7A CN109902003B (en) 2019-02-19 2019-02-19 Test script generation method and device

Publications (2)

Publication Number Publication Date
CN109902003A CN109902003A (en) 2019-06-18
CN109902003B true CN109902003B (en) 2022-06-14

Family

ID=66944954

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910121285.7A Active CN109902003B (en) 2019-02-19 2019-02-19 Test script generation method and device

Country Status (1)

Country Link
CN (1) CN109902003B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111078535A (en) * 2019-11-28 2020-04-28 广州及包子信息技术咨询服务有限公司 Method and system for rapidly providing automatic test execution capacity
CN113282476B (en) * 2021-06-24 2023-01-20 深圳市商汤科技有限公司 Interface performance testing method and device and electronic equipment
CN113704099A (en) * 2021-08-20 2021-11-26 北京空间飞行器总体设计部 Test script generation method and equipment for spacecraft power system evaluation

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2610754A1 (en) * 2011-12-28 2013-07-03 Verisign, Inc. Test automation environment for testing domain name resolution
CN105335287A (en) * 2015-10-15 2016-02-17 广东欧珀移动通信有限公司 Automatic test method and device
CN106326121A (en) * 2016-08-22 2017-01-11 上海亿账通互联网科技有限公司 Method for automatically generating test script and terminal
CN108446225A (en) * 2018-03-06 2018-08-24 平安科技(深圳)有限公司 Creating device, method and the computer readable storage medium of analog interface
CN108984398A (en) * 2018-06-28 2018-12-11 广州视源电子科技股份有限公司 Method, apparatus, electronic device and the storage medium of software test

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2610754A1 (en) * 2011-12-28 2013-07-03 Verisign, Inc. Test automation environment for testing domain name resolution
CN105335287A (en) * 2015-10-15 2016-02-17 广东欧珀移动通信有限公司 Automatic test method and device
CN106326121A (en) * 2016-08-22 2017-01-11 上海亿账通互联网科技有限公司 Method for automatically generating test script and terminal
CN108446225A (en) * 2018-03-06 2018-08-24 平安科技(深圳)有限公司 Creating device, method and the computer readable storage medium of analog interface
CN108984398A (en) * 2018-06-28 2018-12-11 广州视源电子科技股份有限公司 Method, apparatus, electronic device and the storage medium of software test

Also Published As

Publication number Publication date
CN109902003A (en) 2019-06-18

Similar Documents

Publication Publication Date Title
CN108924029B (en) Method and device for sending customer service data
CN109902003B (en) Test script generation method and device
CN106415480B (en) High-speed application for installation on a mobile device for enabling remote configuration of the mobile device
US20150317234A1 (en) System, method, apparatus and computer program for automatic evaluation of user interfaces in software programs
US20120204160A1 (en) Managing Non-Common Features for Program Code Translation
US10452231B2 (en) Usability improvements for visual interfaces
US11741002B2 (en) Test automation systems and methods using logical identifiers
CN107479868B (en) Interface loading method, device and equipment
US8984487B2 (en) Resource tracker
US11003668B2 (en) Programming language independent software testing environment
CN113031946A (en) Method and device for rendering page component
US9037994B2 (en) Navigation to a data definition in a diff context
CN111722995B (en) Data processing method and device
US11422783B2 (en) Auto-deployment of applications
CN112925583B (en) Host application capability extension method, device, equipment and storage medium
CN112243024B (en) Service control method, device, server and storage medium
CN112035117A (en) Page display system, method and device
CN108037914B (en) Method and device for developing android native system by combining js
CN109284222B (en) Software unit, project testing method, device and equipment in data processing system
CN107665124B (en) Modular JavaScript file processing method, device and server
CN111242731B (en) Service execution method and device
CN107391223B (en) File processing method and device
CN112068814A (en) Method, device, system and medium for generating executable file
CN115309376B (en) Application creation method and device, electronic equipment and storage medium
CN109324966B (en) Test script generation and execution 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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200922

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman, British Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman, British Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200922

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman, British Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

GR01 Patent grant
GR01 Patent grant