CN111258900A - Interface test script generation method, system, equipment and storage medium - Google Patents

Interface test script generation method, system, equipment and storage medium Download PDF

Info

Publication number
CN111258900A
CN111258900A CN202010050556.7A CN202010050556A CN111258900A CN 111258900 A CN111258900 A CN 111258900A CN 202010050556 A CN202010050556 A CN 202010050556A CN 111258900 A CN111258900 A CN 111258900A
Authority
CN
China
Prior art keywords
test
test script
interface
code
codes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010050556.7A
Other languages
Chinese (zh)
Inventor
柯婵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
OneConnect Smart Technology Co Ltd
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
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 OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202010050556.7A priority Critical patent/CN111258900A/en
Publication of CN111258900A publication Critical patent/CN111258900A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses a method for generating an interface test script, which comprises the following steps: acquiring a plurality of function test script codes; packaging the plurality of function test script codes to obtain a plurality of packaged target test script codes; establishing a mapping relation between the access path of each target test script code and a corresponding test interface to form an interface test address; receiving code parameter configuration information input by a user, and generating test interface request information according to the code parameter configuration information; and configuring corresponding target test script codes according to the test interface request information to generate a target test script. The embodiment of the invention also provides a system, equipment and a storage medium for generating the interface test script. The embodiment of the invention has the beneficial effects that: the target test script can be generated by one key, so that the occurrence probability of code errors is reduced, and the accuracy of test results is improved.

Description

Interface test script generation method, system, equipment and storage medium
Technical Field
The embodiment of the invention relates to the field of software testing, in particular to a method, a system, equipment and a storage medium for generating an interface testing script.
Technical Field
The interface refers to communication rules between different functional layers of the same system. When service interfacing (providing an interface externally in a service manner) is prevalent, in an end-to-end interface system, it is important to ensure the quality and stability of an interface for interaction at a front end and a back end, and the quality and stability of the interface are verified by an interface test in an interface development process, which puts a high requirement on the accuracy of a verification result of the interface test.
In the conventional interface test, because the front-end development (herein, broadly, the development of a client) and the back-end development (herein, broadly, the development of a server) of service software in the same service system are often parallel, the test of an interface developed by the front-end and the test of an interface developed by the back-end are also parallel. The testing of the interface developed by the front-end interface testing engineer and the back-end interface testing engineer is respectively carried out based on information such as standard software functions, parameters, return values and the like provided in an interface description, the interface description is the basis of interactive operation between the front-end developer and the back-end developer, a contract-based cooperation mode between the front-end developer and the back-end developer is also constructed, and the consistency of understanding of the contracts by the two parties is the basis that the interface testing can be accurately and efficiently carried out.
However, the programmer level varies, which results in insufficient reliability of the test results obtained by running the written test code. Even, some personnel with a low programming level cannot perform a functional test on the interface to be tested, so that the accuracy of the test result of the interface test is often low.
Disclosure of Invention
In view of this, an object of the embodiments of the present invention is to provide a method, a system, a device and a storage medium for generating an interface test script, which can generate a target test script by one key, reduce the occurrence probability of code errors, and improve the accuracy of a test result, thereby improving the working efficiency.
In order to achieve the above object, an embodiment of the present invention provides a method for generating an interface test script, including:
acquiring a plurality of function test script codes;
packaging the plurality of function test script codes to obtain a plurality of packaged target test script codes;
establishing a mapping relation between the access path of each target test script code and a corresponding test interface to form an interface test address;
receiving code parameter configuration information input by a user, and generating test interface request information according to the code parameter configuration information;
and configuring corresponding target test script codes according to the test interface request information to generate a target test script.
Further, the step of performing a packaging operation on the plurality of functional test script codes to obtain a plurality of packaged target test script codes includes:
acquiring a plurality of function test script codes, and constructing a function library based on the plurality of function test script codes;
acquiring a function test script code corresponding to the test script code from the function library;
and packaging the test script codes corresponding to the execution actions in the functional test script by taking the completion of one execution action as a reference to obtain target test script codes.
Further, the step of receiving code parameter configuration information input by a user and generating test interface request information according to the code parameter configuration information includes:
acquiring a corresponding test document to be filled according to a request instruction of a user and sending the test document to be filled to a terminal;
receiving a test document filled by the user based on the terminal, wherein the test document comprises code parameter configuration information;
and generating test interface request information according to the test interface name in the code parameter configuration information.
Further, the step of configuring corresponding target test script codes according to the test interface request information to generate a target test script includes:
receiving the test interface request information;
inquiring an interface test address corresponding to the interface according to the test interface name of the code parameter configuration information of the test interface request information;
inquiring a corresponding target test script code according to the interface test address;
and importing the code parameter configuration information into the target test script code to generate a target test script.
In order to achieve the above object, an embodiment of the present invention further provides a system for generating an interface test script, including:
the acquisition module is used for acquiring a plurality of function test script codes;
the packaging module is used for packaging the plurality of function test script codes to obtain a plurality of packaged target test script codes;
the mapping module is used for establishing a mapping relation between the access path of each target test script code and the corresponding test interface to form an interface test address;
the generating module is used for receiving code parameter configuration information input by a user and generating test interface request information according to the code parameter configuration information;
and the configuration module is used for configuring corresponding target test script codes according to the test interface request information so as to generate a target test script.
Further, the encapsulation module is further configured to:
acquiring a plurality of function test script codes, and constructing a function library based on the plurality of function test script codes;
acquiring a function test script code corresponding to the test script code from the function library;
and packaging the test script codes corresponding to the execution actions in the functional test script by taking the completion of one execution action as a reference to obtain target test script codes.
Further, the generation module is further configured to:
acquiring a corresponding test document to be filled according to a request instruction of a user and sending the test document to be filled to a terminal;
receiving a test document filled by the user based on the terminal, wherein the test document comprises code parameter configuration information;
and generating test interface request information according to the test interface name in the code parameter configuration information.
Further, the configuration module is further configured to:
receiving the test interface request information;
inquiring an interface test address corresponding to the interface according to the test interface name of the code parameter configuration information of the test interface request information;
inquiring a corresponding target test script code according to the interface test address;
and importing the code parameter configuration information into the target test script code to generate a target test script.
To achieve the above object, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, where the memory stores a computer program that is executable on the processor, and the computer program, when executed by the processor, implements the steps of the interface test script generation method as described above.
To achieve the above object, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, where the computer program is executable by at least one processor, so as to cause the at least one processor to execute the steps of the interface test script generation method described above.
According to the interface test script generation method, system, device and storage medium provided by the embodiment of the invention, a plurality of function test script codes are packaged to obtain a plurality of packaged target test script codes, and the target test script codes can be searched through an interface test address when an interface test request is carried out by establishing a mapping relation between an access path of the target test script codes and a test interface, so that the target test script is generated by one key; the probability of code errors is reduced, and the accuracy of test results is improved, so that the working efficiency is improved.
Drawings
Fig. 1 is a flowchart of a first embodiment of a method for generating an interface test script according to an embodiment of the present invention.
FIG. 2 is a flowchart of step S102 according to an embodiment of the present invention.
FIG. 3 is a flowchart of step S106 according to an embodiment of the present invention.
FIG. 4 is a flowchart of step S108 according to an embodiment of the present invention.
Fig. 5 is a schematic diagram of program modules of a second embodiment of a system for generating an interface test script according to an embodiment of the present invention.
Fig. 6 is a schematic diagram of a hardware structure of a third embodiment of a computer device according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. 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 invention.
Example one
Referring to fig. 1, a flowchart illustrating steps of a method for generating an interface test script according to a first embodiment of the present invention is shown. It is to be understood that the flow charts in the embodiments of the present method are not intended to limit the order in which the steps are performed. The following description will exemplarily be given with the computer device 2 as an execution subject. The details are as follows.
Step S100, a plurality of function test script codes are obtained.
Specifically, the obtaining of the functional test script code may be by reading a test case database to obtain a functional test script code in the test case database; or acquiring the functional test script code written by the user through the test function tool.
And step S102, packaging the plurality of function test script codes to obtain a plurality of packaged target test script codes.
Specifically, when the functional test script codes are packaged into a plurality of target test script codes, the codes corresponding to the execution actions in the functional test script are packaged by taking the completion of one execution action as a reference to obtain the target test script codes, and a plurality of functional test script codes are obtained according to different execution actions. For example, verifying the login function in the function test script, and writing the execution action corresponding to the login function test step by using the test tool function includes: enter a username, enter a password, and click to log in, each execution action is represented by writing code.
Exemplarily, referring to fig. 2, the step S102 further includes:
step S102A, obtaining a plurality of function test script codes, and constructing a function library based on the function test script codes;
step S102B, obtaining a function test script code corresponding to the test script code from the function library;
step S102C, packaging the test script code corresponding to the execution action in the functional test script based on the completion of the execution action, to obtain the target test script code.
Specifically, the code corresponding to the execution action may be divided into different target test script codes, so that each target test script code is movable on the screen of the terminal and named through a keyword. The method comprises the steps of arranging and combining test script codes according to the dragging operation of a user on the test script codes to generate functional operation function blocks, enabling the test script codes to move according to the dragging place of the user when the dragging operation of the user on the test script codes is detected, for example, when the user pulls a certain test script code by using a mouse, and generating new functions through recombination of movable blocks according to the dragging behavior of the user. For example, a user may create a login function operation function block by dragging a test script code whose keywords are "enter user name", "enter password", and "click login", or may package the test script code to form a target test script code and display the target test script code in the form of a keyword. The format is as follows:
field 1+ data type
Field 2+ data type
And so on.
And step S104, establishing a mapping relation between the access path of each target test script code and the corresponding test interface to form an interface test address.
Specifically, when the test user performs the test, the test user may search the functional function block from the functional function library through the interface test address. The access path of the target test script code and the corresponding test interface can be established into a form in advance, when the test user needs to test, an interface test address can be inquired through the form, and the test interface can directly call the target test script code through the access path of the target test script code. The access path of the test script code is a storage path of the test script code.
And step S106, receiving code parameter configuration information input by a user, and generating test interface request information according to the code parameter configuration information.
Specifically, the test interface request information may include: a request name, a url of the request, a request type (get/post), a request parameter value (get parameter value/post parameter value), etc.;
for example: let test interface request information be http:// example. com/demo. htm? The searchNo is 0, and the request name in the test interface request information is: demo, url of the request is http:// example. com/demo, the request type is get request, the request parameter is searchNo, and the value of the request parameter is 0.
The request parameter value in the test interface request information in step 106 may be set manually, or may be automatically generated by the test tool using a constraint condition that the correct test interface request information should satisfy.
Exemplarily, referring to fig. 3, the step S106 further includes:
step S106A, obtaining a corresponding test document to be filled according to the request instruction of the user, and sending the test document to be filled to the terminal.
Specifically, the request instruction includes a document name of the test document to be filled in, and the test document to be filled in can be inquired according to the document name.
Step S106B, receiving a test document filled by the user based on the terminal, where the test document includes code parameter configuration information.
Specifically, the test document is a document necessary for modular development in the software development process, and comprises a standard protocol followed by module interface interaction and a custom protocol. The formatting interface document is mainly a document format which is arranged from a test file and can be identified by a program, the document format mainly comprises a message format, a message header, a message protocol and the like, the arranging process of arranging the document format needs manual intervention, but can be executed in batch, and the overall consumed workload is less. The document format is mainly an excel format, so that original interface protocol messages can be directly copied in batches, and then rules, such as field type identification, message identification and the like, are configured according to tests. Of course, the formatted interface document may also be stored in a format such as an XML format, a txt format, etc., and the specific format is not limited, and may be selected according to the specific requirements of the user or the actual test environment.
Step S106C, generating test interface request information according to the test interface name in the code parameter configuration information.
Specifically, the code parameter configuration information includes configuration information of information to be tested and a test interface name, and the test interface name is added to the test interface request information, so that an access path of the target test script code can be conveniently found according to the test interface.
And S108, configuring corresponding target test script codes according to the test interface request information to generate a target test script.
Specifically, the code parameter configuration information in the test interface request information is input into the corresponding target test script code, and the target test script can be generated by one key.
Exemplarily, referring to fig. 4, the step S108 further includes:
step S108A, receiving the test interface request information.
Step S108B, querying an interface test address corresponding to the interface according to the test interface name of the code parameter configuration information of the test interface request information.
Step S108C, according to the interface test address, the corresponding target test script code is inquired.
Step S108D, importing the code parameter configuration information into the target test script code to generate a target test script.
Specifically, the test interface request information is a service request sent by a client terminal for completing a certain service, and the test interface request information includes request modes of get, post, put, and delete; parameterizing data needing parameterization in the target test script code body according to the confirmed test interface request information; the data to be parameterized in the target test script code body is data to be modified in the data body according to the service to be completed by the client, namely the code parameter configuration information.
For example, if a test user logs in a hundred-degree library, an account password is input on a front-end interface, then the front end sends the entry participation request information to the back end through the test interface, the back end verifies whether the account password is correct, and then a test result is returned to the front end: if the login is correct, the login is successful; if the password is incorrect, skipping cannot be performed, and a password or an account number is prompted to be incorrect.
The input parameters are password information and account information input by a user to be tested, a plurality of function test script codes are searched according to the password information and the account information, the function test script codes are packaged, and then the password information and the account information are imported into corresponding target test script codes to generate a target test script.
The target test script is as follows:
Figure BDA0002371001950000091
and whether the generated target test script is correct or not can be judged through the return value.
Example two
Referring to fig. 5, a program module diagram of a second embodiment of the interface test script generation system of the present invention is shown. In the embodiment, the interface test script generating system 20 may include or be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to implement the present invention and implement the interface test script generating method. The program module referred to in the embodiments of the present invention refers to a series of computer program instruction segments capable of performing specific functions, and is more suitable for describing the execution process of the interface test script generating system 20 in the storage medium than the program itself. The following description will specifically describe the functions of the program modules of the present embodiment:
the obtaining module 200 is configured to obtain a plurality of functional test script codes.
Specifically, the obtaining of the functional test script code may be by reading a test case database to obtain a functional test script code in the test case database; or acquiring the functional test script code written by the user through the test function tool.
The encapsulating module 202 is configured to perform an encapsulating operation on the multiple functional test script codes to obtain multiple encapsulated target test script codes.
Specifically, when the functional test script codes are packaged into a plurality of target test script codes, the codes corresponding to the execution actions in the functional test script are packaged by taking the completion of one execution action as a reference to obtain the target test script codes, and a plurality of functional test script codes are obtained according to different execution actions. For example, verifying the login function in the function test script, and writing the execution action corresponding to the login function test step by using the test tool function includes: enter a username, enter a password, and click to log in, each execution action is represented by writing code.
Illustratively, the encapsulation module 202 is further configured to:
acquiring a plurality of function test script codes, and constructing a function library based on the plurality of function test script codes;
acquiring a function test script code corresponding to the test script code from the function library;
and packaging the test script codes corresponding to the execution actions in the functional test script by taking the completion of one execution action as a reference to obtain target test script codes.
Specifically, the code corresponding to the execution action may be divided into different target test script codes, so that each target test script code is movable on the screen of the terminal and named through a keyword. The method comprises the steps of arranging and combining test script codes according to the dragging operation of a user on the test script codes to generate functional operation function blocks, enabling the test script codes to move according to the dragging place of the user when the dragging operation of the user on the test script codes is detected, for example, when the user pulls a certain test script code by using a mouse, and generating new functions through recombination of movable blocks according to the dragging behavior of the user. For example, a user may create a login function operation function block by dragging a test script code whose keywords are "enter user name", "enter password", and "click login", or may package the test script code to form a target test script code and display the target test script code in the form of a keyword. The format is as follows:
field 1+ data type
Field 2+ data type
And so on.
The mapping module 204 is configured to establish a mapping relationship between the access path of each target test script code and the corresponding test interface, so as to form an interface test address.
Specifically, when the test user performs the test, the test user may search the functional function block from the functional function library through the interface test address. The access path of the target test script code and the corresponding test interface can be established into a form in advance, when the test user needs to test, an interface test address can be inquired through the form, and the test interface can directly call the target test script code through the access path of the target test script code. The access path of the test script code is a storage path of the test script code.
A generating module 206, configured to receive code parameter configuration information input by a user, and generate test interface request information according to the code parameter configuration information, where the test interface request information is used to input the code parameter configuration information to a server.
Specifically, the test interface request information may include: a request name, a url of the request, a request type (get/post), a request parameter value (get parameter value/post parameter value), etc.;
for example: let test interface request information be http:// example. com/demo. htm? The searchNo is 0, and the request name in the test interface request information is: demo, url of the request is http:// example. com/demo, the request type is get request, the request parameter is searchNo, and the value of the request parameter is 0.
The request parameter value in the test interface request information may be set manually, or may be automatically generated by a test tool using a constraint condition that the correct test interface request information should satisfy.
Illustratively, the generating module 206 is further configured to:
and acquiring a corresponding test document to be filled according to a request instruction of a user and sending the test document to be filled to a terminal.
Specifically, the request instruction includes a document name of the test document to be filled in, and the test document to be filled in can be inquired according to the document name.
And receiving a test document filled by the user based on the terminal, wherein the test document comprises code parameter configuration information.
Specifically, the test document is a document necessary for modular development in the software development process, and comprises a standard protocol followed by module interface interaction and a custom protocol. The formatting interface document is mainly a document format which is arranged from a test file and can be identified by a program, the document format mainly comprises a message format, a message header, a message protocol and the like, the arranging process of arranging the document format needs manual intervention, but can be executed in batch, and the overall consumed workload is less. The document format is mainly an excel format, so that original interface protocol messages can be directly copied in batches, and then rules, such as field type identification, message identification and the like, are configured according to tests. Of course, the formatted interface document may also be stored in a format such as an XML format, a txt format, etc., and the specific format is not limited, and may be selected according to the specific requirements of the user or the actual test environment.
And generating test interface request information according to the test interface name in the code parameter configuration information.
Specifically, the code parameter configuration information includes configuration information of information to be tested and a test interface name, and the test interface name is added to the test interface request information, so that an access path of the target test script code can be conveniently found according to the test interface.
The configuration module 208 is configured to configure a corresponding target test script code according to the test interface request information, so as to generate a target test script.
Specifically, the code parameter configuration information in the test interface request information is input into the corresponding target test script code, and the target test script can be generated by one key.
Illustratively, the configuration module 208 is further configured to:
receiving the test interface request information;
inquiring an interface test address corresponding to the interface according to the test interface name of the code parameter configuration information of the test interface request information;
inquiring a corresponding target test script code according to the interface test address;
and importing the code parameter configuration information into the target test script code to generate a target test script.
Specifically, the test interface request information is a service request sent by a client terminal for completing a certain service, and the test interface request information includes request modes of get, post, put, and delete; parameterizing data needing parameterization in the target test script code body according to the confirmed test interface request information; the data to be parameterized in the target test script code body is data to be modified in the data body according to the service to be completed by the client, namely the code parameter configuration information.
For example, if a test user logs in a hundred-degree library, an account password is input on a front-end interface, then the front end sends the entry participation request information to the back end through the test interface, the back end verifies whether the account password is correct, and then a test result is returned to the front end: if the login is correct, the login is successful; if the password is incorrect, skipping cannot be performed, and a password or an account number is prompted to be incorrect.
The input parameters are password information and account information input by a user to be tested, a plurality of function test script codes are searched according to the password information and the account information, the function test script codes are packaged, and then the password information and the account information are imported into corresponding target test script codes to generate a target test script.
The target test script is as follows:
Figure BDA0002371001950000131
Figure BDA0002371001950000141
and whether the generated target test script is correct or not can be judged through the return value.
EXAMPLE III
Fig. 6 is a schematic diagram of a hardware architecture of a computer device according to a third embodiment of the present invention. In the present embodiment, the computer device 2 is a device capable of automatically performing numerical calculation and/or information processing in accordance with a preset or stored instruction. The computer device 2 may be a rack server, a blade server, a tower server or a rack server (including an independent server or a server cluster composed of a plurality of servers), and the like. As shown in FIG. 6, the computer device 2 includes, but is not limited to, at least a memory 21, a processor 22, a network interface 23, and an interface test script generation system 20, which may be communicatively coupled to each other via a system bus. Wherein:
in this embodiment, the memory 21 includes at least one type of computer-readable storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 21 may be an internal storage unit of the computer device 2, such as a hard disk or a memory of the computer device 2. In other embodiments, the memory 21 may also be an external storage device of the computer device 2, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like provided on the computer device 2. Of course, the memory 21 may also comprise both internal and external memory units of the computer device 2. In this embodiment, the memory 21 is generally used for storing an operating system installed in the computer device 2 and various application software, such as the program code of the interface test script generating system 20 in the second embodiment. Further, the memory 21 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 22 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 22 is typically used to control the overall operation of the computer device 2. In this embodiment, the processor 22 is configured to execute the program code stored in the memory 21 or process data, for example, execute the interface test script generating system 20, so as to implement the interface test script generating method according to the first embodiment.
The network interface 23 may comprise a wireless network interface or a wired network interface, and the network interface 23 is generally used for establishing communication connection between the server 2 and other electronic devices. For example, the network interface 23 is used to connect the server 2 to an external terminal via a network, establish a data transmission channel and a communication connection between the server 2 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth (Bluetooth), Wi-Fi, and the like. It is noted that fig. 6 only shows the computer device 2 with components 20-23, but it is to be understood that not all shown components are required to be implemented, and that more or less components may be implemented instead.
In this embodiment, the interface test script generating system 20 stored in the memory 21 may be further divided into one or more program modules, and the one or more program modules are stored in the memory 21 and executed by one or more processors (in this embodiment, the processor 22) to complete the present invention.
For example, fig. 5 shows a schematic diagram of program modules of a second embodiment of the interface test script generation system 20, in this embodiment, the interface test script generation system 20 may be divided into an obtaining module 200, a packaging module 202, a mapping module 204, a generating module 206, and a configuration module 208. The program module referred to in the present invention refers to a series of computer program instruction segments capable of performing specific functions, and is more suitable than a program for describing the execution process of the interface test script generating system 20 in the computer device 2. The specific functions of the program modules 200 and 208 have been described in detail in the second embodiment, and are not described herein again.
Example four
The present embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application mall, etc., on which a computer program is stored, which when executed by a processor implements corresponding functions. The computer-readable storage medium of the present embodiment is used for storing the interface test script generation system 20, and when executed by the processor, the interface test script generation method of the first embodiment is implemented.
According to the interface test script generation method, system, device and storage medium provided by the embodiment of the invention, a plurality of function test script codes are packaged to obtain a plurality of packaged target test script codes, and the target test script codes can be searched through an interface test address when an interface test request is carried out by establishing a mapping relation between an access path of the target test script codes and a test interface, so that the target test script is generated by one key; the probability of code errors is reduced, and the accuracy of test results is improved, so that the working efficiency is improved.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A method for generating an interface test script is characterized by comprising the following steps:
acquiring a plurality of function test script codes;
packaging the plurality of function test script codes to obtain a plurality of packaged target test script codes;
establishing a mapping relation between the access path of each target test script code and a corresponding test interface to form an interface test address;
receiving code parameter configuration information input by a user, and generating test interface request information according to the code parameter configuration information;
and configuring corresponding target test script codes according to the test interface request information to generate a target test script.
2. The method according to claim 1, wherein the step of performing a packaging operation on the plurality of functional test script codes to obtain a plurality of packaged target test script codes comprises:
acquiring a plurality of function test script codes, and constructing a function library based on the plurality of function test script codes;
acquiring a function test script code corresponding to the test script code from the function library;
and packaging the test script codes corresponding to the execution actions in the functional test script by taking the completion of one execution action as a reference to obtain target test script codes.
3. The method of claim 1, wherein the step of receiving code parameter configuration information input by a user and generating test interface request information according to the code parameter configuration information comprises:
acquiring a corresponding test document to be filled according to a request instruction of a user and sending the test document to be filled to a terminal;
receiving a test document filled by the user based on the terminal, wherein the test document comprises code parameter configuration information;
and generating test interface request information according to the test interface name in the code parameter configuration information.
4. The method according to claim 1, wherein the step of configuring corresponding target test script codes according to the test interface request information to generate a target test script comprises:
receiving the test interface request information;
inquiring an interface test address corresponding to the interface according to the test interface name of the code parameter configuration information of the test interface request information;
inquiring a corresponding target test script code according to the interface test address;
and importing the code parameter configuration information into the target test script code to generate a target test script.
5. A system for generating an interface test script, comprising:
the acquisition module is used for acquiring a plurality of function test script codes;
the packaging module is used for packaging the plurality of function test script codes to obtain a plurality of packaged target test script codes;
the mapping module is used for establishing a mapping relation between the access path of each target test script code and the corresponding test interface to form an interface test address;
the generating module is used for receiving code parameter configuration information input by a user and generating test interface request information according to the code parameter configuration information;
and the configuration module is used for configuring corresponding target test script codes according to the test interface request information so as to generate a target test script.
6. The generation system of claim 5, wherein the encapsulation module is further configured to:
acquiring a plurality of function test script codes, and constructing a function library based on the plurality of function test script codes;
acquiring a function test script code corresponding to the test script code from the function library;
and packaging the test script codes corresponding to the execution actions in the functional test script by taking the completion of one execution action as a reference to obtain target test script codes.
7. The generation system of claim 5, wherein the generation module is further configured to:
acquiring a corresponding test document to be filled according to a request instruction of a user and sending the test document to be filled to a terminal;
receiving a test document filled by the user based on the terminal, wherein the test document comprises code parameter configuration information;
and generating test interface request information according to the test interface name in the code parameter configuration information.
8. The generation system of claim 5, wherein the configuration module is further configured to:
receiving the test interface request information;
inquiring an interface test address corresponding to the interface according to the test interface name of the code parameter configuration information of the test interface request information;
inquiring a corresponding target test script code according to the interface test address;
and importing the code parameter configuration information into the target test script code to generate a target test script.
9. A computer arrangement, characterized in that the computer arrangement comprises a memory, a processor, the memory having stored thereon a computer program executable on the processor, the computer program, when executed by the processor, implementing the steps of the method of generating an interface test script according to any one of claims 1-4.
10. A computer-readable storage medium, having stored therein a computer program executable by at least one processor to cause the at least one processor to perform the steps of the method of generating an interface test script according to any one of claims 1-4.
CN202010050556.7A 2020-01-17 2020-01-17 Interface test script generation method, system, equipment and storage medium Pending CN111258900A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010050556.7A CN111258900A (en) 2020-01-17 2020-01-17 Interface test script generation method, system, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010050556.7A CN111258900A (en) 2020-01-17 2020-01-17 Interface test script generation method, system, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111258900A true CN111258900A (en) 2020-06-09

Family

ID=70952225

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010050556.7A Pending CN111258900A (en) 2020-01-17 2020-01-17 Interface test script generation method, system, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111258900A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111881042A (en) * 2020-07-27 2020-11-03 云账户技术(天津)有限公司 Automatic test script generation method and device and electronic equipment
CN112052167A (en) * 2020-08-25 2020-12-08 北京梧桐车联科技有限责任公司 Method and device for generating test script code
CN112181803A (en) * 2020-08-27 2021-01-05 五八到家有限公司 Data processing method and device
CN112346991A (en) * 2020-11-27 2021-02-09 新华三大数据技术有限公司 Interface test script generation method and device
CN112445712A (en) * 2020-12-10 2021-03-05 北京信而泰科技股份有限公司 Test source code generation method and device
CN113656322A (en) * 2021-08-26 2021-11-16 阿里巴巴(中国)有限公司 Data processing method and device, electronic equipment and computer storage medium
CN113704099A (en) * 2021-08-20 2021-11-26 北京空间飞行器总体设计部 Test script generation method and equipment for spacecraft power system evaluation
CN113852516A (en) * 2021-08-27 2021-12-28 苏州浪潮智能科技有限公司 Method, system, terminal and storage medium for generating switch diagnostic program
CN114676067A (en) * 2022-05-26 2022-06-28 武汉迎风聚智科技有限公司 Parameterization processing method and device for test script
CN115603797A (en) * 2022-11-08 2023-01-13 武汉卓目科技有限公司(Cn) Satellite ground automatic test platform, test system and test method

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111881042A (en) * 2020-07-27 2020-11-03 云账户技术(天津)有限公司 Automatic test script generation method and device and electronic equipment
CN112052167A (en) * 2020-08-25 2020-12-08 北京梧桐车联科技有限责任公司 Method and device for generating test script code
CN112181803A (en) * 2020-08-27 2021-01-05 五八到家有限公司 Data processing method and device
CN112181803B (en) * 2020-08-27 2024-01-30 五八到家有限公司 Data processing method and device
CN112346991B (en) * 2020-11-27 2022-03-22 新华三大数据技术有限公司 Interface test script generation method and device
CN112346991A (en) * 2020-11-27 2021-02-09 新华三大数据技术有限公司 Interface test script generation method and device
CN112445712A (en) * 2020-12-10 2021-03-05 北京信而泰科技股份有限公司 Test source code generation method and device
CN112445712B (en) * 2020-12-10 2024-02-27 北京信而泰科技股份有限公司 Method and device for generating test source code
CN113704099A (en) * 2021-08-20 2021-11-26 北京空间飞行器总体设计部 Test script generation method and equipment for spacecraft power system evaluation
CN113656322B (en) * 2021-08-26 2023-10-10 阿里巴巴(中国)有限公司 Data processing method, device, electronic equipment and computer storage medium
CN113656322A (en) * 2021-08-26 2021-11-16 阿里巴巴(中国)有限公司 Data processing method and device, electronic equipment and computer storage medium
CN113852516A (en) * 2021-08-27 2021-12-28 苏州浪潮智能科技有限公司 Method, system, terminal and storage medium for generating switch diagnostic program
CN114676067A (en) * 2022-05-26 2022-06-28 武汉迎风聚智科技有限公司 Parameterization processing method and device for test script
CN115603797A (en) * 2022-11-08 2023-01-13 武汉卓目科技有限公司(Cn) Satellite ground automatic test platform, test system and test method
CN115603797B (en) * 2022-11-08 2023-03-14 武汉卓目科技有限公司 Satellite ground automatic test platform, test system and test method

Similar Documents

Publication Publication Date Title
CN111258900A (en) Interface test script generation method, system, equipment and storage medium
CN110647471B (en) Interface test case generation method, electronic device and storage medium
CN103077108B (en) A kind of method and system browser collapse being carried out to early warning
CN112039900B (en) Network security risk detection method, system, computer device and storage medium
CN111309593A (en) JSON interface verification method, device and equipment and computer readable storage medium
CN111694749A (en) Automatic interface testing method and device, computer equipment and readable storage medium
CN111858376A (en) Request message generation method and interface test method
CN112380145A (en) SDK generation method, device, equipment and readable storage medium
CN111723019A (en) Interface debugging method and system
CN113127108A (en) Service request processing method and device, storage medium and electronic equipment
CN112615759A (en) Full link voltage measurement assembly, full link voltage measurement method and device
CN107357588B (en) Object code generation method and device
CN115357434A (en) Complete machine testing method, device to be tested, computer device and storage medium
CN111221711A (en) User behavior data processing method, server and storage medium
CN111078529B (en) Client writing module testing method and device and electronic equipment
CN112181836A (en) Test case generation method, system, device and storage medium
CN112561690A (en) Method, system, equipment and storage medium for testing credit card staging service interface
CN112181822A (en) Test method and test method for starting time consumption of application program
CN114429408B (en) Method, device, equipment and system for checking configuration file of intelligent substation
CN113467782B (en) Method, device and equipment for determining business process
CN112990937A (en) Resource data acquisition method and device, computer equipment and storage medium
CN111324654A (en) Interface calling method, system, computer device and computer readable storage medium
CN111562907A (en) Conversion method and system of user-defined interface data
CN113141366B (en) Message submitting method and device, storage medium and electronic equipment
CN110008073B (en) Hardware platform differential shielding method, device, equipment and readable storage medium

Legal Events

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