CN103631719A - Web automated testing method and device - Google Patents
Web automated testing method and device Download PDFInfo
- Publication number
- CN103631719A CN103631719A CN201310681522.8A CN201310681522A CN103631719A CN 103631719 A CN103631719 A CN 103631719A CN 201310681522 A CN201310681522 A CN 201310681522A CN 103631719 A CN103631719 A CN 103631719A
- Authority
- CN
- China
- Prior art keywords
- action
- button
- web
- sequence
- test
- 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
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a Web automated testing method and device, which are used in the drive testing process of a tested object. The method comprises the following steps: 1, scanning a tested HTML (Hypertext Markup Language) document, and collecting all operable page elements; 2, presetting an action set of various types of elements; 3, executing actions to guarantee the element action set; 4, designing a test case operating step, and providing a basis for a testing action sequence; 5, arranging elements according to a sequence written in a test case, realizing the occurrence of a case sequence via corresponding actions in the element action set, and completing all action sequences according to the case; 6, checking whether all elements initiate actions or not. According to the scheme, the comprehensive coverage of functional points in the web automated testing is ensured; meanwhile, the technical problems of redundant automated testing codes and poor reusability are solved.
Description
technical field
The present invention relates to automatic test field, relate in particular to Web automated testing method and device that a kind of measurand drives test process.
background technology
In at present common Customer Relation Management (CRM) system, system object generally be take archives and document as main, and archives and document are from operation interface, and visible part comprises field and button.The general corresponding various data type of field, button is corresponding various action.And field and button, when Web automatic test carries out automation mechanized operation just for operand.
After these operands are called, provide a series of response, the promoter who is performed operation listens to, and then provides judgement, and whether operation is successful.Be easy to like this ignore a problem, the archives and the not every function of document that are exactly system are all passed automated execution.If action promoter only operate the partial function of system object, just think that test job has completed, how the part of test leakage so, guarantee the availability of its function?
And general automatic test carries out in process, be all that streaming is carried out.By typing script, or write test script, then order is carried out script action.The script obtaining like this, although preparation method is simple, reusability is not high, can not adapt to many archives, the scene of many documents, and in script logic, also there is bulk redundancy.Current common Web automated test frame, take executable operations action as basis, be actually the set of one group of operational motion, although in this process, can pass through DO loop, certain is performed an action complicated, but do not change, take the basic essence performing an action as driving, measurand is passive forever.Object herein, exactly in order to change the passive situation of measurand, is become initiatively from passive.
In order to guarantee the comprehensive of web automatic test covering function point, simultaneously also in order to solve automatic test code redundancy, the feature that reusability is not high, a kind of main body of measurand as action generation of take proposed herein, and the modularization of measurand, each module comprises sets of fields, button collection and tab collection, with measurand, send action, and take into account the Web automated testing method of test action sequence.
Object of the present invention is exactly for the deficiency in prior art, provides a kind of measurand to drive Web automated testing method and the device of test process.The covering function point of realizing comprehensive, the while has also solved automatic test code redundancy, the object that reusability is not high.
summary of the invention
The disclosure relates to a kind of according to functional module or functional node division measurand, and measurand is packaged into and can, for the class of access, be offered concrete operations and carry out data access and method call, and finally realize the modularization of measurand.Be applicable in various Customer Relation Management (CRM) systems many documents, the application scenarios of many archives.
The present invention is achieved through the following technical solutions:
A Web automated testing method, drives test process for measurand, it is characterized in that, comprises the following steps:
Step 1: tested html document is scanned, collect all can operated page elements;
Step 2: the behavior aggregate of preset all types of elements;
Step 3: perform an action, for element behavior aggregate provides safeguard;
Step 4: design test case operation steps, for test action sequence provides foundation;
Step 5: arrange element according to the order of writing in test case, by element behavior aggregate respective action, realize the generation of use-case sequence, complete all action sequences according to use-case;
Step 6: check whether all elements all initiated action.
A Web automatic test device, drives test for measurand, comprises with lower module:
Page elements collection module, scans for the html document to tested, collect all can operated page elements;
Element behavior aggregate preset module, for the behavior aggregate of preset all types of elements;
Behavior aggregate is realized module, for performing an action, for element behavior aggregate provides safeguard;
Test Sample Design module, for design test case operation steps, for test action sequence provides foundation;
Test case execution module, arranges element for the order of writing according to test case, by element behavior aggregate respective action, realizes the generation of use-case sequence, according to use-case, completes all action sequences;
Checking module, for checking whether all elements all initiated action.
The present invention also provides:
In one embodiment of the invention, described operated page elements is divided into field, button, tab three parts.Described field comprises text input, combobox selection, link and at least one in the time on date, that described button is divided into is newly-increased, revise, delete and refresh at least one, described tab comprises various field and button.
In one embodiment of the invention, common page elements respective operations is preset in advance, and described respective operations comprises the corresponding keyboard input operation of text box and the operation of streptostyly Related fields a mouse click.
In one embodiment of the invention, described test case is configured so that each step can be performed.
In one embodiment of the invention, after everything sequence is finished and while not reporting an error, in echo check element, whether field, button and tab send action, and check the element whether whole process contains, and readjust accordingly the sequence of operation.
accompanying drawing explanation
Fig. 1 is according to the workflow diagram of web automatic test provided by the invention;
Fig. 2 is according to first prime model table provided by the invention;
Fig. 3 is according to field element set of actions figure provided by the invention;
Fig. 4 is according to tab element set of actions figure provided by the invention;
Fig. 5 is according to button element set of actions figure provided by the invention;
Fig. 6 is according to preset action sequence memory model figure provided by the invention.
Embodiment
Below in conjunction with drawings and Examples, technical scheme of the present invention is further described.
In order to realize above-mentioned target, the present invention proposes a kind of Web automated testing method that drives test process with measurand, shown in the following accompanying drawing 1 of concrete workflow diagram.
In concrete methods of realizing step below, elaborate.
Step 1: first tested html document is scanned, collect all can operated page elements.Generally can be divided into field by operated page elements, button, tab three parts, and field comprises all kinds, comprises text input, combobox is selected, link, and the time on date etc., button is divided into newly-increased according to function, revise, delete, refresh etc., in tab, comprise again various field and button.
With reference to accompanying drawing 2, element is distributed by type and draw various element abstract models.
The html document of take is example:
<html>
<head>
<title>XX archives </title>
</head>
<body>
<field>
<input>XX title </input>
<a herf=" http://localhost:8080 " >XX links </a>
<select>
<option> </option>
<option> month </option>
<option> day </option>
</select>
</field>
<button>
<button_add> increases </button_add> newly
<button_del> deletes </button_del>
<button_refresh> refreshes </button_refresh>
<button_save> preserves </button_save>
</button>
<tab>
<tab_item>
<field>...</field>
<button>...</button>
</tab_item>
</tab>
</body>
</html>
Scanning html document above, by label, we can obtain all exercisable element comprising in XX archives.Scanning ,Ci region, filed region is field area, continues scanning downstream site, comprises an input frame (input label), link (a label), combobox (select coordinates option label).Scanning ,Ci region, button region is button area, comprises three buttons, and newly-increased (button_add label) deleted by (button_del label), refreshes (button_refresh label).Scanning ,Ci region, tab region is tab region, comprise a tab, and under a tab, comprise a field region and a button area, and the some fields of field district inclusion, a button area comprises some buttons simultaneously.By scanning after XX archives in each field, each button, the elements such as tab are stored in a tree structure, and are zone bit of each element arrangements, are initialized as 0, after this element sends action by mark position 1.Now, these are scanned element just as the promoter who moves.And, the element of every kind of form, executable action can obtain by element behavior aggregate.
Step 2: the behavior aggregate of preset all types of elements.
In general, the element of field class, if text box will be inputted such operation by corresponding keyboard, and corresponding a mouse click operation of streptostyly field, thus, can common page elements respective operations is preset in advance.
Preset corresponding relation is with reference to the button element set of actions figure shown in tab element set of actions figure shown in the figure of field element set of actions shown in accompanying drawing 3, accompanying drawing 4 and Fig. 5.
Step 3: perform an action, for element behavior aggregate provides safeguard.
Exercises in previous step, click for example, the realization of the operation such as type completes in this step.
General web robotization Open-Source Tools, can provide some the most basic manner of execution.But only these basic manner of execution are to can not meet under true environment, the actual conditions of multi-platform many browsers.Therefore, need to carry out secondary development to it, we have just obtained a series of set of actions.
Step 4: design test case operation steps, for test action sequence provides foundation.
This step is exactly the test case of writing, and the writing mode of test case is not done too much repeating, still, due to the foundation of these test cases as test action sequence, thereby, when writing these use-cases, be just noted that and must accomplish that each step all can carry out.
Step 5: arrange element according to the order of writing in test case, element, by element behavior aggregate respective action, is realized the generation of use-case sequence.According to use-case, complete all action sequences.
According to the preset action sequence memory model figure shown in action sequence memory model accompanying drawing 6 of the present invention.
Step 6: check whether all elements all initiated action.
After everything sequence is finished, and do not report an error, field, button, tab in echo check element is to send action, will check whole process so, the element of whether containing (the element zone bit that does not send action is initialized 0), readjusts the sequence of operation.
Than prior art, the present invention has following beneficial effect:
This method is scanned the element in measurand, and provides action foundation by preset element behavior aggregate for element, and all action promoters are measurands, before having changed, is the state that element is looked in action always.And increased the zone bit whether element was operated, can help and judge in a module, whether all elements can both carry out correct operation.Do not omit, there is no operating mistake.And after modularization, when carrying out action sequence combination, the test case that can contrast textual form is completely carried out writing of robotization use-case, makes abstract work become more concrete.
In addition, modular measurand, carries out, after release migration or upgrading, still can carrying out multiplexing developer.The workload that has reduced secondary development automatic test code, contributes to improve tester's work efficiency.
Finally explanation is, above embodiment is only unrestricted in order to technical scheme of the present invention to be described, although the present invention is had been described in detail with reference to preferred embodiment, those of ordinary skill in the art is to be understood that, can modify or be equal to replacement technical scheme of the present invention, and not departing from aim and the scope of technical solution of the present invention, it all should be encompassed in the middle of claim scope of the present invention.
Claims (12)
1. a Web automated testing method, drives test process for measurand, it is characterized in that, comprises the following steps:
Step 1: tested html document is scanned, collect all can operated page elements;
Step 2: the behavior aggregate of preset all types of elements;
Step 3: perform an action, for element behavior aggregate provides safeguard;
Step 4: design test case operation steps, for test action sequence provides foundation;
Step 5: arrange element according to the order of writing in test case, by element behavior aggregate respective action, realize the generation of use-case sequence, complete all action sequences according to use-case;
Step 6: check whether all elements all initiated action.
2. a kind of Web automated testing method according to claim 1, is characterized in that, described operated page elements is divided into field, button, tab three parts.
3. a kind of Web automated testing method according to claim 2, it is characterized in that, described field comprises text input, combobox selection, link and at least one in the time on date, that described button is divided into is newly-increased, revise, delete and refresh at least one, described tab comprises various field and button.
4. a kind of Web automated testing method according to claim 1, it is characterized in that, described step 2 further comprises common page elements respective operations preset in advance, and described respective operations comprises the corresponding keyboard input operation of text box and the operation of streptostyly Related fields a mouse click.
5. a kind of Web automated testing method described in any according to claim 1-4, is characterized in that, described test case is configured so that each step can be performed.
6. a kind of Web automated testing method according to claim 1, it is characterized in that, described step 6 further comprises: after everything sequence is finished and while not reporting an error, in echo check element, whether field, button and tab send action, and check the element whether whole process contains, readjust accordingly the sequence of operation.
7. a Web automatic test device, drives test for measurand, it is characterized in that, comprises with lower module:
Page elements collection module, scans for the html document to tested, collect all can operated page elements;
Element behavior aggregate preset module, for the behavior aggregate of preset all types of elements;
Behavior aggregate is realized module, for performing an action, for element behavior aggregate provides safeguard;
Test Sample Design module, for design test case operation steps, for test action sequence provides foundation;
Test case execution module, arranges element for the order of writing according to test case, by element behavior aggregate respective action, realizes the generation of use-case sequence, according to use-case, completes all action sequences;
Checking module, for checking whether all elements all initiated action.
8. a kind of Web automatic test device according to claim 7, is characterized in that, described operated page elements is divided into field, button, tab three parts.
9. a kind of Web automatic test device according to claim 8, it is characterized in that, described field comprises text input, combobox selection, link and at least one in the time on date, that described button is divided into is newly-increased, revise, delete and refresh at least one, described tab comprises various field and button.
10. a kind of Web automatic test device according to claim 7, it is characterized in that, described element behavior aggregate preset module is further preset in advance by common page elements respective operations, and described respective operations comprises the corresponding keyboard input operation of text box and the operation of streptostyly Related fields a mouse click.
11. according to claim 7-10 a kind of Web automatic test device described in any, it is characterized in that, described test case is configured so that each step can be performed.
12. a kind of Web automatic test devices according to claim 7, it is characterized in that, described checking module is further carried out: after everything sequence is finished and while not reporting an error, in echo check element, whether field, button and tab send action, and check the element whether whole process contains, readjust accordingly the sequence of operation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310681522.8A CN103631719A (en) | 2013-12-12 | 2013-12-12 | Web automated testing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310681522.8A CN103631719A (en) | 2013-12-12 | 2013-12-12 | Web automated testing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103631719A true CN103631719A (en) | 2014-03-12 |
Family
ID=50212803
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310681522.8A Pending CN103631719A (en) | 2013-12-12 | 2013-12-12 | Web automated testing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103631719A (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104484269A (en) * | 2014-11-27 | 2015-04-01 | 北京广利核系统工程有限公司 | Method for automatically generating testing script |
CN104679658A (en) * | 2015-03-17 | 2015-06-03 | 百度在线网络技术(北京)有限公司 | Test method and test system for WEB pages |
CN104932980A (en) * | 2015-06-30 | 2015-09-23 | 北京奇虎科技有限公司 | Automatic software test method and device |
CN105608007A (en) * | 2015-12-28 | 2016-05-25 | 北京致远协创软件有限公司 | Page model as well as user interface automated test method and device |
WO2017096990A1 (en) * | 2015-12-07 | 2017-06-15 | 中兴通讯股份有限公司 | Method and device for automatically generating test script |
CN107423222A (en) * | 2017-08-08 | 2017-12-01 | 腾讯科技(深圳)有限公司 | A kind of method and apparatus for determining test coverage |
CN109117373A (en) * | 2018-08-16 | 2019-01-01 | 杭州友声科技股份有限公司 | A kind of method that rule-based guidance carries out UI traversal |
CN112559372A (en) * | 2020-12-24 | 2021-03-26 | 南方电网深圳数字电网研究院有限公司 | Interface test case generation method, system and storage medium |
CN113127354A (en) * | 2021-04-21 | 2021-07-16 | 武汉思普崚技术有限公司 | Automatic testing method, device and equipment based on Web UI and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101635655A (en) * | 2008-07-25 | 2010-01-27 | 阿里巴巴集团控股有限公司 | Method, device and system for page performance test |
CN102521121A (en) * | 2011-11-18 | 2012-06-27 | 华为技术有限公司 | Page testing method and page testing device |
US20120204091A1 (en) * | 2011-02-04 | 2012-08-09 | Oracle International Corporation | Automated test tool interface |
CN103186457A (en) * | 2011-12-29 | 2013-07-03 | 阿里巴巴集团控股有限公司 | Method and device for automatically generating test case |
-
2013
- 2013-12-12 CN CN201310681522.8A patent/CN103631719A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101635655A (en) * | 2008-07-25 | 2010-01-27 | 阿里巴巴集团控股有限公司 | Method, device and system for page performance test |
US20120204091A1 (en) * | 2011-02-04 | 2012-08-09 | Oracle International Corporation | Automated test tool interface |
CN102521121A (en) * | 2011-11-18 | 2012-06-27 | 华为技术有限公司 | Page testing method and page testing device |
CN103186457A (en) * | 2011-12-29 | 2013-07-03 | 阿里巴巴集团控股有限公司 | Method and device for automatically generating test case |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104484269A (en) * | 2014-11-27 | 2015-04-01 | 北京广利核系统工程有限公司 | Method for automatically generating testing script |
CN104679658A (en) * | 2015-03-17 | 2015-06-03 | 百度在线网络技术(北京)有限公司 | Test method and test system for WEB pages |
CN104679658B (en) * | 2015-03-17 | 2018-11-13 | 百度在线网络技术(北京)有限公司 | The test method and system of WEB page |
CN104932980A (en) * | 2015-06-30 | 2015-09-23 | 北京奇虎科技有限公司 | Automatic software test method and device |
CN104932980B (en) * | 2015-06-30 | 2018-10-23 | 北京奇虎科技有限公司 | Software automatic testing method and device |
WO2017096990A1 (en) * | 2015-12-07 | 2017-06-15 | 中兴通讯股份有限公司 | Method and device for automatically generating test script |
CN105608007B (en) * | 2015-12-28 | 2018-04-13 | 北京致远互联软件股份有限公司 | Page model, user interface automated testing method and device |
CN105608007A (en) * | 2015-12-28 | 2016-05-25 | 北京致远协创软件有限公司 | Page model as well as user interface automated test method and device |
CN107423222A (en) * | 2017-08-08 | 2017-12-01 | 腾讯科技(深圳)有限公司 | A kind of method and apparatus for determining test coverage |
CN109117373A (en) * | 2018-08-16 | 2019-01-01 | 杭州友声科技股份有限公司 | A kind of method that rule-based guidance carries out UI traversal |
CN112559372A (en) * | 2020-12-24 | 2021-03-26 | 南方电网深圳数字电网研究院有限公司 | Interface test case generation method, system and storage medium |
CN112559372B (en) * | 2020-12-24 | 2024-05-14 | 南方电网数字平台科技(广东)有限公司 | Method, system and storage medium for generating interface test case |
CN113127354A (en) * | 2021-04-21 | 2021-07-16 | 武汉思普崚技术有限公司 | Automatic testing method, device and equipment based on Web UI and storage medium |
CN113127354B (en) * | 2021-04-21 | 2023-08-11 | 武汉思普崚技术有限公司 | Automatic test method, device, equipment and storage medium based on Web UI |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103631719A (en) | Web automated testing method and device | |
CN104572043B (en) | A kind of control to client application carries out burying method and device a little in real time | |
CN108845940B (en) | Enterprise-level information system automatic function testing method and system | |
Yoo et al. | A formal software requirements specification method for digital nuclear plant protection systems | |
CN104679488A (en) | Flow path customized development platform and method | |
CN101887370B (en) | Method and device for creating system user interface | |
CN104484269A (en) | Method for automatically generating testing script | |
CN107526676B (en) | Cross-system test method and device | |
CN102306122A (en) | Automated testing method and equipment | |
CN105117215A (en) | Development method and device of automobile function | |
CN114691464A (en) | Interface testing method, computer equipment and computer readable storage medium | |
CN112668290A (en) | Dynamic form generation method and system based on gridding design | |
CN104657274A (en) | Method and device for testing software interface | |
Garcia et al. | A Requirements-to-Implementation Mapping Tool for Requirements Traceability. | |
Seiger et al. | Test modeling for context-aware ubiquitous applications with feature petri nets | |
US9678856B2 (en) | Annotated test interfaces | |
CN106371868A (en) | Automatic test method, system and test device | |
CN103186463A (en) | Method and system for determining testing range of software | |
US20150234732A1 (en) | Executable software specification generation | |
Wendel et al. | Provenance of software development processes | |
CN110058849A (en) | Generation method, device, computer equipment and the storage medium of flow chart | |
CN109753281B (en) | Micro-grid energy management strategy visualization development tool based on graphical programming | |
Herrmann et al. | Scaling-Up Model-Based-Development for Large Heterogeneous Systems with Compositional Modeling. | |
Basso et al. | Building the foundations for ‘mde as service’ | |
Clerissi et al. | Test driven development of web applications: A lightweight approach |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: 100094 Beijing city Haidian District North Road No. 68, UFIDA Software Park Applicant after: Yonyou Network Technology Co., Ltd. Address before: 100094 Beijing city Haidian District North Road No. 68, UFIDA Software Park Applicant before: UFIDA Software Co., Ltd. |
|
COR | Change of bibliographic data | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20140312 |
|
RJ01 | Rejection of invention patent application after publication |