CN104820638A - Embedded whole machine automatic testing method - Google Patents

Embedded whole machine automatic testing method Download PDF

Info

Publication number
CN104820638A
CN104820638A CN201510185469.1A CN201510185469A CN104820638A CN 104820638 A CN104820638 A CN 104820638A CN 201510185469 A CN201510185469 A CN 201510185469A CN 104820638 A CN104820638 A CN 104820638A
Authority
CN
China
Prior art keywords
test
testing
user interface
graphical user
test case
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
CN201510185469.1A
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.)
CETC 41 Institute
Original Assignee
CETC 41 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 CETC 41 Institute filed Critical CETC 41 Institute
Priority to CN201510185469.1A priority Critical patent/CN104820638A/en
Publication of CN104820638A publication Critical patent/CN104820638A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention relates to the technical field of testing, in particular to an embedded whole machine automatic testing method. The method comprises the following steps: pre-storing pattern user interface window object information by using a Hash table; simulating mouse and keyboard inputs by using the message mechanism of Windows to simulate a working process; judging a testing result; and giving a testing report. Testing parameters and testing result comparison data are stored in a form of ordinary text, so that the space is saved; a special parser is not needed; parsing can be performed only through basic file and character string access APIs (Application Programming Interfaces); and meanwhile the demand of separation of the testing process and the testing data is met. The testing result is analyzed and judged in a way of combining interface control display information and lower-layer function interface data acquisition, so that the given result is more effective. Testing process control is added on the basis of automatic testing, so that automatic demonstration of products can be finished.

Description

A kind of Embedded complete automatic test method
Technical field
The present invention relates to technical field of measurement and test, be specifically related to a kind of Embedded complete automatic test method.
Background technology
At present, the product manipulated based on Windows graphic user interface GUI when system test, substantially or according to test text, manually operated step by step by tester, correlation parameter is set, perform correlation step, manual analysis, judgement are carried out to result, thus obtains test result.This mode not only efficiency is low, time-consuming, and cannot avoid artificial difference and the impact of carelessness on test result.
User, use study is carried out to product, or when doing product use and introducing, all need to demonstrate, common way is that the person of sending someone carries out execute-in-place demonstration, or to prerecord into image form, plays when needed by other equipment.The former goes to owing to will send professional, and cost is higher; The latter needs by playback equipment, and once product is changed or upgrading, all obtains and again record, both inconvenient, too increases cost.
Be CN 104133770 A at publication number, denomination of invention is in the application for a patent for invention of " a kind of general automatic test approach ", it discloses following content:
" be use XML configuration file accurately to describe testing procedure; routine call XML configuration file automatic imitation user operation; realize software automated testing work; by read test use-case configuration file, carry out simulation operation to the program under Windows, the test case that Bian gets uses document storing; test process is specified by timed task; realize unattended test process, thus saves manpower and test duration, can be ensured the quality of redaction by version iteration test case.”
Still there is following problem in this technology:
1. use extensible markup Files XML configuration file; the data that XML format stores are larger than storing with other database formats the space occupied; its intrinsic redundancy properties requires also higher to dissection process; usually also need the support of special resolver, be unfavorable for some resources and the limited Embedded Application field of processing power.
2. the information obtained from interface control completely can not judge test result sometimes effectively, and the display result on such as interface is a squiggle, and the automatic decision that now will realize test result is just very inconvenient.
3. not to the support of automatic demonstrating function.
Summary of the invention
Based on the problems referred to above, the object of this invention is to provide a kind of Embedded complete automatic test and demonstrate the method combined, with lower resource and processing power requirement, the product solved based on the manipulation of Windows graphic user interface needs manual operation and test result to need the problem of artificial judgment in test and presentation process.
For reaching above-mentioned purpose, the invention provides a kind of Embedded complete automatic test method, comprising:
Write test document, this test document comprises test plan and test case; Described test case comprises execution object, execution parameter and expected results; This execution object comprises object ID corresponding to graphical user interface window object information;
When graphic user interface initialization, obtain object ID corresponding to this graphical user interface window object information with the form inserting function, by hash function by graphical user interface window object information stored in Hash table;
Read described test document, and according to described test plan, choose corresponding test case;
According to described object ID, read the graphical user interface window object information in described Hash table;
Send message to by the window object operated, analog mouse and keyboard, operate described graphical user interface window object, and obtain its control display information; Call lower data Processing Interface function, in conjunction with the expected results in test case, test result is judged, determine whether by test;
By each test case by situation, exported by test report.
Wherein, each described test case is made up of multiple test step; Each described test step comprises: operand ID, object type, type of action, action parameter, time delay, information; Wherein, operand ID, the object ID that namely described graphical user interface window object information is corresponding.
Further, described test document Rich Text Format is write.
Optionally, the method also comprises: controlled this test process by testing apparatus.
The present invention can reach following beneficial effect:
The present invention adopts plain text mode to deposit test parameter and test result comparison data, both space was saved, do not need special resolver, just can read by means of only basic file and character string access API, take into account the needs that test process is separated with test data simultaneously yet yet; . the present invention adopts and obtains with underlying function interface data the mode combined by interface control display information, carries out analysis and judges, provide result more effective to test result; The present invention is on the basis of test automatically, and the testing apparatus adding test process controls and test report, can complete the test function automatic demonstrating to user.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the process flow diagram of a kind of Embedded complete automatic test method of the present invention;
Fig. 2 is the process flow diagram of an instantiation of a kind of Embedded complete automatic test method of the present invention;
Fig. 3 is the schematic diagram of a test suite of the present invention composition structure instantiation.
Fig. 4 is a concrete form schematic diagram of test report of the present invention.
Fig. 5 is the structural representation of test case of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
The present invention uses Hash table (also crying hash table) HashTable to prestore graphical user interface window object information, use basic file and character string access API (Application Programming Interface, application programming interface) read and resolve test document, utilize the message mechanism of Windows, analog mouse, input through keyboard, control test/presentation process, test result is judged, provides test report.Pilot process is without the need to manual intervention.
Fig. 1 is the process flow diagram of a kind of Embedded complete automatic test method of the present invention, and as shown in the figure, the method comprises the following steps:
Step 101, writes test document, and this test document comprises test plan and test case; Described test case comprises execution object, execution parameter and expected results; This execution object comprises object ID corresponding to graphical user interface window object information;
Step 102, when graphic user interface initialization, obtains object ID corresponding to this graphical user interface window object information with the form inserting function, by hash function by graphical user interface window object information stored in Hash table;
Step 103, reads described test document, and according to described test plan, chooses corresponding test case;
The corresponding test document of each test case, is resolved by file access basic under Windows and string operation API.
Step 104, according to described object ID, reads the graphical user interface window object information in described Hash table;
Step 105, send message to by the window object operated, analog mouse and keyboard, operate described graphical user interface window object, and obtain its control display information; Call lower data Processing Interface function, in conjunction with the expected results in test case, test result is judged, determine whether by test;
According to the test case chosen, read and analyze corresponding test document, extract the execution object of each test step, execution parameter and test result basis for estimation, API is sent by windows messaging, SendMessage, PostMessage send message to by the window object operated, analog mouse, key presses and obtain control display information, call lower data Processing Interface function as required, test result judged.
Step 106, by each test case by situation, exported by test report.
Apply this method below by " hand-held gigabit Ethernet quality tester " to realize this instantiation of autorun and be described.
This tester adopts ARM920T to be the Embedded Hardware Platform of core, memory headroom 32MB, run WinCE5.0 operating system, traffic statistics and generation, data capture and decoding, protocol emulation, testing lines, error code testing and RFC2544 can be realized and the function such as to test, the optimum configurations that quantity does not wait all is contained in every function, the result that different parameter combinations produces is all different, therefore, complete all testing authentications by hand, not only waste time and energy, the consistance of result is also difficult to ensure.
After application this method, achieve unattended automatic test, original test job that can complete 1 for 2.5 hours by a skilled tester was just completed in 20 minutes.
Fig. 2 is the process flow diagram that this method realizes in above-mentioned tester, and the step comprised is as follows:
Step 201, writes test document, and this test document comprises test plan and test case; These test cases are organized according to functional module, and the test case belonging to same function is classified as a test suite.As shown in Figure 3, be the schematic diagram of a test suite composition structure of the present invention instantiation;
Step 202, during graphic user interface initialization, at the afterbody of each dialog box window OnInitDialog function, insert the function of NextStep, this function only needs an input parameter, i.e. dialog box window pointer; Corresponding ID can be obtained by this pointer, then by hash function by graphical user interface window object information stored in Hash table, be implemented as follows:
Step 203, reads described test document, and according to described test plan, chooses corresponding test case;
The corresponding test document of each test case, is resolved by file access basic under Windows and string operation API, obtains the information of each test step under test case.
Step 204, according to described object ID, by inquiry Hash table, obtains graph of a correspondence user interface windows pointer to object;
Step 205, according to analysis gained test step information and window object pointer, send API by windows messaging, SendMessage, PostMessage are to the message being sent defined in test step by the window object operated, analog mouse and keyboard behavior, and obtain its control display information; Meanwhile, call lower data Processing Interface function, in conjunction with the expected results in test case, judge test result, whether discriminating test passes through;
In measuring executing process, each test step provides corresponding information display, give time-out/continuation, end, next test case, a upper test case simultaneously and return the prompt operation that test case selects interface, facilitate during function demonstration and carry out manual intervention.
Step 206, after selected test case is all finished, each test case by situation, export with test report form.As shown in Figure 4, be a concrete form schematic diagram of test report of the present invention.
Fig. 5 is the structural representation of test case of the present invention, and as shown in the figure, each described test case is made up of multiple test step; Each described test step comprises: operand ID, object type, type of action, action parameter, time delay, information; Wherein, operand ID, the ID that namely described graphical user interface window is corresponding.
Further, described test document Rich Text Format is write.
Optionally, the method also comprises: controlled this test process by testing apparatus.
Complete automatic test, sometimes need the cooperation of testing apparatus, therefore need in testing procedure, embed corresponding testing apparatus and control.
The present invention can reach following beneficial effect:
The present invention adopts plain text mode to deposit test parameter and test result comparison data, both space was saved, do not need special resolver, just can read by means of only basic file and character string access API, take into account the needs that test process is separated with test data simultaneously yet yet; . the present invention adopts and obtains with underlying function interface data the mode combined by interface control display information, carries out analysis and judges, provide result more effective to test result; The present invention, on the basis of test automatically, adds the control of test process, can realize the automatic Display of product.
Those skilled in the art can also recognize the various illustrative components, blocks (illustrativelogical block) that the embodiment of the present invention is listed, unit, and step can pass through electronic hardware, computer software, or both combinations realize.For the replaceability (interchangeability) of clear displaying hardware and software, above-mentioned various illustrative components (illustrativecomponents), unit and step have universally described their function.Such function is the designing requirement realizing depending on specific application and whole system by hardware or software.Those skilled in the art for often kind of specifically application, can use the function described in the realization of various method, but this realization can should not be understood to the scope exceeding embodiment of the present invention protection.
Above-described embodiment; object of the present invention, technical scheme and beneficial effect are further described; be understood that; the foregoing is only the specific embodiment of the present invention; the protection domain be not intended to limit the present invention; within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (4)

1. an Embedded complete automatic test method, is characterized in that, comprising:
Write test document, this test document comprises test plan and test case; Described test case comprises execution object, execution parameter and expected results etc.; This execution object comprises ID corresponding to graphical user interface window;
When graphic user interface initialization, obtain ID corresponding to this graphical user interface window and pointer with the form inserting function, by hash function by the information such as ID and pointer stored in Hash table;
Read described test document, and according to described test plan, choose corresponding test case;
According to described object ID, read the graphical user interface window object information in described Hash table;
Send message to by the window object operated, analog mouse and keyboard, operate described graphical user interface window object, and obtain its control display information; Call lower data Processing Interface function, in conjunction with the expected results in test case, test result is judged, determine whether by test;
By each test case by situation, exported by test report.
2. method according to claim 1, is characterized in that, each described test case is made up of multiple test step; Each described test step comprises: operand ID, object type, type of action, action parameter, time delay, information; Wherein, operand ID, the ID that namely described graphical user interface window is corresponding.
3. method according to claim 1, is characterized in that, described test document Rich Text Format is write.
4. method according to claim 1, is characterized in that, the method also comprises: control test process, and the robotization completing product is shown.
CN201510185469.1A 2015-04-17 2015-04-17 Embedded whole machine automatic testing method Pending CN104820638A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510185469.1A CN104820638A (en) 2015-04-17 2015-04-17 Embedded whole machine automatic testing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510185469.1A CN104820638A (en) 2015-04-17 2015-04-17 Embedded whole machine automatic testing method

Publications (1)

Publication Number Publication Date
CN104820638A true CN104820638A (en) 2015-08-05

Family

ID=53730939

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510185469.1A Pending CN104820638A (en) 2015-04-17 2015-04-17 Embedded whole machine automatic testing method

Country Status (1)

Country Link
CN (1) CN104820638A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106815100A (en) * 2015-11-27 2017-06-09 北京国双科技有限公司 Interface test method and device
CN112346918A (en) * 2020-10-26 2021-02-09 眸芯科技(上海)有限公司 Method and application for assisting waveform debug in chip verification

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1744056A (en) * 2004-09-04 2006-03-08 华为技术有限公司 Automatic test method of application
CN101241466A (en) * 2007-02-08 2008-08-13 深圳迈瑞生物医疗电子股份有限公司 Embedded software test method and system
CN101478449A (en) * 2009-01-22 2009-07-08 凌阳科技股份有限公司 Protocol automatic test method and system thereof
CN103559445A (en) * 2013-11-07 2014-02-05 北京奇虎科技有限公司 Application-program interactive control method and device
CN104133764A (en) * 2013-05-03 2014-11-05 腾讯科技(深圳)有限公司 Response test method and response test device of application program interface

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1744056A (en) * 2004-09-04 2006-03-08 华为技术有限公司 Automatic test method of application
CN101241466A (en) * 2007-02-08 2008-08-13 深圳迈瑞生物医疗电子股份有限公司 Embedded software test method and system
CN101478449A (en) * 2009-01-22 2009-07-08 凌阳科技股份有限公司 Protocol automatic test method and system thereof
CN104133764A (en) * 2013-05-03 2014-11-05 腾讯科技(深圳)有限公司 Response test method and response test device of application program interface
CN103559445A (en) * 2013-11-07 2014-02-05 北京奇虎科技有限公司 Application-program interactive control method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈刚: "面向云计算的软件可用性机制研究", 《中国优秀博士论文全文数据库 信息科技辑》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106815100A (en) * 2015-11-27 2017-06-09 北京国双科技有限公司 Interface test method and device
CN112346918A (en) * 2020-10-26 2021-02-09 眸芯科技(上海)有限公司 Method and application for assisting waveform debug in chip verification

Similar Documents

Publication Publication Date Title
US9754059B2 (en) Graphical design verification environment generator
CN104317589B (en) A kind of code automatic generation method and device for being used to load dynamic link library
US7895575B2 (en) Apparatus and method for generating test driver
CN109933521A (en) Automated testing method, device, computer equipment and storage medium based on BDD
CN112270149A (en) Verification platform automation integration method and system, electronic equipment and storage medium
JP2007012003A (en) System for providing development environment of feature-oriented software product line
CN103345446A (en) Automated testing method suitable for remote control products
CN108647147B (en) Automatic testing robot implemented by using atlas analysis and use method thereof
US20080162104A1 (en) Simulation data creation supporting device
Sun et al. Specification-driven automated testing of GUI-based Java programs
CN104111852A (en) Web application automated testing system and testing method based on data drive
CN106528429A (en) UI testing method and device
JP2009163609A (en) Program and device for generating test data
CN114297961A (en) Chip test case processing method and related device
CN113126993B (en) Automatic test method and system applied to vehicle detection software
CN104820638A (en) Embedded whole machine automatic testing method
CN111736815A (en) Test file script modular development tool, system and method
CN101727384B (en) Control method for automatically testing application software
Safa The making of user-interface designer a proprietary DSM tool
CN100442729C (en) Configuration method of tested system in conformance test of network protocol
WO2009091088A1 (en) Method of generating user interface model applicable to various platform and apparatus thereof
CN117193733B (en) Method for constructing and using example library and method for evaluating generated example code
JP2002024053A (en) General purpose inspection system on which log function is mounted
CN118170640A (en) Web application automatic test method based on model keyword driving
CN117555803A (en) Function test method and device based on visual programming and visual programming system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20150805