CN1744056A - Automatic test method of application - Google Patents

Automatic test method of application Download PDF

Info

Publication number
CN1744056A
CN1744056A CN 200410079042 CN200410079042A CN1744056A CN 1744056 A CN1744056 A CN 1744056A CN 200410079042 CN200410079042 CN 200410079042 CN 200410079042 A CN200410079042 A CN 200410079042A CN 1744056 A CN1744056 A CN 1744056A
Authority
CN
China
Prior art keywords
test
case
agent module
client
application program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN 200410079042
Other languages
Chinese (zh)
Other versions
CN100340997C (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CNB2004100790425A priority Critical patent/CN100340997C/en
Publication of CN1744056A publication Critical patent/CN1744056A/en
Application granted granted Critical
Publication of CN100340997C publication Critical patent/CN100340997C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The method includes steps: (1) based on interface to Windows and controls of application program to be tested, some cases for test are edited; case ID is setup for each test case; each test includes some testing steps, and step ID is setup for each testing step; (2) a test proxy module is embedded in application program to be tested in order to execute each testing step in a test case; (3) loading all test cases to user test end, and down loading set of case ID to test proxy module and executing test commands; (4) according to received sequence of case ID, the test proxy module obtains and executes each testing step for relevant test case; through certain communication mechanism, the test proxy module requests the user test ends to execute some testing steps to complete test cases in cooperation. The method executes test cases in sequence so as to realize testing application programs automatically.

Description

A kind of automatic test approach of application program
Technical field
The present invention relates to program test, refer to a kind of automatic test approach of application program especially.
Background technology
The automatization testing technique of windows platform application mainly is to carry out message by hook to catch at present, and the form of recording and playback script is tested.But this test can't be tackled off-gauge control, and is for all nonstandard control that interface database such as BCG comprise, often malfunctioning.In addition, be difficult to test frame is transformed, add the particular interface of oneself, as carry out data check etc., need carry out the design and the realization of interface with very complicated method, workload is very big.
General interface detection pattern as shown in Figure 1 in the prior art, it only can be recorded, playback, if when obtaining the test result of standard and measured result and comparing, check the content based on special interface (such as access database), the interface routine of the write specialized of having to such as DLL etc. come external test procedure to carry out interface, also need test procedure can support this interface, very loaded down with trivial details.
In addition, for the Windows complex control after the expansion, such as novel .Net interface and defined interface control, the operation that this traditional recording and replaying method often can not be stable, and being subject to many limitations is such as must be at front stage operation etc.
If test data requires to be complementary with extraneous data flexibly, must support this interface by test procedure, and some test procedure can't satisfy many-sided this requirement.If self-defined test output, form etc. generally also can't be realized.Can only defer to the realization function of testing tool, the user can't oneself customize.
Summary of the invention
The invention provides a kind of automatic test approach of application program, need not user intervention, finish the whole test process of application program automatically, and the convenient comparison that realizes test data, and can carry out on the backstage.
The automatic test approach of application program provided by the invention comprises the following steps:
A) according to the window interface and the control of tested application program, write some test cases, each test case is provided with a use-case ID;
B) in tested application program, embed a test agent module, in order to finish the execution of each testing procedure in the test case;
C) test subscriber holds and loads whole test cases, and issues test case ID set and carry out test command to the test agent module;
D) testing procedure of corresponding test case is obtained and carried out to the test agent module according to the use-case ID order that is received;
E) if all testing procedures of this test case are finished, then judge whether to also have unenforced test case, if, then go to step D, otherwise, auto test flow finished.
According to said method of the present invention, each testing procedure of described test case identifies ID in steps, the test agent module need to judge whether test client to cooperate in each testing procedure and carries out interface operation, if, then send the test case step and carry out message to client executing, return continuation message and testing procedure ID after client is finished, the test agent module continues down to carry out from this testing procedure; If not, then continue to carry out the next procedure of this test case.
According to said method of the present invention, described application program is the application program based on the Windows window.
According to said method of the present invention, realize a foundation class that comprises the basic operation of Windows window interface, described test client and described test agent module realize the test execution of interface operation by this foundation class.
According to said method of the present invention, described test agent module and test client use described foundation class and tested application program to realize the interacting message of interface operation in the process of implementation of test cases.
According to said method of the present invention,, realize testing synchronous coordination by interacting message between the two if when needing test client to cooperate the test agent module to carry out interface operation.
According to said method of the present invention, the following operation of described foundation class encapsulation:
A searches the window that current effective is mated certain title;
B searches subwindow in certain window according to the attribute of parent window handle and subwindow or text handle;
The operation of c button click, parameter: handle;
D selects the operation of certain project of ComboBox according to the serial number of text;
E imports the operation of certain character in edit box.
Other interface operation that need encapsulate of f.
According to said method of the present invention, described test agent module is with tested application program launching one hide window, and described test client is searched and issued test case ID behind this hide window handle and gather to the test agent module.
According to said method of the present invention, described test agent module is obtained test result and is compared with expected results, judges with this whether test is successful, and test result is write an outside shared data memory module; Described test client is from this shared data memory module read test result and processing.
According to said method of the present invention, described test case can be passed through client-side editing, and is stored in and is provided with the back in the described shared data memory module and loads.
Test case of the present invention realizes, as long as the general personnel that grasp VC++ are realization able to programme, the whole robotizations of whole test process realize improving testing efficiency greatly, bigger saving testing cost.In addition, the inventive method can both realize test to control commonly used and non-common control.
Description of drawings
Fig. 1 is the test model synoptic diagram of message-driven in the prior art.
Fig. 2 is the test frame synoptic diagram that method of testing of the present invention adopted.
Fig. 3 is a method of testing particular flow sheet of the present invention.
Embodiment
The test frame synoptic diagram that method of testing of the present invention adopted as shown in Figure 2.Comprise:
Test client: described test client comprises that test case imports the interface, and test case is carried out interface or the like, and the user can oneself add many expanded functions as required.
The shared data memory module: for the self-defining data file database in outside, be used to preserve test case, and store test results.
Test agent module: embed tested application program inside, has a window (invisible on the interface) with the tested program startup to the user, this test agent module is mainly finished the execution of test case testing procedure, the part that can't oneself finish in the testing procedure is (because some operation can cause self-locking, after program ejection dialog box, can't oneself close this dialog box), the test agent module is sent request to test client, receives to continue to carry out test after client is finished request transaction; This test agent module is carried out test logic simultaneously and is judged and output test result etc.
In specific implementation, also can realize a foundation class, comprise the basic operation of Windows window interface.This class can encapsulate following operation:
A searches the window that current effective is mated certain title;
B searches subwindow in certain window according to the attribute of parent window handle and subwindow or text handle;
The operation of c button click, parameter: handle;
D selects the operation of certain project of ComboBox according to the serial number of text;
E imports the operation of certain character in edit box;
F other need be in the method for interface and the enterprising line operate of control.
This class can tested client and the test agent module use jointly.
Described test client and described test agent module realize the test execution of interface operation by this foundation class; Described test agent module uses described foundation class and tested application program to realize the interacting message of interface operation in the process of implementation of test cases.Described interaction message can adopt common window message, self-defined message and Windows copy message etc.
Method of testing idiographic flow of the present invention comprises the steps: as shown in Figure 3
Step 11: start auto test flow at test client;
Step 12: test client reads the test case that is pre-stored in the shared data memory module and loads; Described test case is to write according to the Windows window interface and the control of tested application program, and each test case is provided with a use-case ID; Each test case also comprises some testing procedures, and each testing procedure is provided with a step ID;
Step 13: test client is searched window handle according to text, finds the hide window of test agent module, issues test case ID set and test execution order to the test agent module;
Step 14: the test agent module is according to the test case ID that receives, and beginning is delivered the message of beginning test procedure to self;
Step 15: the test agent module is obtained the testing procedure of next test case according to test case ID set order;
Step 16: the testing procedure of test agent module implementation of test cases, in the step implementation, need to judge whether test client to cooperate the execution interface operation, if, execution in step 17, otherwise, finish current step and skip to step 18;
Step 17: the test agent module sends the test case step and carries out message to the test client execution, returns continuation message and current step ID after test client is finished; Execution in step 18;
Step 18: the test agent module judges whether whole testing procedures of current test case are finished, if then execution in step 19, otherwise, skip to step 16;
Step 19: the test agent module judges whether whole test cases are finished, and if not, skip to step 15, otherwise execution in step 20;
Step 20: finish whole auto test flow.
According to above-mentioned steps of the present invention,, realize testing synchronous coordination by interacting message between the two if when needing test client to cooperate the test agent module to carry out interface operation.
After test was finished, described test agent module was obtained test result and is compared with expected results, judges with this whether test is successful, and test result is write an outside shared data memory module; Described test client is from this shared data memory module read test result and processing.
The above; only for the preferable embodiment of the present invention, but protection scope of the present invention is not limited thereto, and anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; the variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claims.

Claims (10)

1, a kind of automatic test approach of application program comprises the following steps:
A) according to the window interface and the control of tested application program, write some test cases, each test case is provided with a use-case ID;
B) in tested application program, embed a test agent module, in order to finish the execution of each testing procedure in the test case;
C) test subscriber holds and loads whole test cases, and issues test case ID set and carry out test command to the test agent module;
D) testing procedure of corresponding test case is obtained and carried out to the test agent module according to the use-case ID order that is received;
E) if all testing procedures of this test case are finished, then judge whether to also have unenforced test case, if, then go to step D, otherwise, auto test flow finished.
2, the method for claim 1, it is characterized in that: each testing procedure of described test case identifies ID in steps, the test agent module need to judge whether test client to cooperate in each testing procedure and carries out interface operation, if, then send the test case step and carry out message to client executing, return continuation message and testing procedure ID after client is finished, the test agent module continues down to carry out from this testing procedure; If not, then continue to carry out the next procedure of this test case.
3, method as claimed in claim 2 is characterized in that: described application program is the application program based on the Windows window.
4, method as claimed in claim 3 is characterized in that: realize a foundation class that comprises the basic operation of Windows window interface, described test client and described test agent module realize the test execution of interface operation by this foundation class.
5, method as claimed in claim 4 is characterized in that: described test agent module and test client use described foundation class and tested application program to realize the interacting message of interface operation in the process of implementation of test cases.
6, method as claimed in claim 5 is characterized in that: if when needing test client to cooperate the test agent module to carry out interface operation, realize testing synchronous coordination by interacting message between the two.
7, as claim 4 or 5 described methods, it is characterized in that: the following operation of described foundation class encapsulation:
A searches the window that current effective is mated certain title;
B searches subwindow in certain window according to the attribute of parent window handle and subwindow or text handle;
The operation of c button click, parameter: handle;
D selects the operation of certain project of ComboBox according to the serial number of text;
E imports the operation of certain character in edit box.
Other interface operation that need encapsulate of f.
8, the method for claim 1 is characterized in that: described test agent module is with tested application program launching one hide window, and described test client is searched and issued test case ID behind this hide window handle and gather to the test agent module.
9, the method for claim 1 is characterized in that: described test agent module is obtained test result and is compared with expected results, judges with this whether test is successful, and test result is write an outside shared data memory module; Described test client is from this shared data memory module read test result and processing.
10, method as claimed in claim 9 is characterized in that: described test case can be passed through client-side editing, and is stored in and is provided with the back in the described shared data memory module and loads.
CNB2004100790425A 2004-09-04 2004-09-04 Automatic test method of application Expired - Fee Related CN100340997C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2004100790425A CN100340997C (en) 2004-09-04 2004-09-04 Automatic test method of application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2004100790425A CN100340997C (en) 2004-09-04 2004-09-04 Automatic test method of application

Publications (2)

Publication Number Publication Date
CN1744056A true CN1744056A (en) 2006-03-08
CN100340997C CN100340997C (en) 2007-10-03

Family

ID=36139440

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2004100790425A Expired - Fee Related CN100340997C (en) 2004-09-04 2004-09-04 Automatic test method of application

Country Status (1)

Country Link
CN (1) CN100340997C (en)

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011210234A (en) * 2010-03-29 2011-10-20 Nec (China) Co Ltd Method and system for creating object of component in process
CN102467442A (en) * 2010-11-02 2012-05-23 腾讯科技(深圳)有限公司 Software testing method, system and equipment
CN102541728A (en) * 2010-12-14 2012-07-04 北京新媒传信科技有限公司 Method for expanding identifiable control of automatic test tool
CN102736013A (en) * 2011-04-12 2012-10-17 安凯(广州)微电子技术有限公司 Idle state test method of system-on-chip (SoC), system and test device
CN102938800A (en) * 2012-11-07 2013-02-20 大唐移动通信设备有限公司 System and method for automatically testing wireless communication quality
CN101098200B (en) * 2006-06-27 2014-02-19 中兴通讯股份有限公司 Method for implementing customizable test procedure
CN103605092A (en) * 2013-10-23 2014-02-26 上海华力微电子有限公司 Wat test system
CN103853663A (en) * 2014-03-25 2014-06-11 北京金山网络科技有限公司 Application program test method and system
CN104008043A (en) * 2013-02-21 2014-08-27 腾讯科技(深圳)有限公司 Method for testing across terminals and to-be-tested terminals and testing terminal
CN104809062A (en) * 2015-04-22 2015-07-29 北京京东尚科信息技术有限公司 Test method and system of artificial intelligence answering system
CN104820638A (en) * 2015-04-17 2015-08-05 中国电子科技集团公司第四十一研究所 Embedded whole machine automatic testing method
CN104834586A (en) * 2014-02-10 2015-08-12 腾讯科技(深圳)有限公司 Automatic test method, device and system of Android interface
CN105095069A (en) * 2015-06-19 2015-11-25 北京京东尚科信息技术有限公司 Test method and system of artificial intelligence answering system
CN105138450A (en) * 2015-07-31 2015-12-09 北京金山安全软件有限公司 Software stability testing method and device
CN106028367A (en) * 2016-06-23 2016-10-12 惠州Tcl移动通信有限公司 Automatic testing method and system based on CMWrun testing platform
CN107357725A (en) * 2017-06-29 2017-11-17 腾讯科技(深圳)有限公司 Application testing method and device
WO2018036530A1 (en) * 2016-08-26 2018-03-01 上海合福信息科技有限公司 Method for generating test design book
CN108089807A (en) * 2013-11-25 2018-05-29 联想(北京)有限公司 Information processing method and electronic equipment
CN109032870A (en) * 2018-08-03 2018-12-18 百度在线网络技术(北京)有限公司 Method and apparatus for test equipment
CN110674030A (en) * 2019-08-27 2020-01-10 北京金堤科技有限公司 Application testing method and device, computer readable storage medium and electronic equipment
CN112256554A (en) * 2019-07-22 2021-01-22 腾讯科技(深圳)有限公司 Method and equipment for testing based on scene test case
CN115048293A (en) * 2022-06-07 2022-09-13 中国电力科学研究院有限公司 Method and system for testing electric energy meter application program of embedded operating system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1115628C (en) * 1999-09-30 2003-07-23 深圳市中兴通讯股份有限公司 Software simulation test method
CN1139876C (en) * 1999-11-30 2004-02-25 深圳市中兴通讯股份有限公司 Embedded software aided debugging method
US7093238B2 (en) * 2001-07-27 2006-08-15 Accordsqa, Inc. Automated software testing and validation system
CN1310150C (en) * 2002-11-21 2007-04-11 中兴通讯股份有限公司 Embedded software test method
CN1519725A (en) * 2003-01-20 2004-08-11 英业达股份有限公司 Visual method ofr testing object
CN1487446A (en) * 2003-06-24 2004-04-07 深圳市华磊网络技术有限公司 Method for the server and to supply user's interface for Internet explorer client end

Cited By (33)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101098200B (en) * 2006-06-27 2014-02-19 中兴通讯股份有限公司 Method for implementing customizable test procedure
JP2011210234A (en) * 2010-03-29 2011-10-20 Nec (China) Co Ltd Method and system for creating object of component in process
CN102467442A (en) * 2010-11-02 2012-05-23 腾讯科技(深圳)有限公司 Software testing method, system and equipment
CN102467442B (en) * 2010-11-02 2015-04-29 腾讯科技(深圳)有限公司 Software testing method, system and equipment
CN102541728A (en) * 2010-12-14 2012-07-04 北京新媒传信科技有限公司 Method for expanding identifiable control of automatic test tool
CN102736013B (en) * 2011-04-12 2015-08-05 安凯(广州)微电子技术有限公司 A kind of idle condition method of testing of SoC chip, system and proving installation
CN102736013A (en) * 2011-04-12 2012-10-17 安凯(广州)微电子技术有限公司 Idle state test method of system-on-chip (SoC), system and test device
CN102938800A (en) * 2012-11-07 2013-02-20 大唐移动通信设备有限公司 System and method for automatically testing wireless communication quality
CN102938800B (en) * 2012-11-07 2015-09-02 大唐移动通信设备有限公司 A kind of radio communication quality Auto-Test System and method
CN104008043A (en) * 2013-02-21 2014-08-27 腾讯科技(深圳)有限公司 Method for testing across terminals and to-be-tested terminals and testing terminal
CN103605092A (en) * 2013-10-23 2014-02-26 上海华力微电子有限公司 Wat test system
CN103605092B (en) * 2013-10-23 2016-08-24 上海华力微电子有限公司 Wat test system and method for testing
CN108089807B (en) * 2013-11-25 2020-08-25 联想(北京)有限公司 Information processing method and electronic device
CN108089807A (en) * 2013-11-25 2018-05-29 联想(北京)有限公司 Information processing method and electronic equipment
CN104834586A (en) * 2014-02-10 2015-08-12 腾讯科技(深圳)有限公司 Automatic test method, device and system of Android interface
CN104834586B (en) * 2014-02-10 2018-11-20 腾讯科技(深圳)有限公司 Android interface automation test method, apparatus and system
CN103853663B (en) * 2014-03-25 2016-08-31 北京金山网络科技有限公司 Applied program testing method and system
CN103853663A (en) * 2014-03-25 2014-06-11 北京金山网络科技有限公司 Application program test method and system
CN104820638A (en) * 2015-04-17 2015-08-05 中国电子科技集团公司第四十一研究所 Embedded whole machine automatic testing method
CN104809062B (en) * 2015-04-22 2017-12-01 北京京东尚科信息技术有限公司 A kind of method of testing and system of artificial intelligence response system
CN104809062A (en) * 2015-04-22 2015-07-29 北京京东尚科信息技术有限公司 Test method and system of artificial intelligence answering system
CN105095069B (en) * 2015-06-19 2018-06-08 北京京东尚科信息技术有限公司 A kind of artificial intelligence response system detection method and system
CN105095069A (en) * 2015-06-19 2015-11-25 北京京东尚科信息技术有限公司 Test method and system of artificial intelligence answering system
CN105138450A (en) * 2015-07-31 2015-12-09 北京金山安全软件有限公司 Software stability testing method and device
CN106028367A (en) * 2016-06-23 2016-10-12 惠州Tcl移动通信有限公司 Automatic testing method and system based on CMWrun testing platform
WO2018036530A1 (en) * 2016-08-26 2018-03-01 上海合福信息科技有限公司 Method for generating test design book
CN107357725A (en) * 2017-06-29 2017-11-17 腾讯科技(深圳)有限公司 Application testing method and device
CN107357725B (en) * 2017-06-29 2018-09-04 腾讯科技(深圳)有限公司 Application testing method and device
CN109032870A (en) * 2018-08-03 2018-12-18 百度在线网络技术(北京)有限公司 Method and apparatus for test equipment
CN112256554A (en) * 2019-07-22 2021-01-22 腾讯科技(深圳)有限公司 Method and equipment for testing based on scene test case
CN112256554B (en) * 2019-07-22 2023-06-16 腾讯科技(深圳)有限公司 Method and equipment for testing based on scene test cases
CN110674030A (en) * 2019-08-27 2020-01-10 北京金堤科技有限公司 Application testing method and device, computer readable storage medium and electronic equipment
CN115048293A (en) * 2022-06-07 2022-09-13 中国电力科学研究院有限公司 Method and system for testing electric energy meter application program of embedded operating system

Also Published As

Publication number Publication date
CN100340997C (en) 2007-10-03

Similar Documents

Publication Publication Date Title
CN100340997C (en) Automatic test method of application
US6317756B1 (en) On-the-fly garbage collector
CN1845120A (en) Automatic analysis system and method for malicious code
CN1885264A (en) Software package constructing method and system for embedded system
CN1746844A (en) Method for monitoring and managing machine group system of cross-operation platform
CN1867911A (en) Promotion and demotion techniques to facilitate file property management between object systems
CN1747472A (en) Universal embedded marker and marking method based on CCP
CN1949185A (en) Parallel adjusting and performance analyzing method of supporting multi-language multi-platform under isomerized environment
CN109325016B (en) Data migration method, device, medium and electronic equipment
CN1920793A (en) Device and method for implementing test scenarios replay in different voice environment
CN106598859A (en) Appium multi-thread implementation system and method
CN100346315C (en) Three dimension mode construction software automatic testing method based on script
CN1549128A (en) Databank back-up method
CN1564489A (en) Testing method for limitting status machine of communication system
CN1818885A (en) Operation logbook obtaining method
CN101055542A (en) Symbol debug method and system in cross integration development environment
CN1949173A (en) Software assembling method and apparatus thereof
CN1269034C (en) Compression of executable document in embedded type system and its loading method
CN1805582A (en) Method of testing with integrated test tools
CN1152303C (en) Method and device for automatically recording and reproducing operation path on simulator
CN1369802A (en) Method for recording and automatically restoring flow state
CN1684043A (en) Real time monitoring system and method for computer files
CN1521994A (en) Method for implementing automatic test of intelligent service
CN1909481A (en) Method for realizing separation of testing appliance and its interface with engine
CN1848093A (en) Method for debugging high configuration and power supply interface module in basic inputting and outputting system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20071003

Termination date: 20140904

EXPY Termination of patent right or utility model