[go: up one dir, main page]

CN1280727C - Human-machine order testing method - Google Patents

Human-machine order testing method Download PDF

Info

Publication number
CN1280727C
CN1280727C CN 200310117550 CN200310117550A CN1280727C CN 1280727 C CN1280727 C CN 1280727C CN 200310117550 CN200310117550 CN 200310117550 CN 200310117550 A CN200310117550 A CN 200310117550A CN 1280727 C CN1280727 C CN 1280727C
Authority
CN
China
Prior art keywords
command
man
test
machine
automated
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
CN 200310117550
Other languages
Chinese (zh)
Other versions
CN1555014A (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN 200310117550 priority Critical patent/CN1280727C/en
Publication of CN1555014A publication Critical patent/CN1555014A/en
Application granted granted Critical
Publication of CN1280727C publication Critical patent/CN1280727C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

本发明的一种人机命令测试方法,其利用至少一通用计算机,实现人机命令的自动化测试,该方法包括以下步骤:设计人机命令的文件存储格式,以方便使用应用编程接口来获取目标值;设计人机命令的输入界面,通过该人机命令输入界面录入人机命令并保存,生成测试用例;设计自动化测试界面,并设置自动化测试参数;启动目标测试窗口,连接被测试系统;按需创建自动化测试线程,进行人机命令自动化测试;断开自动化测试系统与人机命令网管系统的连接。本发明方法采用了“程序与数据分离”与“Windows消息转发”相结合的技术构思,以实现自动化测试,减轻了测试成本,避免了重复劳动,降低了测试人员压力,并实现了提高测试工作效率和质量的效果。

Figure 200310117550

A man-machine command test method of the present invention utilizes at least one general-purpose computer to realize the automated test of man-machine commands, the method includes the following steps: designing the file storage format of man-machine commands to facilitate the use of application programming interfaces to obtain the target value; design the input interface of the man-machine command, enter the man-machine command through the man-machine command input interface and save it, and generate a test case; design the automated test interface and set the automated test parameters; start the target test window and connect to the system to be tested; press It is necessary to create an automated test thread to conduct automated testing of man-machine commands; disconnect the automated test system from the man-machine command network management system. The method of the invention adopts the technical concept of "separation of program and data" and "windows message forwarding" to realize automated testing, reduce testing costs, avoid duplication of labor, reduce the pressure of testing personnel, and realize the improvement of testing work The effect of efficiency and quality.

Figure 200310117550

Description

一种人机命令测试方法A method for man-machine command testing

技术领域technical field

本发明涉及一种计算机软件测试技术,具体地说,涉及嵌入式软件的一种通用人机命令自动化测试方法。The invention relates to a computer software testing technology, in particular to a general man-machine command automatic testing method for embedded software.

背景技术Background technique

目前,人机命令作为一种独特的、功能强大的网管方式是几乎所有嵌入式软件系统都必须提供的,而随着嵌入式软件系统开发的进展,不开避免地要进行人机命令的网管系统测试、回归测试。然而,对测试人员而言,一次次的系统测试或回归测试,意味着在做相同或相似的工作,如果能对这些重复工作进行改进和优化,就会使测试效率和测试质量得到很大的提高,最终达到提高产品质量的目的。经过对测试工作过程进行详细分析,可以得出影响测试工作效率和测试质量的因素主要体现在以下几个方面:At present, as a unique and powerful network management method, man-machine commands must be provided by almost all embedded software systems. With the development of embedded software systems, network management of man-machine commands is inevitable. System testing, regression testing. However, for testers, system testing or regression testing again and again means doing the same or similar work. If these repeated tasks can be improved and optimized, the test efficiency and test quality will be greatly improved. Improve, and finally achieve the purpose of improving product quality. After a detailed analysis of the testing process, it can be concluded that the factors that affect the testing efficiency and testing quality are mainly reflected in the following aspects:

1.对于回归测试或故障验证测试,测试人员总是重复地执行很多以前已经执行过的正常的操作。1. For regression testing or failure verification testing, testers always repeat many normal operations that have been performed before.

2.对于压力测试,测试人员总是人工去实现,因而在执行频度和数量上难以达到要求。2. For stress testing, testers always implement it manually, so it is difficult to meet the requirements in terms of frequency and quantity of execution.

3.对于并发测试,手工方式往往不能做到同步,因而无法实现真正的并发测试。3. For concurrency testing, manual methods often cannot achieve synchronization, so real concurrency testing cannot be realized.

4.对于故障复现测试,受限于测试人员的记忆能力,在一些故障的复现上,总是不能完全实现。4. For the fault recurrence test, limited by the memory ability of the testers, it is always impossible to fully realize the recurrence of some faults.

5.对于故障隐患测试,由于需要对系统进行深度、不间断测试,在时间有限的情况下,手工测试几乎无法进行。5. For the hidden trouble test, due to the need for in-depth and uninterrupted testing of the system, manual testing is almost impossible in the case of limited time.

6.对于时间利用情况,虽然被测系统可以24小时运行,但是测试人员夜间需要休息。6. Regarding time utilization, although the system under test can run 24 hours a day, testers need to rest at night.

用自动化测试代替繁重的手工测试,并提高测试效率和质量一直是人机命令网管系统测试工作改进的目标。目前商用的捕捉/回放测试工具能够记录下所有的用户与应用程序以及数据库服务器的交互操作,并以测试脚本的形式进行存储,最后根据脚本回放所有用户执行的操作,因此常被用于系统的回归测试与故障验证,是一种可行的自动化测试工具,如美国Rational公司的Robot就是一种商业化的捕捉/回放测试工具。然而,借助Robot工具对人机命令网管进行自动测试虽然在一定程度上减轻了测试人员在回归测试中的工作量,并且也提高了一定效率,但是其缺点也很明显:Replacing heavy manual testing with automated testing and improving testing efficiency and quality has always been the goal of man-machine command network management system testing improvement. The current commercial capture/playback test tool can record all the interactive operations between users, applications and database servers, store them in the form of test scripts, and finally play back the operations performed by all users according to the scripts, so it is often used for system testing. Regression testing and fault verification are feasible automated testing tools, such as the Robot of Rational Corporation in the United States, which is a commercial capture/playback testing tool. However, although automatic testing of man-machine command network management with the help of Robot tool reduces the workload of testers in regression testing to a certain extent and improves certain efficiency, its disadvantages are also obvious:

1.测试成本高。Robot的安装对计算机操作系统类型、内存、硬盘空间等软件、硬件资源要求均较高,一般机器难以胜任,无形中提高了测试成本。1. The cost of testing is high. The installation of Robot has high requirements on software and hardware resources such as computer operating system type, memory, hard disk space, etc., which is difficult for general machines, which virtually increases the cost of testing.

2.测试脚本难以共享。由于Robot录制各种交互操作如鼠标位置,按键次数等时包含了计算机当前设置相关的信息,因而,在一台机器上录制的测试脚本无法轻易的在其它机器上执行,难以达到资源共享;另外,测试脚本不具备通用性,每当测试用例改动时,测试人员必须重新录制测试脚本或者手工修改脚本,使用起来极其不方便。2. Test scripts are difficult to share. Since Robot records various interactive operations such as mouse position, key presses, etc., it includes information related to the current computer settings, therefore, the test script recorded on one machine cannot be easily executed on other machines, and it is difficult to achieve resource sharing; in addition , The test script is not universal. Whenever the test case is changed, the tester must re-record the test script or manually modify the script, which is extremely inconvenient to use.

3.某些并发操作难以实现。如对远程登录类型的人机命令网管进行并发测试,即使运行Robot多实例也无法在同一台机器上实现。3. Some concurrent operations are difficult to achieve. For example, the concurrency test of the man-machine command network management of the remote login type cannot be realized on the same machine even if multiple instances of Robot are run.

4.测试人员素质要求高。由于Robot采用了脚本技术,必然要求测试人员在脚本因意外被修改时能及时对所录入的脚本进行改正,并对所有测试脚本进行维护,而掌握Robot对身负重任的测试人员来说是一大压力。4. High quality requirements for testers. Since Robot adopts scripting technology, it is necessary for testers to correct the scripts entered in time when the scripts are accidentally modified, and maintain all test scripts, and mastering Robot is an important task for testers with heavy responsibilities. huge pressure.

有鉴于上述现有技术的缺陷存在,显然现有技术有待改进。In view of the existence of the above-mentioned defectives in the prior art, it is obvious that the prior art needs to be improved.

发明内容Contents of the invention

本发明的目的在于克服上面描述的现有技术中的缺点,提供一种人机命令测试方法,即一种基于Windows消息机制的人机命令自动化测试方法。该方法使得测试人员无需安装、掌握Robot软件,无需编写任何测试脚本,只需在一个友好的人机命令编辑界面上编辑、定制测试用例,并选用任何一台能运行Windows操作系统的机器运行按本发明所设计出的系统以及相应的测试用例,就可以对人机命令网管进行自动化测试。The purpose of the present invention is to overcome the shortcomings in the prior art described above, and provide a man-machine command test method, that is, a man-machine command automated test method based on the Windows message mechanism. This method makes it unnecessary for testers to install and master Robot software, and without writing any test scripts. They only need to edit and customize test cases on a friendly man-machine command editing interface, and choose any machine that can run the Windows operating system to run the test. The system designed by the invention and the corresponding test cases can automatically test the man-machine command network management.

本发明的技术方案如下:Technical scheme of the present invention is as follows:

一种人机命令测试方法,其利用至少一通用计算机,实现人机命令的自动化测试,该方法包括以下步骤:A kind of man-machine order testing method, it utilizes at least one general-purpose computer, realizes the automation test of man-machine order, and this method comprises the following steps:

a)设计人机命令的文件存储格式,所述文件存储格式为节/关键字/值;a) Design the file storage format of the man-machine command, the file storage format is section/keyword/value;

b)设计人机命令的输入界面,通过该人机命令输入界面录入人机命令并按所述文件存储格式保存到指定的命令文件,最终保存到项目文件,作为自动化测试的入口参数;b) Design the input interface of the man-machine command, enter the man-machine command through the man-machine command input interface and save it to the specified command file according to the file storage format, and finally save it to the project file as the entry parameter of the automated test;

c)设计自动化测试界面,并设置自动化测试参数,每一自动化测试对应一项目文件;c) Design the automated test interface, and set the automated test parameters, each automated test corresponds to a project file;

d)启动目标测试窗口,连接被测试系统;d) Start the target test window and connect to the system under test;

e)按需创建自动化测试线程,进行人机命令自动化测试;e) Create an automated test thread as needed to perform automated testing of man-machine commands;

f)断开自动化测试系统与人机命令网管系统的连接。f) Disconnect the automated test system from the man-machine command network management system.

所述的测试方法,其中,所述文件存储格式为节/关键字/值,所述节分为两类,一类用以表示本命令文件中的命令个数,另一类记录实际的命令。The test method, wherein, the file storage format is section/keyword/value, and the section is divided into two categories, one is used to represent the number of commands in the command file, and the other is to record the actual command .

所述的测试方法,其中,所述步骤b)还包括以下步骤:Described testing method, wherein, described step b) also comprises the following steps:

b1)在所述人机命令的输入界面中录入人机命令,同时指定人机命令的参数名称、参数个数、运行次数、延时,并通过宏形式来实现随机数、IP地址、MAC地址自动生成,以及支持命令参数值的动态获取;b1) Enter the man-machine command in the input interface of the man-machine command, specify the parameter name, the number of parameters, the number of operations, and the delay of the man-machine command at the same time, and realize the random number, IP address, and MAC address through the macro form Automatic generation, and support for dynamic acquisition of command parameter values;

b2)按所述步骤a)所设计的存储格式保存所录入的人机命令到指定的命令文件中,该命令文件名包含两部分信息:用例名本身和命令文件执行次数信息,该命令文件中所有命令均执行一遍;b2) According to the storage format designed in step a), save the entered man-machine command into the specified command file. The command file name contains two parts of information: the use case name itself and the execution times information of the command file. In the command file All commands are executed once;

b3)以项目文件的形式保存欲包含的命令文件。b3) Save the command files to be included in the form of project files.

所述的测试方法,其中,所述步骤c)中的所述自动化界面包括:至少一个自动化测试所需的项目文件路径名编辑框,对Telnet网管类型,还需登录用户名称、密码、目标系统IP地址、并发测试数等编辑框,所述每一自动化测试对应一个项目文件;以及至少一启动自动化测试按钮、暂停自动化测试按钮、停止自动化测试按钮。Described test method, wherein, the described automation interface in the described step c) comprises: at least one required project file path name edit box of automation test, to Telnet network management type, also needs login user name, password, target system Edit boxes such as IP address, concurrent test number, etc., each automated test corresponds to a project file; and at least one start automated test button, pause automated test button, stop automated test button.

所述的测试方法,其中,所述步骤e)还包括以下步骤:Described testing method, wherein, described step e) also comprises the following steps:

e1)从所述自动化测试界面上获取参数,并根据所取得的参数调用应用程序接口启动相应的测试线程;e1) Obtaining parameters from the automated test interface, and calling an API to start a corresponding test thread according to the obtained parameters;

e2)测试线程从所述项目文件中获取最终的人机命令,并对该人机命令进行缓存;e2) The test thread obtains the final man-machine command from the project file, and caches the man-machine command;

e3)测试线程对所获取的人机命令进行预处理;e3) The test thread preprocesses the obtained man-machine commands;

e4)测试线程把预处理后的人机命令转化为字符消息亦即操作系统消息序列;e4) The test thread converts the preprocessed man-machine command into a character message, that is, an operating system message sequence;

e5)将转化后的所述字符序列中的消息通过调用信息邮寄应用程序接口自动邮寄到目标窗口,即进行自动化测试;e5) automatically mailing the message in the converted character sequence to the target window by calling the information mailing application program interface, that is, performing an automated test;

e6)重复所述e3)以后的步骤,直到该测试过程中断或结束。e6) Repeat the steps after e3) until the test process is interrupted or ended.

所述的测试方法,其中,所述命令文件中用来表示实际命令的节,其名称为命令编号,其同时包含两个关键字,其一关键字值为该命令本身,还包括该命令的具体执行信息;其二关键字用来指示该命令是否要执行。The test method, wherein, the section used to represent the actual command in the command file, its name is the command number, and it contains two keywords at the same time, one of which is the command itself, and also includes the command Specific execution information; the second keyword is used to indicate whether the command should be executed.

本发明的一种人机命令测试方法,采用了“程序与数据分离”与“Windows消息转发”相结合的技术构思,以实现自动化测试,本发明方法与现有技术相比,避免了利用捕捉/回放测试工具录制脚本所带来的脚本庞大、脚本维护困难、测试成本高等缺点,良好的人机界面使测试人员能灵活地创建、修改、维护测试用例,该短小精悍、可独立运行的自动化测试系统使得测试人员可以选用任何一台能运行Windows操作系统的机器运行该系统以及测试用例,最终减轻了测试成本,避免了重复劳动,降低了测试人员压力,并实现了提高测试工作效率和质量的效果。A man-machine command test method of the present invention adopts the technical concept of "separation of program and data" and "Windows message forwarding" to realize automated testing. Compared with the prior art, the method of the present invention avoids the use of capturing /Playback test tools have disadvantages such as huge scripts, difficult script maintenance, and high test costs brought about by recording scripts. A good man-machine interface enables testers to flexibly create, modify, and maintain test cases. The system allows testers to choose any machine that can run the Windows operating system to run the system and test cases, which ultimately reduces the cost of testing, avoids duplication of work, reduces the pressure of testers, and improves the efficiency and quality of test work. Effect.

附图简要说明Brief description of the drawings

下面通过具体的实施例并结合附图对本发明作进一步详细地描述。The present invention will be described in further detail below through specific embodiments and in conjunction with the accompanying drawings.

附图中,In the attached picture,

图1是本发明的一种人机命令测试方法的整体流程示意图;Fig. 1 is the overall flowchart diagram of a kind of man-machine order testing method of the present invention;

图2是本发明方法的人机命令输入界面设计及录入流程示意图;Fig. 2 is the man-machine command input interface design of the inventive method and the input flow diagram;

图3是本发明方法的Windows消息转发模式流程图;Fig. 3 is the Windows message forwarding mode flowchart of the inventive method;

图4是本发明方法的目标窗口定位程序流程图;Fig. 4 is the target window positioning program flowchart of the inventive method;

图5是本发明方法的自动化测试界面设计及自动化测试程序流程图。Fig. 5 is a flow chart of the automated test interface design and the automated test program of the method of the present invention.

具体实施方式Detailed ways

以下结合附图对技术方案的实施例作进一步的详细描述:Below in conjunction with accompanying drawing, the embodiment of technical scheme is described in further detail:

本发明方法的主要核心思想是结合“程序与数据分离”和“Windows消息转发”,“程序与数据分离”思想是人机命令不与程序绑定在一起:设计一个人机命令录入程序(界面),通过此界面编辑人机命令,并把人机命令以配置文件格式——以文件存储格式“节(section)/关键字(key)/值(string)”保存到一命令文件中,而自动测试程序则实现与具体命令无关性,它通过访问所述命令文件的方法来获取存储在该命令文件中的人机命令,对所获取到的人机命令进行命令预处理,并把预处理后的人机命令即字符串转化为相应的字符消息(亦即操作系统的Windows消息)序列,最后,利用操作系统所提供的“Windows消息转发”机制,将字符消息序列邮寄到目标测试窗口,以达到自动化测试目的。The main core idea of the inventive method is to combine " program and data separation " and " Windows message forwarding ", and " program and data separation " idea is that man-machine command is not bound together with program: design a man-machine command entry program (interface ), edit the man-machine command through this interface, and save the man-machine command in the configuration file format——in the file storage format "section (section)/keyword (key)/value (string)" to a command file, and The automatic test program realizes that it has nothing to do with specific commands. It obtains the man-machine commands stored in the command file by accessing the command file, performs command preprocessing on the acquired man-machine commands, and converts the preprocessed The final man-machine command is converted into a corresponding character message (that is, the Windows message of the operating system) sequence, and finally, the character message sequence is mailed to the target test window by using the "Windows message forwarding" mechanism provided by the operating system. In order to achieve the purpose of automated testing.

本发明的一种人机命令测试方法,如图1所示的,在实施本发明之前,首先必须设计人机命令的文件存储格式,具体格式可以是“节(section)/关键字(key)/值(string)”;设计好人机命令的文件存储格式后,设计人机命令输入界面,通过人机命令录入界面编辑的人机命令,并以所述文件存储格式保存到所述命令文件中;之后,设计自动化测试界面,在自动化测试界面上设置各种必要参数,例如,项目文件信息,连接被测试系统所必须的登录参数等等;接着,若是非Telnet类型网管,则需手工连接被测试系统,获取目标测试窗口句柄,否则(Telnet类型网管)由自动化测试程序自动根据登录参数进行连接,并获取目标测试窗口句柄;最后,根据并发测试数目,创建所需的自动化测试线程,而所述自动化测试线程所需参数由前面步骤提供,自动化测试线程以项目文件中的信息为入口,获取具体的人机命令,对人机命令进行预处理,把人机命令转为为字符消息并放入系统的消息队列,由系统完成消息队列里消息的邮寄、分发到目标测试窗口,自动化测试过程持续到测试结束条件满足为止。A kind of man-machine command test method of the present invention, as shown in Figure 1, before implementing the present invention, must at first design the file storage format of man-machine command, concrete format can be " section (section)/keyword (key) /value (string)”; after designing the file storage format of the man-machine command, design the man-machine command input interface, enter the man-machine command edited by the man-machine command input interface, and save it in the command file with the file storage format ; Afterwards, design the automated test interface, and set various necessary parameters on the automated test interface, such as project file information, login parameters necessary to connect to the tested system, etc.; Test the system, obtain the target test window handle, otherwise (Telnet type network management) automatically connect according to the login parameters by the automated test program, and obtain the target test window handle; finally, according to the number of concurrent tests, create the required automated test thread, and the The parameters required for the above-mentioned automated test thread are provided by the previous steps. The automated test thread uses the information in the project file as the entry point to obtain specific man-machine commands, preprocess the man-machine commands, convert the man-machine commands into character messages and put them in Into the message queue of the system, the system completes the mailing and distribution of the messages in the message queue to the target test window, and the automated test process continues until the test end condition is met.

以下为本发明方法的具体各个步骤的详细说明:The following is a detailed description of the concrete steps of the method of the present invention:

第一步,设计人机命令的文件存储格式。本发明所采用的人机命令存储格式为“节(section)/关键字(key)/值(string)”,这样,可以方便使用WritePrivateProfileString、GetPrivateProfileString等API来获取目标值,具体来说,section分为两大类,一类用来表示本命令文件中共有多少命令;另外一类则用来表示实际的命令,此时,section名称为命令编号,同时包含两个关键字,其一名称可以为Cmd,关键字值为命令本身,它同时也包含了该命令的具体执行信息:执行次数、延时等等,而命令及执行信息之间在存储时以约定的特殊间隔符号隔开,访问时则按相同的间隔符号分段进行;关键字二名称可以为RunFlag,用来指示该命令是否要执行。The first step is to design the file storage format of man-machine commands. The man-machine command storage format adopted in the present invention is "section (section)/keyword (key)/value (string)", so that APIs such as WritePrivateProfileString and GetPrivateProfileString can be conveniently used to obtain the target value. There are two categories, one is used to indicate the total number of commands in this command file; the other is used to indicate the actual command. At this time, the section name is the command number and contains two keywords at the same time. One of the names can be Cmd, the keyword value is the command itself, it also contains the specific execution information of the command: execution times, delay, etc. Then, it is divided into sections according to the same interval symbol; the name of the second keyword can be RunFlag, which is used to indicate whether the command is to be executed.

第二步,设计人机命令输入界面,通过人机命令的所述输入界面录入人机命令。设计人机命令的输入界面的目的是为了方便测试人员能够直观地录入、编辑欲进行测试的人机命令,对测试人员来说,人机命令录入的过程就是生成一测试用例的过程。In the second step, the man-machine command input interface is designed, and the man-machine command is entered through the input interface of the man-machine command. The purpose of designing the input interface of man-machine commands is to facilitate testers to intuitively input and edit the man-machine commands to be tested. For testers, the process of man-machine command input is the process of generating a test case.

本步骤又可以包括下列步骤:This step may further include the following steps:

1.所设计的人机命令的输入界面除了能录入人机命令外,还必须满足以下要求:第一、指定人机命令的参数名称、参数个数、运行次数、延时。第二、通过“宏”的形式来实现随机数、IP地址、MAC地址自动生成。第三、支持命令参数值的动态获取,这在关联命令测试中尤为重要。1. In addition to being able to input HMI commands, the designed HMI command input interface must also meet the following requirements: First, specify the parameter name, number of parameters, running times, and delay of the HMI command. Second, the automatic generation of random numbers, IP addresses, and MAC addresses is realized in the form of "macro". Third, it supports dynamic acquisition of command parameter values, which is especially important in associated command tests.

2.按所述文件存储格式保存所录入的人机命令到指定的命令文件中,首先判断所述命令文件是否存在,如不存在则创建新的命令文件;如已有一命令文件存在,则覆盖该已有命令文件。该命令文件的文件名包含两部分信息:所述测试用例名本身和命令文件执行次数信息;缺省的执行次数为1,即该命令文件中的所有命令均须至少执行一遍。2. Save the entered HMI command to the specified command file according to the file storage format, first judge whether the command file exists, if it does not exist, create a new command file; if an existing command file exists, overwrite it The existing command file. The file name of the command file includes two parts of information: the test case name itself and the execution times information of the command file; the default execution times is 1, that is, all the commands in the command file must be executed at least once.

3.以“项目文件”的形式保存欲包含的命令文件,首先判断所述项目文件是否存在,如不存在则创建新的项目文件,如已有一项目文件存在则覆盖已有的项目文件;所述项目文件的信息是进行自动化测试的入口信息,人机命令是自动化测试的内容,而命令文件则是为了对人机命令进行分类而引进的,命令文件中以一定格式存储了录入的人机命令。3. Save the command file to be included in the form of "project file", first judge whether the project file exists, if not, create a new project file, and overwrite the existing project file if there is an existing project file; The information in the above project file is the entry information for automated testing, the man-machine command is the content of the automated test, and the command file is introduced to classify the man-machine commands, and the entered man-machine commands are stored in a certain format in the command file. Order.

如图2所示的,是人机命令的输入界面设计及录入流程图,所述人机命令的输入界面在实施本发明专利之前必须设计好,所设计的人机命令输入界面必须包含以下几个方面的因素:第一,能够编辑简单的、未带参数的人机命令;第二,能够编辑带参数的人机命令;第三,能够编辑嵌套的、关联命令,体现在:静态编辑一个人机命令,动态执行多个命令,例如静态编辑一个含有特殊分割符号——“∧”符号的人机命令为“Command1∧Command2∧Command3”,则动态执行时将顺序执行这三个人机命令:Command1,Command2,Command3;而关联命令体现在参数值引用上,后一个命令可以通过宏“PARAM(n)”来取得前面命令第n个参数的值,其中n为参数序号。该方法的使用前提条件:关联命令本身必须是如上所述的嵌套命令编辑。为了实现嵌套、关联,本发明采用了命令三段化,即命令前部——命令中部亦即参数——命令后部,其中命令中部和命令后部是可选项,关联命令参数值引用只能在命令后部出现。第四,能够支持“宏”应用,即编辑命令时使用约定符号,动态执行时能转化为预期的值,而转化部分工作在自动化测试线程的命令预处理部分完成,如DELAY(1000)表示执行完命令延时1000毫秒,RAND_IP自动产生合法的IP地址,RAND_MAC自动产生合法的MAC地址。第五,能够指定人机命令的运行次数、延时。As shown in Figure 2, it is the input interface design and input flow chart of man-machine command, the input interface of described man-machine command must be designed before implementing the patent of the present invention, the designed man-machine command input interface must include the following several Factors in two aspects: first, the ability to edit simple man-machine commands without parameters; second, to edit man-machine commands with parameters; third, to be able to edit nested and associated commands, which are reflected in: static editing One man-machine command can dynamically execute multiple commands. For example, statically edit a man-machine command containing a special separation symbol - "∧" as "Command1∧Command2∧Command3", then these three man-machine commands will be executed sequentially during dynamic execution : Command1, Command2, Command3; and the associated command is reflected in the parameter value reference, the latter command can use the macro "PARAM(n)" to obtain the value of the nth parameter of the previous command, where n is the parameter number. Prerequisites for using this method: the associated command itself must be a nested command editor as described above. In order to realize nesting and association, the present invention adopts a three-stage command, that is, the front part of the command—the middle part of the command is the parameter—the rear part of the command, wherein the middle part of the command and the rear part of the command are optional, and the reference of the parameter value of the associated command is only Can appear after the command. Fourth, it can support "macro" applications, that is, when editing commands, the agreed symbols can be converted into expected values during dynamic execution, and the conversion part is completed in the command preprocessing part of the automated test thread, such as DELAY (1000) means execution After the command is delayed for 1000 milliseconds, RAND_IP automatically generates a legal IP address, and RAND_MAC automatically generates a legal MAC address. Fifth, it is possible to specify the running times and delay of man-machine commands.

所述人机命令被录入、编辑完毕后,即以本发明方法所述的存储格式保存到所述命令文件中,以便自动化测试时使用,或将来重新加载该命令文件时进行修改等操作。所有的人机命令被分类后即以命令文件的形式进行存储,最终保存到项目文件,作为自动化测试线程的入口参数之一。而当自动化测试规程进行时,则以相反的方向访问人机命令。After the man-machine command is entered and edited, it is saved in the command file in the storage format described in the method of the present invention, so that it can be used in automated testing, or be modified when the command file is reloaded in the future. After all man-machine commands are classified, they are stored in the form of command files, and finally saved to the project file as one of the entry parameters of the automated test thread. While the automated test procedure is in progress, the HMI commands are accessed in the opposite direction.

如图3所示的是本发明方法中Windows消息转发的模式图,消息转发是实现本发明的核心技术之一,本发明的自动化测试系统本质上是一个Windows应用程序,为此,必须充分掌握Windows消息机制的原理。As shown in Figure 3 is the pattern diagram of Windows message forwarding in the inventive method, and message forwarding is to realize one of core technology of the present invention, and automated test system of the present invention is a Windows application program in essence, for this reason, must fully grasp The principle of Windows message mechanism.

Windows是一种面向对象的体系结构,Windows环境和应用程序都是通过消息来交互的,而系统维护一个或多个消息队列,由应用程序产生的所有消息都会被放入或是插入队列中,然后系统会自动分发队列中的消息到应用程序的消息循环,即从消息队列中取出每一条消息,根据消息的接收句柄而将该消息发送给对应拥有该窗口的程序的消息循环。每一个运行的程序都有自己的消息循环,在其消息循环中得到属于自己的消息并根据接收窗口的句柄调用相应的窗口过程函数。而在没有消息时消息循环就将控制权交还给系统。Windows is an object-oriented architecture. The Windows environment and applications interact through messages, and the system maintains one or more message queues. All messages generated by applications will be put or inserted into the queues. Then the system will automatically distribute the messages in the queue to the message loop of the application program, that is, take out each message from the message queue, and send the message to the message loop of the program corresponding to the window according to the receiving handle of the message. Each running program has its own message loop, in which it gets its own message and calls the corresponding window procedure function according to the handle of the receiving window. The message loop returns control to the system when there is no message.

消息队列中消息的结构(MSG)可以为:The structure (MSG) of the message in the message queue can be:

typedef struct tagMSG{typedef struct tagMSG{

  HWND hwnd;HWND hwnd;

  UINT message;UINT message;

  WPARAM wParam;WPARAM wParam;

  LPARAM lParam;LPARAM lParam;

  DWORD time;DWORD time;

  POINT pt;POINT pt;

}MSG;} MSG;

其中第一个成员变量是用以标识接收该消息的窗口的窗口句柄;第二个参数便是消息标识号;第三个和第四个参数的具体意义同message值有关,均为消息参数,后两个参数则分别表示发送、邮寄消息的时间和光标位置。Among them, the first member variable is the window handle used to identify the window receiving the message; the second parameter is the message identification number; the specific meanings of the third and fourth parameters are related to the message value, both of which are message parameters. The latter two parameters represent the time of sending and mailing the message and the cursor position respectively.

对应于消息结构,在实际运行时,第一个参数的取值即为目标测试窗口的句柄,而消息参数则指人机命令,最后两个参数取缺省值。Corresponding to the message structure, in actual operation, the value of the first parameter is the handle of the target test window, while the message parameter refers to the man-machine command, and the last two parameters take the default value.

第三步,设计自动化测试界面、设置自动化测试参数。本界面主要包含几个元素:自动化测试所需的项目文件路径名编辑框(允许有多个),对Telnet网管类型,还需包含登录用户名称、密码,目标系统IP地址,并发测试数(每个需要对应一个项目文件)。另外,启动自动化测试按钮、暂停自动化测试按钮、停止自动化测试按钮也是必须的。最后,通过自动化测试界面设置自动化测试参数。The third step is to design the automated test interface and set the automated test parameters. This interface mainly includes several elements: the edit box for the project file path name required for automated testing (multiple are allowed), and for the Telnet network management type, it also needs to include the login user name, password, target system IP address, and the number of concurrent tests (per need to correspond to a project file). In addition, the button to start the automated test, the button to pause the automated test, and the button to stop the automated test are also necessary. Finally, set the automated test parameters through the automated test interface.

第四步,启动目标测试窗口,连接被测试系统。根据实际情况,对Telnet类型的人机命令网管系统,需用户提供连接网管系统的用户名和密码,而测试程序则按需并发数目自动启动一个或多个Telnet程序登录、连接网管系统,同时通过FindWindow API查找、定位各Telnet窗口,把窗口句柄保存到数组中,以便在人机命令消息邮寄时区分正确的目标测试窗口;对非Telnet类型的人机命令网管,需用先由测试人员手动启动测试窗口并连接被测试网管系统,然后利用WindowFromPoint、ChildWindowFromPointEx API查找功能定位到目标测试窗口,保存目标测试窗口句柄。The fourth step is to start the target test window and connect to the system under test. According to the actual situation, for the Telnet-type man-machine command network management system, the user needs to provide the user name and password to connect to the network management system, and the test program automatically starts one or more Telnet programs to log in and connect to the network management system according to the number of concurrency required, and at the same time through FindWindow The API searches and locates each Telnet window, and saves the window handle in an array, so as to distinguish the correct target test window when the HMI command message is mailed; for non-Telnet type HMI command network management, the tester needs to manually start the test first Window and connect to the network management system under test, then use the WindowFromPoint and ChildWindowFromPointEx API search functions to locate the target test window, and save the target test window handle.

如图4所示的是目标窗口的定位流程图,从消息结构成员得知,转发消息时必须首先取得目标测试窗口的句柄,而目标窗口定位解决了该问题。有两种方式可以获得目标窗口句柄:As shown in Figure 4 is the target window positioning flow chart, from the members of the message structure, we must first obtain the handle of the target test window when forwarding a message, and target window positioning solves this problem. There are two ways to get the target window handle:

1.对人机命令网管类型为Telnet网管类的,则只需给系统提供连接Telnet网管的用户名、密码及IP地址,测试程序根据并发数目启动一个或多个Telnet应用程序,并在随之产生的Telnet窗口中连接、登录人机命令网管系统,同时,使用FindWindowAPI获取各个Telnet窗口句柄并保存Telnet窗口句柄到数组中,以便自动化测试线程使用。1. If the man-machine command network management type is Telnet network management, you only need to provide the system with the user name, password and IP address to connect to the Telnet network management, and the test program starts one or more Telnet applications according to the number of concurrent applications, and then Connect and log in the man-machine command network management system in the generated Telnet window. At the same time, use FindWindowAPI to obtain the handles of each Telnet window and save the Telnet window handles into an array for use by the automated test thread.

2.对于人机命令网管为非Telnet网管类型的,如超级终端等具有Windows窗口的网管,则需要手工启动、连接网管程序,然后利用WindowFromPoint、ChildWindowFromPointEx API定位到目标测试窗口,保存目标测试窗口句柄到变量中,以便自动化测试线程使用。2. For the man-machine command network management is non-Telnet network management type, such as super terminal and other network management with Windows windows, you need to manually start and connect to the network management program, and then use WindowFromPoint, ChildWindowFromPointEx API to locate the target test window and save the target test window handle into a variable for use by the automated test thread.

第五步,按需创建自动化测试线程,进行人机命令自动化测试。The fifth step is to create an automated test thread as needed to conduct automated testing of man-machine commands.

本步骤又可以包括下列步骤:This step may further include the following steps:

1.从自动化测试界面上获取参数,并根据所取得的参数调用AfxBeginThread启动相应的测试线程。1. Obtain parameters from the automated test interface, and call AfxBeginThread to start the corresponding test thread according to the obtained parameters.

2.测试线程从项目文件获取最终的人机命令,并对人机命令进行缓存2. The test thread obtains the final man-machine command from the project file and caches the man-machine command

3.测试线程对所获取的人机命令进行预处理。3. The test thread preprocesses the obtained HMI commands.

4.测试线程把预处理后的人机命令转化为字符消息亦即Windows消息序列。4. The test thread converts the preprocessed man-machine commands into character messages, that is, Windows message sequences.

5.将转化后字符序列消息调用PostMessage API自动邮寄到目标窗口,即自动化测试。5. Call the PostMessage API to automatically post the converted character sequence message to the target window, that is, the automated test.

6.重复3以后的步骤,直到测试中断或结束。6. Repeat the steps after 3 until the test is interrupted or ended.

如图5所示的是本发明方法中的自动化测试流程图,所述自动化测试是最终目标,进行自动化测试之前必须提供好自动化测试所需的参数,为此,首先设计自动化测试界面,对Telnet网管类型,自动化测试界面中须包含以下几个元素:自动化测试所需的项目文件路径名编辑框(允许多个),还需包含登录用户名称、密码,目标系统IP地址,并发测试数(每个需要对应一个项目文件)。而对非Telnet网管而言,自动化测试界面须包含自动化测试所需的项目文件路径名编辑框。另外,不管哪种类型网管,所述自动化测试界面上须包括:启动自动化测试按钮、暂停自动化测试按钮、停止自动化测试按钮。As shown in Figure 5 is the automated testing flowchart in the inventive method, described automated testing is final goal, must provide the required parameter of automated testing before automated testing, for this reason, at first design automated testing interface, to Telnet Network management type, the automated test interface must contain the following elements: the edit box for the path name of the project file required for the automated test (multiple are allowed), and the login user name, password, IP address of the target system, and the number of concurrent tests (per need to correspond to a project file). For non-Telnet network administrators, the automated test interface must include an edit box for the project file path name required by the automated test. In addition, regardless of the type of network management, the automated test interface must include: a button to start the automated test, a button to pause the automated test, and a button to stop the automated test.

接着,在所设计的自动化测试界面设置好所必要的信息。Then, set up the necessary information in the designed automated test interface.

当前提条件满足后,调用AfxBeginThread API创建并启动一个或多个自动化测试线程,由自动化测试线程来完成自动测试操作。自动化测试线程首先找到所述项目文件,然后找到该项目文件所包含的所述命令文件,最后从所述命令文件中提取对应的人机命令。为了减少测试过程中频繁打开、关闭文件等耗时操作,自动化测试线程把所获取到的所述命令文件和所述人机命令均进行了缓存,随后对该命令文件和人机命令的访问均从缓存中获取。When the preconditions are met, call the AfxBeginThread API to create and start one or more automated test threads, and the automated test threads will complete the automatic test operation. The automated testing thread first finds the project file, then finds the command file included in the project file, and finally extracts the corresponding man-machine commands from the command file. In order to reduce time-consuming operations such as frequently opening and closing files during the test, the automated test thread caches the obtained command file and the man-machine command, and subsequently accesses the command file and the man-machine command fetched from cache.

每当取得一个人机命令时,所述自动测试线程对人机命令进行预处理,完成对以宏形式进行人机命令编辑的字符转化,如自动随机数生成、随机IP地址生成、随机MAC地址,嵌套命令处理、关联命令处理。所述人机命令预处理后,自动测试线程把人机命令转化为Windows消息,并根据目标测试窗口句柄值,借助Windows消息转发机制,调用PostMessage(消息邮寄)把人机命令邮寄到目标测试窗口,达到自动测试的目的。Whenever a man-machine command is obtained, the automatic test thread preprocesses the man-machine command, and completes the character conversion of man-machine command editing in macro form, such as automatic random number generation, random IP address generation, random MAC address , nested command processing, associated command processing. After the man-machine command preprocessing, the automatic test thread converts the man-machine command into a Windows message, and according to the target test window handle value, by means of the Windows message forwarding mechanism, calls PostMessage (message mailing) to mail the man-machine command to the target test window , to achieve the purpose of automatic testing.

该自动测试过程持续到项目文件所包含的命令文件和命令文件中所包含的命令全部测试完毕或中途停止为止,若指定测试次数时,还要循环测试到测试次数达到指定测试次数为止(包括命令文件执行次数和命令本身执行次数等等)。This automatic test process continues until the command files contained in the project file and the commands contained in the command files are all tested or stopped halfway. number of file executions and the number of times the command itself was executed, etc.).

最后介绍采用本发明方法对一个具有三个参数的人机命令进行自动化测试的一个具体实施案例:Introduce a specific implementation case of adopting the inventive method to carry out automated testing to a man-machine command with three parameters at last:

利用本发明的方法实现的自动化测试系统是一个与被测产品及产品运行平台无关的Windows应用程序,其使用方法如下:The automated testing system that utilizes the method of the present invention to realize is a Windows application program independent of the product under test and the product operating platform, and its method of use is as follows:

假设网管为Telnet网管,人机命令为“Config Board”,该命令有三个参数frame,范围为1到255;shelf,范围为1到2;slot,范围为1到8。由三个Telnet终端并发测试网管系统。Assume that the network management system is Telnet, and the HMI command is "Config Board". This command has three parameters: frame, ranging from 1 to 255; shelf, ranging from 1 to 2; slot, ranging from 1 to 8. The network management system is tested concurrently by three Telnet terminals.

首先按要求设计好人机命令输入界面,在人机命令输入界面上录入人机命令“Config Board”,并指定参数个数为3个,同时指定参数1为frame,最小值为1,最大值为255,步长为1;参数2为shelf,最小值为1,最大值为2,步长为1;参数3为slot,最小值为1,最大值为8,步长为1,该指定该命令反覆测试1000次,以要求的存储格式保存到test.cmd命令文件,保存test.cmd命令文件到项目文件test.ctp;按要求设计好自动化测试界面,在该自动化测试界面输入连接Telnet网管的用户名test,密码test,选择项目文件test.ctp,由于是Telnet网管,故选择并发测试数目为3,程序将自动启动三个Telnet应用程序,单击启动按钮,即可以进入自动化测试,此时,可以看到有三个Telnet终端在并发对被测试系统进行测试。到该自动化测试结束,本自动化测试系统将以255*2*8种参数组合向Telnet网管实际发送1000次,共255*2*8*1000个命令,由此可以看出本发明的测试方法中的自动化测试效率。First, design the man-machine command input interface according to the requirements, enter the man-machine command "Config Board" on the man-machine command input interface, and specify the number of parameters as 3, and specify parameter 1 as frame, the minimum value is 1, and the maximum value is 255, the step size is 1; the parameter 2 is shelf, the minimum value is 1, the maximum value is 2, and the step size is 1; the parameter 3 is slot, the minimum value is 1, the maximum value is 8, and the step size is 1. Repeat the command test 1000 times, save it to the test.cmd command file in the required storage format, and save the test.cmd command file to the project file test.ctp; design the automated test interface according to the requirements, and enter the connection to the Telnet network management in the automated test interface User name test, password test, select the project file test.ctp, because it is a Telnet network management, so select the number of concurrent tests as 3, the program will automatically start three Telnet applications, click the start button, you can enter the automated test, at this time , you can see that three Telnet terminals are testing the system under test concurrently. To the end of this automated test, this automated test system will actually send 1000 times to the Telnet network manager with 255*2*8 kinds of parameter combinations, a total of 255*2*8*1000 commands, it can be seen that in the test method of the present invention automated testing efficiency.

第六步,断开自动化测试系统与人机命令网管系统的连接。The sixth step is to disconnect the automated test system from the man-machine command network management system.

本发明的基于Windows消息机制的人机命令自动化测试方法及系统具有以下优点:The man-machine command automatic testing method and system based on Windows message mechanism of the present invention have the following advantages:

1.测试成本低。本自动化测试系统直接利用了Windows操作系统所提供的消息转发功能,无需任何第三方软件(如Robot)即可直接运行并进行自动化测试,另外,本测试系统对计算机软件、硬件均无特殊要求,在任何一台安装了Windows操作系统的通用计算机上均能运行。1. Low cost of testing. This automated test system directly utilizes the message forwarding function provided by the Windows operating system, and can run directly and perform automated tests without any third-party software (such as Robot). In addition, this test system has no special requirements for computer software and hardware. It can run on any general-purpose computer with Windows operating system installed.

2.测试用例便于共享。在不同机器上定制的测试用例能够在不做任何修改的情况下复制到其它机器上利用本自动化测试系统进行自动化测试。2. Test cases are easy to share. The test cases customized on different machines can be copied to other machines without any modification, using this automated test system for automated testing.

3.简单、高效。本自动化测试系统已经对测试脚本——自动化测试程序进行了封装,无需测试人员进行干预,而且,人机命令编辑界面简单、友好、功能强大,测试人员真正完全能够把全部精力放在人机命令测试用例的定制上,达到“所见即所得”。3. Simple and efficient. This automated test system has encapsulated the test script - the automated test program, without the intervention of testers. Moreover, the man-machine command editing interface is simple, friendly, and powerful, and testers can really focus on man-machine commands. In terms of customization of test cases, "what you see is what you get".

4.易于推广。由于本自动化测试提供良好的人机界面,加之整个系统仅包含一个可执行文件,使用极其方便,因而也容易在项目内推广。另外,由于“程序与数据分离”,只要录入新的测试用例,便可对其它项目的人机命令网管进行自动化测试,即易于项目间推广。4. Easy to promote. Since this automated test provides a good man-machine interface, and the whole system contains only one executable file, it is extremely convenient to use, and thus it is easy to promote in the project. In addition, due to the "separation of program and data", as long as a new test case is entered, the man-machine command network management of other projects can be automatically tested, which is easy to promote among projects.

5.为开发自动化测试软件提供了一个典范。5. Provide a model for the development of automated testing software.

本发明的实施例实现了本发明的目的,在实际的测试工作中达到了减轻测试人员负担,避免重复劳动的效果,比单纯的应用捕捉/回放测试工具更为简洁、灵活,大大提高测试效率和测试质量。The embodiment of the present invention achieves the purpose of the present invention, and achieves the effect of reducing the burden of testers and avoiding duplication of labor in the actual test work. It is more concise and flexible than simple application capture/playback test tools, and greatly improves test efficiency. and test quality.

应当指出的是,对本领域普通技术人员来说,可以根据本发明的技术方案及其构思加以等同改变或替换,而所有这些改变或替换都应属于本发明所附的权利要求的保护范围。It should be noted that those skilled in the art can make equivalent changes or substitutions according to the technical solutions and concepts of the present invention, and all these changes or substitutions should fall within the protection scope of the appended claims of the present invention.

Claims (6)

1、一种人机命令测试方法,其利用至少一通用计算机,实现人机命令的自动化测试,该方法包括以下步骤:1, a kind of man-machine command test method, it utilizes at least one general-purpose computer, realizes the automation test of man-machine command, and this method comprises the following steps: a)设计人机命令的文件存储格式,所述文件存储格式为节/关键字/值;a) Design the file storage format of the man-machine command, the file storage format is section/keyword/value; b)设计人机命令的输入界面,通过该人机命令输入界面录入人机命令并按所述文件存储格式保存到指定的命令文件,最终保存到项目文件,作为自动化测试的入口参数;b) Design the input interface of the man-machine command, enter the man-machine command through the man-machine command input interface and save it to the specified command file according to the file storage format, and finally save it to the project file as the entry parameter of the automated test; c)设计自动化测试界面,并设置自动化测试参数,每一自动化测试对应一项目文件;c) Design the automated test interface, and set the automated test parameters, each automated test corresponds to a project file; d)启动目标测试窗口,连接被测试系统;d) Start the target test window and connect to the system under test; e)按需创建自动化测试线程,进行人机命令自动化测试;e) Create an automated test thread as needed to perform automated testing of man-machine commands; f)断开自动化测试系统与人机命令网管系统的连接。f) Disconnect the automated test system from the man-machine command network management system. 2、根据权利要求1所述的测试方法,其特征在于,所述文件存储格式为节/关键字/值,所述节分为两类,一类用以表示本命令文件中的命令个数,另一类记录实际的命令。2. The test method according to claim 1, wherein the file storage format is section/keyword/value, and the section is divided into two categories, one category is used to represent the number of commands in the command file , another class that logs the actual command. 3、根据权利要求2所述的测试方法,其特征在于,所述步骤b)还包括以下步骤:3. The testing method according to claim 2, characterized in that, said step b) further comprises the following steps: b1)在所述人机命令的输入界面中录入人机命令,同时指定人机命令的参数名称、参数个数、运行次数、延时,并通过宏形式来实现随机数、IP地址、MAC地址自动生成,以及支持命令参数值的动态获取;b1) Enter the man-machine command in the input interface of the man-machine command, specify the parameter name, the number of parameters, the number of operations, and the delay of the man-machine command at the same time, and realize the random number, IP address, and MAC address through the macro form Automatic generation, and support for dynamic acquisition of command parameter values; b2)按所述步骤a)所设计的存储格式保存所录入的人机命令到指定的命令文件中,该命令文件名包含两部分信息:用例名本身和命令文件执行次数信息,该命令文件中所有命令均执行一遍;b2) According to the storage format designed in step a), save the entered man-machine command into the specified command file. The command file name contains two parts of information: the use case name itself and the execution times information of the command file. In the command file All commands are executed once; b3)以项目文件的形式保存欲包含的命令文件。b3) Save the command files to be included in the form of project files. 4、根据权利要求3所述的测试方法,其特征在于,所述步骤c)中的所述自动化测试界面包括:至少一个自动化测试所需的项目文件路径名编辑框,对Telnet网管类型,还需登录用户名称、密码、目标系统IP地址、并发测试数编辑框,每一自动化测试对应一个项目文件;以及至少一启动自动化测试按钮、暂停自动化测试按钮、停止自动化测试按钮。4. The testing method according to claim 3, characterized in that, the automated testing interface in the step c) includes: at least one required project file path name edit box for automated testing, for the Telnet network management type, also User name, password, IP address of the target system, edit box for the number of concurrent tests need to be logged in, and each automated test corresponds to a project file; and at least one button to start the automated test, button to pause the automated test, and button to stop the automated test. 5、根据权利要求4述的测试方法,其特征在于,所述步骤e)还包括以下步骤:5. The test method according to claim 4, wherein said step e) further comprises the following steps: e1)从所述自动化测试界面上获取参数,并根据所取得的参数调用应用程序接口启动相应的测试线程;e1) Obtaining parameters from the automated test interface, and calling an API to start a corresponding test thread according to the obtained parameters; e2)测试线程从所述项目文件中获取最终的人机命令,并对该人机命令进行缓存;e2) The test thread obtains the final man-machine command from the project file, and caches the man-machine command; e3)测试线程对所获取的人机命令进行预处理;e3) The test thread preprocesses the obtained man-machine commands; e4)测试线程把预处理后的人机命令转化为字符消息;e4) The test thread converts the preprocessed man-machine command into a character message; e5)将转化后的所述字符消息通过调用信息邮寄应用程序接口自动邮寄到目标窗口,即进行自动化测试;e5) automatically mailing the converted character message to the target window by calling the information mailing application program interface, that is, performing an automated test; e6)重复所述e3)以后的步骤,直到该测试过程中断或结束。e6) Repeat the steps after e3) until the test process is interrupted or ended. 6、根据权利要求2所述的测试方法,其特征在于,所述命令文件中用来表示实际命令的节,其名称为命令编号,其同时包含两个关键字,其一关键字值为该命令本身,还包括该命令的具体执行信息;其二关键字用来指示该命令是否要执行。6. The test method according to claim 2, characterized in that, the section used to represent the actual command in the command file is called the command number, which contains two keywords at the same time, and one of the keyword values is the The command itself also includes the specific execution information of the command; the second keyword is used to indicate whether the command is to be executed.
CN 200310117550 2003-12-26 2003-12-26 Human-machine order testing method Expired - Fee Related CN1280727C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200310117550 CN1280727C (en) 2003-12-26 2003-12-26 Human-machine order testing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200310117550 CN1280727C (en) 2003-12-26 2003-12-26 Human-machine order testing method

Publications (2)

Publication Number Publication Date
CN1555014A CN1555014A (en) 2004-12-15
CN1280727C true CN1280727C (en) 2006-10-18

Family

ID=34337863

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200310117550 Expired - Fee Related CN1280727C (en) 2003-12-26 2003-12-26 Human-machine order testing method

Country Status (1)

Country Link
CN (1) CN1280727C (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100440162C (en) * 2005-04-08 2008-12-03 环达电脑(上海)有限公司 Embedded apparatus debugging method
CN1905443B (en) * 2005-07-30 2010-06-09 腾讯科技(深圳)有限公司 Method and system for automatically logging in server by client
CN1920791B (en) * 2005-08-22 2010-04-28 王彤 Program testing system
CN101060559B (en) * 2007-05-29 2011-06-22 中兴通讯股份有限公司 A man-machine command queue management system and method
CN103092864A (en) * 2011-11-03 2013-05-08 无锡华润上华科技有限公司 Method and system for generating test data report form
CN103019934B (en) * 2012-11-28 2015-05-27 北京交控科技有限公司 Test case generation method based on data code separation technology
CN103279413B (en) * 2013-04-22 2016-06-01 广州杰赛科技股份有限公司 Digital TV set box software function and stability automated testing method
CN104778118B (en) * 2013-12-30 2018-08-28 深圳键桥通讯技术股份有限公司 The improved method of automatization testing technique
CN106063343B (en) * 2014-03-31 2020-01-03 英特尔Ip公司 Method and apparatus for access point location token
CN104954501B (en) * 2014-03-31 2019-05-10 珠海豹好玩科技有限公司 Cross-domain information interacting method, apparatus and system
CN108491329A (en) * 2018-04-02 2018-09-04 郑州云海信息技术有限公司 A kind of performance test methods and testing tool of SSR clients
CN109828871A (en) * 2018-12-25 2019-05-31 北京奇安信科技有限公司 Equipment automatization test macro
CN110545212A (en) * 2019-08-09 2019-12-06 深圳震有科技股份有限公司 Method and device for IP test at network management end, computer equipment and medium
CN111026667B (en) * 2019-12-09 2023-05-05 北京乐学帮网络技术有限公司 Script execution method and device and electronic equipment
CN112559353A (en) * 2020-12-17 2021-03-26 普华基础软件股份有限公司 System and method for generating test script
CN113032247A (en) * 2021-03-05 2021-06-25 深圳市吉祥腾达科技有限公司 Automatic ubus command line testing method and system
CN113742151B (en) * 2021-09-06 2024-10-29 江苏芯盛智能科技有限公司 Multi-version CDM tool automatic test method, device and computer equipment

Also Published As

Publication number Publication date
CN1555014A (en) 2004-12-15

Similar Documents

Publication Publication Date Title
CN1280727C (en) Human-machine order testing method
CN100351811C (en) Method and device for testing software product robustness
CN1252592C (en) Communications services provisioning method and apparatus and object programming language for developing provisioning models
CN100340997C (en) Automatic test method of application
CN112612699B (en) A universal automated test equipment for HID human-computer interaction scenarios
CN107302475A (en) The method of testing and device of a kind of Based on Distributed storage cluster
CN1728094A (en) Smart gui activity recording and playback framework
CN103092650A (en) Virtual machine mirror image generating method and device based on software preinstallation in cloud environment
CN1767453A (en) Automatic test method and system
CN1851667A (en) Graphic user interface test method and system
CN111880811B (en) A method for implementing cloud platform resource orchestration
CN101079737A (en) An automatic structuring and parsing method and system of command line interface command
CN101853204A (en) A Complicated Control Testing System in Windows Environment
CN107992403A (en) IO performance test methods, device, equipment and computer-readable recording medium
CN1845120A (en) Automatic analysis system and method for malicious code
CN1862508A (en) Automatic testing system of person digital aid cell phone function and method thereof
CN106598859A (en) Appium multi-thread implementation system and method
CN1780236A (en) Universal testing system and method for telecommunication intelligent service
CN1869973A (en) Method and system for generating file
CN112069062A (en) Method and device for editing and generating software test bug module
CN106815132A (en) A kind of cluster server formation gathering method
CN112115064A (en) Method for automatically configuring performance scene based on performance test requirement
CN109741780A (en) Method and system for testing SSD performance based on Linux system
CN1658579A (en) Method for set-up artificial equipment agency
CN1755642A (en) Integrated software testing method with test flexibility

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
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20061018

Termination date: 20131226