CN100468357C - Automatically testing interface of graphical user interface program and automatically testing method thereof - Google Patents

Automatically testing interface of graphical user interface program and automatically testing method thereof Download PDF

Info

Publication number
CN100468357C
CN100468357C CNB2006100270595A CN200610027059A CN100468357C CN 100468357 C CN100468357 C CN 100468357C CN B2006100270595 A CNB2006100270595 A CN B2006100270595A CN 200610027059 A CN200610027059 A CN 200610027059A CN 100468357 C CN100468357 C CN 100468357C
Authority
CN
China
Prior art keywords
data
automatic test
mode
playback
random
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.)
Expired - Fee Related
Application number
CNB2006100270595A
Other languages
Chinese (zh)
Other versions
CN101082877A (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.)
KETAI CENTURY SCIENCE AND TECHNOLOGY Co Ltd SHANGHAI
Original Assignee
KETAI CENTURY SCIENCE AND TECHNOLOGY Co Ltd SHANGHAI
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 KETAI CENTURY SCIENCE AND TECHNOLOGY Co Ltd SHANGHAI filed Critical KETAI CENTURY SCIENCE AND TECHNOLOGY Co Ltd SHANGHAI
Priority to CNB2006100270595A priority Critical patent/CN100468357C/en
Publication of CN101082877A publication Critical patent/CN101082877A/en
Application granted granted Critical
Publication of CN100468357C publication Critical patent/CN100468357C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a self-testing interface between driving and affair analyzer and self-testing method of image boundary program for user, which comprises the following parts: multiple line paths, one or more data file, random affair and allocating file. The self-testing method comprises the following steps: obtaining the operating pattern of self-testing interface; affirming whether the operating pattern is common pattern, recording pattern, playback pattern or random pattern; writing the data read by data line path into ordered data file when the operating pattern is recording pattern; reading data from ordered data file through reading data line path when the operating pattern is playback pattern; transmitting the data to the affair analyzer; hanging the reading data line path when the operating pattern is random pattern; generating random pattern through random affair generating line path; transmitting the affair to the affair analyzer to process. The invention is convenient to record and play back the operation of mouse and keyboard with automatic regression test, which is fit for robustness and limit test.

Description

The automatic test interface and the automatic test approach thereof of graphical user interface program
Technical field
The present invention relates to a kind of automatic test interface that graphical user interface program is tested, this test interface can by data file to the operation of drivings such as user's mouse and keyboard write down, playback.The invention still further relates to this automatic test interface and carry out automatic test method.
Background technology
Graphic user interface is a program to finally the representing of user, and the appreciable program part of user also has only graphic user interface, so the quality of graphic user interface directly influenced user experience, has also directly determined the quality of program.Just because of graphic user interface has so importance in application program, the test of graphic user interface also is subjected to people more and more pays close attention to.
Graphic user interface and user's generally is by hardware such as mouse (or touch-screen) and keyboards alternately, therefore mainly being the Test Engineer to the test of graphic user interface clicks the mouse or beats keyboard and test according to design and the test case armrest that generates are moving, result according to reality compares with expected results then, and whether detect application program has complete functional, fault-tolerance and robustness etc.But the function of present software product becomes increasingly complex, more and more perfect, a general cover software all comprises abundant user interface, and each interface comprises a plurality of object elements again, so the test of graphic user interface relies on the manual test method can't reach test target fully.And after the regression test and product up-gradation in software test procedure, all need to carry out a large amount of graphic user interface tests, at this moment the efficient of manual test can't satisfy the test needs; When software product was carried out robustness or limit test, the deficiency of manual test was completely exposed especially.
The Windows operating system of Microsoft provides a cover to be used for the automatic test interface of Windows graphic user interface: Hook (hook), this instrument can allow user oneself handle the various message that Windows operating system is sent out, and can realize record and the playback operated by this instrument.But API (application programming interfaces) and each message of using this instrument to be familiar with being correlated with, and want user oneself with manual each parameter of removing recording messages, this has increased testing cost undoubtedly, and this instrument is little for the effect of the robustness of graphic user interface and limit test.
Summary of the invention
The technical problem to be solved in the present invention provides a kind of graphical user's automatic test interface, and it has the record of mouse and keyboard operation and playback function, can be used for replacing Test Engineer's manual operations to carry out regression test, verifying software product functional; The present invention can also provide playback cycle and produce the random occurrence function, is used for software product is carried out robustness and limit test.For this reason, the present invention also will provide the method that a kind of this automatic test interface is tested.
For solving the problems of the technologies described above, the present invention is achieved by the following technical solutions: test interface comprises: a plurality of threads, one or more data file, random occurrence and a configuration file between driving and incident resolver automatically.
Described automatic test approach may further comprise the steps: obtain the operational mode of automatic test interface, determine that this operational mode is general mode, logging mode, playback mode or random pattern; When being logging mode, will write the data file that is used for preserving data of appointment from drive by the data that the reading of data thread reads; When being playback mode, the thread of reading of data reading of data from designated data files is issued these data the incident resolver then and is handled; When being random pattern, the reading of data thread is suspended, and produces thread by a random occurrence and produces random occurrence, and then incident is issued the incident resolver handle.
The present invention is owing to adopted technique scheme, has such beneficial effect, promptly realized record and playback function, improved the speed that needs the test done after regression test in the test process and the product up-gradation, and improved the test accuracy rate user's mouse and keyboard operation; And realized producing the function of random occurrence, thereby robustness and limit test have been realized to software product.
Description of drawings
Fig. 1 is the catenation principle figure of the automatic test interface of graphic user interface;
Fig. 2 is the inner structure schematic diagram of automatic test interface of the present invention;
Fig. 3 is according to event data form synoptic diagram of the present invention.
Embodiment
As shown in Figure 1, test interface is between driving and incident resolver automatically, and what the incident resolver was directly faced is automatic test interface, rather than drives, and it is transparent driving the incident resolver like this; And the incident resolver only is responsible for handling the data that automatic test interface sends.Automatically test interface comes to provide various data to resolver according to the difference of test-types.
As shown in Figure 2, this automatic test interface comprises: a plurality of threads, one or more data file, random occurrence and a configuration file.
Below in conjunction with specific embodiment automatic test interface of the present invention and automatic test approach implementation procedure thereof are further described:
At first, before starting the graphical interface of user program, pattern that automatic test interface need obtain operation this time is general mode, logging mode, playback mode or random pattern.Wherein, general mode refers to, directly data issued the incident resolver after keyboard or the mouse-driven reading of data to handle, and is equivalent to the test mode of prior art; Logging mode refers to that the data that obtain from described driving can be saved in it designated data files earlier; Playback mode refers to, direct reading of data from designated data files, rather than from drive reading of data, and then the incident resolver of issuing is handled; Random pattern refers to that test interface produces mouse and KeyEvent at random according to the speed of appointment in the described configuration file automatically, and the incident resolver is issued in this random occurrence handled.And the appointment of operational mode can realize by following dual mode: specify in configuration file or specify in order line, wherein the order line assigned priority is higher than the configuration file appointment.
For example,, in configuration file grafix.cfg, specify AutoTesttype=1, promptly be appointed as logging mode if need the program A by name of the graphical interface of user of operation, then can be with logging mode working procedure A; If but specified parameter during A again in operation is 2 to be appointed as playback mode, then because the order line assigned priority is higher than configuration file specifies, so at this moment can be with playback mode working procedure A.Wherein, the acquiescence operational mode is a general mode.
After obtaining concrete operational mode, obtain the thread of mouse and keyboard drive data and can carry out different operations according to different operational modes:
When this operational mode is logging mode, automatically the reading of data thread of test interface at first will be write the data file that is used for preserving data of appointment from the data that drivings such as mouse or keyboard obtain, the title of this data file is specified by the command line parameter of assignment graph program, as A-record.dat, then the file of appointment is called record.dat, if there is not the specified file name, then this document name can be defaulted as with program of the same name, as A/1, then with recording mode working procedure A, the file of appointment is called A.dat (A for not with the program name of suffix name).Because data are obtained by two threads, so need lock to file operation when these data are write file, avoid writing file bad.The record format of writing certain data in the file as shown in Figure 3, totally 3 parts, first is the zone bit of a position, the type of flag data, promptly to should be the mouse-driven data still be the keyboard drive data to Zhi Hou driving data.Second portion is the mouse that obtains or the driving data of keyboard from concrete driving, concrete size is by driving decision.Third part is interval time, represents the time interval of this incident and a last incident.After having moved program, can generate the data file of this record like this in current directory with recording mode.Also can be by clicking the button end record pattern of appointment, the situation of this end record pattern can be made as general mode with operational mode.
When operational mode is playback mode, the data that test interface can be preserved, obtain the driving data of mouse or keyboard automatically when designated data files is logging mode, then this driving data is issued the incident resolver and handled.When playback mode, the operation of keyboard has then been become control to playback, can quicken or deceleration-operation playback speed, also can control the current operation execution that whether circulates, if specified circulation to carry out, then can circulate and read data in the file, and data be issued the incident resolver handle.Its specific implementation method is as follows: mouse or keyboard thread that automatic test interface is used for reading of data then can not go to read corresponding driving, but from designated data files reading of data, the filename of this specified file is the same with filename in the above-mentioned logging mode is specified or the acquiescence name by order line.Simultaneously, test interface can be set up another a control thread and remove to read keyboard data automatically, is used for the control to playback, comprises control playback speed and time-out, continuation etc.When the graphical interface of user program start, automatically the main thread of test interface reads the zone bit of first data in the described data file earlier, this zone bit has determined that the reading of data thread still is the keyboard thread for the mouse thread, for example, if this zone bit is represented mouse, then the mouse thread is waken up, and the control of read data files is given the mouse thread, and the keyboard thread can only be waited for.Then, the mouse thread reads the mouse-driven data behind this zone bit successively, the zone bit of interval time and next data, wait for certain playback duration afterwards, this time is by obtaining according to a certain percentage the interval time that obtains, this ratio can be increased or reduced by the method for user by a beating keyboard, is mainly used in the control playback speed.After stand-by period arrives, again the mouse-driven data of obtaining are issued the incident resolver and handled.If the zone bit of next data that obtain this moment is identical with previous zone bit, then this thread continues reading of data; But if this moment next data of obtaining zone bit then wake other thread up for the zone bit of the reading of data thread of other type, as having obtained the keyboard zone bit in the mouse thread, then wake the keyboard thread up, allow the keyboard thread go to read next data, the mouse thread then enters waiting status.The rest may be inferred, and mouse thread and keyboard thread replace reading of data, run through until all data.After the ending of reading described data file,, then operational mode can be made as general mode, give the user control if program does not also withdraw from.If be shuffle data file pattern this moment, then can after a data file playback is intact, continue another data file of picked at random, play with continuation.
When operational mode was random pattern, mouse and keyboard thread all were suspended, and produced random occurrence but produce thread by an independent random occurrence.Automatically test interface produces mouse and KeyEvent at random according to the speed of appointment in the configuration file, and this incident is issued the incident resolver handle, also can specify the mouse zone and the key assignments that need filtration in the configuration file, the mouse event of Chan Shenging just can not carried out clicking operation in this zone so at random, also can not send the key assignments that needs filtration.Also can initiate a control thread during random pattern, be used to read the data of keyboard, to withdraw from or to proceed the operation of random test.
Engage specific embodiment below and illustrate in actual applications how to use automatic test interface of the present invention and method of testing thereof, the graphical interface of user program is tested.Before software product is tested automatically, at first need be by the Test Engineer according to the step described in the test cases, operation earlier is once when logging mode.After having moved, can generate data file, only need pattern be set to playback mode afterwards in current directory, and the preceding for it file that generates of specific data file, then can from this data file, obtain incident after the program run, realize playback to the last registration operation.
Also can carry out and repeatedly write down and save as different data files, carry out the shuffle file mode afterwards, like this data of this program in will these several data files of loop play same software.
When needs carry out robustness or limit test, can be set to the random occurrence pattern, can produce at random mouse and KeyEvent like this, mouse can be clicked the optional position in the interface, and send keyboard arbitrarily, and can move always, so just can be issued to robustness and limit test in the situation that does not need the people to intervene.

Claims (13)

1, a kind of automatic test interface of graphical user interface program is characterized in that, this automatic test interface comprises between driving and incident resolver:
A plurality of operational modes, this operational mode comprises logging mode, playback mode and random pattern;
One or more data files are used to preserve data;
The reading of data thread is used under logging mode from described driving reading of data and writes the designated data files, under playback mode from designated data files reading of data, and the data that read are issued described incident resolver handle;
Random occurrence produces thread, is used for producing random occurrence under random pattern, described incident resolver is issued in the random occurrence that is produced handled; With
Configuration file is used to specify the speed that random occurrence produces.
2, the automatic test interface of graphical user interface program according to claim 1 is characterized in that, the record format of data is in the described data file: zone bit, the type of flag data; The data of from concrete driving, obtaining; Interval time, the time interval between an expression current event and a last incident.
3, the automatic test interface of graphical user interface program according to claim 1 is characterized in that, described automatic test interface also comprises the control thread, is used for reading of data with the control playback, comprises the control playback speed, suspends playback and continues playback.
4, the automatic test interface of graphical user interface program according to claim 1, it is characterized in that, described configuration file also is used to specify mouse zone and the key assignments that needs filtration, thereby make the mouse event that produces at random not carry out clicking operation, also do not send the key assignments of appointment in the mouse zone of this appointment.
5, the automatic test interface of graphical user interface program according to claim 1, it is characterized in that, described operational mode is by specifying in described configuration file or specify in order line, and the operational mode of dual mode appointment possesses different priorities.
6, a kind of automatic test approach that utilizes the automatic test interface of the described graphical user interface program of claim 1 is characterized in that, may further comprise the steps:
Obtain the operational mode of automatic test interface, determine that this operational mode is general mode, logging mode, playback mode or random pattern;
When described operational mode is logging mode, will write the data file that is used for preserving data of appointment from drive by the data that the reading of data thread reads;
When described operational mode is playback mode, reading of data from designated data files, and the data that read are issued the incident resolver handle;
When described operational mode was random pattern, the reading of data thread was suspended, and produced thread by a random occurrence and produced random occurrence, and then incident is issued the incident resolver handle.
7, the automatic test approach of the automatic test interface of graphical user interface program according to claim 6, it is characterized in that, described operational mode can be specified by following dual mode: in configuration file, specifies or in order line, specifies, and the priority difference of dual mode.
8, the automatic test approach of the automatic test interface of graphical user interface program according to claim 6 is characterized in that, the mode of button that can be by clicking appointment finishes described logging mode, and operational mode is made as general mode subsequently.
9, the automatic test approach of the automatic test interface of graphical user interface program according to claim 6 is characterized in that, when described playback mode, the process of reading of data comprises from designated data files:
(1) when the graphical interface of user program start, the main thread of test interface reads first Data Labels position in the described data file automatically, the type of decision reading of data thread;
(2) corresponding reading of data thread reads the data in the described data file;
(3) during the data in the read data files, read the zone bit of driving data, interval time and next data successively, wait for certain playback duration then;
(4) after the playback duration, the driving data of obtaining is issued the incident resolver handle;
(5) if the zone bit of next data that reads this moment is identical with the zone bit of previous data, then enters step (6), otherwise wake other thread up, original reading of data thread then enters waiting status, and enters step (6);
(6) repeating step (2), last data in reading file;
(7) when if when reading the ending of described data file,, then operational mode is made as general mode if program does not also withdraw from.
10, according to the automatic test approach of the automatic test interface of claim 6 or 9 described graphical user interface program; it is characterized in that; when described playback mode; automatically test interface also can be initiated a control thread; read keyboard data; the speed of control playback comprises playback duration being set or suspending playback or the continuation playback.
11, according to the automatic test approach of the automatic test interface of claim 6 or 9 described graphical user interface program, it is characterized in that, described playback mode also can carry out playback by shuffle data file pattern, after the next data file playback of this shuffle data file pattern is intact, another data file of picked at random is continued to play.
12, the automatic test approach of the automatic test interface of graphical user interface program according to claim 6, it is characterized in that, when described operational mode is random pattern, in configuration file, specifies the generation speed of described random occurrence, and need the mouse zone and the key assignments of filtration.
13, according to the automatic test approach of the automatic test interface of claim 6 or 12 described graphical user interface program, it is characterized in that, when described operational mode is random pattern, also can initiate a control thread, be used to read the data of keyboard, to withdraw from or to proceed the operation of random test.
CNB2006100270595A 2006-05-30 2006-05-30 Automatically testing interface of graphical user interface program and automatically testing method thereof Expired - Fee Related CN100468357C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006100270595A CN100468357C (en) 2006-05-30 2006-05-30 Automatically testing interface of graphical user interface program and automatically testing method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006100270595A CN100468357C (en) 2006-05-30 2006-05-30 Automatically testing interface of graphical user interface program and automatically testing method thereof

Publications (2)

Publication Number Publication Date
CN101082877A CN101082877A (en) 2007-12-05
CN100468357C true CN100468357C (en) 2009-03-11

Family

ID=38912460

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006100270595A Expired - Fee Related CN100468357C (en) 2006-05-30 2006-05-30 Automatically testing interface of graphical user interface program and automatically testing method thereof

Country Status (1)

Country Link
CN (1) CN100468357C (en)

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101620564B (en) * 2008-06-30 2011-10-19 福建升腾资讯有限公司 Method for automatically testing recording playback mode of terminal system
CN101620565B (en) * 2008-07-04 2012-05-09 福建升腾资讯有限公司 Method for automatically testing functions of terminal system
CN101493790B (en) * 2009-02-27 2015-08-05 北京中星微电子有限公司 Record playback system and record back method
CN102147756B (en) * 2010-02-05 2013-04-03 中国移动通信集团公司 Methods and systems for testing terminal
CN101930399A (en) * 2010-08-16 2010-12-29 于秀山 Method for recording software test
CN102141957B (en) * 2010-10-21 2015-03-11 华为技术有限公司 Auxiliary test method, device and system for remote real machine
CN102591754A (en) * 2011-01-18 2012-07-18 智比特信息技术(镇江)有限公司 Automatic testing method for electronic product controlled by computer
CN103186459B (en) * 2011-12-30 2016-05-11 迈普通信技术股份有限公司 JAVA graphic user interface automatic test approach based on script
CN103577322B (en) 2012-08-08 2015-08-12 腾讯科技(深圳)有限公司 A kind of hit testing method and apparatus
CN102975749B (en) * 2012-11-21 2016-03-23 上海富欣智能交通控制有限公司 Based on event driven track traffic automatic train monitor and playback process method
WO2014117320A1 (en) * 2013-01-29 2014-08-07 Hewlett-Packard Development Company, L.P. Generating test code to test executable code
CN103268285A (en) * 2013-05-31 2013-08-28 百度在线网络技术(北京)有限公司 Method and device for automatic generation of robustness test case of API interface
CN103984625A (en) * 2014-05-12 2014-08-13 浪潮电子信息产业股份有限公司 System robustness testing method based on use rate analysis
CN105893236A (en) * 2015-01-26 2016-08-24 中兴通讯股份有限公司 Detection method, apparatus and system for suspend running-out fault of to-be-tested device
CN104657141B (en) * 2015-02-12 2017-09-26 金光 A kind of gui software wrapper and its implementation based on computer vision
CN106325827B (en) * 2015-06-16 2019-07-19 深圳市中兴微电子技术有限公司 A kind of random test program generation method and device
CN105718353B (en) * 2016-01-18 2019-01-29 深圳市紫光同创电子有限公司 It is a kind of for graphical interfaces application test method, apparatus and system
CN106886492A (en) * 2017-02-13 2017-06-23 北京趣拿软件科技有限公司 Method of testing and test device based on data readback
CN110351496B (en) * 2019-07-05 2021-11-26 晶晨半导体(上海)股份有限公司 Switching analysis method of signal source
CN111831559A (en) * 2020-06-24 2020-10-27 厦门亿联网络技术股份有限公司 QT interface program automatic detection method and device
CN112791387B (en) * 2021-01-08 2024-09-17 杭州雾联科技有限公司 Data processing method, device and medium based on mouse and keyboard

Also Published As

Publication number Publication date
CN101082877A (en) 2007-12-05

Similar Documents

Publication Publication Date Title
CN100468357C (en) Automatically testing interface of graphical user interface program and automatically testing method thereof
JP6757385B2 (en) Programmable logic controller and main unit
JP6757386B2 (en) Programmable logic controller and program creation support device
JP2553307B2 (en) Process monitoring method
KR101072211B1 (en) Interactive progress display enabling modification to computer operations
TWI438689B (en) Method and computer program product for creating host-level application-consistent backups of virtual machines
US20120131456A1 (en) Capture and Playback for GUI-Based Tasks
JP2006018827A (en) Smart user interface record and reproduction framework
US20050283673A1 (en) Information processing apparatus, information processing method, and program
JP4295775B2 (en) GUI test support system and application program for test support
CN102147756B (en) Methods and systems for testing terminal
US20070294708A1 (en) System, method and program tool to reset an application
TW200405695A (en) Accessibility system events mechanism and method
CN102519514B (en) One-click automatic testing realization method of electronic test instrument
US20120216031A1 (en) Method for configuring the generation and storage of output data, computer system, electromechanical device, operating system and data carrier
JP2005208967A5 (en)
JP2005208967A (en) Management computer and method for managing storage device
CN111126032B (en) Automatic document version generation method based on intelligent prediction of editing behaviors
CN106775503A (en) A kind of method and device for performing operational order
JP2549251B2 (en) How to create an annotation record for live data
CN106294081B (en) Analysis of biological information task run monitoring system
CN100375955C (en) Program compiling device using computor
JP6948450B2 (en) Programmable logic controller and main unit
JPH06208487A (en) Method for display and display system
JP6806946B2 (en) External setting devices and programs

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1109663

Country of ref document: HK

C14 Grant of patent or utility model
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: GR

Ref document number: 1109663

Country of ref document: HK

CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090311

Termination date: 20180530

CF01 Termination of patent right due to non-payment of annual fee