[go: up one dir, main page]

CN111881042B - Automatic test script generation method and device and electronic equipment - Google Patents

Automatic test script generation method and device and electronic equipment Download PDF

Info

Publication number
CN111881042B
CN111881042B CN202010730964.7A CN202010730964A CN111881042B CN 111881042 B CN111881042 B CN 111881042B CN 202010730964 A CN202010730964 A CN 202010730964A CN 111881042 B CN111881042 B CN 111881042B
Authority
CN
China
Prior art keywords
keywords
scene
keyword
test
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.)
Active
Application number
CN202010730964.7A
Other languages
Chinese (zh)
Other versions
CN111881042A (en
Inventor
尚微
邹永强
杨晖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Accumulus Technologies Tianjin Co Ltd
Original Assignee
Accumulus Technologies Tianjin 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 Accumulus Technologies Tianjin Co Ltd filed Critical Accumulus Technologies Tianjin Co Ltd
Priority to CN202010730964.7A priority Critical patent/CN111881042B/en
Publication of CN111881042A publication Critical patent/CN111881042A/en
Application granted granted Critical
Publication of CN111881042B publication Critical patent/CN111881042B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2468Fuzzy queries
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

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)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Fuzzy Systems (AREA)
  • Probability & Statistics with Applications (AREA)
  • Automation & Control Theory (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (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; the scene keywords are combined and configured through the step keywords, then the combined and configured test task templates are carried out according to the scene keywords, and finally an automatic test script is generated according to the test task templates, so that a flexible and convenient automatic test script generation method is provided, flexible configuration of complex test scenes and personalized requirements can be realized, and the test efficiency is improved.

Description

Automatic test script generation method and device and electronic equipment
Technical Field
The present application relates to the field of software testing, and in particular, to a method and an apparatus for generating an automatic test script, and an electronic device.
Background
In the current software testing field, automated test scripts can generally be generated by these methods: using the existing open source test framework, a tester manually writes a test script according to service requirements; using natural language to perform automatic test, defining corresponding natural language for component type and operation type of the system to be tested, and performing script writing according to agreed grammar specification; the interface request is defined as a keyword, and the test script is generated through permutation and combination of the keywords.
The current technical implementation has various problems, such as manual writing of test scripts, very high requirement on code writing capability of testers, and high later maintenance cost especially in business scenes facing complex flows; the automatic test is carried out by adopting natural language, the grammar requirement on the natural language is extremely high, and when new component types and operation types appear, the development needs to be put into again and new service scenes need to be met by redeployment; the automatic test script is generated by adopting a keyword combination mode, so that basic functions such as interface requests and database operations can be generally met, the automatic test script can be used after being redeveloped and deployed in the face of complex and personalized requirements, and particularly when the service flow is very complex and the number of test cases reaches a certain level, the test script is still generated by combining keywords so as to greatly influence the test operation efficiency.
Disclosure of Invention
The application provides a method, a device and electronic equipment for generating an automatic test script, which are used for solving the problems of low efficiency and high cost of post management and maintenance of the automatic test script generation and improving the flexibility and efficiency of the test script generation.
In order to achieve the above purpose, the present application adopts the following scheme:
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 mapping relations with test script codes in a test database;
Configuring a scene keyword according to the step keyword, wherein the scene keyword comprises 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 the steps of combining the scene keywords according to a designated sequence;
And generating an automatic test script according to the test task template.
Optionally, the step key includes: interface keywords, SQL keywords, and/or custom keywords.
Optionally, the configuration 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 the interface keyword configuration page: interface key, interface key number, interface name, interface address, request mode, and uploading attachment.
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 database tables, deleting the database tables, modifying the database tables, and querying the database tables.
Optionally, configuring the custom key includes:
Based on a third input executed by the user on the custom keyword configuration page, online compiling is performed to generate target custom keywords associated with target test steps which are not currently supported.
Optionally, the configuring the scene keyword according to the step keyword includes:
Creating scene keywords based on fourth input executed by a user on the scene configuration page, wherein the scene keywords comprise sequence information of scenes, running environments, running times and/or step keywords;
Optionally, the configuring the test task template according to the scene keyword includes:
and combining the scene keywords in a specified order based on a fifth input performed by the user on the test task template configuration page.
In one aspect, an embodiment of the present application provides a device for generating an automated test script, including:
The first processing module is used for configuring step keywords, wherein the step keywords have a mapping relation with test script codes in a test database;
The second processing module is used for configuring a scene keyword according to the step keyword, wherein the scene keyword comprises a plurality of step keywords 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 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:
a processor, a memory, and a program stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the method for generating an automated test script according to an embodiment of the present application.
In one aspect, embodiments of the present application provide a computer readable storage medium having a computer program stored thereon, which when executed by a processor, implements the steps of the method for generating an automated test script according to embodiments of the present application.
The technical scheme provided by the embodiment of the application has the beneficial effects that at least:
Firstly, configuring step keywords, wherein the step keywords have a mapping relation with test script codes in a test database; the scene keywords are combined and configured through the step keywords, then the combined and configured test task templates are carried out according to the scene keywords, and finally an automatic test script is generated according to the test task templates, so that a flexible and convenient automatic test script generation method is provided, flexible configuration of complex test scenes and personalized requirements can be realized, and the test efficiency is improved.
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 of a method for generating an automated test script according to an exemplary embodiment of the present application;
FIG. 4 is a schematic diagram of a method for generating an automated test script according to an exemplary embodiment of the present application;
FIG. 5 is a schematic diagram of a method for generating an automated test script according to an exemplary embodiment of the present application;
FIG. 6 is a schematic diagram of a method for generating an automated test script according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a method for generating an automated test script according to an embodiment of the present application;
FIG. 8 is a schematic diagram of a method for generating an automated test script according to an embodiment of the present application;
FIG. 9 is a schematic diagram of a method for generating an automated test script according to an embodiment of the present application;
FIG. 10 is a schematic diagram of a device for generating an automated test script according to an embodiment of the present application;
FIG. 11 is a schematic diagram of a device for generating an automated test script according to an embodiment of the present application;
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 more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present application. It will be apparent that the described embodiments are some, but not all, embodiments of the application. All other embodiments, which can be made by a person skilled in the art without any inventive effort, based on the described embodiments of the application fall within the scope of the application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type, and are not limited to the number of objects, such as the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
The voice detection method provided by the embodiment of the application is described in detail below through specific embodiments and application scenes thereof with reference to the accompanying drawings.
In addition, the technical features of the different embodiments of the present application described below may be combined with each other as long as they do not collide with each other.
Referring to fig. 1, a flowchart illustration of a method for generating an automated test script according to an embodiment of the present application is shown, where the method for generating an automated test script includes:
Step 101, configuring step keywords, wherein the step keywords have mapping relation with test script codes in a test database;
In step 101, the smallest unit capable of being split in the script, namely, the step is defined as step keywords, and each step keyword has a mapping relation with target script codes capable of executing target steps in the test database.
Step 102, configuring a scene keyword according to the step keyword, wherein the scene keyword comprises a plurality of step keywords arranged according to a specified sequence;
In step 102, selecting applicable step keywords according to different service scene needs, and combining according to a certain sequence to generate scene keywords;
for example, as in step 101, the key words of a, b, c, d, e steps are configured, which respectively correspond to 5 operation steps and script code mapping of the 5 operation steps in the test data; at this time, according to scene needs, a, B, C are sequentially combined to generate scene keywords A (a-B-C), a, e, C are sequentially combined to generate scene keywords B (a-e-C), and B, f are sequentially combined to generate scene keywords C (B-f).
Step 103, configuring a test task template according to the scene keywords, wherein the test task template comprises the scene keywords combined according to a designated sequence;
in step 103, according to different testing requirements, such as according to preset task templates, the related scene keywords are combined and configured to test the task templates according to a certain sequence;
Illustratively, the test task templates 001 are configured in combination, such as by associating scene keywords A, B, C in the order B-A-C, according to the task templates 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 the 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 an automatic test script.
The method for generating the automatic test script provided by the embodiment of the application can be used for mapping the step keywords with the corresponding script codes by splitting the script into the minimum units, namely the step keywords, then generating the corresponding scene keywords by combining the step keywords according to a certain sequence according to different scene requirements, configuring the test task template according to the task template, wherein the test task template comprises the scene keywords combined according to the appointed sequence, and finally automatically generating the test script 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 for completing processing of a business flow, such as a bank card money-playing business, and the interface key words refer to calling a bank card money-playing interface;
The SQL key refers to the addition, deletion and modification operation of the database, is generally used for preparing data before testing, calling parameters among different interfaces, transmitting parameter sources and asserting a database table, such as bank card cash, for example, and refers to the state of inquiring a cash order table and asserting whether the state meets expectations or not;
The SQL refers to structured query language (Structured Query Language) for short, is a special purpose programming language, is a database query and programming language and is used for accessing data and querying, updating and managing a relational database system, so that SQL keywords are used for operating a database in the technical scheme provided by the embodiment of the application;
the custom key words are operations which are not supported by the system at present and are finished through compiling input code segments, such as execution of shell scripts, generation of excel files, waiting for money in a bank money-making service and the like.
Referring to fig. 2, a keyword management list is shown, which has three options of interface keywords, SQL keywords, and/or custom keywords, respectively, and a corresponding step keyword management page, such as an interface keyword management page, an SQL keyword management page, or a custom keyword management page, is displayed based on a sixth input performed 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:
Step keywords are added;
Carrying out fuzzy query on the step keywords;
copying the target step keywords;
deleting the keywords of the target step;
displaying a target step keyword configuration page;
and automatically generating a scene according to the target step keywords.
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, default parameters, an attachment, an operation, and the like;
the method can carry out fuzzy query based on the interface keywords, the interface names and/or the interface addresses input by the user, the user can also add the interface keywords by clicking "add", delete the interface keywords of the target by clicking "delete", and can also display the configuration pages of the interface keywords of the target by clicking "edit";
For example, in the sql keyword management page and the custom keyword page, the addition, deletion, fuzzy query or configuration page of the target step keyword of the sql keyword and/or the custom keyword can be executed based on the corresponding input executed by the user, so as to perform parameter configuration.
Optionally, in step 101, the configuring step keyword includes configuring an interface keyword, including:
editing at least one of the following parameters of the target interface keyword based on a first input performed by a user on the interface keyword configuration page: interface key, interface key number, interface name, interface address, request mode, and uploading attachment.
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 a corresponding step keyword configuration page by executing different inputs in the page and configure step keywords by continuing to execute corresponding inputs;
The interface keyword may be used as a step in a test script, and the interface keyword configuration page is used to maintain interface configurations of all tested systems, including, but not limited to, unique interface keywords of a full platform, interface names, interface addresses, request modes, default parameters, uploading information of accessories, and the like;
Referring to fig. 4, an interface configuration page is shown in an interface keyword configuration page, and the configuration page contains parameters which can be set, such as a number, an interface keyword, an interface name, a domain name, a request mode, a default request parameter, an uploading attachment and the like;
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 respectively corresponding to a bank card money-making interface request, an interface name of 'bank card real-time money making' and a serial number of 6, and after the configuration of the target interface keyword is completed, the user executes input, such as clicking a transfer key, to complete the configuration of the target interface keyword;
Corresponding interface keywords, such as a related parameter of the configured interface keyword 'query_real_order', can be respectively configured according to different interface requests, such as payment, weChat payment, inquiry order and the like, so as to correspond to the inquiry order interface request.
Optionally, in step 101, configuring the step key includes configuring an SQL key, including:
Editing at least one of the following parameters of the target SQL key based on a second input performed by the user on the SQL key configuration page:
adding database tables, deleting the database tables, modifying the database tables, and querying the database tables.
Illustratively, setting SQL keywords, which can be used as a step in a test script, wherein SQL keyword management is used for maintaining operation behaviors of a database, including but not limited to adding, deleting, modifying and inquiring database tables;
notably, in the SQL statement of the SQL keyword, the where condition is transmitted through use case parameters, so that the reusability of the SQL keyword can be improved, and the separation of the test script and the test data is realized;
When SQL keyword configuration is carried out, firstly, a data source browser is set, and a data source browser configuration page shown in FIG. 5 is referred to, wherein the data source browser configuration page is used for configuring information such as database names DNNAME, network address URLs, user names USENAME, PASSWORDs PASSWORD, drive DRIVER and the like, and after the user completes configuration of the data source in the page by executing corresponding input, clicking and submitting the data source can be saved and timely taken effect;
the data source is configured to maintain the authority of database operation in the SQL key word, the database can be maintained by configuring the database address and account information, and the configuration is effective in time without restarting;
Secondly, as shown in fig. 6, configuring a target SQL keyword through an SQL keyword configuration page, wherein parameters such as a number, an SQL keyword, an SQL description, a library name, an SQL statement start, an SQL statement end and the like are displayed in the SQL configuration page shown in fig. 6;
For example, reference may be made specifically to the following configuration:
Setting SQL keywords as order_bills, namely inquiring an order table;
The name of the data source to be configured is input into the library, such as the data source reader configured above;
filling SQL sentences, if the where condition is required to be filled and the value of the parameter is changed, configuring the SQL keywords without filling the specific where condition, only filling where 1=1, and transmitting the condition through test data;
notably, the subsequent statement of the where condition, such as order by, group by, etc., may not be filled in.
Optionally, configuring the custom key includes:
performing online compiling to generate target custom keywords associated with target testing steps which are not currently supported based on third input executed by a user on a custom keyword configuration page;
the custom keyword can be used as a step in a test script, the corresponding script code can be configured in an online code writing mode, and the keyword of the current step and any complex operation which cannot be supported by the corresponding script code can be realized by defining the custom keyword, such as generating an excel file, operating the file, operating a complex database, operating 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, the number ID, keywords, meanings, descriptions, examples, and the like of the custom keyword are shown;
And at least one of the following operations can be performed based on a seventh input performed by the user on the custom keyword management page:
Based on the keywords and/or descriptions, fuzzy query is carried out on the custom keywords;
Adding a custom keyword;
Displaying a custom keyword configuration interface;
checking codes of target custom keywords;
deleting the target custom key.
Referring to fig. 8, a user can configure keywords, meanings and examples of a custom keyword by executing corresponding inputs, and can open a corresponding configuration interface by the custom keyword configuration interface or the check code in fig. 7, compile codes of a target custom keyword on line, configure corresponding code segments, submit and save after configuration is completed, and operate without restarting.
Optionally, step 102, configuring the scene keyword according to the step keyword includes:
based on a fourth input performed by the user at the scene configuration page, a scene key is created, the scene key comprising sequence information of the scene, the running environment, the number of runs and/or the step key.
The scene configuration page provides an automatic scene management function, realizes configuration of scene keywords, selects applicable step keywords according to service requirements, and can be any one or more of interface keywords, SQL keywords and custom keywords, and automatically generates a test script by combining according to a certain sequence;
Referring to fig. 9, a scene configuration page is shown, based on a fourth input performed by a user, at least one of the following operations may be performed: configuring parameters such as scene keywords, scene names, environments, cycle times, steps and the like;
the step is to combine the step keywords according to a certain sequence, such as manually inputting according to the requirement of a service scene, or inquiring and selecting the interface keywords according to a certain sequence, wherein the SQL keywords are inquired and any one or more of the user-defined keywords are displayed in the step parameters of the scene keywords according to the selected sequence.
Optionally, configuring the test task template according to the scene keyword includes:
and combining the scene keywords in a specified order based on a fifth input performed 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, different test cases are generated by associating different test data with scene keywords, and then an automatic test script aiming at the test cases can be generated by executing the test task template.
By taking a bank card, a payment bank and a WeChat money-making scene as examples, the method for generating the automatic test script provided by the embodiment of the application is further described:
The above scenario involves the following step keywords:
interface key a1: a bank card payment interface request;
Interface key a2: a payment precious money-making interface request;
interface key a3: a WeChat money-making interface request;
Custom key b: waiting for 1 minute;
interface key c: inquiring an order interface request;
SQL key d: the order table status is queried.
In order to transfer parameters between different scenes, the keyword e needs to be customized: storing a certain value of a certain scene into an intermediate table;
custom key f: fetching values for which there is an intermediate table for a certain scene;
Configuring the keywords of the steps; and then configuring scene keywords according to the keywords in the steps:
Configuring a scene keyword A: namely, interface keywords a1-e are combined in sequence and are associated with 20 test data to generate 20 bank card money-drawing test cases.
Configuration scene key B: namely, interface keywords a2-e are combined in sequence and are associated with 20 test data to generate 20 payment treasures and money-making test cases.
Configuring a scene keyword C: namely, interface keywords a3-e are combined in sequence and are associated with 20 test data, so that 20 WeChat money-making test cases are generated.
Configuring a scene keyword D: i.e., custom key b, and correlate 1 test data, i.e., wait 1 minute.
Configuring a scene keyword E: the method comprises the steps that 'custom keywords f-interface keywords C-SQL keywords d' are combined in sequence, 60 pieces of test data are associated, and order inquiry requests and database state inquiry are carried out on bank cards, payment treasures and WeChat money orders generated by scene keywords A, B and C;
Configuring a test task template: the scene keywords A-B-C-D-E are combined for the second time according to the sequence to generate a test task template, at the moment, 60 money making cases are executed in the whole scene firstly, then the execution is waited for 1 minute, the interface and database query is carried out on 60 money making interfaces, the whole time consumption is waited for 1 minute than that of each scene keyword, the total time consumption is not less than 60 minutes, and the time is greatly saved;
The ABC executes 60 pieces of money, 60 pieces of money order data are generated, a custom keyword E is used for storing the 60 pieces of money order data into an intermediate table as a medium, and 60 pieces of order data can be obtained from the scene keyword E to check an interface query result and a database order table result;
The self-defined keyword f is a value;
The custom key e and the custom key f are a pair, the value is stored in the former scene, and the value is taken in the other scene, so that the purpose is to make parameter transfer in different scene keys.
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 the test database;
a second processing module 102, configured to configure a scene keyword according to the step keywords, where the scene keyword includes a plurality of step keywords arranged according to a specified order;
A third processing module 103, configured to configure a test task template according to the scene keywords, where the test task template includes combining the scene keywords according to 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.
Optionally, referring to fig. 11, the first processing module 101 includes:
The first processing sub-module 1011 is configured to configure interface keywords comprising:
editing at least one of the following parameters of the target interface keyword based on a first input performed by a user on the interface keyword configuration page: interface key, interface key number, interface name, interface address, request mode, and uploading attachment.
Optionally, referring to fig. 11, the first processing module 101 includes:
a second processing sub-module 1012, configured to configure SQL keywords, 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 database tables, deleting the database tables, modifying the database tables, and querying the database tables.
Optionally, referring to fig. 11, the first processing module 101 includes:
the third processing sub-module 1013 is configured to configure custom keywords including:
Based on a third input executed by the user on the custom keyword configuration page, online compiling is performed to generate target custom keywords associated with target test steps which are not currently supported.
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, including:
and combining the scene keywords in a specified order based on a fifth input performed 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, including 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 embodiment of the method for generating an automated test script, and can achieve the same technical effects, and for avoiding repetition, will not be described herein.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the processes of the embodiment of the method for generating an automated test script, and can achieve the same technical effects, and in order to avoid repetition, the description is omitted here. Wherein the computer readable storage medium is selected from Read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
It is apparent that the above examples are given by way of illustration only and are not limiting of the embodiments. Other variations or modifications of the above teachings will be apparent to those of ordinary skill in the art. It is not necessary here nor is it exhaustive of all embodiments. While still being apparent from variations or modifications that may be made by those skilled in the art are within the scope of the application.

Claims (10)

1. A method for generating an automated test script, comprising:
configuring step keywords, wherein the step keywords are minimum units which can be split in scripts, and the step keywords have a mapping relation with test script codes in a test database;
Configuring a scene keyword according to the step keyword, wherein the scene keyword comprises 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 the steps of combining the scene keywords according to a designated sequence;
And acquiring all step keywords according to the scene keywords in the test task template, and acquiring script codes corresponding to the step keywords according to the step keywords to generate an automatic test script.
2. The method for generating an automated test script according to claim 1, wherein the step key comprises: interface keywords, SQL keywords, and/or custom keywords.
3. The method for generating an automated test script of claim 2, wherein configuring interface keywords comprises:
editing at least one of the following parameters of the target interface keyword based on a first input performed by a user on the interface keyword configuration page: interface key, interface key number, interface name, interface address, request mode, and uploading attachment.
4. The method of automated test script generation 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 database tables, deleting the database tables, modifying the database tables, and querying the database tables.
5. The method for generating an automated test script of claim 2, wherein configuring the custom key comprises:
Based on a third input executed by the user on the custom keyword configuration page, online compiling is performed to generate target custom keywords associated with target test steps which are not currently supported.
6. The method for generating an automated test script according to claim 1, wherein configuring the scenario keywords according to the step keywords comprises:
Based on a fourth input performed by the user at the scene configuration page, scene keywords are created, the scene keywords including sequence information of the scene, the running environment, the running times and/or the step keywords.
7. The method for generating an automated test script according to claim 1, wherein configuring a test task template according to the scenario key comprises:
And combining the scene keywords in a specified order based on a fifth input performed by the user on the test task template configuration page.
8. An automated test script generating apparatus, comprising:
The first processing module is used for configuring step keywords, wherein the step keywords are minimum units which can be split in the script, and the step keywords have a mapping relation with test script codes in the test database;
The second processing module is used for configuring a scene keyword according to the step keyword, wherein the scene keyword comprises a plurality of step keywords 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 combined according to a specified sequence;
The generating module is used for acquiring all step keywords according to the scene keywords in the test task template, and acquiring script codes corresponding to the step keywords according to the step keywords to generate an automatic test script.
9. An electronic device, comprising: a processor, a memory and a 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 as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, implements the steps of the method of generating an automated test script according to any of claims 1 to 7.
CN202010730964.7A 2020-07-27 2020-07-27 Automatic test script generation method and device and electronic equipment Active CN111881042B (en)

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 CN111881042A (en) 2020-11-03
CN111881042B true 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)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112328481B (en) * 2020-11-04 2024-08-09 中国平安人寿保险股份有限公司 Automatic testing method, device, equipment and storage medium for multitasking scene
CN112306893A (en) * 2020-11-27 2021-02-02 平安普惠企业管理有限公司 UI page testing method and device, computer equipment and storage medium
CN113220566B (en) * 2021-04-26 2024-06-28 深圳市云网万店科技有限公司 Method and device for generating interface performance test script and computer equipment
CN113656295B (en) * 2021-08-10 2024-06-07 上海浦东发展银行股份有限公司 Automatic generation method and device of test data, electronic equipment and storage medium
CN114048144A (en) * 2021-11-24 2022-02-15 瀚云科技有限公司 A method, apparatus, computer equipment and medium for constructing a program
CN114138674A (en) * 2021-12-20 2022-03-04 南京星云数字技术有限公司 Automated testing method, device and computer equipment
CN114281688A (en) * 2021-12-20 2022-04-05 神策网络科技(北京)有限公司 Codeless or low-code automatic case management method and device
CN115221146B (en) * 2022-09-20 2022-12-27 云账户技术(天津)有限公司 Method and device for deleting key value in Redis
CN115756581A (en) * 2022-11-16 2023-03-07 中国联合网络通信集团有限公司 Script file generation method and device, computer equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9038026B2 (en) * 2011-10-17 2015-05-19 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
CN107526676B (en) * 2016-06-20 2021-03-02 江苏苏宁物流有限公司 Cross-system test method and device
CN108459957A (en) * 2017-11-29 2018-08-28 平安科技(深圳)有限公司 Test method, device, equipment and the storage medium of fund system test case
CN108710571B (en) * 2018-05-14 2021-11-23 中国建设银行股份有限公司 Method and device for generating automatic test code
CN110134604A (en) * 2019-05-16 2019-08-16 极智(上海)企业管理咨询有限公司 A method, device and computer equipment for unit or interface testing without code
CN111258900A (en) * 2020-01-17 2020-06-09 深圳壹账通智能科技有限公司 Interface test script generation method, system, equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN111881042A (en) 2020-11-03

Similar Documents

Publication Publication Date Title
CN111881042B (en) Automatic test script generation method and device and electronic equipment
CN107861870B (en) Interface test and test data generation method, device, terminal and storage medium
CN111722839B (en) Code generation method and device, electronic equipment and storage medium
CN109783346B (en) Keyword-driven automatic testing method and device and terminal equipment
CN112463154A (en) Page generation method, device and system and electronic equipment
CN109783543A (en) Data query method, apparatus, equipment and storage medium
US9582270B2 (en) Effective feature location in large legacy systems
CN111026670B (en) Test case generation method, test case generation device and storage medium
CN109614312A (en) Method for generating test case, device, electronic equipment and storage medium
CN114048129B (en) Automated testing method, device, equipment and system for software function changes
CN108959436A (en) Dictionary edit methods and system for voice dialogue platform
AU2017265144A1 (en) Information retrieval
CN110647314B (en) Skill generation method and device and electronic equipment
CN116048987A (en) Processing method, device, electronic equipment, system and storage medium for flow business
CN102760096A (en) Test data generation method, unit testing method and unit testing system
CN115438113A (en) Parameter management method and device, electronic equipment and storage medium
US10740209B2 (en) Tracking missing data using provenance traces and data simulation
CN117270944A (en) Version management method, device, computer equipment and medium of promt product
CN110555185A (en) Page customization method and system based on PC client
CN119396394A (en) Page code generation method, device, electronic device and storage medium
CN114817071B (en) Online automatic test system, method and device and readable storage medium
CN116127212A (en) Data access method, electronic equipment and storage medium
CN114519007A (en) Interface test data pushing method and device
CN107688948A (en) Claims Resolution data processing method, device, computer equipment and storage medium
CN114356308A (en) Web page display editing method, device, device and 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