CN109815132A - A kind of method, storage medium that manual test process is automatically converted to test script - Google Patents
A kind of method, storage medium that manual test process is automatically converted to test script Download PDFInfo
- Publication number
- CN109815132A CN109815132A CN201811627207.6A CN201811627207A CN109815132A CN 109815132 A CN109815132 A CN 109815132A CN 201811627207 A CN201811627207 A CN 201811627207A CN 109815132 A CN109815132 A CN 109815132A
- Authority
- CN
- China
- Prior art keywords
- test
- user
- text block
- manual
- script
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Abstract
A kind of method, storage medium that manual test process is automatically converted to test script, the element including defining test script;When user's manual test starts, the working environment description of user is recorded, the text block T1 of description file header is formed;By clicking the output of the tested test system to be tracked stored in selection test and management system as a result, forming the text block T3 of the output result of description tracking process;The manual test process of tested management system record user, forms the text block T2 of description operational elements sequence;System reads the feedback result of current tested system automatically, carries out format revision to the output result for describing tracking process in step 3, forms the revised text block T3 of description expected result;Text block T1, T2, T3 are combined, script file is formed.Automatic method for transformation of the invention is accustomed to tester directly according to routine work, records and generates test script, reduces the workload of manual edit script.
Description
Technical field
The present invention relates to script testing field more particularly to a kind of manual test process is automatically converted to test script
Method.
Background technique
In automatization test system, test logic and expected knot are generally described with the test script of built-in text type
Fruit.Automatization test system, which is explained, executes test script, triggers corresponding software and hardware movement, signal or condition is generated, specific
Under conditions of obtain system feedback, compared with expected results, judge whether system feedback meets expection, therefore, it is determined that system function
Whether design requirement can be met.
Test script can be generated by tester's manual edit, and when editor can input script in text edit software
File can also generate script file by figure pulling mode.In actual test work, tester often first carries out hand
Dynamic test, records the test process of oneself, converts script for test process later, be entered into system.
When manual edit generates script file, tester needs to be very familiar to the operation logic of script, to tester
Technical requirements it is relatively high, difficulty is big.The manual test process of tester is not fully used, and is greatly to waste,
It is also the loss of working efficiency.
Summary of the invention
The present invention provides a kind of method, storage medium that manual test process is automatically converted to test script, to solve
Problem of the existing technology.
The invention adopts the following technical scheme:
A method of manual test process being automatically converted to test script, step 1: defining the element of test script: (1) literary
Part head, (2) operational elements sequence, (3) expected result;
Step 2: when user's manual test starts, recording the working environment description of user, form the text block T1 of description file header;
Step 3: when user's manual test starts, by clicking the tested system to be tracked stored in selection test and management system
The output of system is as a result, form the text block T3 of the output result of description tracking process;
Step 4: in the manual test process of user, being tested the manual test process of management system record user, form description behaviour
Want the text block T2 of prime sequences;
Step 5: after user's manual test, system reads the feedback result of current tested system automatically, retouches in step 3
The output result for stating tracking process carries out format revision, forms the revised text block T3 of description expected result;
Step 6: text block T1, T2, T3 being combined, script file is formed.
In the step 4, after forming text block T2, need to carry out standardization processing to text block T2, at the standardization
Reason process includes:
(1) operational elements for establishing corresponding relationship between description operational elements and element type describe library;
(2) in the manual test process of user, to the operation content of each step of user, at least one corresponding to operation content is obtained
Operational elements, traversing operation element describe library, the corresponding element type of search operation element;
(3) according to the operation content of the element type of operational elements and setting, determine whether operation content is complete, if endless
It is whole, then the default value of the corresponding element type of the preset operational elements is supplemented, the text block T2 after forming standardization processing.
In the step 1, the content of the text block T1 of the statement file header of formation includes:
(1) logon name and login time of the user recorded;
(2) hardware version and software version of the current equipment for running tested test system obtained;
(3) user's purpose that this is tested by the specified sheet of manual operation test and management system.
In the step 4, the manual test process of user includes setting item, project number, when starting relatively of operation
Between.
A kind of computer readable storage medium, the computer-readable recording medium storage have computer program, the meter
The step of calculation machine program realizes the method when being executed by processor.
Beneficial effects of the present invention: automatic method for transformation of the invention allows tester directly according to routine work
Habit is recorded and generates test script, reduces the workload of manual edit script.The learning difficulty for reducing operator, mentions
High working efficiency.
Specific embodiment
Invention is further described in detail With reference to embodiment.
The present invention provides one kind in automatic test course, and the manual test process of user is automatically converted to test foot
This method.
Automatization test system described in the present invention, is the mature automatization test system in existing many fields, one
As include three parts: (1) test and management system;(2) equipment occurs and acquires for signal;(3) it is tested test system.Test and management system
System, which is explained, executes test script, and driving signal occurs and signal or Production conditions occur for acquisition equipment, acquires tested test system
Feedback result, and be compared with expected results defined in test script, judge whether tested test system meets expection, thus
Judge whether tested test system meets design requirement.
The manual test function of automatization test system offer user.In general, the manual test process of user is substantially
It is as follows:
(1) user opens equipment, completes the processes such as login, the record identity information hardware environment used with test;
(2) user operates in the interface of test and management system, triggers manually, issues various signals
(3) in point of observation appropriate, user observes the feedback result of tested test system, and whether artificial judgment feedback result meets
It is expected that.
The above-mentioned script file of the present invention defines following element, and the present invention is finally automatically generated to be wanted with following
The test script of element:
(1) file header, including file name, function description, the environmental requirement of operation, recording people, recording time;
(2) operational elements sequence: being a series of operational elements and its precondition, and operational elements content includes time, movement
Title, action parameter etc..Such as " 20 seconds setting speed output numerical values 80 ".Operational elements can there are many, such as setting speed,
Setting signal lamp, setting diesel engine speed etc.;Operational elements can need to be configured according to different test environment and test.
(3) desired result: including output with conditions result.Such as " emergency braking condition=output ".
On the basis of the above, the method for the invention that manual test process is automatically converted to test script includes following step
It is rapid:
Step 1: as described above, need to define the element content inside the element and element of test script: (1) file header, (2) behaviour
Prime sequences are wanted, (3) expected result.
Step 2: forming file header, when user's manual test starts, record the working environment description of user, form description text
The text block T1 of part head.In the step, the content of text block T1 includes:
(1) logon name and login time of the user recorded;
(2) hardware version and software version of the current device of the operation test macro obtained;
(3) user's purpose that this is tested by the specified sheet of manual operation test and management system.
Step 3: forming desired result: being to sentence since the expected result in script file is extremely important in this step
Whether disconnected script execution successfully indicates.Therefore in actual test, output with conditions has very strong timeliness, if user is allowed to survey
It is selected in examination if determining output condition, opportunity may be missed, to record the output result of mistake.
Therefore, because the output of tested test system is stored in test and management system as a result, and result can be in tested system
Selected in the software interface of system, therefore when user's manual test starts, in the software interface of test and management system by
User clicks the output of the selection tested test system to be tracked as a result, such as tracking " emergency braking condition ".Form description tracking
The form of the text block T3, T3 of the output result of process may be designed as: " tracking: emergency braking condition ".
Step 4: prime sequences are wanted in formation operation.In the step, when user's manual test starts, tested management system is clicked
The entrance of pre-set " start record script " on system interface when user's manual test, is tested management system record and uses
The manual test process at family forms the text block T2 of description operational elements sequence.
The manual test process of user includes setting item, project numerical value and the operation opposite time started, these operations
Element forms text block T2.
The text block T2 of following operating process for certain user recorded:
1) setting speed, velocity amplitude=0, operating time=0;
2) setting signal lamp, green light, operating time=5;
3) driving parameter is designed, driver number=1234, time=8 are set;
4) setting speed, speed=20, operating time=58;
5) setting speed, speed=40, operating time=80;
6) setting signal: signal=red light, operating time=103.
After forming text block T2 in step 4, need to carry out standardization processing to text block T2, the purpose of standardization processing is
Operating process is mapped to operation element.
Standardization processing process includes:
(1) operational elements for establishing corresponding relationship between description operational elements and element type describe library;
(2) in the manual test process of user, to the operation content of each step of user, at least one corresponding to operation content is obtained
Operational elements, traversing operation element describe library, the corresponding element type of search operation element;Such as the factor kind of " setting speed "
Type may be designed as 2;
(3) according to the element type of operational elements and operation content, determine whether operation content is complete, if imperfect, mend
The default value of the corresponding element type of the preset operational elements is filled, which presets.Such as the third of operating process
Step " setting driving parameter ", user does not set station number of dispatching a car, then system takes default value automatically.Due to each operational elements
All there is the operation content of setting, can judge whether the operation content of user is complete according to the operation content of setting, imperfect need
It mends completely, that is, fills into default value.
Text block T2 after above process end of operation, after forming standardization processing.
Step 5: after user's manual test, user clicks " obtaining tracking result " option in test and management system,
System reads the feedback result of current tested system automatically, and is matched with specified output result tracking project, revision
The format of text block T3 forms the revised text block T3 of description expected result.For example revised text block T3 content is " urgent at this time
Meeting auto state=output ".
Step 6: text block T1, text block T2, revised text block T3 being combined, script file is formed.
Following is the example of a test script of an automatic conversion:
File header: it for testing the script of red parking mode, runs in LKJ-15S, it is desirable that software version V1.0.1, from
Body version V1.0, is recorded by Zhang San, recording time on July 27th, 2018.
Operate element sequence (including setting item, project numerical value and the operation opposite time started):
1, setting speed parameter: element type=2, operating time=0, velocity amplitude=0;
2, setting signal lamp: element type=3, operating time=5, signal=green light;
3, driving parameter: element type=1 is designed, operating time=8 set driver number=1234, set station number=25 of dispatching a car;
4, setting speed: operational elements=2, operating time=58, speed=20;
5, setting speed: operational elements=2, operating time=80, speed=40;
6, setting signal: operational elements=3, operating time=103, signal=red light;
Expect output:
Emergency braking=output
The present invention realizes all or part of the process in the above method, and relevant hardware can also be instructed by computer program
It completes, the computer program can be stored in a computer readable storage medium, the computer program is by processor
When execution, it can be achieved that the step of above-mentioned each embodiment of the method.Wherein, computer program includes computer program code, is calculated
Machine program code can be source code form, object identification code form, executable file or certain intermediate forms etc..It is computer-readable
Medium may include: any entity or device, recording medium, USB flash disk, mobile hard that can carry the computer program code
Disk, magnetic disk, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory
(RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..
In the description of this specification, particular features, structures, materials, or characteristics can be real in any one or more
Applying can be combined in any suitable manner in example or example.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any
Those skilled in the art the invention discloses in the range of, the variation or replacement that can be readily occurred in should all be covered
Within the scope of the present invention.
Claims (5)
1. a kind of method that manual test process is automatically converted to test script, it is characterised in that:
Step 1: the element of test script: (1) file header is defined, (2) operational elements sequence, (3) expected result;
Step 2: when user's manual test starts, recording the working environment description of user, form the text block T1 of description file header;
Step 3: when user's manual test starts, by clicking the tested system to be tracked stored in selection test and management system
The output of system is as a result, form the text block T3 of the output result of description tracking process;
Step 4: in the manual test process of user, being tested the manual test process of management system record user, form description behaviour
Want the text block T2 of prime sequences;
Step 5: after user's manual test, system reads the feedback result of current tested system automatically, retouches in step 3
The output result for stating tracking process carries out format revision, forms the revised text block T3 of description expected result;
Step 6: text block T1, T2, T3 being combined, script file is formed.
2. a kind of method that manual test process is automatically converted to test script according to claim 1, feature exist
In:
In the step 4, after forming text block T2, need to carry out standardization processing, the standardization processing mistake to text block T2
Journey includes:
(1) operational elements for establishing corresponding relationship between description operational elements and element type describe library;
(2) in the manual test process of user, to the operation content of each step of user, at least one corresponding to operation content is obtained
Operational elements, traversing operation element describe library, the corresponding element type of search operation element;
(3) according to the operation content of the element type of operational elements and setting, determine whether operation content is complete, if endless
It is whole, then the default value of the corresponding element type of the preset operational elements is supplemented, the text block T2 after forming standardization processing.
3. a kind of method that manual test process is automatically converted to test script according to claim 1, feature exist
In:
In the step 1, the content of the text block T1 of the statement file header of formation includes:
The logon name and login time of the user of record;
The hardware version and software version of the current equipment for running tested test system obtained;
User's purpose that this is tested by the specified sheet of manual operation test and management system.
4. a kind of method that manual test process is automatically converted to test script according to claim 1, feature exist
In:
In the step 4, the manual test process of user includes setting item, project number, the relative start time of operation.
5. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists
In realization is such as the step of claim 1 ~ 4 the method when the computer program is executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811627207.6A CN109815132B (en) | 2018-12-28 | 2018-12-28 | Method and storage medium for automatically converting manual test process into test script |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811627207.6A CN109815132B (en) | 2018-12-28 | 2018-12-28 | Method and storage medium for automatically converting manual test process into test script |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109815132A true CN109815132A (en) | 2019-05-28 |
CN109815132B CN109815132B (en) | 2022-07-08 |
Family
ID=66601488
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811627207.6A Active CN109815132B (en) | 2018-12-28 | 2018-12-28 | Method and storage medium for automatically converting manual test process into test script |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109815132B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112162916A (en) * | 2020-08-31 | 2021-01-01 | 北京交大思诺科技股份有限公司 | LKJ test system capable of automatically generating test script |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE10157081A1 (en) * | 2001-11-21 | 2003-06-05 | Siemens Ag | System for testing the functioning of program controlled components of complex equipment or plant, whereby test command sequences can be recorded in a test script which can be used at a later time to simply reproduce the test |
CN101021451A (en) * | 2007-03-30 | 2007-08-22 | 株洲南车时代电气股份有限公司 | Train running monitoring device comprehensive test method and comprehensive testbench |
CN101025686A (en) * | 2007-03-22 | 2007-08-29 | 中兴通讯股份有限公司 | Automation test system and test script generating and operating method |
CN101060372A (en) * | 2007-06-26 | 2007-10-24 | 华为技术有限公司 | A method and system for rapid creating the automation test script |
CN101620564A (en) * | 2008-06-30 | 2010-01-06 | 福建升腾资讯有限公司 | Method for automatically testing recording playback mode of terminal system |
-
2018
- 2018-12-28 CN CN201811627207.6A patent/CN109815132B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE10157081A1 (en) * | 2001-11-21 | 2003-06-05 | Siemens Ag | System for testing the functioning of program controlled components of complex equipment or plant, whereby test command sequences can be recorded in a test script which can be used at a later time to simply reproduce the test |
CN101025686A (en) * | 2007-03-22 | 2007-08-29 | 中兴通讯股份有限公司 | Automation test system and test script generating and operating method |
CN101021451A (en) * | 2007-03-30 | 2007-08-22 | 株洲南车时代电气股份有限公司 | Train running monitoring device comprehensive test method and comprehensive testbench |
CN101060372A (en) * | 2007-06-26 | 2007-10-24 | 华为技术有限公司 | A method and system for rapid creating the automation test script |
CN101620564A (en) * | 2008-06-30 | 2010-01-06 | 福建升腾资讯有限公司 | Method for automatically testing recording playback mode of terminal system |
Non-Patent Citations (1)
Title |
---|
白鸿钧; 杨清祥; 李冠军; 张明凯: "LKJ自动化测试系统图形化技术研究", 《铁道通信信号》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112162916A (en) * | 2020-08-31 | 2021-01-01 | 北京交大思诺科技股份有限公司 | LKJ test system capable of automatically generating test script |
CN112162916B (en) * | 2020-08-31 | 2024-04-19 | 北京交大思诺科技股份有限公司 | LKJ test system capable of automatically generating test script |
Also Published As
Publication number | Publication date |
---|---|
CN109815132B (en) | 2022-07-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101719278B1 (en) | Deep learnig framework and image recognition method for content-based visual image recognition | |
US10176079B2 (en) | Identification of elements of currently-executing component script | |
CN109204389B (en) | Fault diagnosis and self-healing method and system for subway equipment | |
CN105760296B (en) | Automatic test control method, device and terminal | |
CN110134659B (en) | Log monitoring system, method, medium, and apparatus for running program | |
CN109684223B (en) | Test script automatic linking method and storage medium | |
CN109634253B (en) | Automatic flow control method and system | |
CN108776278B (en) | Topological-associated configuration type relay protection test system and method | |
CN109429264B (en) | Data processing method, device, equipment and computer readable storage medium | |
CN109815132A (en) | A kind of method, storage medium that manual test process is automatically converted to test script | |
CN102707712B (en) | Electronic equipment fault diagnosis method and system | |
CN106294172A (en) | App self-testing method based on terminal unit and device | |
CN109766274A (en) | A kind of test script automation fusion method, storage medium | |
Oxstrand et al. | A model-based approach to HRA: qualitative analysis methodology | |
CN103701671A (en) | Method and device for detecting conflicts among businesses | |
WO2024020213A1 (en) | Methods and apparatus for natural language-based safety case discovery to train a machine learning model for a driving system | |
CN105791037A (en) | Out-field automatic testing method and equipment | |
CN103150251A (en) | Method for intelligently acquiring automated test object | |
CN115511317A (en) | Wind control strategy configuration method and device | |
CN111813648A (en) | Automatic testing method and device applied to App, storage medium and electronic equipment | |
CN105045698A (en) | Method for analyzing chip verification progress by using MATPLOTLIB of PYTHON | |
CN115587028A (en) | Interface automation test method, system, medium and terminal | |
CN113935572A (en) | Intelligent detection system and equipment for abnormal sound of general online product | |
CN114326642A (en) | Interface matching method, device, equipment and medium for nuclear power DCS (distributed control System) | |
CN113591286A (en) | System and method for confirming validity of trial flight subjects |
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 |