CN114218072A - Test script generation method and device, storage medium and computer equipment - Google Patents

Test script generation method and device, storage medium and computer equipment Download PDF

Info

Publication number
CN114218072A
CN114218072A CN202111397479.3A CN202111397479A CN114218072A CN 114218072 A CN114218072 A CN 114218072A CN 202111397479 A CN202111397479 A CN 202111397479A CN 114218072 A CN114218072 A CN 114218072A
Authority
CN
China
Prior art keywords
test
software
function
tested
test script
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
CN202111397479.3A
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.)
Chengdu Luyi Technology Co ltd
Original Assignee
Chengdu Luyi Technology 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 Chengdu Luyi Technology Co ltd filed Critical Chengdu Luyi Technology Co ltd
Priority to CN202111397479.3A priority Critical patent/CN114218072A/en
Publication of CN114218072A publication Critical patent/CN114218072A/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

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 invention discloses a test script generation method, a test script generation device, a storage medium and computer equipment, relates to the technical field of information, and mainly aims to improve the generation efficiency and the generation precision of a test script. The method comprises the following steps: receiving a test script generation instruction corresponding to software to be tested, wherein the test script generation instruction comprises identification information corresponding to the software to be tested; determining the software type of the software to be tested based on the identification information, and determining a test script template corresponding to the software type; based on the test script template, acquiring a test function corresponding to the software to be tested, and displaying function information corresponding to the test function; acquiring test parameters corresponding to the software to be tested according to the function information; and generating a test script corresponding to the software to be tested based on the test function and the test parameters. The invention is suitable for generating the test script.

Description

Test script generation method and device, storage medium and computer equipment
Technical Field
The present invention relates to the field of information technologies, and in particular, to a test script generation method, an apparatus, a storage medium, and a computer device.
Background
After a developer develops a product, the product needs to be tested, and a test script needs to be generated when the product is tested.
Currently, in the process of generating a test script, a tester needs to be familiar with the called function in advance. However, in this way of generating the test script, a worker needs to refer to the relevant information of the function in advance, the process of referring to the function takes a long time, which results in low efficiency of generating the test script, and meanwhile, due to the uneven technical level of the developer, a wrong reference of the information of the function occurs, which results in a wrong generation of the test script, thereby reducing the accuracy of generating the script.
Disclosure of Invention
The invention provides a test script generation method, a test script generation device, a storage medium and computer equipment, and mainly aims to improve the generation efficiency and the generation precision of a test script.
According to a first aspect of the present invention, there is provided a test script generation method, including:
receiving a test script generation instruction corresponding to software to be tested, wherein the test script generation instruction comprises identification information corresponding to the software to be tested;
determining the software type of the software to be tested based on the identification information, and determining a test script template corresponding to the software type;
based on the test script template, acquiring a test function corresponding to the software to be tested, and displaying function information corresponding to the test function;
acquiring test parameters corresponding to the software to be tested according to the function information;
and generating a test script corresponding to the software to be tested based on the test function and the test parameters.
According to a second aspect of the present invention, there is provided a test script generating apparatus comprising:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a test script generation instruction corresponding to software to be tested, and the test script generation instruction comprises identification information corresponding to the software to be tested;
the determining unit is used for determining the software type of the software to be tested based on the identification information and determining a test script template corresponding to the software type;
the first obtaining unit is used for obtaining a test function corresponding to the software to be tested based on the test script template and displaying function information corresponding to the test function;
the second obtaining unit is used for obtaining the test parameters corresponding to the software to be tested according to the function information;
and the generating unit is used for generating a test script corresponding to the software to be tested based on the test function and the test parameters.
According to a third aspect of the present invention, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
receiving a test script generation instruction corresponding to software to be tested, wherein the test script generation instruction comprises identification information corresponding to the software to be tested;
determining the software type of the software to be tested based on the identification information, and determining a test script template corresponding to the software type;
based on the test script template, acquiring a test function corresponding to the software to be tested, and displaying function information corresponding to the test function;
acquiring test parameters corresponding to the software to be tested according to the function information;
and generating a test script corresponding to the software to be tested based on the test function and the test parameters.
According to a fourth aspect of the present invention, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the program:
receiving a test script generation instruction corresponding to software to be tested, wherein the test script generation instruction comprises identification information corresponding to the software to be tested;
determining the software type of the software to be tested based on the identification information, and determining a test script template corresponding to the software type;
based on the test script template, acquiring a test function corresponding to the software to be tested, and displaying function information corresponding to the test function;
acquiring test parameters corresponding to the software to be tested according to the function information;
and generating a test script corresponding to the software to be tested based on the test function and the test parameters.
According to the test script generation method, the test script generation device, the storage medium and the computer equipment, compared with the mode that a tester needs to be familiar with a called function in advance in the process of generating the test script at present, the test script generation instruction corresponding to the software to be tested is received, and the test script generation instruction comprises identification information corresponding to the software to be tested; determining the software type of the software to be tested based on the identification information, and determining a test script template corresponding to the software type; meanwhile, based on the test script template, obtaining a test function corresponding to the software to be tested, and displaying function information corresponding to the test function; then, according to the function information, obtaining a test parameter corresponding to the software to be tested; finally, a test script corresponding to the software to be tested is generated based on the test function and the test parameters, so that the function information corresponding to the test function is displayed while the test function is acquired, the test parameters corresponding to the software to be tested are acquired according to the function information, and finally the test script corresponding to the software to be tested is generated based on the test function and the test parameters.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow chart of a test script generation method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another test script generation method provided by the embodiment of the invention;
fig. 3 is a schematic structural diagram illustrating a test script generating apparatus according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of another test script generating apparatus according to an embodiment of the present invention;
fig. 5 shows a physical structure diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
At present, the mode of familiarizing the called function in advance and regenerating the test script causes low efficiency of test script generation, and in addition, the condition of script generation error is likely to occur due to the fact that a worker refers to the information of the test function incorrectly, so that the generation precision of the test script is low.
In order to solve the above problem, an embodiment of the present invention provides a test script generating method, as shown in fig. 1, where the method includes:
101. receiving a test script generation instruction corresponding to software to be tested, wherein the test script generation instruction comprises identification information corresponding to the software to be tested.
For the embodiment of the invention, in order to overcome the defects of low efficiency and low precision of test script generation in the prior art, the embodiment of the invention displays the function information corresponding to the test function while acquiring the test function, acquires the test parameters corresponding to the software to be tested according to the function information, and finally generates the test script corresponding to the software to be tested based on the test function and the test parameters, so that time waste caused by the fact that a worker refers to the relevant information of the test function in advance can be avoided, the efficiency of test script generation is improved, meanwhile, the problem that the information of the test function is referred by mistake due to negligence of the worker can be avoided, and the generation precision of the test script is improved. The embodiment of the invention is mainly applied to a scene of generating the test script, and the execution main body of the embodiment of the invention is a device or equipment capable of generating the test script, and can be specifically arranged at one side of a client or a server.
Specifically, a script generation system is downloaded and installed in a company official website, the script generation system is opened by double-click, a main interface of the script generation system is displayed, a software type option in the main interface of the script generation system is clicked, a pull-down menu corresponding to different software types appears, a software type to which software to be tested belongs is selected from the pull-down menu, an exclusive automatic script interface corresponding to the software type is displayed, a new script identifier is clicked in the exclusive automatic script interface, a test script generation instruction is generated based on the new script identifier, the script generation system receives the test script generation instruction corresponding to the software to be tested, wherein the test script generation instruction comprises identification information corresponding to the software to be tested, and the identification information can be icon information of the software to be tested, as long as the software to be tested can be uniquely determined through the identification information, the embodiment of the invention does not specifically limit the identification information, then determines the software type to which the software to be tested belongs based on the identification information, determines the test script template corresponding to the software type, meanwhile, obtains the test function based on the test script template, determines the test parameters corresponding to the software to be tested according to the function information corresponding to the test function, and finally generates the test script corresponding to the software to be tested based on the test function and the test parameters, so that time waste caused by the fact that a worker refers to relevant information of the test function in advance can be avoided, and the efficiency of generating the test script is improved.
102. And determining the software type of the software to be tested based on the identification information, and determining a test script template corresponding to the software type.
For the embodiment of the invention, after receiving the test script generation instruction corresponding to the software to be tested and determining the identification information carried in the generation instruction, based on the identification information, the type of the software to be tested is checked, because different types of software correspond to different test script templates, based on the software type to which the software to be tested belongs, the test script template corresponding to the software type is determined, i.e. the test script template corresponding to the software to be tested is determined, for example, according to the icon identification corresponding to the WeChat, the WeChat can be determined to belong to the social software, according to the test script template corresponding to the social software, the test script template corresponding to the WeChat can be determined, and based on the test script template, the test function corresponding to the software to be tested is obtained, and the function information displayed by the test function is obtained, and determining test parameters corresponding to the software to be tested, and finally generating a test script corresponding to the software to be tested based on the test function and the test parameters, so that the error of consulting the information of the test function due to negligence of workers can be avoided, and the generation precision of the test script is improved.
103. And acquiring a test function corresponding to the software to be tested based on the test script template, and displaying function information corresponding to the test function.
The function information includes a name of the test function, for example, if the test function is startActivity (), the function information corresponding to the test function is to run a certain APP.
For the embodiment of the invention, after the test script template corresponding to the software to be tested is determined, the test script template interface is generated, the position corresponding to the title item of the test function in the test script template interface is clicked, a pull-down menu corresponding to the test function is displayed, a plurality of test functions corresponding to the software type are recorded in the pull-down menu, the test function corresponding to the software to be tested is selected from the plurality of test functions, after the test function is selected, the function information corresponding to the test function, namely the explanation information of the test function name and the like, is automatically displayed in the test script template interface, the test parameters corresponding to the software to be tested are filled in the test script template based on the function information, and finally, the test script corresponding to the software to be tested is generated based on the test function and the test parameters, therefore, by displaying the function information corresponding to the test function, the time waste caused by the fact that a user is familiar with the test function in advance can be avoided, and the efficiency of generating the test script is improved.
104. And acquiring test parameters corresponding to the software to be tested according to the function information.
If the test function is startActivity (), and the corresponding function information is to run a certain APP, the test parameters corresponding to the software to be tested are APPs such as WeChat, QQ, and a certain player, and if the test function is wait (), the test parameters corresponding to the software to be tested are 10s, 50s, and the like.
For the embodiment of the present invention, in order to generate the test script corresponding to the software to be tested, after obtaining the test function and displaying the function information corresponding to the test function, it is further required to obtain the test parameters corresponding to the software to be tested based on the function information, for example, a test function sleep () that needs to wait forcibly is required in the process of testing the software to be tested, where the test function that needs to wait forcibly is a function that needs to wait regardless of whether the resource of a page is loaded completely, after obtaining the sleep () function, it is shown that the function information corresponding to the sleep () function is wait forcibly, and according to the function information, the time that needs to wait forcibly, i.e., the test parameters, needs to be determined, and the time that needs to wait forcibly is filled into the corresponding position of the test script template, so as to obtain the test function and the test parameters corresponding to the software to be tested, and generating a test script corresponding to the software to be tested based on the test function and the test parameters.
105. And generating a test script corresponding to the software to be tested based on the test function and the test parameters.
For the embodiment of the invention, after the test function is acquired based on the test script template, the script generating system automatically displays the function information corresponding to the test function around the test function, the user fills the test parameters corresponding to the software to be tested in the positions corresponding to the test parameter options based on the function information, completes the filling of the test function and the test parameters, clicks the generation identification in the test script template, and then generates the test script corresponding to the software to be tested, so that the time waste caused by the fact that the worker refers to the relevant information of the test function in advance can be avoided by acquiring the test function, simultaneously displaying the function information corresponding to the test function, acquiring the test parameters corresponding to the software to be tested according to the function information, and finally generating the test script corresponding to the software to be tested based on the test function and the test parameters, the efficiency of test script generation is improved, simultaneously, also can avoid leading to the information of test function to look up the mistake because of staff's carelessness, improved the generating accuracy of test script.
Compared with the mode that a tester needs to be familiar with the called function in advance in the process of generating the test script at present, the test script generation method provided by the invention generates an instruction by receiving the test script corresponding to the software to be tested, wherein the test script generation instruction comprises identification information corresponding to the software to be tested; determining the software type of the software to be tested based on the identification information, and determining a test script template corresponding to the software type; meanwhile, based on the test script template, obtaining a test function corresponding to the software to be tested, and displaying function information corresponding to the test function; then, according to the function information, obtaining a test parameter corresponding to the software to be tested; finally, a test script corresponding to the software to be tested is generated based on the test function and the test parameters, so that the function information corresponding to the test function is displayed while the test function is acquired, the test parameters corresponding to the software to be tested are acquired according to the function information, and finally the test script corresponding to the software to be tested is generated based on the test function and the test parameters.
Further, in order to better explain the above-mentioned process for generating a script, as a refinement and extension to the above-mentioned embodiment, an embodiment of the present invention provides another test script generation method, as shown in fig. 2, where the method includes:
201. receiving a test script generation instruction corresponding to software to be tested, wherein the test script generation instruction comprises identification information corresponding to the software to be tested.
For the embodiment of the invention, if a test script corresponding to the software to be tested needs to be constructed, the script generating system is firstly opened, selecting the software type of the software to be tested in the script generation system display interface, then clicking a newly-built script identifier to generate a script generation instruction corresponding to the software to be tested, then determining the software type of the software to be tested according to the identification information corresponding to the software to be tested carried in the script generation instruction by the script generation system, and determining a test script template corresponding to the software type, filling a test function in the test script template by a user, and according to the displayed function information corresponding to the test function, filling test parameters in the test script template, and finally generating a test script corresponding to the software to be tested based on the test function and the test parameters.
202. And determining the software type of the software to be tested based on the identification information, and determining a test script template corresponding to the software type.
For the embodiment of the invention, in order to save the time for a user to select the test function, different types of software need to correspond to different test script templates, and meanwhile, different types of test function libraries need to correspond to different test script templates, and the method comprises the following steps of: packaging each group of test logic codes corresponding to different types of software to obtain each group of test functions corresponding to the different types of software; storing each group of test functions into a test function library corresponding to the different types of software; and constructing test script templates corresponding to the different types of software, and establishing mapping relations between the different test script templates and the different test function libraries.
Specifically, before determining the test script corresponding to the software type, it is necessary to package each set of test logic codes corresponding to different types of software, and specifically, different languages may be used to package each set of test logic codes, which language is convenient to use, i.e., which language may be selected for packaging, in an embodiment of the present invention, the packaging language is not specifically limited, for example, JAVA, C + +, Python, or other languages may be used to package each set of test logic codes corresponding to different types of software, so as to obtain each set of test functions corresponding to different types of software, and then store each set of test functions into a test function library corresponding to different types of test software, respectively, where the test function library includes a general test function and a specific test function corresponding to the software type, and a test script template corresponding to different types of software needs to be constructed in advance, the test script templates corresponding to different types of software all comprise a test description title item, a test operation step title item, a test function information title item and a test parameter information title item, and then in order to enable different test script templates to correspond to different test function libraries, a mapping relation between different test script templates and different test function libraries needs to be established, so that test functions corresponding to the types of software can be mapped in the test script templates corresponding to the different types of software, a worker can be prevented from selecting the test functions corresponding to the software to be tested from all the test functions corresponding to the different types of software, the workload of the worker is reduced, and meanwhile, the efficiency of test script generation is improved.
Further, after the test function library and the test script template corresponding to different types of software are constructed and the mapping relation between different test script templates and different test function libraries is established, the test script template corresponding to the software type is determined based on the software type to which the software to be tested belongs, at this time, the test function library corresponding to the software type is also determined, and the test function corresponding to the software to be tested is selected from the test function library.
203. And determining a test function library corresponding to the test script template based on the mapping relation between different test script templates and different test function libraries.
For the embodiment of the invention, after the software type of the software to be tested is determined, the test script template corresponding to the software type needs to be determined, the test function library corresponding to the software type is determined based on the mapping relation between different test script templates and different test function libraries, and the test function corresponding to the software to be tested is selected from the test function library.
204. And acquiring a test function selected by a user from the test function library for the software to be tested, and displaying function information corresponding to the test function.
For the embodiment of the present invention, in order to obtain the test function corresponding to the software to be tested, the step 204 specifically includes: determining test title information and test operation step information corresponding to the software to be tested in the test script template; and acquiring the test function selected by the user from the test function library based on the test header information and the test step information.
Specifically, the test script template comprises a test description title item, a test operation step title item, a test function information title item and a test parameter information title item, firstly, test title information corresponding to the software to be tested is filled in a position corresponding to the test description title item, the test title information has normal main interface function, meanwhile, test operation step information corresponding to the software to be tested is filled in a position corresponding to the test operation step title item, the test operation step information waits for 10s for example, and based on the test title information and the test operation step information, a pull-down menu identifier corresponding to the test function title item is clicked, a test function library corresponding to the type of the software to be tested is exhibited, a test function corresponding to the software to be tested is selected in the test function library, and after the test function is selected, function information corresponding to the test function is displayed in a test script template interface, and based on the function information, the method comprises the following steps: acquiring the position information of the test function in the test script template; and displaying function information corresponding to the test function in the test script template based on the position information.
After a test function is selected at a position corresponding to a title item of the test function in the test script template, determining position information of the test function in the test script template, and displaying function information corresponding to the test function at a position above or below the test function based on the position information, wherein the position of the function information can enable a worker to clearly know that the function information is the function information corresponding to the test function.
205. And acquiring test parameters corresponding to the software to be tested according to the function information.
For the embodiment of the present invention, after the function information is displayed in the test script template, based on the function information, the test parameter corresponding to the software to be tested is filled in the position corresponding to the title item of the test parameter, if the function information is how long to wait, the test parameter is time, if the function information is to start a certain APP, the test parameter is a certain specific APP, and finally, based on the test function and the test parameter, the test script corresponding to the software to be tested is generated.
206. And generating a test script corresponding to the software to be tested based on the test function and the test parameters.
For the embodiment of the invention, after the test title information, the test operation step title item, the test function information title item and the test parameter information title item in the test script template are respectively filled in corresponding positions of the test description title item, the test operation step title item, the test function information and the test parameter information title item, the test script corresponding to the software to be tested can be generated by clicking the script generation mark in the test script template, at this time, the test script is displayed at a preset position in the test script template, if the test column for testing the software to be tested only contains one test script, the completion button is clicked in the test script template again, the test script corresponding to the software to be tested is finally generated, if the test column for testing the software to be tested contains a plurality of test scripts, that is, multiple test scripts are required to execute simultaneously or execute test operations sequentially, based on which step 206 specifically includes: generating a first test script corresponding to the software to be tested based on the first test function and the first test parameter; generating a second test script corresponding to the software to be tested based on the second test function and the second test parameter; and generating a test script corresponding to the software to be tested based on the first test script and the second test script.
Specifically, firstly, respectively filling test title information, first operation step information and a first test function in corresponding positions of a test description title item, a test operation step title item, a test function information title item and a test parameter information title item in the test script template, displaying first function information corresponding to the first test function, filling first test parameters in corresponding positions based on the first function information, clicking a generation script identifier in the test script template after filling corresponding information, generating a first test script corresponding to the to-be-tested software, displaying the first test script in a preset position in the test script template, wherein no information exists in corresponding positions of the test operation step title item, the test function information title item and the test parameter information title item in the test script template, and then, displaying the first test script corresponding to the to-be-tested software in the test script template at the preset position, wherein no information exists in corresponding positions of the test operation step title item, the test function information title item and the test parameter information title item in the test operation step title item, Respectively filling second operation step information and a second test function in positions corresponding to a test function information title item and a test parameter information title item, displaying second function information corresponding to the second test function, filling second test parameters in corresponding positions based on the second function information, clicking a generation script mark in the test script template after the corresponding information is filled, generating a second test script corresponding to the to-be-tested software, displaying the second test script below a first test script in the preset position in the test script template, generating a plurality of test scripts corresponding to the to-be-tested software according to the method, sequentially displaying the plurality of test scripts in the preset positions, clicking a completion button in the test script template after the plurality of test scripts are generated, and then based on the plurality of test scripts, and generating a test script corresponding to the software to be tested.
Further, after generating the test script corresponding to the software to be tested, if the software to be tested needs to be tested, the test script needs to be executed, based on which the method includes: responding to a test script execution instruction corresponding to the client software, and generating and displaying prompt information for detecting whether the device where the client software is located is successfully connected; and if receiving confirmation information of successful connection of the device fed back by the user, executing a test script corresponding to the client software.
Specifically, the software to be tested is client software, a generated test script is stored in a script generation system main interface corresponding to the software type of the software to be tested, the software type to which the software to be tested belongs is selected in the script generation system main interface, at this time, the test script corresponding to the software type is displayed in the main interface, the test script corresponding to the software to be tested is searched and selected in the test script, then, an execution identifier in the script generation system main interface is clicked, a test script execution instruction is generated, meanwhile, prompt information for detecting whether the connection of the position of the client software is successful is generated and displayed, and a user connects the position of the client software with a computer where the test script is located based on the prompt information, for example, the client software is mobile phone client software, connecting the mobile phone with a computer where the test script is located, checking a connection state by using an adb devices command, clicking a confirmation button by a user after the connection is confirmed to be successful, generating confirmation information of successful connection, and executing the test script corresponding to the client software by the test script generation system if the confirmation information of successful connection of the device fed back by the user is received.
According to another test script generation method provided by the invention, compared with the mode that a tester needs to be familiar with a called function in advance in the process of generating the test script at present, the method generates a command by receiving the test script corresponding to the software to be tested, wherein the test script generation command comprises identification information corresponding to the software to be tested; determining the software type of the software to be tested based on the identification information, and determining a test script template corresponding to the software type; meanwhile, based on the test script template, obtaining a test function corresponding to the software to be tested, and displaying function information corresponding to the test function; then, according to the function information, obtaining a test parameter corresponding to the software to be tested; finally, a test script corresponding to the software to be tested is generated based on the test function and the test parameters, so that the function information corresponding to the test function is displayed while the test function is acquired, the test parameters corresponding to the software to be tested are acquired according to the function information, and finally the test script corresponding to the software to be tested is generated based on the test function and the test parameters.
Further, as a specific implementation of fig. 1, an embodiment of the present invention provides a test script generating apparatus, as shown in fig. 3, where the apparatus includes: a receiving unit 31, a determining unit 32, a first acquiring unit 33, a second acquiring unit 34, and a generating unit 35.
The receiving unit 31 may be configured to receive a test script generation instruction corresponding to software to be tested, where the test script generation instruction includes identification information corresponding to the software to be tested.
The determining unit 32 may be configured to determine, based on the identification information, a software type to which the software to be tested belongs, and determine a test script template corresponding to the software type.
The first obtaining unit 33 may be configured to obtain a test function corresponding to the software to be tested based on the test script template, and display function information corresponding to the test function.
The second obtaining unit 34 may be configured to obtain a test parameter corresponding to the software to be tested according to the function information.
The generating unit 35 may be configured to generate a test script corresponding to the software to be tested based on the test function and the test parameter.
In a specific application scenario, in order to obtain a test function corresponding to the software to be tested, as shown in fig. 4, the first obtaining unit 33 includes a determining module 331 and an obtaining module 332.
The determining module 331 may be configured to determine a test function library corresponding to the test script template based on a mapping relationship between different test script templates and different test function libraries.
The obtaining module 332 may be configured to obtain a test function selected by a user from the test function library for the software to be tested.
In a specific application scenario, in order to obtain a test function selected by a user from the test function library for the software to be tested, the obtaining module 332 includes a determining sub-module and a obtaining sub-module.
The determining submodule may be configured to determine test header information and test operation step information corresponding to the software to be tested in the test script template.
The obtaining sub-module may be configured to obtain a test function selected by a user from the test function library based on the test header information and the test step information.
In a specific application scenario, in order to display function information corresponding to the test function, the first obtaining unit 33 further includes a displaying module 333.
The obtaining module 332 may be further configured to obtain location information of the test function in the test script template.
The presentation module 333 may be configured to present, in the test script template, function information corresponding to the test function based on the location information.
In a specific application scenario, in order to establish a mapping relationship between a test script template and a function library, the apparatus further includes: an encapsulation unit 36, a storage unit 37 and a setup unit 38.
The packaging unit 36 may be configured to package each set of test logic codes corresponding to different types of test software, so as to obtain each set of test functions corresponding to the different types of software.
The storage unit 37 may be configured to store the sets of test functions into a test function library corresponding to the different types of test software.
The establishing unit 38 may be configured to establish test script templates corresponding to the different types of test software, and establish mapping relationships between the different test script templates and the different test function libraries.
In a specific application scenario, in order to generate a test script corresponding to the software to be tested, the generating unit 35 may be specifically configured to generate a first test script corresponding to the software to be tested based on the first test function and the first test parameter; generating a second test script corresponding to the software to be tested based on the second test function and the second test parameter; and generating a test script corresponding to the software to be tested based on the first test script and the second test script.
In a specific application scenario, in order to execute the test script corresponding to the client software, the apparatus further includes: an execution unit 39.
The generating unit 35 may be specifically configured to generate and display a prompt message for detecting whether the connection of the device where the client software is located is successful in response to the test script execution instruction corresponding to the client software.
The executing unit 39 may be configured to execute the test script corresponding to the client software if receiving the confirmation information that the device connection is successful, which is fed back by the user.
It should be noted that other corresponding descriptions of the functional modules related to the test script generating apparatus provided in the embodiment of the present invention may refer to the corresponding description of the method shown in fig. 1, and are not described herein again.
Based on the method shown in fig. 1, correspondingly, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the following steps: receiving a test script generation instruction corresponding to software to be tested, wherein the test script generation instruction comprises identification information corresponding to the software to be tested; determining the software type of the software to be tested based on the identification information, and determining a test script template corresponding to the software type; based on the test script template, acquiring a test function corresponding to the software to be tested, and displaying function information corresponding to the test function; acquiring test parameters corresponding to the software to be tested according to the function information; and generating a test script corresponding to the software to be tested based on the test function and the test parameters.
Based on the above embodiments of the method shown in fig. 1 and the apparatus shown in fig. 3, an embodiment of the present invention further provides an entity structure diagram of a computer device, as shown in fig. 5, where the computer device includes: a processor 41, a memory 42, and a computer program stored on the memory 42 and executable on the processor, wherein the memory 42 and the processor 41 are both arranged on a bus 43 such that when the processor 41 executes the program, the following steps are performed: receiving a test script generation instruction corresponding to software to be tested, wherein the test script generation instruction comprises identification information corresponding to the software to be tested; determining the software type of the software to be tested based on the identification information, and determining a test script template corresponding to the software type; based on the test script template, acquiring a test function corresponding to the software to be tested, and displaying function information corresponding to the test function; acquiring test parameters corresponding to the software to be tested according to the function information; and generating a test script corresponding to the software to be tested based on the test function and the test parameters.
According to the technical scheme, the test script generating instruction corresponding to the software to be tested is received, and the test script generating instruction comprises the identification information corresponding to the software to be tested; determining the software type of the software to be tested based on the identification information, and determining a test script template corresponding to the software type; meanwhile, based on the test script template, obtaining a test function corresponding to the software to be tested, and displaying function information corresponding to the test function; then, according to the function information, obtaining a test parameter corresponding to the software to be tested; finally, a test script corresponding to the software to be tested is generated based on the test function and the test parameters, so that the function information corresponding to the test function is displayed while the test function is acquired, the test parameters corresponding to the software to be tested are acquired according to the function information, and finally the test script corresponding to the software to be tested is generated based on the test function and the test parameters.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A test script generation method, comprising:
receiving a test script generation instruction corresponding to software to be tested, wherein the test script generation instruction comprises identification information corresponding to the software to be tested;
determining the software type of the software to be tested based on the identification information, and determining a test script template corresponding to the software type;
based on the test script template, acquiring a test function corresponding to the software to be tested, and displaying function information corresponding to the test function;
acquiring test parameters corresponding to the software to be tested according to the function information;
and generating a test script corresponding to the software to be tested based on the test function and the test parameters.
2. The method of claim 1, wherein obtaining the test function corresponding to the software to be tested based on the test script template comprises:
determining a test function library corresponding to the test script template based on the mapping relation between different test script templates and different test function libraries;
and acquiring a test function selected by a user for the software to be tested from the test function library.
3. The method of claim 2, wherein the obtaining the test function selected by the user for the software to be tested from the test function library comprises:
determining test title information and test operation step information corresponding to the software to be tested in the test script template;
and acquiring the test function selected by the user from the test function library based on the test header information and the test step information.
4. The method according to claim 1, wherein the presenting function information corresponding to the test function comprises:
acquiring the position information of the test function in the test script template;
and displaying function information corresponding to the test function in the test script template based on the position information.
5. The method of claim 1, wherein prior to said determining a test script template corresponding to the software type, the method further comprises:
packaging each group of test logic codes corresponding to different types of software to obtain each group of test functions corresponding to the different types of software;
storing the test functions into test function libraries corresponding to the different types of software;
and constructing test script templates corresponding to the different types of software, and establishing mapping relations between the different test script templates and the different test function libraries.
6. The method of claim 1, wherein generating a test script corresponding to the software to be tested based on the test function and the test parameters comprises:
generating a first test script corresponding to the software to be tested based on the first test function and the first test parameter;
generating a second test script corresponding to the software to be tested based on the second test function and the second test parameter;
and generating a test script corresponding to the software to be tested based on the first test script and the second test script.
7. The method of claim 6, wherein the software to be tested is client software, and after the generating of the test script corresponding to the software to be tested based on the first test script and the second test script, the method further comprises:
responding to a test script execution instruction corresponding to the client software, and generating and displaying prompt information for detecting whether the device where the client software is located is successfully connected;
and if receiving confirmation information of successful connection of the device fed back by the user, executing a test script corresponding to the client software.
8. A test script generating apparatus, comprising:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a test script generation instruction corresponding to software to be tested, and the test script generation instruction comprises identification information corresponding to the software to be tested;
the determining unit is used for determining the software type of the software to be tested based on the identification information and determining a test script template corresponding to the software type;
the first obtaining unit is used for obtaining a test function corresponding to the software to be tested based on the test script template and displaying function information corresponding to the test function;
the second obtaining unit is used for obtaining the test parameters corresponding to the software to be tested according to the function information;
and the generating unit is used for generating a test script corresponding to the software to be tested based on the test function and the test parameters.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
10. A computer arrangement comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the computer program realizes the steps of the method of any one of claims 1 to 7 when executed by the processor.
CN202111397479.3A 2021-11-23 2021-11-23 Test script generation method and device, storage medium and computer equipment Pending CN114218072A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111397479.3A CN114218072A (en) 2021-11-23 2021-11-23 Test script generation method and device, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111397479.3A CN114218072A (en) 2021-11-23 2021-11-23 Test script generation method and device, storage medium and computer equipment

Publications (1)

Publication Number Publication Date
CN114218072A true CN114218072A (en) 2022-03-22

Family

ID=80697986

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111397479.3A Pending CN114218072A (en) 2021-11-23 2021-11-23 Test script generation method and device, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN114218072A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116860630A (en) * 2023-07-05 2023-10-10 珠海视熙科技有限公司 Equipment testing method and device, storage medium and computer equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116860630A (en) * 2023-07-05 2023-10-10 珠海视熙科技有限公司 Equipment testing method and device, storage medium and computer equipment

Similar Documents

Publication Publication Date Title
CN109302522B (en) Test method, test device, computer system, and computer medium
CN108108297B (en) Method and device for automatic testing
CN108984388B (en) Method and terminal equipment for generating automatic test case
CN107659455B (en) Method, storage medium, device and system for Mock data of iOS (internet operating system) end
CN106776319B (en) Automatic test method and device
CN110096424B (en) Test processing method and device, electronic equipment and storage medium
CN105302722B (en) CTS automatic testing method and device
WO2019214109A1 (en) Monitoring device and method for testing process, and computer readable storage medium
CN111078567B (en) Report generation method, terminal and storage medium of automatic test platform
CN113467868B (en) Method and device for creating equipment resources
CN112100078A (en) Method, device and equipment for generating interface test case
CN113384896A (en) Unity-based resource packaging method, device, equipment and medium
CN114218072A (en) Test script generation method and device, storage medium and computer equipment
CN110543429A (en) Test case debugging method and device and storage medium
CN114168471A (en) Test method, test device, electronic equipment and storage medium
CN109240928A (en) A kind of test method, device, equipment and storage medium
CN106302011B (en) Multi-terminal-based test method and terminal
CN109474822B (en) Android television multi-language automatic testing method and device
CN115756934A (en) Application crash analysis method and device
US11994973B2 (en) Integrated development environment terminal, platform server, and medium
CN115016968A (en) Exception handling method, device, equipment and medium
CN115269285A (en) Test method and device, equipment and computer readable storage medium
CN107623602B (en) Automatic checking method and system
CN112069078A (en) ESA interface pressure testing method, device, testing equipment and storage medium
CN111881021A (en) Interface test method, device and system

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