CN101887389A - Binary structure-based script generating method - Google Patents

Binary structure-based script generating method Download PDF

Info

Publication number
CN101887389A
CN101887389A CN 201010190927 CN201010190927A CN101887389A CN 101887389 A CN101887389 A CN 101887389A CN 201010190927 CN201010190927 CN 201010190927 CN 201010190927 A CN201010190927 A CN 201010190927A CN 101887389 A CN101887389 A CN 101887389A
Authority
CN
China
Prior art keywords
window
xml
script
recorded
recording
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
CN 201010190927
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.)
NANJING ALLDAYTEST AUTOMATION TECH Co
Original Assignee
NANJING ALLDAYTEST AUTOMATION TECH Co
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 NANJING ALLDAYTEST AUTOMATION TECH Co filed Critical NANJING ALLDAYTEST AUTOMATION TECH Co
Priority to CN 201010190927 priority Critical patent/CN101887389A/en
Publication of CN101887389A publication Critical patent/CN101887389A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a binary structure-based script generating method. In the method, each window or web window is regarded as an independent image, all controls in each window are regarded as the subobjects of a window object, and a frame index, a like component count index and a combined identification mode are introduced to make the nested hierarchy of the control objects contain at least two stages, and the objects are stored and recorded in an expandable markup language xml and in a diadactic structure in an object definition.xml file; on the basis of completing object recording, tree scenes are created and each independent tree scene is stored in a binary structure to form a scenarios.xml file; and finally, scripts are created automatically according to objects and scenes, and the generated script system are definitely in a binary structure for the objects and the scenes exist in the mode of binary structure.

Description

A kind of scenario generation method based on diadactic structure
Technical field
The present invention is a kind of script system generation method, belongs to the script generation technique field in the software automated testing technology.
Background technology
Software test is an indispensable part in the software development process, its objective is to find the defective that exists in the software and wrong and make amendment as far as possible, to improve the q﹠r of software.Show that according to statistics the software test expense has taken 30%~50% of entire software development.Continuous lifting along with software function and complexity has become the research focus as the software automated testing that can improve software quality.
Test script is being played the part of important role in automatic test, the design of script and establishment directly influence the reproduction of test result.At present, Chang Yong script technology has four kinds: linear script, structuring script, data-driven script and key word drive script.Linear script is fully based on manual operations, the recording operation step, and cost of development is low, but does not have logic function, and later maintenance cost is very high; The structuring script adopts multiple logical organization to come implementation structure chemical control system, writes complexity, and cost of development is higher, and later maintenance cost is low; The data-driven script is revised script and data separating test data and can not exerted an influence to script, and it is high that the relative structuring script of cost of development is wanted, and later maintenance cost is low; Key word drives script and has encapsulated various basic operations, comes call operation by key word, and maintenance is easy to, but requires the tester that good program capability is arranged.Yet all have under the situation of corresponding operating at a plurality of nested windows of appearance and each window, traditional script technology will present nested at many levels, the baroque drawback of script, when causing the script playback response time slow, can not satisfy real-time, be not easy to simultaneously safeguard.This shows that today that software function is complicated day by day, traditional script technology can not satisfy user's demand.
Summary of the invention
Technical matters: the present invention seeks to provides a kind of scenario generation method based on diadactic structure at the defective that prior art exists.Solve current outstanding business automation testing tool both at home and abroad and in having the window of COMPLEX FRAME, produce the too problem of complex script, make automatized script that two-level nested be arranged at the most.Simplify the script structure, improve the ease for use and the maintainability of script, improve testing efficiency.
Technical scheme: the present invention adopts following technical scheme for achieving the above object:
The present invention is a kind of scenario generation method based on diadactic structure, it is characterized in that described method is as follows:
Step (1) object is recorded: when recording object, at first window is recorded, window i.e. an independently main object, comes identification window by window title; All controls in the window are set to the subobject of window then, after finishing object and recording, use XML (extensible Markup Language) xml to preserve with the form of diadactic structure object, are recorded in the ObjectDefinition.xml file;
Step (2) is recorded at object on the basis of finishing, and the Object node of recording is in advance created scene, creates scene tree and generates document scene Scenarios.xml according to the demand of test case simultaneously.
Preferably, described object adopts framework index (FrameIndex), similar control counting index (CountIndex) and combination recognition method to make the nested level of control object be at most two-stage, forms the Object Management group system of diadactic structure.
Beneficial effect:
(1), avoided producing the too problem of complex script based on the script system of diadactic structure;
(2) because script is simple in structure, have only two-level nested, be convenient to the extensive script that produces automatically, the test duration is saved in the understandable also operation easily of standard for the tester;
(3) the script logicality of diadactic structure is very strong, has improved maintainability, reduces script maintenance cost in the future;
(4) script is simple, and the operating rate that improves automatic test software has improved testing efficiency simultaneously.
Description of drawings
Fig. 1: be to use automatic test system of the present invention.
Embodiment
Be elaborated below in conjunction with the technical scheme of accompanying drawing to invention:
As shown in Figure 1, the present invention generates the standalone scenario of diadactic structure by realizing the Object Management group system of diadactic structure, thereby guarantees to produce automatically the script system of diadactic structure.
(1) when recording object, at first window to be recorded, window i.e. an independently main object, comes identification window by window title; All controls in this window are regarded the subobject of window object as then, wait and identify by control property such as object oriented, object type.Make the nested level of control object be at most two-stage by introducing framework index (FrameIndex), similar control counting index (CountIndex) and combination recognition method, form the Object Management group system of diadactic structure; Adopt frame choosing and continuous single-point to improve the efficient that object is recorded simultaneously.
In the complex window, usually there are a plurality of frameworks, introduce FrameIndex and come the mark framework according to the window loading sequence, as one of the attribute of control in the framework,, can be expressed as " FrameIndex=0_1 " as " FrameIndex=0 " if there is nesting frame, represent 1 work song framework in the framework No. 0, so can eliminate the multilayer nest in the complex page, keep the diadactic structure of Object Management System, and can improve the anti-speed of selecting of object.
The introducing principle of similar FrameIndex, when existing a plurality of identical controls and other attribute can not this control of unique identification the time in the same window, as WebCheckBox, WebRadioGroup, WebLink, WebSpan, WebDiv, WebElement etc.Adopt similar control counting (CountIndex) mark control, identify, represent that as " CountIndex=2 " this control is the 3rd in this type control since 0 index according to same type control.
For the object that can't discern in the window, adopt the combination recognition method to realize.But identifying object comes the ferret out object near promptly utilizing.At first near object is finished the detecting operation, type such as Fig. 1 utilize the howtofind method to search under the compiling objective object.Howtofind provides range and two kinds of ways of search of deep, and range just carries out unidirectional search from sub level to parent from inside to outside successively; And deep can realize bidirectional research, when sub level when parent search is unsuccessful, can continue comprehensively to search for to sub level from parent successively from outside to inside, to guarantee to find destination object.
Above-mentioned three kinds of object recording technologies have realized that window and control present with the form of diadactic structure all the time, guarantee that the nested level of control object is at most two-stage.After finishing object and recording, use XML (extensible Markup Language) xml to preserve with the form of diadactic structure object, be recorded in the ObjectDefinition.xml file.Its structure is as follows:
<Objects>
<Object ID=" Netease " Type=" Browser "
Property=″openurl= http://mail.163.com/.~″>
<Object?ID=″username″Type=″WebEdit″Property=″Name=username″/>
<Object?ID=″password″Type=″WebEdit″Property=″Name=password″/>
<Object ID=" login " Type=" WebButton " Property=" Value=login "/〉
</Object>
<Object ID=" D dish " Type=" Window " Property=" opentitle=local disk (D :) " 〉
<Object ID=" new folder " Type=" Listltem " Property=" Name=new folder "/〉
</Object>
</Objects>
<Objects〉and</Objects〉be the root node of xml, represent that respectively the mark of xml language begins and finishes; " Type=Browser " and " Type=Window " expression parent type, browser window is " Browser ", and the Windows window is " Window "; " Property=" openurl=http: //mail.163.com/.~" " be the condition that is used to search parent form; " Object ID=" username " " is that the daughter element in the forms is a subobject; " Type=" WebEdit " " is the type of daughter element " username "; " Property=" Name=username " " is the condition of searching daughter element " username ";
In order to improve testing efficiency, frame choosing and continuous single-point scheme have been proposed.The tester can select " detecting selected " pattern when recording object, use the mode of dilatory mouse, and the object that the frame choosing need be recorded just can successfully be recorded these objects get off; Perhaps under " detecting selected " pattern, click the object that a plurality of needs are recorded continuously, realize recording simultaneously a plurality of objects.This scheme has been avoided the object of repeated multiple times detecting the same window, saves time, and has improved ease for use and testing efficiency.
(2) record on the basis of finishing at object, the tester can create scene to the Object node of recording in advance, create scene tree and generate document scene Scenarios.xml according to the demand of test case simultaneously, design philosophy and object definition file are similar, adopt the describing mode of diadactic structure in each standalone scenario.
<Scenarios>
<Scenario ID=" Netease " 〉
<Step ObjID=" Netease " Method=" Navigate " Value=" http://mail.163.com/ " Type=" Action " ID=" http://mail.163.com/_Navigate "/〉
<Step?ObjID=″username″Method=″Set″Value=″xxxx″Type=″Action″ID=″username″/>
<Step?ObjID=″password″Method=″Set″Value=″yyyy″Type=″Action″ID=″password″/>
<Step ObjID=" login " Method=" Click " Value=" " Type=" Action " ID=" login "/〉
</Scenario>
<Scenario ID=" D dish " 〉
<Step ObjID=" new folder " Method=" Click " Value=" " Type=" Action " ID=" new folder "/〉
</Scenario>
</Scenarios>
Equally,<Scenarios〉and</Scenarios〉be the root node of xml;<Scenario ID=" Netease "〉represent the ID of this scene, must unique the sign in scene ID; Step under " Step ObjID=" Netease " " expression scene, " ObjID " represents the execution object of this step; " Method " method for expressing; The value of " Value " expression the method; " Type " represents step type; " ID " is meant step ID, also must unique the sign.
Before the automatic test implementation of test cases, at first to generate test script.Script of the present invention generates automatically based on object definition file ObjectDefinition.xml and document scene Scenarios.xml.Because ObjectDefinition.xml and Scenarios.xml have guaranteed the Object Management group system and the scene management system of diadactic structure, so the script that generates is inevitable automatically also is diadactic structure, annotates whole test process with the binary system of " window, control " all the time.
Embodiment:
(1) test case design: the tester writes test case according to testing requirement, contingent situation in the test case coverage test scene as far as possible.
(2) object is recorded: the tester is according to test case, window is recorded, in recording process, can edit object, make it understandable, convenient maintenance in the future, and use the xml preservation thought of diadactic structure of the present invention that object is preserved, generate the ObjectDefinition.xml file.
(3) scene creation: after the object work of recording is finished, create tree-like scene, and use the xml preservation thought of diadactic structure of the present invention that each scene is preserved, generate Scenarios.xml according to the test case demand.
(4) script generates: the script that generates the diadactic structure of " forms, control " form based on object definition file ObjectDefinition.xml and document scene Scenarios.xml automatically.
(5) carry out script: carry out script, reach test purpose.
(6) revise script: when script executing makes a mistake, need make amendment to script, adopt script of the present invention, the object and the scene that can allow the tester navigate to fast to make a mistake improve testing efficiency.

Claims (2)

1. scenario generation method based on diadactic structure is characterized in that described method is as follows:
Step (1) object is recorded: when recording object, at first window is recorded, window i.e. an independently main object, comes identification window by window title; All controls in the window are set to the subobject of window then, after finishing object and recording, use XML (extensible Markup Language) xml to preserve with the form of diadactic structure object, are recorded in the ObjectDefinition.xml file;
Step (2) is recorded at object on the basis of finishing, and the Object node of recording is in advance created scene, creates scene tree and generates document scene Scenarios.xml according to the demand of test case simultaneously.
2. a kind of scenario generation method according to claim 1 based on diadactic structure, it is characterized in that described object adopts framework index (FrameIndex), similar control counting index (CountIndex) and combination recognition method to make the nested level of control object be at most two-stage, forms the Object Management group system of diadactic structure.
CN 201010190927 2010-06-03 2010-06-03 Binary structure-based script generating method Pending CN101887389A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010190927 CN101887389A (en) 2010-06-03 2010-06-03 Binary structure-based script generating method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201010190927 CN101887389A (en) 2010-06-03 2010-06-03 Binary structure-based script generating method

Publications (1)

Publication Number Publication Date
CN101887389A true CN101887389A (en) 2010-11-17

Family

ID=43073317

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010190927 Pending CN101887389A (en) 2010-06-03 2010-06-03 Binary structure-based script generating method

Country Status (1)

Country Link
CN (1) CN101887389A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102306122A (en) * 2011-09-14 2012-01-04 北京星网锐捷网络技术有限公司 Automated testing method and equipment
CN102508775A (en) * 2011-10-31 2012-06-20 彭勇 Interactive automation test system
CN102866944A (en) * 2012-06-12 2013-01-09 中国联合网络通信集团有限公司 Pressure testing system and method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070022407A1 (en) * 2001-07-27 2007-01-25 Accordsqa, Inc. Automated software testing and validation system
CN101334728A (en) * 2008-07-28 2008-12-31 北京航空航天大学 Interface creating method and platform based on XML document description
CN101436133A (en) * 2008-11-20 2009-05-20 腾讯科技(深圳)有限公司 Method and device for generating control object library

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070022407A1 (en) * 2001-07-27 2007-01-25 Accordsqa, Inc. Automated software testing and validation system
CN101334728A (en) * 2008-07-28 2008-12-31 北京航空航天大学 Interface creating method and platform based on XML document description
CN101436133A (en) * 2008-11-20 2009-05-20 腾讯科技(深圳)有限公司 Method and device for generating control object library

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102306122A (en) * 2011-09-14 2012-01-04 北京星网锐捷网络技术有限公司 Automated testing method and equipment
CN102508775A (en) * 2011-10-31 2012-06-20 彭勇 Interactive automation test system
CN102866944A (en) * 2012-06-12 2013-01-09 中国联合网络通信集团有限公司 Pressure testing system and method
CN102866944B (en) * 2012-06-12 2015-04-29 中国联合网络通信集团有限公司 Pressure testing system and method

Similar Documents

Publication Publication Date Title
CN108647883B (en) Business approval method, device, equipment and medium
US9766922B2 (en) Automated web task procedures based on an analysis of actions in web browsing history logs
CN108196880A (en) Software project knowledge mapping method for automatically constructing and system
CN103309904B (en) A kind of method and device generating data warehouse ETL code
CN102479079B (en) Method and device for generating application
CN106598591A (en) Webpage dynamic menu generation method and device
CN104035754A (en) XML (Extensible Markup Language)-based custom code generation method and generator
CN106293664A (en) Code generating method and device
CN105022615A (en) Interface generating method and system
US20120166480A1 (en) Xpath-based selection assistance of gui elements during manual test script authoring for xml-based applications
CN101025686A (en) Automation test system and test script generating and operating method
CN111597484B (en) UI dynamic generation method
CN102388374A (en) Method and device for data storage
CN102306122A (en) Automated testing method and equipment
CN105893063B (en) A kind of construction method of the Application Program Interface based on XML format configuration file
CN101499063A (en) Tracing-based database schema evolution method and system
CN116627418B (en) Multi-level form interface visual generation method and device based on recursion algorithm
CN105468793B (en) A kind of automatic management method of simulation model data
CN111144132B (en) Semantic recognition method and device
CN107526679A (en) Automated test frame, the automated testing method based on thereon, storage medium and computer equipment
CN109116828A (en) Model code configuration method and device in a kind of controller
CN106919390A (en) A kind of method and apparatus of page generation
CN101887389A (en) Binary structure-based script generating method
CN102279886B (en) Method and equipment for processing metadata
CN103927244A (en) Plug-in scheduling process monitoring method implemented based on dynamic proxy

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20101117