The content of the invention
It is an object of the invention to provide a kind of edit methods of automatic test script, to realize quick editor's test pin
This, increases the reusability of test script, reduces the work of developer.
For achieving the above object, the invention provides a kind of edit methods of automatic test script, comprise the following steps:
Mapping form is generated according to test script to be edited;
Any row of the mapping form is selected to be operated;
The test script is automatically updated according to the operation.
Compared with prior art, the edit methods of automatic test script of the present invention, first according to test pin to be edited
This generation mapping form, after then any row in Choose for user form is operated, can automatically update test pin according to operation
This, it is achieved thereby that simply, quickly generating new test script on the basis of existing test script, increased test script
Reusability, reduce the work of developer.
It is preferred that the test script includes multiple script units, each script unit includes action type and control
Part is numbered, and one processing mode of each script unit correspondence.
It is preferred that " the generating mapping form according to test script to be edited " is specially:
The row information of the mapping form is generated according to the id that each script unit is stored in database;
Action type and control numbering according to included by the script unit generates the column information of the mapping form.
It is preferred that " the selecting any row of the mapping form to be operated " specifically includes:
Select any row of the mapping form;
The corresponding id of row according to selecting searches picture corresponding with the script unit and layout in database
File;
The picture is included, on interface, parsing the topology file and being shown on the picture;
Click the picture by right key to provide multiple operations;
Select any operation and perform.
It is preferred that the operation includes time delay, increases checkpoint, deletion, insertion circulation.
It is preferred that also including while described " automatically updating the test script according to the operation ":
The mapping form and the database are automatically updated according to the operation.
It is preferred that also including after described " automatically updating the test script according to the operation ":
Choose whether to preserve the renewal;
When selecting to be, the test script and the database after updating are preserved.
It is preferred that also including before described " generating mapping form according to test script to be edited ":
Select test script to be edited.
By description below and accompanying drawing is combined, the present invention will become more fully apparent, these accompanying drawings are used to explain the present invention
Embodiment.
Specific embodiment
With reference now to Description of Drawings embodiments of the invention, the element numbers being similar in accompanying drawing represent similar element.This
In invention, automatic test script is that, based on Android platform, each test script includes multiple script units, each script
Unit corresponds to a processing mode, and each script unit includes the information such as action type and control numbering, and such as qq was logged in
During Cheng Jinhang automatic tests, test script includes clicking on multiple operations such as account frame, input qq accounts, and these operations are as right
Processing mode in qq software test procedures.
Fig. 1 is refer to, the idiographic flow of one embodiment of edit methods of automatic test script of the present invention is described.As schemed
Shown in 1, comprise the following steps:
Step S101, arranges a form in automatic test software, it is stipulated that every a line correspondence of form shows script list
The id that unit is stored in database, each of which script unit correspond to a processing mode, and the row of form show script unit institute
Comprising content, such as action type and control numbering etc.;
Step S102, selects test script to be edited, clicks on editor;
Step S103, generates mapping form according to test script to be edited and the form for pre-setting;
Specifically, the id that each script unit is stored in database is corresponded to the row on form, then successively will be every
The action type and control numbering included by the corresponding script unit of a line is shown in the row of form, and the form for obtaining is and reflects
Firing table lattice, so as to generate mapping form, wherein action type bag according to test script to be edited and the form for pre-setting
Include click, it is long refer to table 1, described the schematic diagram of mapping form by, dragging, button, time delay and checkpoint etc., it is as follows
Shown in table 1, to click on control 2, the corresponding script unit of the operation is stored in data for the corresponding operation of the first row of mapping form
Id in storehouse is 1, the like, the full content of test script can be reflected so as to pass through the mapping form;
Table 1
Step S104, any row of Choose for user form;
Step S105, calls database, is searched and the script unit pair according to the corresponding id of row for selecting in database
Picture and topology file that the processing mode answered is included, wherein picture and topology file are test script in test process before
The picture and topology file of middle recording, topology file is XML type;When such as clicking on the second row in selection table 1, can be by the
The corresponding id of two rows(Now id=2)Picture corresponding with the script unit and topology file are searched in database;
Step S106, picture is included, on interface, parsing XML layout file and reflecting the layout information obtained after parsing
Penetrate on picture;The control that sliding trace is passed through can be shown when mouse slides on picture, so as to test man can be clearly
See the layout scenarios on current operation interface;
Step S107, clicks picture by right key, there is provided multiple operations are selected for user;Operation herein includes time delay, increases
Checkpoint, deletion, insertion circulation etc.;Such as unnecessary step deletion, to needing to add checkpoint where adding checkpoint
Deng, after the insertion circulation in test script, test script can be made to carry out pressure test, after test script editor's time delay, energy
The execution of automatic test script is adapted to enough;
Step S108, selects any operation and performs;A certain step is deleted such as;
Step S109, according to the picture in the operation synchronized update database for performing and topology file, mapping form and survey
Training sheet;Wherein often carry out single stepping, all can automatic updating test script and corresponding database, mapping form, such as exist
Corresponding steps after a certain step is deleted in mapping form, in meeting synchronization removal test script and database;
Step S110, after the completion of editor, chooses whether the renewal before preserving, if so, then execution step S111, conversely,
Execution step S112;
Step S111, automatically saves test script and database after updating, so as to generate new test script;
Step S112, does not preserve renewal, recovers initial test script and database.
It should be noted that when a certain row of the present invention in mapping form is operated, both can be by shown in Fig. 1
After certain a line is selected in embodiment, right button operate on picture, it is also possible to directly in mapping form right button to a certain traveling
Row operation.
By above description as can be seen that the edit methods of automatic test script of the present invention, when needing to edit test script
When, mapping form, after then any row of Choose for user form is operated, meeting are generated according to test script to be edited first
Automatic updating test script and database, it is achieved thereby that simply, quickly generating on the basis of existing test script new
Test script, increased the reusability of test script, reduce the work of developer.
Above in association with most preferred embodiment, invention has been described, but the invention is not limited in enforcement disclosed above
Example, and modification, the equivalent combinations that various essence of the invention are carried out should be covered.