CN106326121A - Method for automatically generating test script and terminal - Google Patents

Method for automatically generating test script and terminal Download PDF

Info

Publication number
CN106326121A
CN106326121A CN201610705635.0A CN201610705635A CN106326121A CN 106326121 A CN106326121 A CN 106326121A CN 201610705635 A CN201610705635 A CN 201610705635A CN 106326121 A CN106326121 A CN 106326121A
Authority
CN
China
Prior art keywords
test
script
parameter
parameter value
entry
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201610705635.0A
Other languages
Chinese (zh)
Inventor
王庆丰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
OneConnect Smart Technology Co Ltd
Original Assignee
Shanghai Billion Through Internet 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 Billion Through Internet Technology Co Ltd filed Critical Shanghai Billion Through Internet Technology Co Ltd
Priority to CN201610705635.0A priority Critical patent/CN106326121A/en
Publication of CN106326121A publication Critical patent/CN106326121A/en
Pending legal-status Critical Current

Links

Classifications

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

Abstract

The invention discloses a method for automatically generating a test script. The method comprises the following steps: after a test script generation instruction sent by a user is received by a script generation terminal, enabling the script generation terminal to generate and display a test script parameter setting interface; after all test step parameter input items and corresponding script parameters input on the test script parameter setting interface by the user are received, according to mapping relationship between a control name and a test code, determining the test code corresponding to each test step parameter input item; according to a preset rule, filling the corresponding test codes with test parameter values corresponding to all the test step parameter input items, and generating standard test codes; according to a selected increase sequence of all the test step parameter input items by the user, sequentially splicing all the standard test codes, and generating a standard test script document. The invention also discloses the script generation terminal for automatically generating the test script. The method has the advantages that the artificial writing of the test script by the user is not needed, the labor cost is reduced, and the maintenance is easy.

Description

The automatic generation method of test script and terminal
Technical field
The present invention relates to field of computer technology, particularly relate to automatic generation method and the terminal of a kind of test script.
Background technology
At present, the automatic test of cloud test platform for APP operation interface control is substantially needs and uploads and write Good test script, or download a client recording test script write and then upload the cloud test platform of APP.This Two ways is required to write the test script of correspondence, not only wasting manpower and material resources for APP operation interface, and has coding Certain requirement, safeguards inconvenience.
Summary of the invention
Present invention is primarily targeted at automatic generation method and the terminal that a kind of test script is provided, it is intended to according to user Instruction automatically generates test script.
For achieving the above object, the automatic generation method of a kind of test script that the present invention provides, described method include with Lower step:
Script generation terminal, after receiving the test script generation instruction that user sends, generates and shows a test script Parameter arranges interface, and described test script parameter arranges interface and includes that testing procedure increases button and selects in order for user to increase Adding testing procedure parameter typing entry, described testing procedure parameter typing entry includes script argument entry item, and described script is joined Number entry item includes control title entry item, action type entry item and test parameter value entry item;
Described script generation terminal arranges each test of interface typing receiving user based on described test script parameter After the script argument of step parameter typing entry and correspondence thereof, according to reflecting between predetermined control title and test code Penetrate relation, determine the test code that each testing procedure parameter typing entry of reception is corresponding;
Described script generates terminal by preset rules by each corresponding for each testing procedure parameter typing entry test ginseng Numerical value is inserted in the test code of correspondence, to generate standard testing code;
Described script generates terminal according to user to the selection increase of each testing procedure parameter typing entry order, will be each Standard testing code corresponding to individual testing procedure parameter typing entry is stitched together, in order to generate a standard testing foot Presents.
Preferably, described preset rules is:
According to the mapping relations between predetermined test parameter Value Types and key word, search out from test code The key word corresponding with each test parameter Value Types, and the key word searched is replaced with the test parameter Value Types of correspondence Test parameter value.
Preferably, described preset rules is:
According to the mapping relations between predetermined test parameter Value Types and insertion mark, search for from test code Go out the insertion mark corresponding with each test parameter Value Types, and at the insertion mark searched, insert corresponding test parameter The test parameter value of Value Types.
Preferably, described test parameter Value Types include test user name Parameter Value Type, test cryptographic parameter Value Types, Parameter Value Type clicked on by button.
Preferably, described testing procedure parameter typing entry also includes that preset kind operates button, and the method also includes step Rapid:
Described script generates terminal and is receiving user based on preset kind corresponding to a testing procedure parameter typing entry After the operational order of operation button, the operational order that response receives, this testing procedure parameter typing entry is carried out preset kind Operation.
Additionally, for achieving the above object, the present invention also provides for a kind of script automatically generating test script and generates terminal, institute State script generation terminal to include:
Generation module, for after receiving the test script generation instruction that user sends, generates and shows a test foot This parameter arranges interface, and described test script parameter arranges interface and includes that testing procedure increases button and selects in order for user Increasing testing procedure parameter typing entry, described testing procedure parameter typing entry includes script argument entry item, described script Parameter entry item includes control title entry item, action type entry item and test parameter value entry item;
Determine module, for receiving user and arrange based on described test script parameter each testing procedure of interface typing After the script argument of parameter typing entry and correspondence thereof, close according to the mapping between predetermined control title and test code System, determines the test code that each testing procedure parameter typing entry of reception is corresponding;
Fill in module, be used for each corresponding for each testing procedure parameter typing entry test parameter value by preset rules Insert in the test code of correspondence, to generate standard testing code;
Concatenation module, for according to user to the selection increase of each testing procedure parameter typing entry order, by each Standard testing code corresponding to testing procedure parameter typing entry is stitched together, in order to generate a standard testing script File.
Preferably, described preset rules is:
According to the mapping relations between predetermined test parameter Value Types and key word, search out from test code The key word corresponding with each test parameter Value Types, and the key word searched is replaced with the test parameter Value Types of correspondence Test parameter value.
Preferably, described preset rules is:
According to the mapping relations between predetermined test parameter Value Types and insertion mark, search for from test code Go out the insertion mark corresponding with each test parameter Value Types, and at the insertion mark searched, insert corresponding test parameter The test parameter value of Value Types.
Preferably, described test parameter Value Types include test user name Parameter Value Type, test cryptographic parameter Value Types, Parameter Value Type clicked on by button.
Preferably, described testing procedure parameter typing entry also includes that preset kind operates button, and described script generates eventually End also includes:
Respond module, for receiving user based on preset kind operation corresponding to testing procedure parameter typing entry After the operational order of button, the operational order that response receives, this testing procedure parameter typing entry is carried out preset kind operation.
The automatic generation method of a kind of test script that the present invention proposes and terminal, receiving the test script that user sends After generating instruction, generate one and record for user input test step parameter typing entry such as control title entry item, action type The test script parameter entering item and test parameter value entry item arranges interface, and according to predetermined control title and test generation Mapping relations between Ma, determine the test code that each testing procedure parameter typing entry of reception is corresponding;Each is surveyed Try each test parameter value corresponding to step parameter typing entry and insert generation standard testing code in corresponding test code, will Standard testing code corresponding to each testing procedure parameter typing entry splices in order and generates final standard testing script literary composition Part.Control title, action type and the survey tested need to be carried out owing to user only need to arrange input in interface in test script parameter Examination parameter value, can automatically generate corresponding standard testing script file, it is not necessary to user carries out artificial test script and writes, joint About human cost, and be easily maintained.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of the automatic generation method first embodiment of test script of the present invention;
Fig. 2 is the schematic flow sheet of automatic generation method second embodiment of test script of the present invention;
Fig. 3 is the high-level schematic functional block diagram that the present invention automatically generates the script generation terminal first embodiment of test script;
Fig. 4 is the high-level schematic functional block diagram that the present invention automatically generates script generation terminal second embodiment of test script.
The realization of the object of the invention, functional characteristics and advantage will in conjunction with the embodiments, are described further referring to the drawings.
Detailed description of the invention
Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
The present invention provides the automatic generation method of a kind of test script.
Schematic flow sheet with reference to the automatic generation method first embodiment that Fig. 1, Fig. 1 are test script of the present invention.
In the first embodiment, the automatic generation method of this test script includes:
Step S10, script generation terminal, after receiving the test script generation instruction that user sends, generates and shows one Test script parameter arranges interface, and described test script parameter arranges interface and includes that testing procedure increases button and presses for user suitable Sequence selects to increase testing procedure parameter typing entry, and described testing procedure parameter typing entry includes script argument entry item, institute State script argument entry item and include control title entry item, action type entry item and test parameter value entry item;
In the present embodiment, user carries out the automatic of the test such as cloud test platform for APP operation interface control at needs When changing test, not directly by the test script that manual compiling is corresponding, but first generate terminal such as individual electricity to default script Brain, testing service device etc. send test script and generate instruction.Script generates terminal and is receiving the test script generation that user sends After instruction, generate and show that a test script parameter arranges interface, generating the test foot of terminal demonstration for user at script This parameter arranges and inputs, according to its testing requirement, each test parameter that need to insert in test script on interface.
Described test script parameter arranges interface and includes that testing procedure increases button, and user can be by each survey selecting increase The rapid order of try clicks on the testing procedure that described test script parameter arranges in interface successively increases button, thus in order Select to increase testing procedure parameter typing entry.Described testing procedure parameter typing entry includes script argument entry item, described Script argument entry item includes control title entry item, action type entry item and test parameter value entry item.
Wherein, user, both can be from predetermined control title when carrying out the typing of described control title entry item Testing procedure parameter as belonging to select in titles such as " user name input frame, Password Input frame, Button Login, user's head portrait buttons " The control title that typing entry is corresponding, it is also possible to manually entered the control that affiliated testing procedure parameter typing entry is corresponding by user Title, does not limits at this.
User, both can be from predetermined action type as " defeated when carrying out the typing of described action type entry item Enter, click on " etc. action type selects belonging to action type corresponding to testing procedure parameter typing entry, it is also possible to by user's hands The action type that testing procedure parameter typing entry belonging to work input is corresponding, does not limits at this.
User, both can from predetermined test parameter value such as when carrying out the typing of described test parameter value entry item " test user name parameter value be ' Jack ', test cryptographic parameter value for ' 123456 ', button click on parameter value for ' N/A ' " etc. survey The test parameter value that testing procedure parameter typing entry belonging to selecting in examination parameter value is corresponding, it is also possible to manually entered institute by user Belong to the test parameter value that testing procedure parameter typing entry is corresponding, do not limit at this.
Step S20, described script generates terminal and arranges interface typing based on described test script parameter receiving user After the script argument of each testing procedure parameter typing entry and correspondence thereof, according to predetermined control title and test code Between mapping relations, determine the test code that each testing procedure parameter typing entry of reception is corresponding;
Described script generation terminal arranges each test of interface typing receiving user based on described test script parameter After script argument such as control title, action type and the test parameter value of step parameter typing entry and correspondence, according in advance Mapping relations between the different control titles and the test code that first determine, and each testing procedure parameter typing bar received Control title in mesh, determines the test code that each testing procedure parameter typing entry of reception is corresponding.Such as, can be in advance Determine control title " user name input frame ", " Password Input frame ", " Button Login ", the test generation of " user's head portrait button " correspondence Code is " X1 ", " X2 ", " X3 ", " X4 ", is receiving user and arrange based on described test script parameter the testing procedure of interface typing When in parameter typing entry, the control name of input is referred to as " user name input frame ", it is judged that the current testing procedure of user be to " use Name in an account book input frame " test, i.e. can determine that the test code that current testing procedure is corresponding is " X1 ", directly transfer test generation Code " X1 " is as the basic test code being subsequently generated test script.
Step S30, described script generates terminal by preset rules by corresponding for each testing procedure parameter typing entry each Individual test parameter value is inserted in the test code of correspondence, to generate standard testing code;
In described script generation terminal according to the mapping relations between predetermined different control titles and test code, And the control title in each testing procedure parameter typing entry received, determine each testing procedure parameter record of reception After entering the test code that entry is corresponding, transfer the test code determined, and each testing procedure parameter typing entry is corresponding Each test parameter value insert by preset rules determine test code in relevant position in, generate each testing procedure record Enter the standard testing code that entry is corresponding.
Step S40, described script generates terminal to be increased the selection of each testing procedure parameter typing entry according to user Sequentially, standard testing code corresponding for each testing procedure parameter typing entry is stitched together in order, to generate one Standard testing script file.
After generating the standard testing code that each testing procedure typing entry is corresponding, according to user at described test script Parameter arranges the order clicking on testing procedure increase button in interface namely the selection to each testing procedure parameter typing entry Increase order, splices one the most successively by standard testing code corresponding for each testing procedure parameter typing entry generated Rise, ultimately generate a standard testing script file.This standard testing script file comprises the basis to each testing procedure Test code, and the test parameter value of each testing procedure, can be by this standard testing script file pair automatically generated Each testing procedure carries out complete test.
In the present embodiment after receiving the test script generation instruction that user sends, generate one and walk for user's input test Rapid parameter typing entry such as control title entry item, action type entry item and the test script parameter of test parameter value entry item Interface is set, and according to the mapping relations between predetermined control title and test code, determines each survey of reception The test code that examination step parameter typing entry is corresponding;By each corresponding for each testing procedure parameter typing entry test parameter Value is inserted and is generated standard testing code in corresponding test code, standard corresponding for each testing procedure parameter typing entry is surveyed Examination code splices the standard testing script file that generation is final in order.Owing to user only need to arrange interface in test script parameter Middle input need to carry out control title, action type and the test parameter value tested, and can automatically generate corresponding standard testing foot Presents, it is not necessary to user carries out artificial test script and writes, and has saved human cost, and has been easily maintained.
Further, in other embodiments, above-mentioned preset rules may include that
According to the mapping relations between predetermined test parameter Value Types and key word, search out from test code The key word corresponding with each test parameter Value Types, and the key word searched is replaced with the test parameter Value Types of correspondence Test parameter value.
In the present embodiment, each corresponding for each testing procedure parameter typing entry test parameter value is being pressed preset rules When inserting in the relevant position in the test code determined, can be according to predetermined different test parameter Value Types and key word Between mapping relations, from the test code determined, search out the key word corresponding with each test parameter Value Types, and will The key word searched from the test code determined replaces with the test parameter value of the test parameter Value Types of correspondence, to generate The standard testing code that each testing procedure typing entry is corresponding.Wherein, described test parameter Value Types includes but not limited to survey Parameter Value Type clicked on by name in an account book Parameter Value Type on probation, test cryptographic parameter Value Types, button.Such as, test can be predefined The key word that user name Parameter Value Type is corresponding is " username ", then search out " username " from the test code determined After, " username " in the test code that can will determine replaces with the test parameter of the test user name Parameter Value Type of correspondence Value " Jack ".
Further, in other embodiments, above-mentioned preset rules can also include:
According to the mapping relations between predetermined test parameter Value Types and insertion mark, search for from test code Go out the insertion mark corresponding with each test parameter Value Types, and at the insertion mark searched, insert corresponding test parameter The test parameter value of Value Types.
In the present embodiment, each corresponding for each testing procedure parameter typing entry test parameter value is being pressed preset rules When inserting in the relevant position in the test code determined, can mark with inserting according to predetermined different test parameter Value Types Mapping relations between knowledge, search out the insertion mark corresponding with each test parameter Value Types from the test code determined, And at the insertion mark searched, insert the test parameter value of corresponding test parameter Value Types, to generate each testing procedure The standard testing code that typing entry is corresponding.Wherein, described test parameter Value Types includes but not limited to test user name parameter Parameter Value Type clicked on by Value Types, test cryptographic parameter Value Types, button.Such as, test user name parameter value can be predefined Insertion corresponding to type is designated " username: ", then search out from the test code determined that " username: after ", can be Insertion mark " the username: " place searched inserts the test parameter value " Jack " of corresponding test parameter Value Types, The test parameter value " username:Jack " of the test parameter Value Types of correspondence is inserted in test code.
As in figure 2 it is shown, second embodiment of the invention proposes the automatic generation method of a kind of test script, described testing procedure Parameter typing entry also includes that preset kind operates button, on the basis of above-described embodiment, also includes:
Step S50, described script generates terminal to receive user corresponding based on a testing procedure parameter typing entry After the operational order of preset kind operation button, the operational order that response receives, this testing procedure parameter typing entry is carried out Preset kind operates.
In the present embodiment, described testing procedure parameter typing entry also includes that preset kind operation button as above moves, moves down And/or the operation button such as deletion.Described script generates terminal and is receiving user based on a testing procedure parameter typing entry pair After the operational order of the preset kind operation button answered, the operational order that response receives, to this testing procedure parameter typing entry Carry out preset kind operation.Such as, user can operate button by clicking on the upper shifting of this testing procedure parameter typing entry, with Sending the instruction sequentially moved of this testing procedure parameter typing entry, described script generates terminal and is receiving this test step After the instruction sequentially moved of rapid parameter typing entry, by the sequentially shifting one of this testing procedure parameter typing entry;User Can be by clicking on the deletion action button of this testing procedure parameter typing entry, to send this testing procedure parameter typing bar The instruction that mesh is deleted, described script generation terminal, should after receiving the instruction of the deletion to this testing procedure parameter typing entry Testing procedure parameter typing entry is deleted.
The present embodiment can realize user is arranged the testing procedure parameter typing bar added in interface in test script parameter Mesh carry out upper shifting, move down, the operation such as deletion, more flexibly, conveniently.
The present invention further provides a kind of script automatically generating test script and generate terminal.
It is the functional module that the present invention automatically generates the script generation terminal first embodiment of test script with reference to Fig. 3, Fig. 3 Schematic diagram.
In the first embodiment, this script generation terminal automatically generating test script includes:
Generation module 01, for, after receiving the test script generation instruction that user sends, generating and show a test Script argument arranges interface, and described test script parameter arranges interface and includes that testing procedure increases button and selects in order for user Selecting increase testing procedure parameter typing entry, described testing procedure parameter typing entry includes script argument entry item, described foot This parameter entry item includes control title entry item, action type entry item and test parameter value entry item;
In the present embodiment, user carries out the automatic of the test such as cloud test platform for APP operation interface control at needs When changing test, not directly by the test script that manual compiling is corresponding, but first generate terminal such as individual electricity to default script Brain, testing service device etc. send test script and generate instruction.Script generates terminal and is receiving the test script generation that user sends After instruction, generate and show that a test script parameter arranges interface, generating the test foot of terminal demonstration for user at script This parameter arranges and inputs, according to its testing requirement, each test parameter that need to insert in test script on interface.
Described test script parameter arranges interface and includes that testing procedure increases button, and user can be by each survey selecting increase The rapid order of try clicks on the testing procedure that described test script parameter arranges in interface successively increases button, thus in order Select to increase testing procedure parameter typing entry.Described testing procedure parameter typing entry includes script argument entry item, described Script argument entry item includes control title entry item, action type entry item and test parameter value entry item.
Wherein, user, both can be from predetermined control title when carrying out the typing of described control title entry item Testing procedure parameter as belonging to select in titles such as " user name input frame, Password Input frame, Button Login, user's head portrait buttons " The control title that typing entry is corresponding, it is also possible to manually entered the control that affiliated testing procedure parameter typing entry is corresponding by user Title, does not limits at this.
User, both can be from predetermined action type as " defeated when carrying out the typing of described action type entry item Enter, click on " etc. action type selects belonging to action type corresponding to testing procedure parameter typing entry, it is also possible to by user's hands The action type that testing procedure parameter typing entry belonging to work input is corresponding, does not limits at this.
User, both can from predetermined test parameter value such as when carrying out the typing of described test parameter value entry item " test user name parameter value be ' Jack ', test cryptographic parameter value for ' 123456 ', button click on parameter value for ' N/A ' " etc. survey The test parameter value that testing procedure parameter typing entry belonging to selecting in examination parameter value is corresponding, it is also possible to manually entered institute by user Belong to the test parameter value that testing procedure parameter typing entry is corresponding, do not limit at this.
Determine module 02, for receiving user and arrange based on described test script parameter each test step of interface typing After the script argument of rapid parameter typing entry and correspondence thereof, according to the mapping between predetermined control title and test code Relation, determines the test code that each testing procedure parameter typing entry of reception is corresponding;
Described script generation terminal arranges each test of interface typing receiving user based on described test script parameter After script argument such as control title, action type and the test parameter value of step parameter typing entry and correspondence, according in advance Mapping relations between the different control titles and the test code that first determine, and each testing procedure parameter typing bar received Control title in mesh, determines the test code that each testing procedure parameter typing entry of reception is corresponding.Such as, can be in advance Determine control title " user name input frame ", " Password Input frame ", " Button Login ", the test generation of " user's head portrait button " correspondence Code is " X1 ", " X2 ", " X3 ", " X4 ", is receiving user and arrange based on described test script parameter the testing procedure of interface typing When in parameter typing entry, the control name of input is referred to as " user name input frame ", it is judged that the current testing procedure of user be to " use Name in an account book input frame " test, i.e. can determine that the test code that current testing procedure is corresponding is " X1 ", directly transfer test generation Code " X1 " is as the basic test code being subsequently generated test script.
Fill in module 03, be used for each corresponding for each testing procedure parameter typing entry test parameter by preset rules Value is inserted in the test code of correspondence, to generate standard testing code;
In described script generation terminal according to the mapping relations between predetermined different control titles and test code, And the control title in each testing procedure parameter typing entry received, determine each testing procedure parameter record of reception After entering the test code that entry is corresponding, transfer the test code determined, and each testing procedure parameter typing entry is corresponding Each test parameter value insert by preset rules determine test code in relevant position in, generate each testing procedure record Enter the standard testing code that entry is corresponding.
Concatenation module 04, for according to user to the selection increase of each testing procedure parameter typing entry order, will be each Standard testing code corresponding to individual testing procedure parameter typing entry is stitched together, in order to generate a standard testing foot Presents.
After generating the standard testing code that each testing procedure typing entry is corresponding, according to user at described test script Parameter arranges the order clicking on testing procedure increase button in interface namely the selection to each testing procedure parameter typing entry Increase order, splices one the most successively by standard testing code corresponding for each testing procedure parameter typing entry generated Rise, ultimately generate a standard testing script file.This standard testing script file comprises the basis to each testing procedure Test code, and the test parameter value of each testing procedure, can be by this standard testing script file pair automatically generated Each testing procedure carries out complete test.
In the present embodiment after receiving the test script generation instruction that user sends, generate one and walk for user's input test Rapid parameter typing entry such as control title entry item, action type entry item and the test script parameter of test parameter value entry item Interface is set, and according to the mapping relations between predetermined control title and test code, determines each survey of reception The test code that examination step parameter typing entry is corresponding;By each corresponding for each testing procedure parameter typing entry test parameter Value is inserted and is generated standard testing code in corresponding test code, standard corresponding for each testing procedure parameter typing entry is surveyed Examination code splices the standard testing script file that generation is final in order.Owing to user only need to arrange interface in test script parameter Middle input need to carry out control title, action type and the test parameter value tested, and can automatically generate corresponding standard testing foot Presents, it is not necessary to user carries out artificial test script and writes, and has saved human cost, and has been easily maintained.
Further, in other embodiments, above-mentioned preset rules may include that
According to the mapping relations between predetermined test parameter Value Types and key word, search out from test code The key word corresponding with each test parameter Value Types, and the key word searched is replaced with the test parameter Value Types of correspondence Test parameter value.
In the present embodiment, each corresponding for each testing procedure parameter typing entry test parameter value is being pressed preset rules When inserting in the relevant position in the test code determined, can be according to predetermined different test parameter Value Types and key word Between mapping relations, from the test code determined, search out the key word corresponding with each test parameter Value Types, and will The key word searched from the test code determined replaces with the test parameter value of the test parameter Value Types of correspondence, to generate The standard testing code that each testing procedure typing entry is corresponding.Wherein, described test parameter Value Types includes but not limited to survey Parameter Value Type clicked on by name in an account book Parameter Value Type on probation, test cryptographic parameter Value Types, button.Such as, test can be predefined The key word that user name Parameter Value Type is corresponding is " username ", then search out " username " from the test code determined After, " username " in the test code that can will determine replaces with the test parameter of the test user name Parameter Value Type of correspondence Value " Jack ".
Further, in other embodiments, above-mentioned preset rules can also include:
According to the mapping relations between predetermined test parameter Value Types and insertion mark, search for from test code Go out the insertion mark corresponding with each test parameter Value Types, and at the insertion mark searched, insert corresponding test parameter The test parameter value of Value Types.
In the present embodiment, each corresponding for each testing procedure parameter typing entry test parameter value is being pressed preset rules When inserting in the relevant position in the test code determined, can mark with inserting according to predetermined different test parameter Value Types Mapping relations between knowledge, search out the insertion mark corresponding with each test parameter Value Types from the test code determined, And at the insertion mark searched, insert the test parameter value of corresponding test parameter Value Types, to generate each testing procedure The standard testing code that typing entry is corresponding.Wherein, described test parameter Value Types includes but not limited to test user name parameter Parameter Value Type clicked on by Value Types, test cryptographic parameter Value Types, button.Such as, test user name parameter value can be predefined Insertion corresponding to type is designated " username: ", then search out from the test code determined that " username: after ", can be Insertion mark " the username: " place searched inserts the test parameter value " Jack " of corresponding test parameter Value Types, The test parameter value " username:Jack " of the test parameter Value Types of correspondence is inserted in test code.
As shown in Figure 4, second embodiment of the invention proposes a kind of script automatically generating test script and generates terminal, described Testing procedure parameter typing entry also includes that preset kind operates button, on the basis of above-described embodiment, also includes:
Respond module 05, for receiving user based on preset kind behaviour corresponding to testing procedure parameter typing entry After making the operational order of button, the operational order that response receives, this testing procedure parameter typing entry is carried out preset kind behaviour Make.
In the present embodiment, described testing procedure parameter typing entry also includes that preset kind operation button as above moves, moves down And/or the operation button such as deletion.Described script generates terminal and is receiving user based on a testing procedure parameter typing entry pair After the operational order of the preset kind operation button answered, the operational order that response receives, to this testing procedure parameter typing entry Carry out preset kind operation.Such as, user can operate button by clicking on the upper shifting of this testing procedure parameter typing entry, with Sending the instruction sequentially moved of this testing procedure parameter typing entry, described script generates terminal and is receiving this test step After the instruction sequentially moved of rapid parameter typing entry, by the sequentially shifting one of this testing procedure parameter typing entry;User Can be by clicking on the deletion action button of this testing procedure parameter typing entry, to send this testing procedure parameter typing bar The instruction that mesh is deleted, described script generation terminal, should after receiving the instruction of the deletion to this testing procedure parameter typing entry Testing procedure parameter typing entry is deleted.
The present embodiment can realize user is arranged the testing procedure parameter typing bar added in interface in test script parameter Mesh carry out upper shifting, move down, the operation such as deletion, more flexibly, conveniently.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.By above embodiment party The description of formula, those skilled in the art it can be understood that can add required general to above-described embodiment method by software The mode of hardware platform realizes, naturally it is also possible to by hardware, but a lot of in the case of the former is more preferably embodiment.Based on Such understanding, the part that prior art is contributed by technical scheme the most in other words can be with software product Form embody, this computer software product is stored in a storage medium (such as ROM/RAM, magnetic disc, CD), including Some instructions are with so that a station terminal equipment (can be mobile phone, computer, server, or the network equipment etc.) performs this Method described in each embodiment bright.
These are only the preferred embodiments of the present invention, not thereby limit the scope of the claims of the present invention, every utilize this Equivalent structure or equivalence flow process that bright description and accompanying drawing content are made convert, or are directly or indirectly used in other relevant skills Art field, is the most in like manner included in the scope of patent protection of the present invention.

Claims (10)

1. the automatic generation method of a test script, it is characterised in that said method comprising the steps of:
Script generation terminal, after receiving the test script generation instruction that user sends, generates and shows a test script parameter Arranging interface, described test script parameter arranges interface and includes that testing procedure increases button and selects in order to increase for user to survey Examination step parameter typing entry, described testing procedure parameter typing entry includes script argument entry item, and described script argument is recorded Enter item and include control title entry item, action type entry item and test parameter value entry item;
Described script generation terminal arranges each testing procedure of interface typing receiving user based on described test script parameter After the script argument of parameter typing entry and correspondence thereof, close according to the mapping between predetermined control title and test code System, determines the test code that each testing procedure parameter typing entry of reception is corresponding;
Described script generates terminal by preset rules by each corresponding for each testing procedure parameter typing entry test parameter value Insert in the test code of correspondence, to generate standard testing code;
Described script generates terminal according to user to the selection increase of each testing procedure parameter typing entry order, each is surveyed The standard testing code trying step parameter typing entry corresponding is stitched together in order, to generate a standard testing script literary composition Part.
2. the automatic generation method of test script as claimed in claim 1, it is characterised in that described preset rules is:
According to the mapping relations between predetermined test parameter Value Types and key word, search out from test code with respectively The key word that individual test parameter Value Types is corresponding, and the key word searched is replaced with the survey of the test parameter Value Types of correspondence Examination parameter value.
3. the automatic generation method of test script as claimed in claim 1 or 2, it is characterised in that described preset rules is:
According to predetermined test parameter Value Types and insert mark between mapping relations, from test code search out with The insertion mark that each test parameter Value Types is corresponding, and at the insertion mark searched, insert corresponding test parameter value class The test parameter value of type.
4. the automatic generation method of test script as claimed in claim 3, it is characterised in that described test parameter Value Types bag Include test user name Parameter Value Type, test cryptographic parameter Value Types, button click Parameter Value Type.
5. the automatic generation method of test script as claimed in claim 1, it is characterised in that described testing procedure parameter typing Entry also includes that preset kind operates button, and the method further comprises the steps of:
Described script generates terminal and is receiving user based on preset kind operation corresponding to testing procedure parameter typing entry After the operational order of button, the operational order that response receives, this testing procedure parameter typing entry is carried out preset kind operation.
6. the script automatically generating test script generates terminal, it is characterised in that described script generates terminal and includes:
Generation module, for after receiving the test script generation instruction that user sends, generates and shows a test script ginseng Number arranges interface, and described test script parameter arranges interface and includes that testing procedure increases button and selects in order for user to increase Testing procedure parameter typing entry, described testing procedure parameter typing entry includes script argument entry item, described script argument Entry item includes control title entry item, action type entry item and test parameter value entry item;
Determine module, for receiving user and arrange based on described test script parameter each testing procedure parameter of interface typing After the script argument of typing entry and correspondence thereof, according to the mapping relations between predetermined control title and test code, Determine the test code that each testing procedure parameter typing entry of reception is corresponding;
Fill in module, for each corresponding for each testing procedure parameter typing entry test parameter value being inserted by preset rules In corresponding test code, to generate standard testing code;
Concatenation module, for according to user to the selection increase of each testing procedure parameter typing entry order, each is tested Standard testing code corresponding to step parameter typing entry is stitched together in order, to generate a standard testing script literary composition Part.
The script automatically generating test script the most as claimed in claim 6 generates terminal, it is characterised in that described preset rules For:
According to the mapping relations between predetermined test parameter Value Types and key word, search out from test code with respectively The key word that individual test parameter Value Types is corresponding, and the key word searched is replaced with the survey of the test parameter Value Types of correspondence Examination parameter value.
The script automatically generating test script the most as claimed in claims 6 or 7 generates terminal, it is characterised in that described default Rule is:
According to predetermined test parameter Value Types and insert mark between mapping relations, from test code search out with The insertion mark that each test parameter Value Types is corresponding, and at the insertion mark searched, insert corresponding test parameter value class The test parameter value of type.
The script automatically generating test script the most as claimed in claim 8 generates terminal, it is characterised in that described test parameter Value Types includes testing user name Parameter Value Type, test cryptographic parameter Value Types, button click Parameter Value Type.
The script automatically generating test script the most as claimed in claim 6 generates terminal, it is characterised in that described test step Rapid parameter typing entry also includes that preset kind operates button, and described script generates terminal and also includes:
Respond module, for receiving user based on preset kind operation button corresponding to testing procedure parameter typing entry Operational order after, the operational order that receives of response, this testing procedure parameter typing entry is carried out preset kind operation.
CN201610705635.0A 2016-08-22 2016-08-22 Method for automatically generating test script and terminal Pending CN106326121A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610705635.0A CN106326121A (en) 2016-08-22 2016-08-22 Method for automatically generating test script and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610705635.0A CN106326121A (en) 2016-08-22 2016-08-22 Method for automatically generating test script and terminal

Publications (1)

Publication Number Publication Date
CN106326121A true CN106326121A (en) 2017-01-11

Family

ID=57741889

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610705635.0A Pending CN106326121A (en) 2016-08-22 2016-08-22 Method for automatically generating test script and terminal

Country Status (1)

Country Link
CN (1) CN106326121A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107943683A (en) * 2017-10-30 2018-04-20 北京奇虎科技有限公司 A kind of test script generation method, device, electronic equipment and storage medium
CN108763066A (en) * 2018-05-15 2018-11-06 南京璇玑信息技术有限公司 A kind of natural language test script edit methods of word slot design and test machine people
CN109299005A (en) * 2018-09-05 2019-02-01 北京邮电大学 The generation method and device of test script
CN109522218A (en) * 2018-10-19 2019-03-26 平安科技(深圳)有限公司 Interface test method, device, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101025686A (en) * 2007-03-22 2007-08-29 中兴通讯股份有限公司 Automation test system and test script generating and operating method
US20090217302A1 (en) * 2008-02-27 2009-08-27 Accenture Global Services Gmbh Test script transformation architecture
CN102693183A (en) * 2012-05-30 2012-09-26 瑞斯康达科技发展股份有限公司 Method and system for realizing automatic software testing
CN104298595A (en) * 2014-09-29 2015-01-21 百视通网络电视技术发展有限责任公司 Automatic testing method and testing system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101025686A (en) * 2007-03-22 2007-08-29 中兴通讯股份有限公司 Automation test system and test script generating and operating method
US20090217302A1 (en) * 2008-02-27 2009-08-27 Accenture Global Services Gmbh Test script transformation architecture
CN102693183A (en) * 2012-05-30 2012-09-26 瑞斯康达科技发展股份有限公司 Method and system for realizing automatic software testing
CN104298595A (en) * 2014-09-29 2015-01-21 百视通网络电视技术发展有限责任公司 Automatic testing method and testing system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107943683A (en) * 2017-10-30 2018-04-20 北京奇虎科技有限公司 A kind of test script generation method, device, electronic equipment and storage medium
CN107943683B (en) * 2017-10-30 2021-07-30 北京奇虎科技有限公司 Test script generation method and device, electronic equipment and storage medium
CN108763066A (en) * 2018-05-15 2018-11-06 南京璇玑信息技术有限公司 A kind of natural language test script edit methods of word slot design and test machine people
CN109299005A (en) * 2018-09-05 2019-02-01 北京邮电大学 The generation method and device of test script
CN109522218A (en) * 2018-10-19 2019-03-26 平安科技(深圳)有限公司 Interface test method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN106326121A (en) Method for automatically generating test script and terminal
CN107908541B (en) Interface testing method and device, computer equipment and storage medium
CN107818162B (en) Bury a processing method, device, computer equipment and storage medium
CN103713889B (en) A kind of exploitation of application, compiling and adjustment method and device
CN104834595A (en) Visual automatic test method and system
CN104978258B (en) Automatic software test method and system
EP2778929B1 (en) Test script generation system
CN103744680B (en) Method and device for business process processing
CN102810105B (en) Edit method for pages accessed by mobile terminals and webpage editor
CN106776294B (en) Automatic android mobile phone testing method and system
CN100512274C (en) Device and method for simulating communication system capable of easily controlling protocol message
CN103714002B (en) Project testing method and device based on configuration system
US8204498B1 (en) Automated content download tool
CN107066272B (en) Page updating method and device
CN106326120B (en) A kind of regression testing method and device, electronic equipment of application software
CN106933729A (en) A kind of method of testing and system based on cloud platform
CN105991888A (en) Server device, operation image data providing method and information processing system
CN103914212B (en) A kind of terminal device and its application configuration method
CN104471530A (en) Executable software specification generation
CN109857668A (en) UI automated function test method, test device, test equipment and storage medium
CN105335139A (en) Webpage display method and apparatus
CN103402008A (en) Method and device for rapidly mass texting message
CN106330560A (en) Method and apparatus for switching server in system setting during IOS system test
CN108021503A (en) The method, apparatus and computer-readable storage medium of automated function test
CN105915490A (en) Security question interaction method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
CB02 Change of applicant information

Address after: 200030 Xuhui District, Shanghai Kai Bin Road 166, 9, 10 level.

Applicant after: Shanghai Financial Technologies Ltd

Address before: 200135 Pudong New Area, Shanghai, China (Shanghai) free trade trial area 2 Pudong road 2250 2 story room 1

Applicant before: Shanghai one track Internet Technology Co., Ltd.

Address after: 200135 Pudong New Area, Shanghai, China (Shanghai) free trade trial area 2 Pudong road 2250 2 story room 1

Applicant after: Shanghai one track Internet Technology Co., Ltd.

Address before: 200135 Pudong New Area, Shanghai, China (Shanghai) free trade trial area 2 Pudong road 2250 2 story room 1

Applicant before: Shanghai billion through Internet Technology Co., Ltd.

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20180530

Address after: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Applicant after: Shenzhen one ledger Intelligent Technology Co., Ltd.

Address before: 200030 Xuhui District, Shanghai Kai Bin Road 166, 9, 10 level.

Applicant before: Shanghai Financial Technologies Ltd

CB02 Change of applicant information
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination