CN111881042A - Automatic test script generation method and device and electronic equipment - Google Patents
Automatic test script generation method and device and electronic equipment Download PDFInfo
- Publication number
- CN111881042A CN111881042A CN202010730964.7A CN202010730964A CN111881042A CN 111881042 A CN111881042 A CN 111881042A CN 202010730964 A CN202010730964 A CN 202010730964A CN 111881042 A CN111881042 A CN 111881042A
- Authority
- CN
- China
- Prior art keywords
- keywords
- keyword
- scene
- configuring
- interface
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 147
- 238000013515 script Methods 0.000 title claims abstract description 79
- 238000000034 method Methods 0.000 title claims abstract description 48
- 238000013507 mapping Methods 0.000 claims abstract description 10
- 238000012545 processing Methods 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 9
- 238000013522 software testing Methods 0.000 abstract description 3
- 238000010586 diagram Methods 0.000 description 11
- 230000006870 function Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 238000012217 deletion Methods 0.000 description 2
- 230000037430 deletion Effects 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- YTPUIQCGRWDPTM-UHFFFAOYSA-N 2-acetyloxybenzoic acid;5-(2-methylpropyl)-5-prop-2-enyl-1,3-diazinane-2,4,6-trione;1,3,7-trimethylpurine-2,6-dione Chemical compound CC(=O)OC1=CC=CC=C1C(O)=O.CN1C(=O)N(C)C(=O)C2=C1N=CN2C.CC(C)CC1(CC=C)C(=O)NC(=O)NC1=O YTPUIQCGRWDPTM-UHFFFAOYSA-N 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
- G06F16/2433—Query languages
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F16/2468—Fuzzy queries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/20—Software design
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/36—Software reuse
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Data Mining & Analysis (AREA)
- Computational Linguistics (AREA)
- Databases & Information Systems (AREA)
- Fuzzy Systems (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Automation & Control Theory (AREA)
- Probability & Statistics with Applications (AREA)
- Debugging And Monitoring (AREA)
- Stored Programmes (AREA)
Abstract
The application provides a method and a device for generating an automatic test script and electronic equipment, and belongs to the technical field of software testing. The method for generating the automatic test script comprises the steps of firstly configuring step keywords, wherein the step keywords have a mapping relation with test script codes in a test database; and then, combining and configuring scene keywords through the keywords in the step, then combining and configuring a test task template according to the scene keywords, and finally generating an automatic test script according to the test task template.
Description
Technical Field
The application relates to the field of software testing, in particular to a method and a device for generating an automatic test script and electronic equipment.
Background
In the field of software testing, an automated test script can be generated by the following methods: using the existing open source test framework, a tester manually writes a test script according to the service requirement; using natural language to carry out automatic test, defining corresponding natural language for the component type and the operation type of the system to be tested, and compiling scripts according to the agreed grammar specification; and defining the interface request as a keyword, and generating a test script through the permutation and combination of the keyword.
The prior art has a plurality of problems, for example, the requirement on the code compiling capability of testers is very high by manually compiling test scripts, and particularly, the later maintenance cost is high in the face of a service scene with a complex flow; the automatic testing is carried out by adopting the natural language, the grammar requirement of the natural language is extremely high, and when new component types and operation types appear, development is required to be put into again and new service scenes are required to be met by redeployment; the method adopts a keyword combination mode to generate the automatic test script, generally only can meet basic functions such as interface requests and database operation, and can be used after redevelopment and deployment are needed in the face of relatively complex and personalized requirements, and especially when the service flow is very complex and the number of test cases reaches a certain level, the test script generated by combining the keywords still greatly influences the test operation efficiency.
Disclosure of Invention
The application provides a method and a device for generating an automatic test script and electronic equipment, so that the problems of low generation efficiency and high later-stage management and maintenance cost of the automatic test script are solved, and the flexibility and the efficiency of generating the test script are improved.
In order to achieve the purpose, the following scheme is adopted in the application:
in one aspect, an embodiment of the present application provides a method for generating an automated test script, including:
configuring step keywords, wherein the step keywords have a mapping relation with test script codes in a test database;
configuring scene keywords according to the step keywords, wherein the scene keywords comprise a plurality of step keywords arranged according to a specified sequence;
configuring a test task template according to the scene keywords, wherein the test task template comprises combining the scene keywords according to a specified sequence;
and generating an automatic test script according to the test task template.
Optionally, the step keyword includes: interface keywords, SQL keywords, and/or custom keywords.
Optionally, configuring the interface key includes:
editing at least one of the following parameters of the target interface keyword based on a first input performed by a user on an interface keyword configuration page: interface keywords, interface keyword numbers, interface names, interface addresses, request modes and uploading accessories.
Optionally, configuring the SQL key includes:
based on a second input performed by the user on the SQL keyword configuration page, configuring at least one of the following operations for the target SQL keyword:
adding a database table, deleting the database table, modifying the database table and inquiring the database table.
Optionally, configuring the custom keyword includes:
and performing online compilation to generate a target custom keyword associated with a target test step which is not supported currently based on a third input executed by the user on the custom keyword configuration page.
Optionally, the configuring the scene keyword according to the step keyword includes:
creating scene keywords based on fourth input executed by a user on a scene configuration page, wherein the scene keywords comprise sequence information of scenes, running environments, running times and/or step keywords;
optionally, the configuring a test task template according to the scene keyword includes:
and combining the scene keywords according to a specified sequence based on a fifth input executed by the user on the test task template configuration page.
In one aspect, an embodiment of the present application provides an apparatus for generating an automated test script, including:
the first processing module is used for configuring step keywords, and the step keywords have a mapping relation with test script codes in a test database;
the second processing module is used for configuring scene keywords according to the step keywords, wherein the scene keywords comprise a plurality of step keywords which are arranged according to a specified sequence;
the third processing module is used for configuring a test task template according to the scene keywords, wherein the test task template comprises the scene keywords which are combined according to a specified sequence;
and the generating module is used for generating an automatic test script according to the test task template.
In one aspect, an embodiment of the present application provides an electronic device, including:
the system comprises a processor, a memory and a program stored on the memory and capable of running on the processor, wherein the program realizes the steps of the generation method of the automatic test script according to the embodiment of the application when being executed by the processor.
In one aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the method for generating an automated test script according to the present application.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
firstly, configuring step keywords, wherein the step keywords have a mapping relation with test script codes in a test database; and then, combining and configuring scene keywords through the keywords in the step, then combining and configuring a test task template according to the scene keywords, and finally generating an automatic test script according to the test task template.
Drawings
FIG. 1 is a flowchart of a method for generating an automated test script according to an exemplary embodiment of the present application;
FIG. 2 is a schematic diagram of a method for generating an automated test script according to an exemplary embodiment of the present application;
FIG. 3 is a schematic diagram illustrating a method for generating an automated test script according to an exemplary embodiment of the present application;
FIG. 4 is a schematic diagram illustrating a method for generating an automated test script according to an exemplary embodiment of the present application;
FIG. 5 is a schematic diagram illustrating a method for generating an automated test script according to an exemplary embodiment of the present application;
FIG. 6 is a schematic diagram illustrating a method for generating an automated test script according to an embodiment of the present disclosure;
FIG. 7 is a schematic diagram illustrating a method for generating an automated test script according to an embodiment of the present disclosure;
FIG. 8 is a schematic diagram illustrating a method for generating an automated test script according to an embodiment of the present disclosure;
FIG. 9 is a schematic diagram illustrating a method for generating an automated test script according to an embodiment of the present disclosure;
fig. 10 is a schematic structural diagram of an apparatus for generating an automated test script according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of an apparatus for generating an automated test script according to an embodiment of the present disclosure;
fig. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings of the embodiments of the present application. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the described embodiments of the application without making any creative effort, shall fall within the protection scope of the application.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The speech detection method provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
In addition, the technical features mentioned in the different embodiments of the present application described below may be combined with each other as long as they do not conflict with each other.
Referring to fig. 1, a flowchart illustration of a method for generating an automated test script provided in an embodiment of the present application is shown, where the method for generating an automated test script includes:
in step 101, a step, which is the smallest unit that can be split in the script, is defined as step keywords, and each step keyword has a mapping relationship with a target script code in the test database that can execute a target step.
102, configuring scene keywords according to the step keywords, wherein the scene keywords comprise a plurality of step keywords arranged according to a specified sequence;
in step 102, selecting applicable step keywords according to different service scenes, and combining the step keywords according to a certain sequence to generate scene keywords;
illustratively, 5 step keywords a, b, c, d, e are configured in step 101, and correspond to 5 operation steps and script code mappings about the above 5 operation steps in the test data, respectively; in this case, a, B, and C are combined in order to generate a scene keyword a (a-B-C), a, e, and C are combined in order to generate a scene keyword B (a-e-C), and B and f are combined in order to generate a scene keyword C (B-f), as required by the scene.
103, configuring a test task template according to the scene keywords, wherein the test task template comprises combining the scene keywords according to a specified sequence;
in step 103, according to different test requirements, such as according to a preset task template, combining the related scene keywords according to a certain sequence to configure a test task template;
illustratively, the test task template 001 is configured as a combination of associated scene keywords A, B, C in the order of B-A-C according to the task template 001;
104, generating an automatic test script according to the test task template;
in step 104, if the test task template 001 is executed, all step keywords are obtained according to the scene keywords in the test task template, and then the corresponding script codes are obtained according to the step keywords, so as to generate the automatic test script.
According to the method for generating the automatic test script, the script is divided into the minimum unit, namely the step keywords, the step keywords are mapped with the corresponding script codes, the step keywords are combined according to a certain sequence to generate the corresponding scene keywords according to different scene requirements, the test task template is configured according to the task template, the test task template comprises the scene keywords combined according to the appointed sequence, and finally the test script is automatically generated by executing the test task template.
Optionally, in step 101, step keywords are configured, where the step keywords include: interface keywords, SQL keywords and/or custom keywords;
the interface key words refer to calling an API interface to request to complete the processing of the business process, and if a bank card money-making business is taken as an example, the interface key words refer to calling a bank card money-making interface;
the SQL key refers to an operation of adding, deleting, modifying and checking a database, and is generally used for data preparation before testing, parameters called among different interfaces, transferred parameter sources and assertion for a database table, for example, in the case of bank card money deposit, the SQL key refers to a function of querying a state of a money deposit order table and asserting whether the state meets expectations;
the SQL refers to Structured Query Language (SQL) for short, is a programming Language with a special purpose, is a database Query and programming Language, and is used for accessing data and querying, updating, and managing a relational database system, and therefore, SQL keywords are used for operating a database in the technical solution provided by the embodiment of the present application;
the custom keyword refers to operations which are not supported by the system at present, and the operations which are not supported by the system at present are completed by compiling input code segments, such as execution of a shell script, generation of an excel file, waiting for payment in a bank payment service and the like.
Referring to fig. 2, a keyword management list is shown, which has three options of an interface keyword, an SQL keyword and/or a custom keyword, respectively, and displays a keyword management page of a corresponding step, such as the interface keyword management page, the SQL keyword management page or the custom keyword management page, based on a sixth input executed by the user in the keyword management list;
based on a seventh input performed by the user at the corresponding step keyword management page, one of the following operations may be performed:
adding step keywords;
carrying out fuzzy query on the keywords in the step;
copying the keywords of the target step;
deleting the keywords in the target step;
displaying a keyword configuration page of the target step;
and automatically generating a scene according to the keywords of the target step.
Specifically, referring to fig. 3, an interface keyword management page is shown, where the interface management page displays a list of each interface keyword, including information such as a serial number ID of the interface keyword, an interface name, an address type, an interface address, a request mode, a default parameter, an attachment, and an operation;
the fuzzy query can be carried out on the basis of the interface keywords, the interface names and/or the interface addresses input by the user, the user can add the interface keywords by clicking addition, delete the target interface keywords by clicking deletion, or display the configuration page of the target interface keywords by clicking editing;
for example, parameter configuration may also be performed on the sql keyword management page and the custom keyword page on a configuration page where the user performs corresponding input to perform addition, deletion, fuzzy query or display of target step keywords on the sql keyword and/or the custom keyword.
Optionally, in step 101, the key words in the configuration step include a configuration interface key word, which includes:
editing at least one of the following parameters of the target interface keyword based on a first input performed by a user on an interface keyword configuration page: interface keywords, interface keyword numbers, interface names, interface addresses, request modes and uploading accessories.
The step keyword configuration page of the automatic test script generation method provided by the application provides various step keyword management functions, including configuration of interface keywords, configuration of SQL keywords and configuration of custom keywords, and a user can open the corresponding step keyword configuration page by executing different inputs in the page and configure the step keywords by continuously executing corresponding inputs;
illustratively, the interface keyword may be used as a step in the test script, and the interface keyword configuration page is used to maintain the interface configuration of all the systems under test, including but not limited to the unique interface keyword of the whole platform, the interface name, the interface address, the request mode, the default parameter, the uploaded attachment and other information;
referring to fig. 4, an interface keyword configuration page shows an interface configuration page, and the configuration page includes parameters that can be set, such as a number, an interface keyword, an interface name, a domain name, a request mode, a default request parameter, and an upload attachment;
taking a bank card money-making service scene as an example, a user sets an interface keyword as order _ real time by executing a first input, sets other parameters such as a domain name and the like corresponding to a bank card money-making interface request, an interface name of 'real-time money making of a bank card', and a serial number of 6, and executes input, such as clicking a submit key, to complete configuration of a target interface keyword after completing configuration of the target interface keyword;
corresponding interface keywords can be configured according to different interface requests such as payment for treasures, WeChat payment, order inquiry and the like, for example, relevant parameters of the interface keyword query _ real _ order are configured, and the interface requests of the order inquiry are corresponded.
Optionally, in step 101, the configuring step key includes configuring an SQL key, including:
editing at least one of the following parameters of the target SQL keyword based on a second input executed by the user on the SQL keyword configuration page:
adding a database table, deleting the database table, modifying the database table and inquiring the database table.
Illustratively, setting an SQL keyword, which may be a step in a test script, is used to manage operations for maintaining a database, including but not limited to adding, deleting, modifying, and querying a database table;
it is worth noting that in the SQL statement of the SQL keyword, where the where condition is transmitted through the use case parameter, the reusability of the SQL keyword can be improved, and the separation of the test script and the test data is realized;
when the SQL keyword is configured, firstly, a data source broker is set, referring to a data source broker configuration page shown in fig. 5, and used for configuring information such as database name DNNAME, network address URL, user name usemame, PASSWORD, DRIVER and the like, and after a user completes configuration of the data source in the page by executing corresponding input, the user clicks and submits the data source, and the data source can be stored and takes effect in time;
the data source configuration is used for maintaining the authority of the database operation in the SQL keyword, the database can be maintained by configuring the address of the database and the account information, and the configuration is effective in time without restarting;
secondly, as shown in fig. 6, configuring the target SQL keyword through an SQL keyword configuration page, where parameters such as a number, an SQL keyword, an SQL description, a library name, an SQL statement start, and an SQL statement end are displayed in the SQL configuration page shown in fig. 6;
for example, the following configuration may be specifically referred to:
setting SQL keywords as order _ bills, namely, inquiring an order table;
inputting the name of the data source to be configured by the library name, such as the data source broker configured above;
filling in an SQL sentence, if a where condition is required to be filled and the value of the parameter is changed, filling in only where 1 equals 1 without filling in a specific where condition in the SQL keyword configuration, and transmitting the condition through test data;
it is noted that the statements behind the where condition, such as order by, group by, etc., may not be filled in.
Optionally, configuring the custom keyword includes:
performing online compilation to generate a target custom keyword associated with a target test step which is not supported currently based on a third input executed by a user on a custom keyword configuration page;
exemplarily, the custom keyword can be used as a step in a test script, the corresponding script code can be configured in an online code compiling manner, and any complex operation which cannot be supported by the keyword and the corresponding script code in the current step can be realized by defining the custom keyword, such as generation of an excel file, operation on a file, complex operation on a database, operation on a log file, and the like, so that various personalized scenes can be met;
fig. 7 and 8 show a custom keyword management page and a configuration page, respectively, and with reference to the custom keyword management page shown in fig. 7, show the number ID, keywords, meanings, descriptions, examples, and the like of the custom keyword;
and based on a seventh input executed by the user on the custom keyword management page, at least one of the following operations can be executed:
based on the keywords and/or the description, fuzzy query is carried out on the user-defined keywords;
adding a user-defined keyword;
displaying a user-defined keyword configuration interface;
checking codes of the target user-defined keywords;
and deleting the target custom keywords.
Referring to fig. 8, the user can configure the keyword, meaning, and example of the custom keyword by executing corresponding input, open a corresponding configuration interface through the custom keyword configuration interface or the check code in fig. 7, compile the code of the target custom keyword on line, configure the corresponding code segment, and submit and store the configured code segment after configuration is completed, and can operate without restarting the configuration interface.
Optionally, in step 102, configuring the scene keyword according to the step keyword includes:
and creating scene keywords based on fourth input executed by the user on the scene configuration page, wherein the scene keywords comprise sequence information of scenes, running environments, running times and/or step keywords.
Illustratively, a scene configuration page provides an automatic scene management function, realizes the configuration of scene keywords, selects applicable step keywords according to business needs, can be any one or more of interface keywords, SQL keywords and custom keywords, and combines the keywords according to a certain sequence to automatically generate a test script;
referring to FIG. 9, a scene configuration page is shown that, based on a fourth input performed by the user, may perform at least one of the following: configuring parameters such as scene keywords, scene names, environments, cycle times, steps and the like;
combining the step keywords according to a certain sequence, such as manually inputting according to the needs of a service scene, or querying and selecting, and displaying any one or more of the interface keyword query, the SQL keyword query and the user-defined keyword according to a certain sequence in the step parameters of the scene keywords according to the selected sequence.
Optionally, configuring a test task template according to the scene keyword includes:
and combining the scene keywords according to a specified sequence based on a fifth input executed by the user on the test task template configuration page.
After the configuration of the test task template is completed, a user can set test cases according to the test task template, associate different test data with the scene keywords to generate different test cases, and then execute the test task template to generate automatic test scripts aiming at the test cases.
The method for generating the automated test script provided by the embodiment of the present application is further described by taking a bank card, a payment treasure and a wechat payment scenario as an example:
the above scenario involves the following steps of keywords:
interface keyword a 1: a bank card interface request;
interface keyword a 2: a request of a payment bank money interface;
interface keyword a 3: a WeChat money printing interface request;
self-defining key words b: waiting for 1 minute;
interface keyword c: inquiring an order interface request;
SQL keyword d: the order table state is queried.
In order to transfer parameters between different scenes, a user-defined keyword e is required: storing a certain value of a certain scene into an intermediate table;
self-defining keywords f: taking out the values for which there is an intermediate table for a certain scenario;
configuring the keywords of the step; and then configuring scene keywords according to the keywords in the step:
configuring a scene keyword A: namely, the interface keywords a1-e are combined in sequence and are associated with 20 test data to generate 20 bank card money drawing test cases.
Configuring a scene keyword B: namely, the interface keywords a2-e are combined in sequence and are associated with 20 test data to generate 20 test cases for paying money.
Configuring a scene keyword C: namely, the interface keywords a3-e are combined in sequence and are associated with 20 test data to generate 20 wechat typing test cases.
Configuring a scene keyword D: i.e. custom key b, and associate 1 test data, i.e. wait 1 minute.
Configuring a scene keyword E: the user-defined keyword f, the interface keyword C and the SQL keyword d are combined in sequence, 60 pieces of test data are associated, and an order query request and a database state query are carried out on the payment orders of the bank cards, the payment instruments and the WeChat generated by the scene keywords A, B and C;
configuring a test task template: the method comprises the steps that scene keywords A-B-C-D-E are combined for the second time in sequence to generate a test task template, at the moment, the whole scene executes execution of 60 money-making cases firstly, then the execution waits for 1 minute, interface and database query are carried out on 60 money-making interfaces, the whole time consumption is 1 minute later than that of each scene keyword, the total time is not less than 60 minutes, and the time is greatly saved;
wherein ABC executes 60 money orders, generates 60 money order data, self-defines the keywords E, and stores the 60 orders in the intermediate table as a medium, and acquires 60 order data in the scene keywords E to check the interface query result and the database order table result;
the user-defined keyword f is a value;
the user-defined keyword e and the user-defined keyword f are a pair, values are stored in the former scene, and values are taken in the other scene, so that parameter transmission is performed on the keywords in different scenes.
Referring to fig. 10, an embodiment of the present application provides an apparatus 110 for generating an automated test script, including:
the first processing module 101 is configured to configure step keywords, where the step keywords have a mapping relationship with test script codes in a test database;
the second processing module 102 is configured to configure a scene keyword according to the step keyword, where the scene keyword includes a plurality of step keywords arranged according to a specified order;
the third processing module 103 is configured to configure a test task template according to the scene keywords, where the test task template includes combining the scene keywords in a specified order;
and the generating module 104 is used for generating an automatic test script according to the test task template.
Optionally, the first processing module 101 is configured to configure step keywords, where the step keywords include: interface keywords, SQL keywords, and/or custom keywords.
Alternatively, referring to fig. 11, the first processing module 101 includes:
the first processing sub-module 1011 is configured to configure an interface key, and includes:
editing at least one of the following parameters of the target interface keyword based on a first input performed by a user on an interface keyword configuration page: interface keywords, interface keyword numbers, interface names, interface addresses, request modes and uploading accessories.
Alternatively, referring to fig. 11, the first processing module 101 includes:
the second processing sub-module 1012, configured to configure the SQL key, includes:
based on a second input performed by the user on the SQL keyword configuration page, configuring at least one of the following operations for the target SQL keyword:
adding a database table, deleting the database table, modifying the database table and inquiring the database table.
Alternatively, referring to fig. 11, the first processing module 101 includes:
the third processing sub-module 1013 is configured to configure the custom keyword, including:
and performing online compilation to generate a target custom keyword associated with a target test step which is not supported currently based on a third input executed by the user on the custom keyword configuration page.
Optionally, the second processing module 102 is further configured to configure a scene keyword according to the step keyword, including:
creating scene keywords based on fourth input executed by the user on the scene configuration page, wherein the scene keywords comprise sequence information of scenes, operation environments, operation times and/or step keywords;
optionally, the third processing module 103 is further configured to configure a test task template according to the scene keyword, and includes:
and combining the scene keywords according to a specified sequence based on a fifth input executed by the user on the test task template configuration page.
Referring to fig. 12, an embodiment of the present invention further provides an electronic device 120, which includes a processor 121, a memory 122, and a computer program stored in the memory 122 and capable of running on the processor 121, where the computer program, when executed by the processor 121, implements the processes of the above-mentioned embodiment of the method for generating an automatic test script, and can achieve the same technical effects, and therefore, in order to avoid repetition, the details are not repeated here.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the embodiment of the method for generating an automatic test script, and can achieve the same technical effect, and is not described herein again to avoid repetition. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
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. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
It should be understood that the above examples are only for clarity of illustration and are not intended to limit the embodiments. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. And are neither required nor exhaustive of all embodiments. And obvious variations or modifications of this invention are intended to be covered by the scope of the invention as expressed herein.
Claims (10)
1. A method for generating an automated test script, comprising:
configuring step keywords, wherein the step keywords have a mapping relation with test script codes in a test database;
configuring scene keywords according to the step keywords, wherein the scene keywords comprise a plurality of step keywords arranged according to a specified sequence;
configuring a test task template according to the scene keywords, wherein the test task template comprises combining the scene keywords according to a specified sequence;
and generating an automatic test script according to the test task template.
2. The method of generating an automated test script of claim 1, wherein the step keywords comprise: interface keywords, SQL keywords, and/or custom keywords.
3. The method of claim 2, wherein configuring the interface key comprises:
editing at least one of the following parameters of the target interface keyword based on a first input performed by a user on an interface keyword configuration page: interface keywords, interface keyword numbers, interface names, interface addresses, request modes and uploading accessories.
4. The method of generating an automated test script of claim 2, wherein configuring the SQL key comprises:
based on a second input performed by the user on the SQL keyword configuration page, configuring at least one of the following operations for the target SQL keyword:
adding a database table, deleting the database table, modifying the database table and inquiring the database table.
5. The method of claim 2, wherein configuring custom keywords comprises:
and performing online compilation to generate a target custom keyword associated with a target test step which is not supported currently based on a third input executed by the user on the custom keyword configuration page.
6. The method for generating an automated test script according to claim 1, wherein the configuring a scenario keyword according to the step keyword comprises:
and creating scene keywords based on fourth input executed by the user on the scene configuration page, wherein the scene keywords comprise sequence information of scenes, running environments, running times and/or step keywords.
7. The method for generating an automated test script according to claim 1, wherein the configuring a test task template according to the scenario keyword comprises:
and combining the scene keywords according to a specified sequence based on a fifth input executed by the user on the test task template configuration page.
8. An apparatus for generating an automated test script, comprising:
the first processing module is used for configuring step keywords, and the step keywords have a mapping relation with test script codes in a test database;
the second processing module is used for configuring scene keywords according to the step keywords, wherein the scene keywords comprise a plurality of step keywords which are arranged according to a specified sequence;
the third processing module is used for configuring a test task template according to the scene keywords, wherein the test task template comprises the scene keywords which are combined according to a specified sequence;
and the generating module is used for generating an automatic test script according to the test task template.
9. An electronic device, comprising: processor, memory and program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the method of generating an automated test script according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon, which computer program, when being executed by a processor, carries out the steps of the method of generating an automated test script according to one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010730964.7A CN111881042B (en) | 2020-07-27 | 2020-07-27 | Automatic test script generation method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010730964.7A CN111881042B (en) | 2020-07-27 | 2020-07-27 | Automatic test script generation method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111881042A true CN111881042A (en) | 2020-11-03 |
CN111881042B CN111881042B (en) | 2024-06-25 |
Family
ID=73200723
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010730964.7A Active CN111881042B (en) | 2020-07-27 | 2020-07-27 | Automatic test script generation method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111881042B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112306893A (en) * | 2020-11-27 | 2021-02-02 | 平安普惠企业管理有限公司 | UI page testing method and device, computer equipment and storage medium |
CN112328481A (en) * | 2020-11-04 | 2021-02-05 | 中国平安人寿保险股份有限公司 | Automatic testing method, device and equipment for multi-task scene and storage medium |
CN113220566A (en) * | 2021-04-26 | 2021-08-06 | 深圳市云网万店科技有限公司 | Interface performance test script generation method and device and computer equipment |
CN113656295A (en) * | 2021-08-10 | 2021-11-16 | 上海浦东发展银行股份有限公司 | Automatic generation method and device of test data, electronic equipment and storage medium |
CN115221146A (en) * | 2022-09-20 | 2022-10-21 | 云账户技术(天津)有限公司 | Method and device for deleting key value in Redis |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130097586A1 (en) * | 2011-10-17 | 2013-04-18 | International Business Machines Corporation | System and Method For Automating Test Automation |
US20130339930A1 (en) * | 2012-06-18 | 2013-12-19 | South Dakota Board Of Regents | Model-based test code generation for software testing |
CN107526676A (en) * | 2016-06-20 | 2017-12-29 | 苏宁云商集团股份有限公司 | A kind of cross-system method of testing and device |
CN108459957A (en) * | 2017-11-29 | 2018-08-28 | 平安科技(深圳)有限公司 | Test method, device, equipment and the storage medium of fund system test case |
CN108710571A (en) * | 2018-05-14 | 2018-10-26 | 中国建设银行股份有限公司 | A kind of method and apparatus generating automatic test code |
CN109086199A (en) * | 2018-06-22 | 2018-12-25 | 网宿科技股份有限公司 | A kind of automation generates the method for test script, terminal and can storage medium |
CN110109818A (en) * | 2019-03-15 | 2019-08-09 | 平安城市建设科技(深圳)有限公司 | Monitoring method, device, terminal and the readable storage medium storing program for executing of back end interface data |
CN110134604A (en) * | 2019-05-16 | 2019-08-16 | 极智(上海)企业管理咨询有限公司 | A kind of unit or interface test method, device and computer equipment without code |
CN111258900A (en) * | 2020-01-17 | 2020-06-09 | 深圳壹账通智能科技有限公司 | Interface test script generation method, system, equipment and storage medium |
-
2020
- 2020-07-27 CN CN202010730964.7A patent/CN111881042B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130097586A1 (en) * | 2011-10-17 | 2013-04-18 | International Business Machines Corporation | System and Method For Automating Test Automation |
US20130339930A1 (en) * | 2012-06-18 | 2013-12-19 | South Dakota Board Of Regents | Model-based test code generation for software testing |
CN107526676A (en) * | 2016-06-20 | 2017-12-29 | 苏宁云商集团股份有限公司 | A kind of cross-system method of testing and device |
CN108459957A (en) * | 2017-11-29 | 2018-08-28 | 平安科技(深圳)有限公司 | Test method, device, equipment and the storage medium of fund system test case |
CN108710571A (en) * | 2018-05-14 | 2018-10-26 | 中国建设银行股份有限公司 | A kind of method and apparatus generating automatic test code |
CN109086199A (en) * | 2018-06-22 | 2018-12-25 | 网宿科技股份有限公司 | A kind of automation generates the method for test script, terminal and can storage medium |
CN110109818A (en) * | 2019-03-15 | 2019-08-09 | 平安城市建设科技(深圳)有限公司 | Monitoring method, device, terminal and the readable storage medium storing program for executing of back end interface data |
CN110134604A (en) * | 2019-05-16 | 2019-08-16 | 极智(上海)企业管理咨询有限公司 | A kind of unit or interface test method, device and computer equipment without code |
CN111258900A (en) * | 2020-01-17 | 2020-06-09 | 深圳壹账通智能科技有限公司 | Interface test script generation method, system, equipment and storage medium |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112328481A (en) * | 2020-11-04 | 2021-02-05 | 中国平安人寿保险股份有限公司 | Automatic testing method, device and equipment for multi-task scene and storage medium |
CN112306893A (en) * | 2020-11-27 | 2021-02-02 | 平安普惠企业管理有限公司 | UI page testing method and device, computer equipment and storage medium |
CN113220566A (en) * | 2021-04-26 | 2021-08-06 | 深圳市云网万店科技有限公司 | Interface performance test script generation method and device and computer equipment |
CN113656295A (en) * | 2021-08-10 | 2021-11-16 | 上海浦东发展银行股份有限公司 | Automatic generation method and device of test data, electronic equipment and storage medium |
CN113656295B (en) * | 2021-08-10 | 2024-06-07 | 上海浦东发展银行股份有限公司 | Automatic generation method and device of test data, electronic equipment and storage medium |
CN115221146A (en) * | 2022-09-20 | 2022-10-21 | 云账户技术(天津)有限公司 | Method and device for deleting key value in Redis |
CN115221146B (en) * | 2022-09-20 | 2022-12-27 | 云账户技术(天津)有限公司 | Method and device for deleting key value in Redis |
Also Published As
Publication number | Publication date |
---|---|
CN111881042B (en) | 2024-06-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111881042B (en) | Automatic test script generation method and device and electronic equipment | |
CN111177231B (en) | Report generation method and report generation device | |
CN111722839B (en) | Code generation method and device, electronic equipment and storage medium | |
CN111221726A (en) | Test data generation method and device, storage medium and intelligent equipment | |
EP2172839A1 (en) | Methods for identifying and/or analyzing concepts and systems thereof | |
CN109614312A (en) | Method for generating test case, device, electronic equipment and storage medium | |
CN110795697A (en) | Logic expression obtaining method and device, storage medium and electronic device | |
CN109739526A (en) | Code update method and device | |
CN102760096A (en) | Test data generation method, unit testing method and unit testing system | |
CN110825395B (en) | Multi-plug-in layered deployment system, device and medium | |
CN116048987A (en) | Processing method, device, electronic equipment, system and storage medium for flow business | |
CN108959294A (en) | A kind of method and apparatus accessing search engine | |
CN111831277B (en) | Virtual data generation method, system, device and computer readable storage medium | |
US10606843B2 (en) | Irreducible modules | |
WO2023151397A1 (en) | Application program deployment method and apparatus, device, and medium | |
US11726818B1 (en) | System for executing tasks in different programming languages | |
CN114756224A (en) | Activity execution method and device | |
CN111400623B (en) | Method and device for searching information | |
EP4154129A1 (en) | Database management methods and associated apparatus | |
CN114819631A (en) | Multitask visualization method and device, computer equipment and storage medium | |
CN114020789A (en) | Bill data query method, system, device and storage medium | |
CN113407598A (en) | Method and device for generating demand document, storage medium and electronic equipment | |
CN113806327A (en) | Database design method and device and related equipment | |
US12099976B2 (en) | Group eligibility criteria builder | |
CN114553688B (en) | Cloud computing deployment method, device, equipment and computer 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |