CN109857735A - A kind of data configuration method and system carrying out regular description by excel - Google Patents

A kind of data configuration method and system carrying out regular description by excel Download PDF

Info

Publication number
CN109857735A
CN109857735A CN201811636432.6A CN201811636432A CN109857735A CN 109857735 A CN109857735 A CN 109857735A CN 201811636432 A CN201811636432 A CN 201811636432A CN 109857735 A CN109857735 A CN 109857735A
Authority
CN
China
Prior art keywords
operating procedure
key
character string
executing
description
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
Application number
CN201811636432.6A
Other languages
Chinese (zh)
Other versions
CN109857735B (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.)
Shanghai Rui Jia Information Technology Co Ltd
Original Assignee
Shanghai Rui Jia Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Rui Jia Information Technology Co Ltd filed Critical Shanghai Rui Jia Information Technology Co Ltd
Priority to CN201811636432.6A priority Critical patent/CN109857735B/en
Publication of CN109857735A publication Critical patent/CN109857735A/en
Application granted granted Critical
Publication of CN109857735B publication Critical patent/CN109857735B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application provides a kind of data configuration method and system that regular description is carried out by excel table.Its method includes: the basic information and form information that parsing carries out regular description by excel table, to generate forms pages;Parsing carries out the operating procedure of regular description by excel table, executes the operating procedure with the corresponding operation target of the Keyword Selection according to described in operating procedure;When executing the operating procedure, operating procedure based on the key message inputted in the forms pages and before as a result, being replaced to the specific character string in the rule description of the operating procedure of execution;The Debugging message of each operating procedure is exported to complete data configuration.Regular description can be carried out by excel in this way, operating procedure and list are combined, realizes automatic data configuration with corresponding combine of operation target, the management service of rule template is simple, data configuration is high-efficient, convenient for shared.

Description

A kind of data configuration method and system carrying out regular description by excel
Technical field
This application involves computer testing field more particularly to a kind of data configurations that regular description is carried out by excel Method and system
Background technique
When being tested based on test environment, it usually needs carry out data configuration, some meet spy for generating The test data of fixed condition.Data configuration is carried out, common are construction by hand and automatic construction two ways.Construction by hand leads to It is often the experience (for example being linked up with research and development, or read code etc.) that tester combines oneself, in the following manner some Combination carries out data configuration: 1) calling the http interface of test environment;2) it (is included but are not limited to for test environment data base Relevant database as mysql, it is also possible to be analogous to Document image analysis as mongoDB) carry out data increasing It revises and looks into.Automatic construction, is normally based on experience, develops a front end page, allow user to fill in by list some necessary After premise field, it is committed to backstage, reaches construction number in such a way that code removes calling interface or more new database from the background According to purpose.For common data configuration demand, it is intended to provide automatic make as far as possible convenient for exploitation and tester It uses, but existing automatic construction requires the code for developing a set of front-end and back-end again every time, takes time very much, efficiency is too It is low.
Summary of the invention
This specification is proposed to overcome the above problem in order to provide a kind of or at least be partially solved the logical of the above problem Cross the data configuration method and system that excel carries out regular description.
In a first aspect, the application provides a kind of data configuration method for carrying out regular description by excel table, comprising: Parsing carries out the basic information and form information of regular description by excel table, to generate forms pages;Parsing passes through Excel table carries out the operating procedure of regular description, with the corresponding operation mesh of the Keyword Selection according to described in operating procedure Mark executes the operating procedure;When executing the operating procedure, based on the key message inputted in the forms pages and it Preceding operating procedure as a result, being replaced to the specific character string in the rule description of the operating procedure of execution;Output The Debugging message of each operating procedure is to complete data configuration.
Wherein, described that regular description is carried out by excel, comprising: to establish the excel table, carry out regular description, institute Stating excel table includes basic information, form information and operating procedure.
Wherein, the basic information includes the effect of rule description, maintenance people;The form information includes needing user hand The key message that the operating procedure that work is filled in needs when executing;The operating procedure includes: the corresponding list of each operating procedure Only operation, each individually operation have corresponding operation target, and each operating procedure is provided with corresponding parameter;Wherein, root Operating procedure is associated with form information according to specific character string, according to specific character string by between operating procedure and operating procedure into Row association.
Wherein, the operation target includes at least: calling one or more interface targets of test environment;And/or it is depositing Data modification is carried out in storage system.
Wherein, forms pages are generated, comprising: the web form page is generated based on the form information, to fill in list Key message in information.
Wherein, further includes: receive the forms pages and submit the key message to come up.
Wherein, parsing carries out the operating procedure of regular description by excel table, according to the keyword in operating procedure Corresponding operation target is selected to execute each operating procedure, comprising: to execute each operation step of excel table step by step Suddenly, corresponding database storage system target or interface target are operated.
Wherein, when executing the operating procedure, behaviour based on the key message inputted in the forms pages and before Make step as a result, carries out value replacement to the specific character string in the rule description of the operating procedure of execution, specific to wrap Include: the specific character string in the rule description of operating procedure includes: the character for indicating the key message key inputted in forms pages It goes here and there $ { form:key }, with operation associated step and form information;Indicate the step serial number before the operating procedure of execution For the character string $ { step number N:key } of the output result key of N operating procedure, by between operating procedure and operating procedure into Row association;When executing the operating procedure, the character string $ { form:key } occurred in the operating procedure of execution is replaced Practical value for the key message key inputted in the forms pages;It, will be described in execution when executing the operating procedure The character string $ { step number N:key } occurred in operating procedure replaces with the value of the output result key of operating procedure N.
Wherein, the Debugging message of each step is exported to complete data configuration, comprising: defeated after executing to each operating procedure Debugging message is out to complete data configuration;Wherein, Debugging message includes at least: operating procedure description, replaced practical operation Step parameter and operating result.
Second aspect, the application provide a kind of data configuration system that regular description is carried out by excel table, comprising: Generation unit is parsed, for parsing the basic information and form information that pass through excel table and carry out regular description, to generate list The page;Resolution executing, for parsing the operating procedure for passing through excel table and carrying out regular description, according to operating procedure Described in the corresponding operation target of Keyword Selection execute the operating procedure;Replacement unit, for executing the operation When step, operating procedure based on the key message inputted in the forms pages and before as a result, the behaviour to execution The specific character string made in the rule description of step is replaced;Output unit, the debugging for exporting each operating procedure are believed Breath is to complete data configuration.
Wherein, described that regular description is carried out by excel, further includes: the excel table is established, regular description is carried out, The excel table includes basic information, form information and operating procedure.
Wherein, the basic information includes the effect of rule description, maintenance people;And/or the form information includes needing The key message that the operating procedure of user's hand filling needs when executing;The operating procedure includes: that each operating procedure is corresponding One individually operation, each individually operation have corresponding operation target, and each operating procedure is provided with corresponding parameter;Its In, operating procedure is associated with form information according to specific character string, according to specific character string by operating procedure and operating procedure Between be associated.
Wherein, the operation target includes at least: calling one or more interface targets of test environment;And/or it is depositing Data modification is carried out in storage system.
Wherein, generation unit is parsed, further includes: for generating the web form page based on the form information, to fill out Write the key message in form information.
Wherein, further includes: receiving unit submits the key message to come up for receiving the forms pages.
Wherein, resolution executing, further includes: for executing each operating procedure of excel table step by step, to phase The database storage system target or interface target answered are operated.
Wherein, replacement unit, further includes: the specific character string in the rule description of operating procedure includes: instruction form page The character string $ { form:key } of the key message key inputted in face, with operation associated step and form information;Instruction is executing The operating procedure before step serial number N operating procedure output result key character string { step number N:key }, Will be associated between operating procedure and operating procedure;When executing the operating procedure, by the operating procedure of execution The character string $ { form:key } of middle appearance replaces with the practical value of the key message key inputted in the forms pages;It is holding When the row operating procedure, the character string $ { step number N:key } occurred in the operating procedure of execution is replaced with into operation The value of the output result key of step N.
Wherein, output unit, further includes: for exporting Debugging message after executing to each operating procedure to complete data structure It makes;Wherein, Debugging message includes at least: operating procedure description, replaced practical operation step parameter and operating result.
The third aspect, the application provide a kind of server, including processor and memory: the memory is held for storing The program of the row above method;The processor is configured to for executing the program stored in the memory.
Fourth aspect, the application provide a kind of computer readable storage medium, are stored with computer program, and feature exists In when the program is executed by processor the step of realization preceding claim method.
According to the above scheme of the application, regular description is carried out by excel table, operating procedure and list are tied It closes, is associated between operating procedure, between operating procedure and list, and realize automatically number with corresponding combine of operation target According to construction.The rule of data configuration simply and easily can carry out regular description and management service, i.e. data by excel table The rule template of construction simply and readily manages;In turn, test platform is described according to rule, automatically generates list by form information The page fills in data to test user, other test users is facilitated to use, and is conducive to team's shared data construction experience;Execute number The Debugging message such as the result of step can be exported according to each link, that is, each operating procedure of construction, convenient for determining in test Position.To improve data configuration efficiency and improve sharing capability.
Above description is only the general introduction of technical scheme, in order to better understand the technological means of the application, And can be implemented in accordance with the contents of the specification, with the preferred embodiment of the application and cooperate attached drawing below detailed description is as follows.
Detailed description of the invention
The attached drawing constituted part of this application is used to provide further understanding of the present application, the schematic reality of the application Example and its explanation are applied for explaining the application, is not constituted an undue limitation on the present application.In the accompanying drawings:
Fig. 1 is shown to be controlled according to the data configuration for carrying out regular description by excel table of one embodiment of the application The flow chart of method.
Fig. 2 shows the data configuration systems that regular description is carried out by excel table according to the application one embodiment Structural schematic diagram.
Fig. 3 is shown according to one embodiment of the application in the flow chart being applied in test environment scene.
Specific embodiment
This specification technical solution is described in detail below by attached drawing and specific embodiment, it should be understood that this theory Specific features in bright book embodiment and embodiment are the detailed description to this specification technical solution, rather than to this theory The restriction of bright book technical solution, in the absence of conflict, technical characteristic in this specification embodiment and embodiment can be with It is combined with each other.
The terms "and/or", only a kind of incidence relation for describing affiliated partner, indicates that there may be three kinds of passes System, for example, A and/or B, can indicate: individualism A exists simultaneously A and B, these three situations of individualism B.In addition, herein Middle character "/" typicallys represent the relationship that forward-backward correlation object is a kind of "or".
Embodiment
Referring to FIG. 1, the application carries out one embodiment of the data configuration method of regular description by excel table, Include:
Step S110, parsing carries out the basic information and form information of regular description by excel table, to generate list The page.
Wherein, management and the description rule that rule is carried out by way of excel table, i.e., design rule template and manage Reason safeguards the rule template.
In one embodiment, excel table is established, regular description is carried out.It is main to wrap in the excel table of foundation The information of three parts (sheet) is included, such as: basic information, form information and operating procedure.
Further, the basic information includes the effect of rule description, maintenance people;And/or the form information includes needing The key message for wanting the operating procedure of user's hand filling to need when executing;And/or the operating procedure includes, each step Corresponding one individually operation, it is each it is individually operated have corresponding operation target, each operating procedure is provided with corresponding parameter. Specifically such as:
1, basic information: the effect (such as account information of one test user of construction) of the template, maintenance people etc..
2, form information: some information is to need user (such as: test man) to carry out by hand when data configuration The information filled in may require that use when operating procedure executes using these information as key message, to complete the number of test According to construction.
3, operating procedure: each operating procedure is an individually operation, such as triggers a http request, or It is searched for mysql, or is inserted into etc. for mongoDB database.
Further, in test environment, the data under certain special scenes are constructed for demand, operating procedure can choose Operation target such as:
(i) calling certain interfaces of test environment, (such as types such as http interface or thrift, protobuf connect Mouthful).In the present embodiment, such as: call http protocol interface, be specifically divided into get and post different agreement, the result of return is Json format.
(ii) modification for directly carrying out data within the storage system, is increased, is deleted, being changed, looking into that (storage system usually can be The Document image analysis of the relevant database of similar mysql, similar mongoDB, or the key-value of similar redis Database etc.).In the present embodiment, such as: in mysql database direct action, can specifically be divided into increasing, delete, change, to look into this several The different operation of kind, wherein the content operated is specific a line record.
It further, can formation rule in conjunction with the information of three parts of table by the combination of the target of operation above Template, to carry out data configuration.
Further, will be associated and (connect) between operating procedure and form information, by operating procedure and operating procedure it Between be associated (series connection).
Specifically, the specific character string in the rule description of operating procedure includes: the key for indicating to input in forms pages The character string $ { form:key } of information key, with operation associated step and form information;Indicate the operating procedure in execution The character string { step number N:key } of the output result key of step serial number N operating procedure before, by operating procedure with It is associated between operating procedure.In this way, when executing the operating procedure, if there is word in the operating procedure executed Symbol string $ { form:key }, so that it may replace with the practical value of the key message key inputted in the forms pages;It is executing When the operating procedure, if there is character string $ { step number N:key } in the operating procedure executed, so that it may replace For the value of the output result key of operating procedure N.
For example, some key key in the rule description for configuring operating procedure, in setting specific character string and form information It, in this way can be with for example, key key can be the key message for user's input that form information is obtained by forms pages in association When executing operating procedure, by the reality of key message key being inputted in the forms pages, being come up by forms pages submission Border value, (i.e. the specific character string of indication key key, is replaced the value for the key key that replacement is needed in the operating procedure of execution It is changed to the value of practical key key);And some operating procedure before specific character string and this operating procedure is arranged (uses step sequence Number N is identified) some key key association in the result after operation is executed, it in this way can be when executing this operating procedure, by the operation Some output information, that is, key key value is supplied to this step (i.e. specific character of indication key key in the output result of step N String, replaces with the value of actual key key) execute use.
When operation data construction, the web form page is generated based on the form information, to fill in list letter Key message in breath.Specifically, system platform passes through the basic information in parsing excel table and form information two Sheet, rendering generate a forms pages, are supplied to user such as test man and carry out filling in filling in for key message, filled in After submit.
System platform can receive the forms pages and submit the key message to come up.
Step S120, parsing carries out the operating procedure of regular description by excel table, to describe according in operating procedure The corresponding operation target of Keyword Selection execute the operating procedure.
Wherein, operation target just includes at least: calling one or more interface targets of test environment;And/or it is storing Data modification is carried out in system.
Keyword described in operating procedure, the i.e. keyword of operating procedure, such as mysql_insert, http_get etc. Content determines that current line (operating procedure) is carried out using what mode in excel table by this kind of brief keyword Parsing and operation.Keyword includes the information in database or this kind of table gauge outfit of interface.Specifically, system platform is to excel Operating procedure in table is parsed, and each operating procedure of executive table step by step, is had in each operating procedure pair Corresponding database storage system target or interface target, operate these targets, calling interface, the place for calling database Reason etc..Such as: http protocol interface is called, get and post different agreement is specifically divided into;Alternatively, direct in mysql database Movement, can specifically be divided into increasing, delete, change, looking into.
Step S130, when executing the operating procedure, based on the key message inputted in the forms pages and before Operating procedure as a result, carrying out value replacement to the specific character string in the rule description of the operating procedure of execution.
Wherein, the key message inputted in forms pages is that by user, test man is inputted in other words by the web form page , it can be submitted after inputting these information, return to system platform use.In each operating procedure for executing operating procedure table When, have a corresponding operation target, for example calling interface or act to database.And it is further, it is based on the list The key message that is inputted in the page and operating procedure before as a result, to the specific word in the rule description of the operating procedure Symbol string carries out value replacement.
Since the specific character string in the rule description of operating procedure includes: the key message for indicating to input in forms pages The character string $ { form:key } of key establishes being associated with for operating procedure and form information (forms pages).In this way, executing institute When stating operating procedure, if there is character string $ { form:key } in the operating procedure executed, so that it may replace with the table The practical value of the key message key inputted in single-page.
In one embodiment, complete in the description of the operating procedure when going to any one operating procedure Character string in, there is the character string (substring) as $ { form:key }, just in the key messages of forms pages The value of the key to come up is actually submitted to go to replace this current character string.One example can will input in the forms pages Key message practical submission value, such as: the key key of input is cell-phone number 12345678, and replacement is described in the execution $ { form:key } character string occurred in operating procedure, such as: $ { form:phoneNo. } is substituted for 12345678, out Existing character string { form:phoneNo. }, just refers to that operating procedure is gone to here, needs actually to submit in forms pages Telephone number.
Since the specific character string in the rule description of operating procedure includes: instruction before the operating procedure of execution Step serial number N operating procedure output result key character string { step number N:key }, establish operating procedure and behaviour Make the association between step.In this way, when executing the operating procedure, if there is character string in the operating procedure executed $ { step number N:key }, so that it may replace with the value of the output result key of operating procedure N.
In one embodiment, when going to any one step, in the complete character string in the description of the step, Occur shaped like character string as $ { step number: key }, is just executed with the operating procedure of step number instruction serial number The value of the key inside result is exported, the character string that current this indication key key needs value is replaced.For example, step number is N, it indicate that be the n-th operating procedure of front, it thus will be inside the result after the n-th operating procedure execution of front The corresponding value of key replaces this current character string.One example, can be by the output result of the operating procedure of step number N In the corresponding key key of some information value, such as: step number be 25 operating procedure output result in have user's volume Number " A ", key " B ", reference number of a document " C " replace $ { step number N:key } word occurred in the operating procedure of execution Symbol string, such as: { 25: reference number of a document } have been substituted for C, have just referred to that operating procedure is gone to here, have needed No. 25 operating procedures Reference number of a document in the result of output.
Step S140 exports the Debugging message of each operating procedure to complete data configuration.
Wherein, Debugging message is exported after executing to each operating procedure, can also have corresponding execute to operate step in this way The operating result etc. exported after rapid, wherein further including the value etc. for the key that can be replaced.
Wherein, Debugging message includes at least: operating procedure description, replaced practical operation step parameter, operating result. Data configuration is completed as a result,.
Referring to FIG. 2, the application carries out one embodiment of the data configuration system of regular description by excel, comprising:
Generation unit 210 is parsed, for parsing the basic information and list letter that pass through excel table and carry out regular description Breath, to generate forms pages.Resolution executing 220, for parsing the operation step for passing through excel table and carrying out regular description Suddenly, each operating procedure is executed with the corresponding operation target of the Keyword Selection according to described in operating procedure.Replacement is single Member 230, for when executing the operating procedure, operation based on the key message inputted in the forms pages and before to be walked It is rapid as a result, carrying out value replacement to the specific character string in the rule description of the operating procedure of execution.Output unit 240, for exporting the Debugging message of each operating procedure to complete data configuration.
Further comprise receiving unit (not shown), submits the crucial letter to come up for receiving the forms pages Breath.
Specifically, described that regular description is carried out by excel table, it is to utilize excel by first establishing excel table Regular description is carried out, it is possible thereby to carry out management and the description rule of rule, i.e. design rule by way of excel table Template and the management service rule template.
In one embodiment, the excel table of foundation carries out regular description, mainly includes three in excel table The information of a part (sheet), such as: basic information, form information and operating procedure.
Further, the basic information includes the effect of rule description, maintenance people;And/or the form information includes needing The key message for wanting the operating procedure of user's hand filling to need when executing;And/or the operating procedure includes, each step Corresponding one individually operation, it is each it is individually operated have corresponding operation target, each operating procedure is provided with corresponding parameter. Specifically such as:
1, basic information: the effect (such as account information of one test user of construction) of the template, maintenance people etc..
2, form information: some information is to need user (such as: test man) to carry out by hand when data configuration The information filled in may require that use when operating procedure executes using these information as key message, to complete the number of test According to construction.
3, operating procedure: each step is an individually operation, such as one http request of triggering, or is directed to Mysql is searched, or is inserted into etc. for mongoDB database.
Further, in test environment, the data under certain special scenes are constructed for demand, operating procedure can choose Operation target such as:
(i) calling certain interfaces of test environment, (such as types such as http interface or thrift, protobuf connect Mouthful).In the present embodiment, such as: call http protocol interface, be specifically divided into get and post different agreement, the result of return is Json format.
(ii) modification for directly carrying out data within the storage system, is increased, is deleted, being changed, looking into that (storage system usually can be The Document image analysis of the relevant database of similar mysql, similar mongoDB, or the key-value of similar redis Database etc.).In the present embodiment, such as: in mysql database direct action, can specifically be divided into increasing, delete, change, to look into this several The different operation of kind, wherein the content operated is specific a line record.
It further, can formation rule in conjunction with the information of three parts of table by the combination of the target of operation above Template, to carry out data configuration.
Further, will be associated and (connect) between operating procedure and form information, by operating procedure and operating procedure it Between be associated (series connection).
Specifically, the specific character string in the rule description of operating procedure includes: the key for indicating to input in forms pages The character string $ { form:key } of information key, with operation associated step and form information;Indicate the operating procedure in execution The character string { step number N:key } of the output result key of step serial number N operating procedure before, by operating procedure with It is associated between operating procedure.In this way, when executing the operating procedure, if there is word in the operating procedure executed Symbol string $ { form:key }, so that it may replace with the practical value of the key message key inputted in the forms pages;It is executing When the operating procedure, if there is character string $ { step number N:key } in the operating procedure executed, so that it may replace For the value of the output result key of operating procedure N.
For example, some key key in the rule description for configuring operating procedure, in setting specific character string and form information It, in this way can be with for example, key key can be the key message for user's input that form information is obtained by forms pages in association When executing operating procedure, by the reality of key message key being inputted in the forms pages, being come up by forms pages submission Border value, (i.e. the specific character string of indication key key, is replaced the value for the key key that replacement is needed in the operating procedure of execution It is changed to the value of practical key key);And some operating procedure before specific character string and this operating procedure is arranged (uses step sequence Number N is identified) some key key association in the result after operation is executed, it in this way can be when executing this operating procedure, by the operation Some output information, that is, key key value is supplied to this step (i.e. specific character of indication key key in the output result of step N String, replaces with the value of actual key key) execute use.
When operation data construction, the web form page is generated based on the form information, to fill in list letter Key message in breath.Specifically, system platform passes through the basic information in parsing excel table and form information two Sheet, rendering generate a forms pages, are supplied to user such as test man and carry out filling in filling in for key message, filled in After submit.
System platform can receive the forms pages and submit the key message to come up.
Specifically, in the resolution executing 220, operation target is just included at least: one or more for calling test environment A interface target;And/or data modification is carried out within the storage system.Keyword described in operating procedure, i.e. operating procedure The contents such as keyword, such as mysql_insert, http_get are determined in excel table by this kind of brief keyword Current line (operating procedure) is parsed and is operated using what mode.Keyword includes database or this kind of table table of interface Information in head.Specifically, system platform parses the operating procedure in excel, and executive table step by step is every A operating procedure, has in each operating procedure to corresponding database storage system target or interface target, to these targets into Row operation, calling interface, the processing for calling database etc..Such as: http protocol interface is called, get and post are specifically divided into Different agreement;Alternatively, can specifically be divided into increasing in mysql database direct action, delete, change, looking into.
Specifically, in replacement unit 230, the key message inputted in forms pages is by the web form page by user Test man's input in other words, it can be submitted after inputting these information, return to system platform use.Executing operating procedure table Each operating procedure when, have a corresponding operation target, for example calling interface or act to database.And into one Step, operating procedure based on the key message inputted in the forms pages and before as a result, rule to the operating procedure Then the specific character string in description carries out value replacement.
Since the specific character string in the rule description of operating procedure includes: the key message for indicating to input in forms pages The character string $ { form:key } of key establishes being associated with for operating procedure and form information (forms pages).In this way, executing institute When stating operating procedure, if there is character string $ { form:key } in the operating procedure executed, so that it may replace with the table The practical value of the key message key inputted in single-page.
In one embodiment, complete in the description of the operating procedure when going to any one operating procedure Character string in, there is the character string (substring) as $ { form:key }, just in the key messages of forms pages The value of the key to come up is actually submitted to go to replace this current character string.One example can will input in the forms pages Key message practical submission value, such as: the key key of input is cell-phone number 12345678, and replacement is described in the execution $ { form:key } character string occurred in operating procedure, such as: $ { form:phoneNo. } is substituted for 12345678, out Existing character string { form:phoneNo. }, just refers to that operating procedure is gone to here, needs actually to submit in forms pages Telephone number.
Since the specific character string in the rule description of operating procedure includes: instruction before the operating procedure of execution Step serial number N operating procedure output result key character string { step number N:key }, establish operating procedure and behaviour Make the association between step.In this way, when executing the operating procedure, if there is character string in the operating procedure executed $ { step number N:key }, so that it may replace with the value of the output result key of operating procedure N.
In one embodiment, when going to any one step, in the complete character string in the description of the step, Occur shaped like character string as $ { step number: key }, is just executed with the operating procedure of step number instruction serial number The value of the key inside result is exported, the character string that current this indication key key needs value is replaced.For example, step number is N, it indicate that be the n-th operating procedure of front, it thus will be inside the result after the n-th operating procedure execution of front The corresponding value of key replaces this current character string.
One example, can be by the corresponding key key's of some information in the output result of the operating procedure of step number N Value, such as: there are Customs Assigned Number " A ", key " B ", reference number of a document in the output result for the operating procedure that step number is 25 " C " replaces $ { step number N:key } character string occurred in the operating procedure of execution, such as: by $, { 25: file is compiled Number it has been substituted for C, just refer to the reference number of a document that operating procedure is gone in the result for needing No. 25 operating procedures to export here.
Specifically, in output unit 240, Debugging message is exported after executing to each operating procedure, can also be had in this way It is corresponding to execute the operating result etc. exported after step, wherein further including the value etc. for the key that can be replaced.Wherein, it adjusts Examination information includes at least: operating procedure description, replaced practical operation step parameter, operating result.Data structure is completed as a result, It makes.
Referring to FIG. 3, the flow chart in test environment scene is applied according to one embodiment of the application, to the side of the application Method and system are described further.
It during being tested for a product, tool etc., can be carried out based on " test environment ", and test environment It is exactly the environment under the line used when test before product publication.The data dependence test man needed in test environment It is created.Such as need test " user's login " scene, need to verify user name be not present, username and password just Really, the different situations such as password mistake, whether the page is by correctly responding.In this way, just needing to prepare to meet these three before testing The data of conditional combination.The application is described further below.
Firstly, carrying out regular description by excel.
Preset data construction selects two kinds of targets (other kinds of target can also be carried out using the same manner): 1, http Protocol interface, is specifically divided into get and post different agreement, and the result of return is json format;2, mysql database, specific point To increase, deleting, change, looking into the different operation of these types, wherein the content operated is specific a line record.
Specifically, by taking the test data of " structuring user's Account Data " scene as an example, there can be 2 during construction Operating procedure:
1, the test existing registration interface of environment is called, user name (phone number) and password are set;
2, in the database according to the user name id of front, the value for modifying " state of activation status " this column is 1.
By both targets and operative combination, method for carrying out data configuration is exactly rule template, here, template It is to be managed and maintained by excel foundation.Excel table is mainly made of the information of 3 parts (Sheet):
1, basic information: be mainly used for herein description rule template effect (such as construction one test user account Information), maintenance people etc..
In the example of " structuring user's Account Data ", following setting is done in basic information part:
Title Description Author
User's registration simultaneously activates A test user is created, and state of activation is set Zhang San
2, form information: the information of this part can be fully described by out when constructing the test data of a scene, be had Which information needs user to carry out hand filling.
In this example, the registration behavior for simulating a user is realized, this registration interface by calling registration interface The information such as phone number, password are needed, user (test man) is needed to provide inside list, rather than are automatically generated, thus, it is this Data needs are described in rule template, for automatically generating the forms pages on webpage when data configuration.
The content that may there are multinomial needs to fill in form information, it is also possible to have different types of Form Element, such as singly Row text box, multiline text frame, radio box etc., it is also possible to partial content has a default value, such as password we can write from memory Recognize to password default as one 123456.
In the Sheet of the form information of excel table, the description that every row is a Form Element can be set, include List id, whether essential, type, parameter, default value, description information etc..Wherein type can choose single-line text boxes, multirow text This frame etc., according to type difference, the format of parameter also different from.
In the example of " structuring user's Account Data ", the description sample of form information:
3, operating procedure: each operating procedure is an individually operation, such as triggers a http request, or It is searched for mysql, or is inserted into etc. for mongoDB database, thus, operating procedure is the one of rule template A core, by the configuration of operating procedure, the automation that can complete entire data configuration process is generated.For http get, Each of post and database operation, need that different parameters is arranged in operating procedure.
Following table is the example of the gauge outfit in the table for the operating procedure established, but the example should not be used as the side to the application The limitation of the embodiment of method and system.The content of gauge outfit can prompt under different keyword rules, and how each column will be filled out It writes and (also can be set as needed other action types, such as mongo_insert, redis_update etc.):
Following cell can then go to fill in the ginseng of difference required for the operating procedure in different column referring to these prompts Number.The example of several operating procedures is named, but the example should not be used as to the embodiment of the present processes and system Limitation.
One url get operating procedure independent of any external data, such as:
It is equivalent to initiate the url in table one get request.
One url post operating procedure independent of any external data, such as:
It is equivalent to initiate the url in table one post request, and takes parameter id=10, status=1.
One database (mysql) independent of any external data is inserted into insert operating procedure, such as:
It is equivalent to execute sql sentence:
USE db_user;
INSERT INTO table_user(phone,password)values('13500000000','123456');
One database update operating procedure, such as:
It is equivalent to execute sql sentence:
USE db_user;
UPDATE table_user SET status=1, type=2WHERE id=10limit 1;
One database Select operating procedure, such as:
It is equivalent to execute sql sentence:
USE db_user;
SELECT*FROM table_user WHERE type=2AND status=1ORDER BY create_time DESC;
One database Delete operating procedure, such as:
It is equivalent to execute sql sentence:
USE db_user;
DELETE FROM table_user WHERE id=10LIMIT 1;
Thus, when the test data constructed in excel table to needs formally configures operating procedure (such as " construction is used The example of family Account Data "), it is referred to the content of gauge outfit, for example, the first column selection from excel table is suitably crucial Word, a kind of mode can be selects specified keyword (such as: mysql_insert, mysql_ by way of drop-down menu Update, url_get etc.), behind several column filled in as needed, such as the operation of mysql, fill in database, table information (is grasped Make the host of database, port, user name, password in addition to configure in the program code of platform), according to being to increase, delete, change, look into Which of operation, fill in corresponding column respectively.
Further, the operation such as mysql can also be compared, limiting at most only influences data line, such as: pass through mysql In determiner limit limit, in this way, can in the case where there is rule setting error situation caused by accidentally delete, change by mistake data etc. Operation, due to be limited to only 1 can then reduce influence face, in addition, to operation execute after have a plurality of data return the case where limit It is set to 1 continuity for also contributing to operating procedure.
During configuring operating procedure herein, looks into, pass through in addition to the additions and deletions to http get, post, database change The form of table is abstracted, and is further also increased in table configuration description and is carried out concatenated mechanism to operating procedure (association).Specifically, it can be associated between operating procedure and form information, it can also be to operating procedure and operating procedure Between be associated.
Operating procedure is associated with form information, such as the get operation of http:
Url_get rule url
url_get Http:// demo.anjuke.com/test/get-some-data? id=1
Id parameter therein can not take 1 every time, but practical in the forms pages for needing to be generated according to form information It is gone to execute operating procedure by the id that user fills in, at this moment, form information is then configurable in rule template:
In this way, the forms pages that will generate form web page (are used to test man in carrying out test data construction process Family) it goes to fill in, such as the text box in forms pages is to the value in requisition for user input data id when carrying out data configuration.By This is needed in http get operation using this id, then modify to the rule description of the operating procedure of front, with Just it is associated with the form information, needs to use the id value actually entered when executing step, such as:
Url_get rule url
url_get Http:// demo.anjuke.com/test/get-some-data? id=$ { form:id }
Here, original id=1 has been mapped to this yuan of id in form information by mode as $ { form:id } The practical value of element realizes the dependence between form information (key message for especially needing user to input) and operating procedure Association.
Being associated between operating procedure and operating procedure, such as some operating procedure are executing the partial parameters in operation, The operation implementing result in some operating procedure before being to rely on.
By mode as the similar $ { form:key title } relied on form information, such as $ is also can be used in we Mode as { step number: key title } quotes the operation implementing result of some operating procedure of front.
Such as: an operating procedure is get, post of http, then its result for executing operation is easy to define, is exactly The practical json result of http request.
Assuming that first operating procedure (i.e. step number N=1) of all operationss step, the get for being http is requested, and is executed Return value after complete is:
So, it in some operating procedure, needs to hold using this operating procedure behind first operating procedure The certain field in result returned after row as a result, we can be replaced by { the step serial number of step: key } It changes.
Such as $ { 1:total } can be used to obtain total value therein (i.e. 23457) in we.For json, we It is traversed by symbol " " Lai Jinhang level.In same result, such as want to obtain broker_id value, so that it may using $ 1: Items.0.broker.broker_id } Lai Guanlian, it can the key key of the different elements in multiple output results, wherein 0 It indicates in the minor structure of a list type, which is to take each execution of the broker_id under the 0th daughter element Actual value afterwards, etc..
Assuming that operating procedure is the operation to mysql, defining increasing, changing, look into the result that operation executes is this data line Practical value after being operated, the result that the operation deleted executes are the value before deleting.Such as the operating procedure is pair The insertion operation of database:
After carrying out insertion operation, inside the demo_table tables of data in demo_db database, it will a newly-increased data (other fields are simultaneously unaware of, it may be possible to by generating from the mode for increasing int or default settings).Performing this A name=demo_name, the number of area=demo_area, price=100 will be increased after a step, in tables of data newly According to possible others fields are provided with from increment or default value, such as id=10, status=0 in this data.
If the insertion operation is the step 2 in all steps, i.e. step number N=2, needed when in subsequent operating procedure X This id (i.e. 10) is used, although can not know that the value of this id is 10 before really executing operating procedure X, It is set using after $ { 2:id }, goes to operating procedure X, so that it may be substituted for actual numerical value 10.For example, rear Status is revised as to other numerical value again in one update operating procedure X in face:
When going to operating procedure X, $ { 2:id } is replaced with the id value in the output result that the step number is 2, i.e., The value of id after the insert data of front.
Then, operation data constructor, operation platform parse in the rule description carried out previously by excel table Basic information and form information, and the forms pages for generating the webpage that user can fill in are rendered, it submits, connects after being filled in by user Receive the key message for being input to forms pages for submitting.
Then, operation platform parses the operating procedure in the rule description carried out previously by excel table, step by step Operating procedure is executed, calling interface or database is operated, and returns to the result exported after operation processing.When going to certain A operating procedure, the step description in be just replaced in the event of specific character string.Specifically, a kind of situation is $ Character string as { form:key } or $ { form:key1, key2 ... keyn }, then just by the character string form information It is middle that the corresponding value of key key (or key1, key2 ... keyn) come up actually is submitted to replace;Another situation is $ { step Serial number: key } or this kind of character string such as $ { step number: key1, key2 ... keyn }, then just will be corresponding in the character string One or more elements in result that step number is N, being exported after the n-th operating procedure before this operating procedure executes That is the value of key key (or key1, key2, keyn etc.) replaces the value of the key key needed in this operating procedure.
Finally, exporting Debugging message after executing to each operating procedure, including practical operation walks after step description, replacement Result etc. after rapid parameter, execution operation, to complete the construction of entire test data.
Since (construction rule template), the foundation of excel, management, dimension is described to rule by establishing excel table More simple and effective is protected, and is described by the rule of the excel, can will establish relation mechanism between the information for carrying out data configuration, Also, when carrying out data configuration, platform is also easier to parse.Thus, carry out again automatic structure without developing program code every time It makes.
Further, when carrying out data configuration, platform is believed according to main basic information, list in the rule description of excel Breath can automatically generate forms pages, and parsing is simple and fast, other people is also facilitated to use, and be conducive to team's shared data construction Experience.Further, each link and each operating procedure of data configuration are executed, the result etc. after all execution can be believed Breath output, easily positions each link and operating procedure.
Based on this understanding, server relevant to the application realization one embodiment of the above method comprising processing Device and memory, memory are configured to store the processing routine of each step of an embodiment of the above method, and processor is then matched It sets for executing the program stored in the memory.
Based on this understanding, the application realizes all or part of the process in an embodiment of the above method, can also be with Relevant hardware is instructed to complete by computer program, the computer program can be stored in a computer-readable storage In medium, the computer program is when being executed by processor, it can be achieved that the step of above-mentioned each embodiment of the method.Wherein, described Computer program includes computer program code, the computer program code can for source code form, object identification code form, Executable file or certain intermediate forms etc..The computer-readable medium may include: that can carry the computer program Any entity or device of code, medium, USB flash disk, mobile hard disk, magnetic disk, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunications letter Number and software distribution medium etc..It should be noted that the content that the computer-readable medium includes can be managed according to the administration of justice Local legislation and the requirement of patent practice carry out increase and decrease appropriate, such as in certain jurisdictions, according to legislation and patent Practice, computer-readable medium does not include electric carrier signal and telecommunication signal.
Although the preferred embodiment of the application has been described, it is created once a person skilled in the art knows basic Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as It selects embodiment and falls into all change and modification of this specification range.Obviously, those skilled in the art can be to this Shen Various modification and variations please be carry out without departing from spirit and scope.If in this way, these modifications and change of the application Type belongs within the scope of the claim of this application and its equivalent technologies, then the application is also intended to encompass these modification and variations and exists It is interior.

Claims (20)

1. a kind of data configuration method for carrying out regular description by excel table, comprising:
Parsing carries out the basic information and form information of regular description by excel table, to generate forms pages;
Parsing carries out the operating procedure of regular description by excel table, with the Keyword Selection according to described in operating procedure Corresponding operation target executes the operating procedure;
When executing the operating procedure, the knot based on the key message and operating procedure before that are inputted in the forms pages Fruit is replaced the specific character string in the rule description of the operating procedure of execution;
The Debugging message of each operating procedure is exported to complete data configuration.
2. the method as described in claim 1, described to carry out regular description by excel, comprising:
The excel table is established, regular description is carried out, the excel table includes basic information, form information and operation step Suddenly.
3. method according to claim 2,
The basic information includes the effect of rule description, maintenance people;
The form information includes the key message for needing the operating procedure of user's hand filling to need when executing;
The operating procedure includes: the corresponding one individually operation of each operating procedure, and each individually operation has corresponding behaviour Make target, each operating procedure is provided with corresponding parameter;
Wherein, operating procedure is associated with according to specific character string with form information, by operating procedure and is grasped according to specific character string Make to be associated between step.
4. method as claimed in claim 3, the operation target is included at least:
Call one or more interface targets of test environment;And/or
Data modification is carried out within the storage system.
5. method as claimed in claim 4 generates forms pages, comprising:
The web form page is generated based on the form information, to fill in the key message in form information.
6. method as claimed in claim 5, further includes:
It receives the forms pages and submits the key message to come up.
7. the method as described in claim 1, parsing carries out the operating procedure of regular description by excel table, according to behaviour The corresponding operation target of Keyword Selection made in step executes each operating procedure, comprising:
The each operating procedure for executing excel table step by step, to corresponding database storage system target or interface target It is operated.
8. the method as described in claim 1, when executing the operating procedure, based on the key inputted in the forms pages Information and operating procedure before as a result, being taken to the specific character string in the rule description of the operating procedure of execution Value replacement, specifically includes:
Operating procedure rule description in specific character string include:
It indicates the character string { form:key } of the key message key inputted in forms pages, is believed with operation associated step and list Breath;
Indicate the character string of the output result key of the step serial number N operating procedure before the operating procedure of execution { step number N:key }, will be associated between operating procedure and operating procedure;
When executing the operating procedure, the character string $ { form:key } occurred in the operating procedure of execution is replaced with The practical value of the key message key inputted in the forms pages;
When executing the operating procedure, the character string $ { step number N:key } occurred in the operating procedure of execution is replaced It is changed to the value of the output result key of operating procedure N.
9. method according to claim 8 exports the Debugging message of each step to complete data configuration, comprising:
Debugging message is exported after executing to each operating procedure to complete data configuration;
Wherein, Debugging message includes at least: operating procedure description, replaced practical operation step parameter and operating result.
10. a kind of data configuration system for carrying out regular description by excel table, comprising:
Generation unit is parsed, for parsing the basic information and form information that pass through excel table and carry out regular description, to generate Forms pages;
Resolution executing, for parsing the operating procedure for passing through excel table and carrying out regular description, according in operating procedure The corresponding operation target of the Keyword Selection of description executes the operating procedure;
Replacement unit is used for when executing the operating procedure, based on the key message inputted in the forms pages and before Operating procedure as a result, being replaced to the specific character string in the rule description of the operating procedure of execution;
Output unit, for exporting the Debugging message of each operating procedure to complete data configuration.
11. system as claimed in claim 10, described carry out regular description by excel, further includes:
The excel table is established, regular description is carried out, the excel table includes basic information, form information and operation step Suddenly.
12. system as claimed in claim 11,
The basic information includes the effect of rule description, maintenance people;And/or
The form information includes the key message for needing the operating procedure of user's hand filling to need when executing;
The operating procedure includes: the corresponding one individually operation of each operating procedure, and each individually operation has corresponding behaviour Make target, each operating procedure is provided with corresponding parameter;
Wherein, operating procedure is associated with according to specific character string with form information, by operating procedure and is grasped according to specific character string Make to be associated between step.
13. system as claimed in claim 12, the operation target includes at least:
Call one or more interface targets of test environment;And/or
Data modification is carried out within the storage system.
14. system as claimed in claim 13, parsing generation unit, further includes:
For generating the web form page based on the form information, to fill in the key message in form information.
15. system as claimed in claim 14, further includes:
Receiving unit submits the key message to come up for receiving the forms pages.
16. system as claimed in claim 10, resolution executing, further includes:
For executing each operating procedure of excel table step by step, to corresponding database storage system target or interface Target is operated.
17. system as claimed in claim 10, replacement unit, further includes:
Operating procedure rule description in specific character string include:
It indicates the character string { form:key } of the key message key inputted in forms pages, is believed with operation associated step and list Breath;
Indicate the character string of the output result key of the step serial number N operating procedure before the operating procedure of execution { step number N:key }, will be associated between operating procedure and operating procedure;
When executing the operating procedure, the character string $ { form:key } occurred in the operating procedure of execution is replaced with The practical value of the key message key inputted in the forms pages;
When executing the operating procedure, the character string $ { step number N:key } occurred in the operating procedure of execution is replaced It is changed to the value of the output result key of operating procedure N.
18. system as claimed in claim 17, output unit, further includes:
For exporting Debugging message after executing to each operating procedure to complete data configuration;Wherein, Debugging message includes at least: Operating procedure description, replaced practical operation step parameter and operating result,.
19. a kind of server, including processor and memory:
The memory is used to store the program that perform claim requires any one of 1 to 9 the method;
The processor is configured to for executing the program stored in the memory.
20. a kind of computer readable storage medium, is stored with computer program, which is characterized in that the program is held by processor The step of any one of claims 1 to 9 the method is realized when row.
CN201811636432.6A 2018-12-29 2018-12-29 Data construction method and system for rule description through excel Active CN109857735B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811636432.6A CN109857735B (en) 2018-12-29 2018-12-29 Data construction method and system for rule description through excel

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811636432.6A CN109857735B (en) 2018-12-29 2018-12-29 Data construction method and system for rule description through excel

Publications (2)

Publication Number Publication Date
CN109857735A true CN109857735A (en) 2019-06-07
CN109857735B CN109857735B (en) 2021-05-04

Family

ID=66893290

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811636432.6A Active CN109857735B (en) 2018-12-29 2018-12-29 Data construction method and system for rule description through excel

Country Status (1)

Country Link
CN (1) CN109857735B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111931471A (en) * 2020-08-31 2020-11-13 平安银行股份有限公司 Form collection method and device, electronic equipment and storage medium
CN115081416A (en) * 2022-08-23 2022-09-20 中科科界(北京)科技有限公司 Voting generation method and device based on file parsing transcoding and configuration

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103778107A (en) * 2012-10-25 2014-05-07 上海宝信软件股份有限公司 Method and platform for quickly and dynamically generating form based on EXCEL
CN103970737A (en) * 2013-01-24 2014-08-06 腾讯科技(深圳)有限公司 Data constitution method and device
CN107729003A (en) * 2017-11-20 2018-02-23 江苏神州信源系统工程有限公司 Automatic generation method, device and the electronic equipment of code
CN108268525A (en) * 2016-12-30 2018-07-10 深圳市优朋普乐传媒发展有限公司 A kind of report implementation method and device based on Excel template

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103778107A (en) * 2012-10-25 2014-05-07 上海宝信软件股份有限公司 Method and platform for quickly and dynamically generating form based on EXCEL
CN103970737A (en) * 2013-01-24 2014-08-06 腾讯科技(深圳)有限公司 Data constitution method and device
CN108268525A (en) * 2016-12-30 2018-07-10 深圳市优朋普乐传媒发展有限公司 A kind of report implementation method and device based on Excel template
CN107729003A (en) * 2017-11-20 2018-02-23 江苏神州信源系统工程有限公司 Automatic generation method, device and the electronic equipment of code

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111931471A (en) * 2020-08-31 2020-11-13 平安银行股份有限公司 Form collection method and device, electronic equipment and storage medium
CN111931471B (en) * 2020-08-31 2024-04-16 平安银行股份有限公司 Form collection method, form collection device, electronic equipment and storage medium
CN115081416A (en) * 2022-08-23 2022-09-20 中科科界(北京)科技有限公司 Voting generation method and device based on file parsing transcoding and configuration

Also Published As

Publication number Publication date
CN109857735B (en) 2021-05-04

Similar Documents

Publication Publication Date Title
US10705942B1 (en) Simulated testing of API
CN109460279A (en) Forms pages development approach, device, equipment and storage medium based on small routine
CN111026470B (en) System and method for verification and conversion of input data
US9218269B2 (en) Testing multiple target platforms
US8812298B1 (en) Macro replacement of natural language input
US20190340230A1 (en) System and method for generating websites from predefined templates
CN112463797A (en) Report generation method, system, storage medium and electronic equipment
CN112000330B (en) Configuration method, device, equipment and computer storage medium of modeling parameters
US20060085761A1 (en) Text masking provider
CN112860247B (en) Custom generation method, device, equipment and medium of model component
US20210124752A1 (en) System for Data Collection, Aggregation, Storage, Verification and Analytics with User Interface
CN106897153A (en) Call the method and system of API
CN108460068A (en) Method, apparatus, storage medium and the terminal that report imports and exports
CN109740129A (en) Report form generation method, device, equipment and readable storage medium storing program for executing based on block chain
CN109857735A (en) A kind of data configuration method and system carrying out regular description by excel
CN109669678A (en) Template engine integration method, device, electronic equipment and storage medium
US11876756B2 (en) Graph-based natural language generation for conversational systems
CN110704394B (en) Report configuration modification method and device
CN109213782B (en) Search interface configuration and display method and device and communication equipment
CN112948264B (en) Method and device for executing test task, system, storage medium and electronic device
JP2019101889A (en) Test execution device and program
CN117093798A (en) Rendering abnormality detection method and device, electronic equipment and storage medium
CN116304211A (en) Information interception method, device and equipment based on graph calculation and readable storage medium
CN110413279A (en) Data load method and device
CN114064716B (en) Metadata-based automatic WEB report generation method and device

Legal Events

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