CN109815132B - Method and storage medium for automatically converting manual test process into test script - Google Patents

Method and storage medium for automatically converting manual test process into test script Download PDF

Info

Publication number
CN109815132B
CN109815132B CN201811627207.6A CN201811627207A CN109815132B CN 109815132 B CN109815132 B CN 109815132B CN 201811627207 A CN201811627207 A CN 201811627207A CN 109815132 B CN109815132 B CN 109815132B
Authority
CN
China
Prior art keywords
test
user
text block
describing
script
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811627207.6A
Other languages
Chinese (zh)
Other versions
CN109815132A (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.)
Henan Thinker Track Traffic Technology Research Institute
Original Assignee
Henan Thinker Track Traffic Technology Research Institute
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 Henan Thinker Track Traffic Technology Research Institute filed Critical Henan Thinker Track Traffic Technology Research Institute
Priority to CN201811627207.6A priority Critical patent/CN109815132B/en
Publication of CN109815132A publication Critical patent/CN109815132A/en
Application granted granted Critical
Publication of CN109815132B publication Critical patent/CN109815132B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

A method, storage medium for automatically converting a manual test procedure into a test script includes defining elements of the test script; when the user starts the manual test, recording the working environment description of the user to form a text block T1 for describing a file header; forming a text block T3 describing an output result of the tracking process by clicking an output result of the system under test to be tracked stored in the selection test management system; the tested management system records the manual testing process of the user and forms a text block T2 describing the operation element sequence; the system automatically reads the feedback result of the current tested system, and carries out format revision on the output result describing the tracking process in the step 3 to form a revised text block T3 describing the expected result; the text blocks T1, T2 and T3 are combined to form a script file. The automatic conversion method of the invention enables the tester to record and generate the test script directly according to the daily working habit, thereby reducing the workload of manually editing the script.

Description

Method and storage medium for automatically converting manual test process into test script
Technical Field
The invention relates to the field of script testing, in particular to a method for automatically converting a manual testing process into a testing script.
Background
In automated test systems, built-in textual test scripts are typically used to describe the test logic and the expected results. The automatic test system interprets and executes the test script, triggers corresponding software and hardware actions, generates signals or conditions, obtains system feedback under specific conditions, compares the system feedback with expected results, and judges whether the system feedback meets the expectation or not, so that whether the system function meets the design requirements or not is judged.
The test script can be manually edited and generated by a tester, a script file can be input into text editing software during editing, and the script file can also be generated in a graph dragging mode. In actual test work, a tester often performs manual test first, records the test process of the tester, converts the test process into a script and inputs the script into a system.
When the script file is generated by manual editing, a tester needs to be familiar with the running logic of the script, and the technical requirements on the tester are high and the difficulty is high. The manual testing process of the tester is not fully utilized, which is a great waste and a loss of working efficiency.
Disclosure of Invention
The invention provides a method and a storage medium for automatically converting a manual test process into a test script, which aim to solve the problems in the prior art.
The invention adopts the following technical scheme:
a method for automatically converting a manual test process into a test script, step 1: elements defining the test script: (1) a file header, (2) a sequence of operational elements, (3) a desired result;
step 2: when the user starts the manual test, recording the working environment description of the user to form a text block T1 for describing a file header;
and 3, step 3: when the user starts the manual test, a text block T3 describing the output result of the tracking process is formed by clicking the output result of the tested system to be tracked, which is stored in the test management system;
and 4, step 4: in the manual testing process of the user, the tested management system records the manual testing process of the user to form a text block T2 for describing the operation element sequence;
and 5: after the user finishes the manual test, the system automatically reads the feedback result of the current tested system, and performs format revision on the output result describing the tracking process in the step 3 to form a revised text block T3 describing the expected result;
step 6: the text blocks T1, T2 and T3 are combined to form a script file.
In the step 4, after the text block T2 is formed, normalization processing needs to be performed on the text block T2, where the normalization processing includes:
(1) establishing an operation element description library for describing the corresponding relation between the operation elements and the element types;
(2) in the manual testing process of a user, acquiring at least one operation element corresponding to the operation content for the operation content of each step of the user, traversing an operation element description library, and searching an element type corresponding to the operation element;
(3) and determining whether the operation content is complete or not according to the element type of the operation element and the set operation content, and if the operation content is incomplete, supplementing a preset default value of the element type corresponding to the operation element to form a text block T2 after normalization processing.
In step 1, the content of the text block T1 for representing the header is formed to include:
(1) recording the login name and login time of the user;
(2) acquiring a hardware version and a software version of equipment currently running a tested system;
(3) the user manually operates the test management system to designate the purpose of the test.
In step 4, the manual testing process of the user includes setting items, item numbers, and relative start times of operations.
A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method.
The invention has the beneficial effects that: the automatic conversion method of the invention enables the tester to record and generate the test script directly according to the daily working habit, thereby reducing the workload of manually editing the script. The learning difficulty of operators is reduced, and the working efficiency is improved.
Detailed Description
The present invention will be described in further detail with reference to specific embodiments.
The invention provides a method for automatically converting a manual test process of a user into a test script in an automatic test process.
The automatic test system of the invention is an automatic test system which is mature in many fields, and generally comprises three parts: (1) a test management system; (2) a signal generating and collecting device; (3) the system under test. The test management system explains and executes the test script, drives the signal generation and the equipment generation signal or the generation condition, acquires the feedback result of the tested system, compares the feedback result with the expected result defined in the test script, and judges whether the tested system meets the expectation or not, thereby judging whether the tested system meets the design requirement or not.
The automated test system provides manual testing functionality for the user. Generally, the manual testing process for a user is generally as follows:
(1) the user opens the equipment, completes the processes of login and the like, records the identity information and the software and hardware environment used for testing;
(2) the user operates in the interface of the test management system, manually triggers and sends out various signals
(3) And at a proper observation point, observing the feedback result of the tested system by the user, and manually judging whether the feedback result meets the expectation.
The script file defines the following elements, and the test script with the following elements is finally and automatically generated by the invention:
(1) the file header comprises a file name, function description, running environment requirements, a recorder and recording time;
(2) the operation element sequence is as follows: the operation elements are a series of operation elements and preconditions thereof, and the contents of the operation elements include time, action names, action parameters and the like. Such as "20 seconds set speed output value 80". The operation elements can be various, such as setting speed, setting signal lamps, setting the rotating speed of a diesel engine and the like; the operation elements can be set according to different test environments and test requirements.
(3) The expected result is: including conditional output results. Such as "emergency braking state = output".
On the basis, the method for automatically converting the manual test process into the test script comprises the following steps:
step 1: as mentioned above, the elements of the test script and the element content inside the elements need to be defined: (1) a header, (2) a sequence of operational elements, (3) a desired result.
And 2, step: when the user manually tests, the description of the working environment of the user is recorded, and a text block T1 describing the file header is formed. In this step, the content of the text block T1 includes:
(1) recording the login name and login time of the user;
(2) acquiring a hardware version and a software version of current equipment for operating the test system;
(3) the user manually operates the test management system to designate the purpose of the test.
And 3, step 3: the desired results were formed: in this step, since the desired result in the script file is very important, it is a flag to judge whether the script execution is successful. Therefore, in the actual test, the condition output has strong timeliness, and if the user selects to determine the output condition in the test, the opportunity may be missed, so that the wrong output result is recorded.
Therefore, since the output result of the system under test is stored in the test management system and can be selected in the software interface of the system under test, the output result of the system under test to be tracked, such as tracking the "emergency brake state", is selected by clicking by the user in the software interface of the test management system when the user manually tests. The text blocks T3, T3 forming the output result describing the tracking process may be in the form of: "tracking: emergency braking state ".
And 4, step 4: a sequence of operational elements is formed. In this step, when the user starts the manual test, the user clicks the entry of the preset "start recording script" on the interface of the tested management system, and when the user starts the manual test, the tested management system records the manual test process of the user to form a text block T2 describing the operation element sequence.
The manual testing process of the user includes setting items, item values, and relative start times of operations, which form the text block T2.
The following is a text block T2 of the operation procedure of a certain user recorded:
1) setting a speed, a speed value =0, and an operation time = 0;
2) setting a signal lamp, a green lamp and an operation time = 5;
3) designing driving parameters, and setting a driver number =1234 and time = 8;
4) setting speed, speed =20, operating time = 58;
5) setting speed, speed =40, operating time = 80;
6) setting a signal: signal = red light, operating time = 103.
After the text block T2 is formed in step 4, the text block T2 needs to be normalized, and the purpose of the normalization is to map the operation process to the operation elements.
The normalization processing process comprises the following steps:
(1) establishing an operation element description library for describing the corresponding relation between the operation elements and the element types;
(2) in the manual testing process of a user, acquiring at least one operation element corresponding to the operation content for the operation content of each step of the user, traversing an operation element description library, and searching an element type corresponding to the operation element; the type of the element such as "set speed" can be designed to be 2;
(3) and determining whether the operation content is complete or not according to the element type and the operation content of the operation element, and if the operation content is incomplete, supplementing a preset default value of the element type corresponding to the operation element, wherein the default value is preset. For example, if the user does not set the number of the departure station, the system automatically takes a default value. Because each operation element has set operation content, whether the operation content of the user is complete or not can be judged according to the set operation content, and the operation content is incomplete and needs to be supplemented completely, namely a default value is supplemented.
After the above-mentioned process operations are completed, the text block T2 after the normalization processing is formed.
And 5: after the user finishes the manual test, the user clicks the option of acquiring the tracking result in the test management system, the system automatically reads the feedback result of the current tested system, and matches the feedback result with the specified output result tracking item, and the format of the text block T3 is revised to form a revised text block T3 which describes the expected result. For example, the revised text block T3 is "emergency automatic status = output" at this time.
Step 6: the text block T1, the text block T2, and the revised text block T3 are combined to form a script file.
The following is an example of a test script that is automatically transformed:
a file header: the script for testing the red light parking mode is operated in LKJ-15S, the software version is required to be V1.0.1, the version of the software is V1.0, and the software is recorded by Zhang III for 7 months and 27 days in 2018.
Operation element sequence (including setting item, item value and time of relative start of operation):
1. setting speed parameters: element type =2, operation time =0, speed value = 0;
2. setting a signal lamp: element type =3, operating time =5, signal = green light;
3. designing driving parameters: element type =1, operation time =8, driver number =1234, departure station number = 25;
4. setting the speed: operational element =2, operational time =58, speed = 20;
5. setting the speed: operational element =2, operational time =80, speed = 40;
6. setting a signal: operational element =3, operational time =103, signal = red light;
the expected output is:
emergency brake = output
The present invention can implement all or part of the processes of the above methods, and can also be implemented by using a computer program to instruct related hardware, where the computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above method embodiments can be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like.
In the description herein, particular features, structures, materials, or characteristics may be combined in any suitable manner in any one or more embodiments or examples.
The above description is only an embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the present invention should be covered by the present invention.

Claims (2)

1. A method for automatically converting a manual test process into a test script, characterized in that:
step 1: elements defining the test script: (1) a file header, (2) a sequence of operational elements, (3) a desired result;
step 2: when the user starts the manual test, recording the working environment description of the user to form a text block T1 for describing a file header;
and step 3: when the user starts the manual test, a text block T3 describing the output result of the tracking process is formed by clicking the output result of the tested system to be tracked, which is stored in the test management system;
and 4, step 4: in the manual testing process of the user, the tested management system records the manual testing process of the user to form a text block T2 for describing the operation element sequence; the manual testing process of the user comprises the steps of setting items, item numbers and relative start time of operation;
after the text block T2 is formed, the text block T2 needs to be normalized, and the normalization process includes:
(1) establishing an operation element description library for describing the corresponding relation between the operation elements and the element types;
(2) in the manual testing process of a user, acquiring at least one operation element corresponding to the operation content for the operation content of each step of the user, traversing an operation element description library, and searching an element type corresponding to the operation element;
(3) determining whether the operation content is complete or not according to the element type of the operation element and the set operation content, and if the operation content is incomplete, supplementing a preset default value of the element type corresponding to the operation element to form a text block T2 after normalized processing;
and 5: after the user finishes the manual test, the system automatically reads the feedback result of the current tested system, and performs format revision on the output result describing the tracking process in the step 3 to form a revised text block T3 describing the expected result;
step 6: combining the text blocks T1, T2 and T3 to form a script file;
in step 1, the content of the text block T1 for representing the header is formed to include:
recording the login name and login time of the user;
acquiring a hardware version and a software version of equipment currently running a tested system;
the user manually operates the test management system to designate the purpose of the test.
2. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method as set forth in claim 1.
CN201811627207.6A 2018-12-28 2018-12-28 Method and storage medium for automatically converting manual test process into test script Active CN109815132B (en)

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 CN109815132A (en) 2019-05-28
CN109815132B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112162916B (en) * 2020-08-31 2024-04-19 北京交大思诺科技股份有限公司 LKJ test system capable of automatically generating test script

Citations (5)

* Cited by examiner, † Cited by third party
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
Title
白鸿钧 ; 杨清祥 ; 李冠军 ; 张明凯.LKJ自动化测试系统图形化技术研究.《铁道通信信号》.2018,第1-4页. *

Also Published As

Publication number Publication date
CN109815132A (en) 2019-05-28

Similar Documents

Publication Publication Date Title
CN106294673B (en) Method and system for analyzing log data in real time by user-defined rule
Martinez et al. Coming: A tool for mining change pattern instances from git commits
US10176079B2 (en) Identification of elements of currently-executing component script
CN102495789B (en) Automatic test method and device for the same
CN111258290A (en) Automatic test method and system for vehicle control unit
CN109684223B (en) Test script automatic linking method and storage medium
US20080154935A1 (en) Generating templates of nodes to structure content objects and steps to process the content objects
CN105760296A (en) Automation testing control method, device and terminal
CN109815132B (en) Method and storage medium for automatically converting manual test process into test script
CN111651365B (en) Automatic interface testing method and device
CN111258876B (en) Accurate regression testing method and device under micro-service architecture
CN115757014A (en) Power consumption testing method and device
CN110990282B (en) Automatic unit testing method
Vogelsang et al. Systematic elicitation of mode models for multifunctional systems
CN111176995A (en) Test method and test system based on big data test case
CN115587028A (en) Interface automation test method, system, medium and terminal
CN112148588B (en) Automatic analysis method and test tool for object resources of automatic test
CN115470100A (en) Signal scene testing method and device for automobile parts
CN115098368A (en) Intelligent verification method and device for recognizing brain picture use case
CN115391223A (en) Traffic recording playback-based non-invasive strategy reconstruction method and device
CN108563560A (en) Calabash-based client application program demand drive test method
CN114647588A (en) Interface test method and device
Filipsky et al. Creating smart tests from recorded automated test cases
Johannsen et al. Supporting knowledge elicitation and analysis for business process improvement through a modeling tool
CN117667680A (en) Use case testing method, system, equipment and storage medium

Legal Events

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