[go: up one dir, main page]

CN109144864B - Method and device for testing window - Google Patents

Method and device for testing window Download PDF

Info

Publication number
CN109144864B
CN109144864B CN201810918389.6A CN201810918389A CN109144864B CN 109144864 B CN109144864 B CN 109144864B CN 201810918389 A CN201810918389 A CN 201810918389A CN 109144864 B CN109144864 B CN 109144864B
Authority
CN
China
Prior art keywords
control
tested
window
information
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810918389.6A
Other languages
Chinese (zh)
Other versions
CN109144864A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201810918389.6A priority Critical patent/CN109144864B/en
Publication of CN109144864A publication Critical patent/CN109144864A/en
Application granted granted Critical
Publication of CN109144864B publication Critical patent/CN109144864B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本申请实施例公开了用于测试窗口的方法及装置。该方法的一具体实施方式包括:查询对应测试数据的待测试窗口,其中,上述测试数据用于对窗口包含的控件进行测试;获取上述待测试窗口的窗口属性,其中,上述窗口属性包括至少一个控件信息,以及对应上述至少一个控件信息中控件信息的操作信息;根据上述窗口属性查询对应上述测试数据的待测试控件;通过上述测试数据控制上述待测试控件。该实施方式提高了对应用程序测试的适用性和有效性。

Figure 201810918389

The embodiments of the present application disclose a method and an apparatus for testing a window. A specific implementation of the method includes: querying the window to be tested corresponding to the test data, wherein the test data is used to test the controls contained in the window; obtaining the window properties of the window to be tested, wherein the window properties include at least one control information, and operation information corresponding to the control information in the at least one control information; query the control to be tested corresponding to the test data according to the window attribute; control the control to be tested by the test data. This implementation improves applicability and effectiveness for application testing.

Figure 201810918389

Description

用于测试窗口的方法及装置Method and apparatus for testing windows

技术领域technical field

本申请实施例涉及计算机技术领域,具体涉及用于测试窗口的方法及装置。The embodiments of the present application relate to the field of computer technologies, and in particular, to a method and an apparatus for testing a window.

背景技术Background technique

随着科技的发展,智能终端的数据处理能力越来越强大。用户可以对智能终端上安装的各种应用(即应用程序)的窗口进行操作,以执行相应的信息处理任务,极大地提高了用户工作和生活的信息处理效率。With the development of science and technology, the data processing capability of intelligent terminals is becoming more and more powerful. The user can operate the windows of various applications (ie, application programs) installed on the smart terminal to perform corresponding information processing tasks, which greatly improves the information processing efficiency of the user's work and life.

为了更好的向用户提供服务,在应用发布前后,技术人员需要对应用进行测试,以消除应用存在的问题。现有对应用测试的过程中,测试程序需要获取被测试应用窗口内控件的句柄等信息,并根据控件的句柄设置对应的测试内容。之后,通过测试内容测试窗口及控件的各种性能。In order to provide better services to users, before and after the application is released, technicians need to test the application to eliminate problems existing in the application. In the existing application testing process, the testing program needs to obtain information such as the handle of the control in the window of the application under test, and set the corresponding test content according to the handle of the control. After that, test the various properties of windows and controls through the test content.

发明内容SUMMARY OF THE INVENTION

本申请实施例提出了用于测试窗口的方法及装置。The embodiments of the present application propose a method and apparatus for testing a window.

第一方面,本申请实施例提供了一种用于测试窗口的方法,应用于包含窗口的应用程序,该方法包括:查询对应测试数据的待测试窗口,其中,上述测试数据用于对窗口包含的控件进行测试;获取上述待测试窗口的窗口属性,其中,上述窗口属性包括至少一个控件信息,以及对应上述至少一个控件信息中控件信息的操作信息;根据上述窗口属性查询对应上述测试数据的待测试控件;通过上述测试数据控制上述待测试控件。In a first aspect, an embodiment of the present application provides a method for testing a window, which is applied to an application program containing a window, the method includes: querying a window to be tested corresponding to test data, wherein the test data is used for the window containing test; obtain the window properties of the above-mentioned window to be tested, wherein, the above-mentioned window properties include at least one control information, and operation information corresponding to the control information in the above-mentioned at least one control information; according to the above-mentioned window properties, query corresponding to the above-mentioned test data. Test controls; control the controls to be tested through the test data.

在一些实施例中,上述测试数据包括待测试控件名称,以及,上述根据上述窗口属性查询对应上述测试数据的待测试控件,包括:根据上述待测试控件名称查询上述窗口属性中对应的控件信息,并将上述待测试窗口中的、与该控件信息对应的控件设置为待测试控件。In some embodiments, the test data includes the name of the control to be tested, and the querying of the control to be tested corresponding to the test data according to the window attribute includes: querying the control information corresponding to the window attribute according to the name of the control to be tested, The control corresponding to the control information in the above-mentioned window to be tested is set as the control to be tested.

在一些实施例中,上述测试数据包括对应待测试控件名称的测试信息,以及,上述通过上述测试数据控制上述待测试控件,包括:查找对应上述待测试控件的控件程序;根据上述测试信息设置操作指令,并通过上述操作指令控制上述控件程序。In some embodiments, the test data includes test information corresponding to the name of the control to be tested, and the control of the control to be tested by the test data includes: searching for a control program corresponding to the control to be tested; setting an operation according to the test information command, and control the above control program through the above operation command.

在一些实施例中,上述根据上述测试信息设置操作指令,包括:查询上述待测试控件的对应上述测试信息的操作信息;根据上述操作信息构建操作指令。In some embodiments, setting the operation instruction according to the test information includes: querying the operation information corresponding to the test information of the control to be tested; and constructing the operation instruction according to the operation information.

在一些实施例中,上述方法还包括:获取对应上述测试数据的测试结果信息,包括:记录上述操作指令的执行信息和结果信息,其中,上述执行信息包括以下至少一项:指令内容、控件程序名称、执行时间,上述结果信息包括以下至少一项:指令内容、执行结果、执行结果输出时间。In some embodiments, the above-mentioned method further includes: acquiring test result information corresponding to the above-mentioned test data, including: recording execution information and result information of the above-mentioned operation instruction, wherein the above-mentioned execution information includes at least one of the following: instruction content, control program Name, execution time, and the above result information includes at least one of the following: instruction content, execution result, and execution result output time.

第二方面,本申请实施例提供了一种用于测试窗口的装置,应用于包含窗口的应用程序,该装置包括:待测试窗口查询单元,被配置成查询对应测试数据的待测试窗口,其中,上述测试数据用于对窗口包含的控件进行测试;窗口属性获取单元,被配置成获取上述待测试窗口的窗口属性,其中,上述窗口属性包括至少一个控件信息,以及对应上述至少一个控件信息中控件信息的操作信息;待测试控件查询单元,被配置成根据上述窗口属性查询对应上述测试数据的待测试控件;测试单元,被配置成通过上述测试数据控制上述待测试控件。In a second aspect, an embodiment of the present application provides an apparatus for testing a window, which is applied to an application program including a window, and the apparatus includes: a to-be-tested window query unit configured to query the to-be-tested window corresponding to the test data, wherein , the above-mentioned test data is used to test the controls contained in the window; the window property acquisition unit is configured to acquire the window properties of the above-mentioned window to be tested, wherein the above-mentioned window properties include at least one control information, and corresponding to the at least one control information in the Operation information of the control information; a control-to-be-tested query unit configured to query the to-be-tested control corresponding to the above-mentioned test data according to the above-mentioned window properties; and a test unit configured to control the above-mentioned to-be-tested control through the above-mentioned test data.

在一些实施例中,上述测试数据包括待测试控件名称,以及,上述待测试控件查询单元包括:待测试控件查询子单元,被配置成根据上述待测试控件名称查询上述窗口属性中对应的控件信息,并将上述待测试窗口中的、与该控件信息对应的控件设置为待测试控件。In some embodiments, the above-mentioned test data includes the name of the control to be tested, and the above-mentioned query unit for the control to be tested includes: a subunit to query the control to be tested, configured to query the corresponding control information in the above-mentioned window properties according to the above-mentioned name of the above-mentioned control to be tested , and set the control corresponding to the control information in the window to be tested as the control to be tested.

在一些实施例中,上述测试数据包括对应待测试控件名称的测试信息,以及,上述测试单元包括:控件程序查找子单元,被配置成查找对应上述待测试控件的控件程序;测试子单元,被配置成根据上述测试信息设置操作指令,并通过上述操作指令控制上述控件程序。In some embodiments, the above-mentioned test data includes test information corresponding to the name of the control to be tested, and the above-mentioned test unit includes: a control program search subunit, configured to search for a control program corresponding to the above-mentioned control to be tested; It is configured to set operation instructions according to the above-mentioned test information, and control the above-mentioned control program through the above-mentioned operation instructions.

在一些实施例中,上述测试子单元包括:操作信息查询模块,被配置成查询上述待测试控件的对应上述测试信息的操作信息;操作指令构建模块,被配置成根据上述操作信息构建操作指令。In some embodiments, the test subunit includes: an operation information query module configured to query the operation information corresponding to the test information of the control to be tested; and an operation instruction construction module configured to construct an operation instruction according to the operation information.

在一些实施例中,上述装置还包括:测试结果信息获取单元,被配置成获取对应上述测试数据的测试结果信息,上述测试结果信息获取单元包括:测试结果信息获取子单元,被配置成记录上述操作指令的执行信息和结果信息,其中,上述执行信息包括以下至少一项:指令内容、控件程序名称、执行时间,上述结果信息包括以下至少一项:指令内容、执行结果、执行结果输出时间。In some embodiments, the above device further includes: a test result information acquisition unit, configured to acquire test result information corresponding to the above test data, the above test result information acquisition unit includes: a test result information acquisition subunit, configured to record the above Execution information and result information of an operation instruction, wherein the execution information includes at least one of the following: instruction content, control program name, and execution time, and the result information includes at least one of the following: instruction content, execution result, and execution result output time.

第三方面,本申请实施例提供了一种电子设备,包括:一个或多个处理器;存储器,其上存储有一个或多个程序,当上述一个或多个程序被上述一个或多个处理器执行时,使得上述一个或多个处理器执行上述第一方面的用于测试窗口的方法。In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; a memory on which one or more programs are stored, when the one or more programs are processed by the one or more programs When the processor is executed, the above-mentioned one or more processors are caused to execute the method for testing a window of the above-mentioned first aspect.

第四方面,本申请实施例提供了一种计算机可读介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现上述第一方面的用于测试窗口的方法。In a fourth aspect, an embodiment of the present application provides a computer-readable medium on which a computer program is stored, characterized in that, when the program is executed by a processor, the method for testing a window of the first aspect above is implemented.

本申请实施例提供的用于测试窗口的方法及装置,首先查询对应测试数据的待测试窗口;然后获取待测试窗口的窗口属性;之后根据窗口属性查询对应测试数据的待测试控件;最后通过测试数据测试待测试控件,提高了对应用程序测试的适用性和有效性。The method and device for testing a window provided by the embodiments of the present application firstly query the to-be-tested window corresponding to the test data; then acquire the window properties of the to-be-tested window; then query the to-be-tested control corresponding to the test data according to the window properties; and finally pass the test Data testing controls to be tested, improving the applicability and effectiveness of application testing.

附图说明Description of drawings

通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

图1是本申请的一个实施例可以应用于其中的示例性系统架构图;FIG. 1 is an exemplary system architecture diagram to which an embodiment of the present application may be applied;

图2是根据本申请的用于测试窗口的方法的一个实施例的流程图;Figure 2 is a flowchart of one embodiment of a method for testing a window according to the present application;

图3是根据本申请的用于测试窗口的方法的另一个实施例的流程图;3 is a flowchart of another embodiment of a method for testing a window according to the present application;

图4是根据本申请的用于测试窗口的方法的一个应用场景的示意图;4 is a schematic diagram of an application scenario of the method for testing a window according to the present application;

图5是根据本申请的用于测试窗口的装置的一个实施例的结构示意图;5 is a schematic structural diagram of an embodiment of an apparatus for testing a window according to the present application;

图6是适于用来实现本申请实施例的电子设备的计算机系统的结构示意图。FIG. 6 is a schematic structural diagram of a computer system suitable for implementing the electronic device according to the embodiment of the present application.

具体实施方式Detailed ways

下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the related invention, but not to limit the invention. In addition, it should be noted that, for the convenience of description, only the parts related to the related invention are shown in the drawings.

需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。It should be noted that the embodiments in the present application and the features of the embodiments may be combined with each other in the case of no conflict. The present application will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.

图1示出了可以应用本申请实施例的用于测试窗口的方法或用于测试窗口的装置的示例性系统架构100。FIG. 1 shows an exemplary system architecture 100 to which a method for testing a window or an apparatus for testing a window may be applied.

如图1所示,系统架构100可以包括终端设备101、102、103,网络104和服务器105。网络104用以在终端设备101、102、103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in FIG. 1 , the system architecture 100 may include terminal devices 101 , 102 , and 103 , a network 104 and a server 105 . The network 104 is a medium used to provide a communication link between the terminal devices 101 , 102 , 103 and the server 105 . The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.

用户可以使用终端设备101、102、103通过网络104与服务器105交互,以接收或发送消息等。终端设备101、102、103上可以安装有各种包含窗口的应用程序,例如网页浏览器应用、购物类应用、搜索类应用、即时通信工具、邮箱客户端、社交平台软件等。需要说明的是,本申请实施例中的“窗口”可以用于向用户展示信息,并提供信息选项或按键等。在一些应用程序或环境下,本申请中的“窗口”也可以称作“界面”、“对话框”等。The user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages and the like. Various applications including windows may be installed on the terminal devices 101 , 102 and 103 , such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, and the like. It should be noted that, the "window" in this embodiment of the present application may be used to display information to the user, and provide information options or buttons. In some applications or environments, the "window" in this application may also be referred to as "interface", "dialog box" and so on.

终端设备101、102、103可以是硬件,也可以是软件。当终端设备101、102、103为硬件时,可以是具有显示屏并且支持窗口显示的各种电子设备,包括但不限于智能手机、平板电脑、电子书阅读器、MP3播放器(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器、膝上型便携计算机和台式计算机等等。当终端设备101、102、103为软件时,可以安装在上述所列举的电子设备中。其可以实现成多个软件或软件模块(例如用来提供分布式服务),也可以实现成单个软件或软件模块,在此不做具体限定。The terminal devices 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, and 103 are hardware, they can be various electronic devices that have a display screen and support window display, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Group Audio Layer 4) Players, Laptops and Desktops, etc. When the terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. It may be implemented as multiple software or software modules (for example, used to provide distributed services), or may be implemented as a single software or software module, which is not specifically limited herein.

服务器105可以是提供各种服务的服务器,例如对终端设备101、102、103上的包含窗口的应用程序进行测试的服务器。服务器可以向终端设备101、102、103发送测试数据,以通过测试数据对终端设备101、102、103上安装的应用程序进行分析等处理,并接收终端设备101、102、103反馈来的处理结果。The server 105 may be a server that provides various services, for example, a server that tests applications including windows on the terminal devices 101 , 102 , and 103 . The server can send test data to the terminal devices 101, 102, and 103 to analyze and process the applications installed on the terminal devices 101, 102, and 103 through the test data, and receive the processing results fed back by the terminal devices 101, 102, and 103. .

需要说明的是,本申请实施例所提供的用于测试窗口的方法一般由终端设备101、102、103执行,相应地,用于测试窗口的装置一般设置于终端设备101、102、103中。It should be noted that the methods for testing windows provided in the embodiments of the present application are generally executed by terminal devices 101 , 102 , and 103 .

需要说明的是,服务器可以是硬件,也可以是软件。当服务器为硬件时,可以实现成多个服务器组成的分布式服务器集群,也可以实现成单个服务器。当服务器为软件时,可以实现成多个软件或软件模块(例如用来提供分布式服务),也可以实现成单个软件或软件模块,在此不做具体限定。It should be noted that the server may be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or can be implemented as a single server. When the server is software, it may be implemented as multiple software or software modules (for example, used to provide distributed services), or may be implemented as a single software or software module, which is not specifically limited herein.

应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。It should be understood that the numbers of terminal devices, networks and servers in FIG. 1 are merely illustrative. There can be any number of terminal devices, networks and servers according to implementation needs.

继续参考图2,示出了根据本申请的用于测试窗口的方法的一个实施例的流程200。该用于测试窗口的方法应用于包含窗口的应用程序,包括以下步骤:With continued reference to FIG. 2, a flow 200 of one embodiment of a method for testing a window according to the present application is shown. The method for testing a window, applied to an application containing a window, includes the following steps:

步骤201,查询对应测试数据的待测试窗口。Step 201, query the window to be tested corresponding to the test data.

在本实施例中,用于测试窗口的方法的执行主体(例如图1所示的终端设备101、102、103)可以通过有线连接方式或者无线连接方式接收服务器105发来的测试数据。其中,测试数据可以是服务器105针对终端设备101、102、103上的某一应用程序而发来的、用于对该应用程序中窗口包含的控件(例如可以是按键、下拉菜单等)进行的测试。需要指出的是,上述无线连接方式可以包括但不限于3G/4G连接、WiFi连接、蓝牙连接、WiMAX连接、Zigbee连接、UWB(ultra wideband)连接、以及其他现在已知或将来开发的无线连接方式。In this embodiment, the execution subject of the method for testing windows (eg, terminal devices 101, 102, and 103 shown in FIG. 1 ) can receive the test data sent by the server 105 through wired connection or wireless connection. Wherein, the test data may be sent by the server 105 for a certain application program on the terminal devices 101, 102, 103, and used for the control (for example, a button, a pull-down menu, etc.) contained in the window of the application program. test. It should be pointed out that the above wireless connection methods may include but are not limited to 3G/4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or developed in the future .

实际中,根据不同的需要,应用程序包含的窗口可以通过多种方式实现。对于某些类型的窗口而言,窗口内包含的控件可以没有对应的句柄。窗口内各控件之间通过特定的逻辑关系进行信息传递,以实现对控件的各种操作。并且,控件之间的逻辑关系并没有通用的结构。因此,现有的测试软件通常难以实现对这类窗口的测试。In practice, according to different needs, the window contained in the application can be realized in various ways. For some types of windows, the controls contained within the window may not have corresponding handles. Information is transmitted between the controls in the window through a specific logical relationship to realize various operations on the controls. Also, there is no general structure for the logical relationship between controls. Therefore, it is usually difficult for the existing test software to test such windows.

在对执行主体上的应用程序进行测试时,执行主体在接收到服务器105发来的测试数据后,可以首先查看该测试数据对应的是哪个应用程序。当测试数据是对窗口进行测试时,执行主体还可以进一步确定该测试数据针对该应用程序的哪个窗口进行测试,并将该窗口设置为待测试窗口。通常,测试数据对待测试窗口测试时,主要是对该待测试窗口所包含的控件进行测试。When testing the application program on the execution body, after the execution body receives the test data sent by the server 105, the execution body can first check which application the test data corresponds to. When the test data is to test a window, the execution body may further determine which window of the application program the test data is to be tested, and set the window as the window to be tested. Usually, when the test data is to be tested on the window to be tested, it mainly tests the controls contained in the window to be tested.

步骤202,获取上述待测试窗口的窗口属性。Step 202: Obtain the window attribute of the above-mentioned window to be tested.

由上述描述可知,本申请待测试窗口内的控件可以没有句柄。应用程序在接收到对应待测试窗口内控件的操作信号后,可以通过窗口属性对待测试窗口内的控件进行相应的控制。对待测试窗口进行测试时,执行主体可以在确定了待测试窗口后,获取该待测试窗口的窗口属性。由于本实施例的执行主体本身就是安装有对应待测试窗口的应用程序的终端设备101、102、103。因此,执行主体可以在确认了待测试窗口后,可以通过查询应用程序在执行主体上的安装文件、注册表信息、应用程序进程等方式直接获取到待测试窗口的窗口属性。例如,执行主体可以查询应用程序安装到执行主体上的安装文件,并查询对待测试窗口进行操作时,安装文件中的哪些数据被调用,进而获取到窗口属性信息。其中,上述窗口属性可以包括至少一个控件信息,以及对应上述至少一个控件信息中控件信息的操作信息。操作信息与控件对应,用于标识控件如何操作。不同的控件可以具有不同的操作信息。例如,当控件是按键时,操作信息可以是鼠标左键单击、鼠标左键双击,以及鼠标右键单击等。It can be seen from the above description that the control in the window to be tested in the present application may not have a handle. After receiving the operation signal corresponding to the control in the window to be tested, the application can control the control in the window to be tested correspondingly through the window property. When testing the to-be-tested window, the execution body may obtain the window attribute of the to-be-tested window after determining the to-be-tested window. Because the execution body of this embodiment is itself the terminal devices 101 , 102 , and 103 on which the application program corresponding to the window to be tested is installed. Therefore, after confirming the window to be tested, the execution body can directly obtain the window properties of the window to be tested by querying the installation file, registry information, and application process of the application on the execution body. For example, the execution body can query the installation file installed by the application program on the execution body, and query which data in the installation file is called when the window to be tested is operated, and then obtain the window attribute information. The above-mentioned window properties may include at least one control information, and operation information corresponding to the control information in the at least one control information. The operation information corresponds to the control and is used to identify how the control operates. Different controls can have different operational information. For example, when the control is a key, the operation information may be left mouse click, left mouse double click, right mouse click, and the like.

步骤203,根据上述窗口属性查询对应上述测试数据的待测试控件。Step 203, query the control to be tested corresponding to the test data according to the window attribute.

在对待测试窗口进行测试时,测试数据可以包含针对该待测试窗口内控件的针对性的测试数据,以检测对应控件的性能。例如,测试数据可以是用于检测待测试窗口内按键控件的灵敏性或准确性等。When testing the window to be tested, the test data may include targeted test data for the controls in the window to be tested, so as to detect the performance of the corresponding control. For example, the test data may be used to detect the sensitivity or accuracy of key controls in the window to be tested.

在本实施例的一些可选的实现方式中,上述测试数据可以包括待测试控件名称,以及,上述根据上述窗口属性查询对应上述测试数据的待测试控件,包括:根据上述待测试控件名称查询上述窗口属性中对应的控件信息,并将上述待测试窗口中的、与该控件信息对应的控件设置为待测试控件。In some optional implementations of this embodiment, the test data may include the name of the control to be tested, and the querying for the control to be tested corresponding to the test data according to the window attribute includes: querying the control to be tested according to the name of the control to be tested The corresponding control information in the window property, and the control corresponding to the control information in the above-mentioned window to be tested is set as the control to be tested.

当测试数据中包含了待测试控件名称等信息时,执行主体可以直接通过待测试控件名称查询窗口属性中对应的控件信息,进而确定对应测试数据的控件信息以及操作信息。之后,将该控件信息和操作信息所指向的控件设置为待测试控件。例如,测试数据包含有待测试控件名称“查询按键”。执行主体可以查询窗口属性中名称包括“查询”的控件信息或具有“查询”功能的操作信息,进而将对应“查询按键”的控件设置为待测试控件。When the test data contains information such as the name of the control to be tested, the execution body can directly query the corresponding control information in the window properties through the name of the control to be tested, and then determine the control information and operation information corresponding to the test data. After that, the control pointed to by the control information and the operation information is set as the control to be tested. For example, the test data contains the name of the control to be tested "query button". The execution body can query the control information whose name includes "query" in the window properties or the operation information with the "query" function, and then set the control corresponding to the "query button" as the control to be tested.

步骤204,通过上述测试数据控制上述待测试控件。Step 204, the control to be tested is controlled by the test data.

确定了待测试控件后,执行主体可以通过测试数据对待测试控件进行控制,以实现对待测试控件的测试。After the control to be tested is determined, the execution body can control the control to be tested through the test data, so as to realize the test of the control to be tested.

在本实施例的一些可选的实现方式中,上述测试数据可以包括对应待测试控件名称的测试信息。其中,测试信息可以是对待测试控件进行的测试内容。例如,测试信息可以是针对双击间隔时间的测试,对应的测试信息可以是连续的两次左键单击间隔0.5秒等。以及,上述通过上述测试数据控制上述待测试控件,可以包括以下步骤:In some optional implementations of this embodiment, the above-mentioned test data may include test information corresponding to the name of the control to be tested. The test information may be the test content of the control to be tested. For example, the test information may be a test for the interval time between double-clicks, and the corresponding test information may be an interval of 0.5 seconds between two consecutive left-clicks, and the like. And, the above-mentioned control of the above-mentioned control to be tested by the above-mentioned test data may include the following steps:

第一步,查找对应上述待测试控件的控件程序。The first step is to find the control program corresponding to the above-mentioned control to be tested.

待测试控件具有对应的控制程序,该控制程序与待测试控件的操作具有对应关系。其中,控件程序与控件操作信息对应,用于执行对应操作信息的数据处理。例如,当操作为“在控件上单击鼠标左键”时,该控件的控制程序可以是执行信息查询功能;当操作为“在控件上双击鼠标左键”时,该控件的控制程序可以是显示用于自定义查询的对话框等。The control to be tested has a corresponding control program, and the control program has a corresponding relationship with the operation of the control to be tested. The control program corresponds to the control operation information, and is used to perform data processing corresponding to the operation information. For example, when the operation is "click the left mouse button on the control", the control program of the control can be to perform the information query function; when the operation is "double-click the left mouse button on the control", the control program of the control can be Show dialogs for custom queries, etc.

第二步,根据上述测试信息设置操作指令,并通过上述操作指令控制上述控件程序。In the second step, an operation instruction is set according to the above-mentioned test information, and the above-mentioned control program is controlled by the above-mentioned operation instruction.

由于应用程序的窗口可以通过多种方式(例如可以是不同的程序设计语言或不同的逻辑架构等)构建,执行主体通常不易直接通过测试信息对控件程序进行测试。为此,执行主体可以根据测试信息来设置对应控件程序的操作指令,进而通过操作指令来对控件程序进行测试。提高了对应用程序测试的适用性和有效性。Since the window of the application can be constructed in various ways (for example, it can be different programming languages or different logic architectures, etc.), it is usually difficult for the execution body to directly test the control program through the test information. To this end, the execution body can set operation instructions corresponding to the control program according to the test information, and then test the control program through the operation instructions. Improved applicability and effectiveness for application testing.

在本实施例的一些可选的实现方式中,上述根据上述测试信息设置操作指令,可以包括以下步骤:In some optional implementations of this embodiment, the above-mentioned setting of the operation instruction according to the above-mentioned test information may include the following steps:

第一步,查询上述待测试控件的对应上述测试信息的操作信息。The first step is to query the operation information of the control to be tested corresponding to the test information.

通常,测试信息用于对待测试控件进行某一方面操作的测试。为此,执行主体可以首先确定与测试信息对应的操作信息。Usually, the test information is used to test the operation of a certain aspect of the control to be tested. To this end, the execution body may first determine the operation information corresponding to the test information.

第二步,根据上述操作信息构建操作指令。In the second step, an operation instruction is constructed according to the above operation information.

确定了操作信息后,执行主体可以按照控件程序能够执行的指令格式来构建操作指令,以通过操作指令测试控件程序。After the operation information is determined, the execution body can construct the operation instruction according to the instruction format that the control program can execute, so as to test the control program through the operation instruction.

如此,本实施例实现了通过测试数据对待测试窗口内控件的测试,提高了对应用程序测试的适用性和有效性。In this way, this embodiment realizes the testing of the controls in the window to be tested through the test data, and improves the applicability and effectiveness of the application program testing.

继续参考图3,示出了根据本申请的用于测试窗口的方法的一个实施例的流程300。该用于测试窗口的方法应用于包含窗口的应用程序,包括以下步骤:With continued reference to FIG. 3 , a flow 300 of one embodiment of a method for testing a window according to the present application is shown. The method for testing a window, applied to an application containing a window, includes the following steps:

步骤301,查询对应测试数据的待测试窗口。Step 301, query the window to be tested corresponding to the test data.

步骤301的内容与步骤201的内容相同,此处不再一一赘述。The content of step 301 is the same as that of step 201, and details are not repeated here.

步骤302,获取上述待测试窗口的窗口属性。Step 302: Obtain the window attribute of the above-mentioned window to be tested.

步骤302的内容与步骤202的内容相同,此处不再一一赘述。The content of step 302 is the same as that of step 202, and details are not repeated here.

步骤303,根据上述窗口属性查询对应上述测试数据的待测试控件。Step 303 , query the control to be tested corresponding to the test data according to the window attribute.

步骤303的内容与步骤203的内容相同,此处不再一一赘述。The content of step 303 is the same as that of step 203, and details are not repeated here.

步骤304,通过上述测试数据控制上述待测试控件。Step 304, the control to be tested is controlled by the test data.

步骤304的内容与步骤204的内容相同,此处不再一一赘述。The content of step 304 is the same as that of step 204, and details are not repeated here.

步骤305,获取对应上述测试数据的测试结果信息。Step 305: Obtain test result information corresponding to the above test data.

对控件测试完成后,执行主体可以获取到对应测试数据的测试结果信息。具体的,执行主体可以记录操作指令的执行信息和结果信息。其中,上述执行信息可以包括以下至少一项:指令内容、控件程序名称、执行时间。上述结果信息包括以下至少一项:指令内容、执行结果、执行结果输出时间。之后,执行主体可以将测试结果信息反馈给服务器105。After the control test is completed, the execution body can obtain the test result information corresponding to the test data. Specifically, the execution body may record the execution information and result information of the operation instruction. The above execution information may include at least one of the following: instruction content, control program name, and execution time. The above result information includes at least one of the following: instruction content, execution result, and execution result output time. Afterwards, the execution body can feed back the test result information to the server 105 .

继续参见图4,图4是根据本实施例的用于测试窗口的方法的应用场景的一个示意图。在图4的应用场景中,服务器105对终端设备102上安装的应用程序进行测试。服务器105通过网络104向终端设备102发送测试数据。终端设备102首先查询测试数据所要测试的待测试窗口;然后,获取到该待测试窗口的窗口属性;之后,根据窗口属性确定测试数据所要测试的待测试控件;最后,通过测试数据来控制待测试控件,以实现对应用程序的测试。Continue to refer to FIG. 4 , which is a schematic diagram of an application scenario of the method for testing a window according to this embodiment. In the application scenario of FIG. 4 , the server 105 tests the application program installed on the terminal device 102 . The server 105 sends the test data to the terminal device 102 through the network 104 . The terminal device 102 first inquires the to-be-tested window to be tested by the test data; then, obtains the window attribute of the to-be-tested window; then, determines the to-be-tested control to be tested by the test data according to the window attribute; finally, controls the to-be-tested control by the test data controls to implement testing of the application.

本申请的上述实施例提供的方法首先查询对应测试数据的待测试窗口;然后获取待测试窗口的窗口属性;之后根据窗口属性查询对应测试数据的待测试控件;最后通过测试数据测试待测试控件。实现了对不包含句柄的窗口进行测试,提高了对应用程序测试的适用性和有效性。The method provided by the above embodiments of the present application firstly queries the window to be tested corresponding to the test data; then acquires the window properties of the window to be tested; then queries the control to be tested corresponding to the test data according to the window properties; and finally tests the control to be tested through the test data. It realizes the test of the window that does not contain the handle, and improves the applicability and effectiveness of the application test.

进一步参考图5,作为对上述各图所示方法的实现,本申请提供了一种用于测试窗口的装置的一个实施例,该装置实施例与图2所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。With further reference to FIG. 5 , as an implementation of the methods shown in the above figures, the present application provides an embodiment of an apparatus for testing a window. The apparatus embodiment corresponds to the method embodiment shown in FIG. 2 . The device can be specifically applied to various electronic devices.

如图5所示,本实施例的用于测试窗口的装置500可以包括:待测试窗口查询单元501、窗口属性获取单元502、待测试控件查询单元503和测试单元504。其中,待测试窗口查询单元501被配置成查询对应测试数据的待测试窗口,其中,上述测试数据用于对窗口包含的控件进行测试;窗口属性获取单元502被配置成获取上述待测试窗口的窗口属性,其中,上述窗口属性包括至少一个控件信息,以及对应上述至少一个控件信息中控件信息的操作信息;待测试控件查询单元503被配置成根据上述窗口属性查询对应上述测试数据的待测试控件;测试单元504被配置成通过上述测试数据控制上述待测试控件。As shown in FIG. 5 , the apparatus 500 for testing a window in this embodiment may include: a window to be tested query unit 501 , a window property acquisition unit 502 , a control to be tested query unit 503 and a testing unit 504 . The to-be-tested window query unit 501 is configured to query the to-be-tested window corresponding to the test data, wherein the above-mentioned test data is used to test the controls contained in the window; the window property acquisition unit 502 is configured to obtain the above-mentioned window of the to-be-tested window Attribute, wherein, the above-mentioned window attribute includes at least one control information, and the operation information corresponding to the control information in the above-mentioned at least one control information; the control-to-be-tested query unit 503 is configured to query the control-to-be-tested corresponding to the above-mentioned test data according to the above-mentioned window attribute; The test unit 504 is configured to control the above-mentioned control to be tested through the above-mentioned test data.

在本实施例的一些可选的实现方式中,上述测试数据包括待测试控件名称,以及,上述待测试控件查询单元503可以包括:待测试控件查询子单元(图中未示出),被配置成根据上述待测试控件名称查询上述窗口属性中对应的控件信息,并将上述待测试窗口中的、与该控件信息对应的控件设置为待测试控件。In some optional implementations of this embodiment, the above-mentioned test data includes the name of the control to be tested, and the above-mentioned control-to-be-tested query unit 503 may include: a control-to-be-tested query subunit (not shown in the figure) that is configured According to the name of the control to be tested, the corresponding control information in the window property is queried, and the control corresponding to the control information in the window to be tested is set as the control to be tested.

在本实施例的一些可选的实现方式中,上述测试数据包括对应待测试控件名称的测试信息,以及,上述测试单元504可以包括:控件程序查找子单元(图中未示出)和测试子单元(图中未示出)。其中,控件程序查找子单元被配置成查找对应上述待测试控件的控件程序;测试子单元被配置成根据上述测试信息设置操作指令,并通过上述操作指令控制上述控件程序。In some optional implementations of this embodiment, the above test data includes test information corresponding to the name of the control to be tested, and the above test unit 504 may include: a control program search subunit (not shown in the figure) and a test subunit unit (not shown in the figure). The control program search subunit is configured to search for the control program corresponding to the control to be tested; the test subunit is configured to set operation instructions according to the test information, and control the control program through the operation instructions.

在本实施例的一些可选的实现方式中,其中,上述测试子单元可以包括:操作信息查询模块(图中未示出)和操作指令构建模块(图中未示出)。其中,操作信息查询模块被配置成查询上述待测试控件的对应上述测试信息的操作信息;操作指令构建模块被配置成根据上述操作信息构建操作指令。In some optional implementations of this embodiment, the above-mentioned test subunit may include: an operation information query module (not shown in the figure) and an operation instruction construction module (not shown in the figure). The operation information query module is configured to query the operation information of the control to be tested corresponding to the test information; the operation instruction construction module is configured to construct an operation instruction according to the operation information.

在本实施例的一些可选的实现方式中,上述用于测试窗口的装置500还可以包括:测试结果信息获取单元(图中未示出),被配置成获取对应上述测试数据的测试结果信息,上述测试结果信息获取单元可以包括:测试结果信息获取子单元(图中未示出),被配置成记录上述操作指令的执行信息和结果信息,其中,上述执行信息包括以下至少一项:指令内容、控件程序名称、执行时间,上述结果信息包括以下至少一项:指令内容、执行结果、执行结果输出时间。In some optional implementations of this embodiment, the above-mentioned apparatus 500 for testing a window may further include: a test result information acquiring unit (not shown in the figure) configured to acquire test result information corresponding to the above test data , the above-mentioned test result information acquisition unit may include: a test result information acquisition subunit (not shown in the figure), configured to record the execution information and result information of the above-mentioned operation instruction, wherein, the above-mentioned execution information includes at least one of the following: an instruction content, control program name, execution time, and the above result information includes at least one of the following: instruction content, execution result, and execution result output time.

本实施例还提供了一种电子设备,包括:一个或多个处理器;存储器,其上存储有一个或多个程序,当上述一个或多个程序被上述一个或多个处理器执行时,使得上述一个或多个处理器执行上述的用于测试窗口的方法。This embodiment also provides an electronic device, including: one or more processors; a memory on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, The above-mentioned one or more processors are caused to perform the above-mentioned method for testing a window.

本实施例还提供了一种计算机可读介质,其上存储有计算机程序,该程序被处理器执行时实现上述的用于测试窗口的方法。This embodiment also provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, implements the above-mentioned method for testing a window.

下面参考图6,其示出了适于用来实现本申请实施例的电子设备(例如,图1中的终端设备101、102、103)的计算机系统600的结构示意图。图6示出的电子设备仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。Referring next to FIG. 6 , it shows a schematic structural diagram of a computer system 600 suitable for implementing electronic devices (eg, terminal devices 101 , 102 , and 103 in FIG. 1 ) of the embodiments of the present application. The electronic device shown in FIG. 6 is only an example, and should not impose any limitations on the functions and scope of use of the embodiments of the present application.

如图6所示,计算机系统600包括中央处理单元(CPU)601,其可以根据存储在只读存储器(ROM)602中的程序或者从存储部分608加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。在RAM 603中,还存储有系统600操作所需的各种程序和数据。CPU 601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。As shown in FIG. 6, a computer system 600 includes a central processing unit (CPU) 601, which can be loaded into a random access memory (RAM) 603 according to a program stored in a read only memory (ROM) 602 or a program from a storage section 608 Instead, various appropriate actions and processes are performed. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601 , the ROM 602 , and the RAM 603 are connected to each other through a bus 604 . An input/output (I/O) interface 605 is also connected to bus 604 .

以下部件连接至I/O接口605:包括键盘、鼠标等的输入部分606;包括诸如、液晶显示器(LCD)等以及扬声器等的输出部分607;包括硬盘等的存储部分608;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分609。通信部分609经由诸如因特网的网络执行通信处理。驱动器610也根据需要连接至I/O接口605。可拆卸介质611,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器610上,以便于从其上读出的计算机程序根据需要被安装入存储部分608。The following components are connected to the I/O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; The communication part 609 of a network interface card such as a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I/O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 610 as needed so that a computer program read therefrom is installed into the storage section 608 as needed.

特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分609从网络上被下载和安装,和/或从可拆卸介质611被安装。在该计算机程序被中央处理单元(CPU)601执行时,执行本申请的方法中限定的上述功能。In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the method illustrated in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network via the communication portion 609 and/or installed from the removable medium 611 . When the computer program is executed by the central processing unit (CPU) 601, the above-described functions defined in the method of the present application are performed.

需要说明的是,本申请上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本申请中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium mentioned above in the present application may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), fiber optics, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. In this application, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device . Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented in dedicated hardware-based systems that perform the specified functions or operations , or can be implemented in a combination of dedicated hardware and computer instructions.

描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器包括待测试窗口查询单元、窗口属性获取单元、待测试控件查询单元和测试单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定,例如,测试单元还可以被描述为“用于通过测试数据对待测试窗口进行测试的单元”。The units involved in the embodiments of the present application may be implemented in a software manner, and may also be implemented in a hardware manner. The described unit can also be set in the processor, for example, it can be described as: a processor includes a to-be-tested window query unit, a window property acquisition unit, a to-be-tested control query unit and a test unit. Among them, the names of these units do not constitute a limitation of the unit itself under certain circumstances, for example, the test unit can also be described as "a unit used to test the window to be tested through test data".

作为另一方面,本申请还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的装置中所包含的;也可以是单独存在,而未装配入该装置中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该装置执行时,使得该装置:查询对应测试数据的待测试窗口,其中,上述测试数据用于对窗口包含的控件进行测试;获取上述待测试窗口的窗口属性,其中,上述窗口属性包括至少一个控件信息,以及对应上述至少一个控件信息中控件信息的操作信息;根据上述窗口属性查询对应上述测试数据的待测试控件;通过上述测试数据控制上述待测试控件。As another aspect, the present application also provides a computer-readable medium, which may be included in the apparatus described in the above-mentioned embodiments, or may exist independently without being assembled into the apparatus. The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the device, the device causes the device to: query the window to be tested corresponding to the test data, wherein the above-mentioned test data is used for The control is tested; the window attribute of the above-mentioned window to be tested is obtained, wherein the above-mentioned window attribute includes at least one control information and operation information corresponding to the control information in the above-mentioned at least one control information; according to the above-mentioned window attribute, the to-be-tested corresponding to the above-mentioned test data is queried. Control; control the above-mentioned control to be tested through the above-mentioned test data.

以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本申请中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本申请中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present application and an illustration of the applied technical principles. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to the technical solution formed by the specific combination of the above technical features, and should also cover the above technical features or Other technical solutions formed by any combination of its equivalent features. For example, a technical solution is formed by replacing the above-mentioned features with the technical features disclosed in this application (but not limited to) with similar functions.

Claims (10)

1.一种用于测试窗口的方法,应用于包含窗口的应用程序,包括:1. A method for testing a window, applied to an application containing a window, comprising: 查询对应测试数据的待测试窗口,其中,所述测试数据用于对窗口包含的控件进行测试,所述待测试窗口中所包括的控件没有对应的句柄;Query the window to be tested corresponding to the test data, wherein the test data is used to test the controls included in the window, and the controls included in the window to be tested do not have corresponding handles; 获取所述待测试窗口的窗口属性,其中,所述窗口属性包括至少一个控件信息,以及对应所述至少一个控件信息中控件信息的操作信息,所述窗口属性基于所述应用程序的安装文件、注册表信息、应用程序进程中至少一种确定;Obtain the window attribute of the window to be tested, wherein the window attribute includes at least one control information and operation information corresponding to the control information in the at least one control information, and the window attribute is based on the installation file of the application, At least one of registry information and application process is determined; 根据所述窗口属性查询对应所述测试数据的待测试控件;Query the control to be tested corresponding to the test data according to the window attribute; 通过所述测试数据控制所述待测试控件;以及control the control to be tested by the test data; and 响应于所述测试数据包括对应待测试控件名称的测试信息,所述通过所述测试数据控制所述待测试控件,包括:In response to the test data including the test information corresponding to the name of the control to be tested, the control of the control to be tested by the test data includes: 查找对应所述待测试控件的控件程序;Find the control program corresponding to the control to be tested; 根据所述测试信息设置操作指令,并通过所述操作指令控制所述控件程序。An operation instruction is set according to the test information, and the control program is controlled by the operation instruction. 2.根据权利要求1所述的方法,其中,所述测试数据包括待测试控件名称,以及2. The method according to claim 1, wherein the test data comprises the name of the control to be tested, and 所述根据所述窗口属性查询对应所述测试数据的待测试控件,包括:Querying the control to be tested corresponding to the test data according to the window attribute includes: 根据所述待测试控件名称查询所述窗口属性中对应的控件信息,并将所述待测试窗口中的、与该控件信息对应的控件设置为待测试控件。Query the corresponding control information in the window property according to the name of the control to be tested, and set the control corresponding to the control information in the window to be tested as the control to be tested. 3.根据权利要求1所述的方法,其中,所述根据所述测试信息设置操作指令,包括:3. The method according to claim 1, wherein said setting an operation instruction according to the test information comprises: 查询所述待测试控件的对应所述测试信息的操作信息;query the operation information of the control to be tested corresponding to the test information; 根据所述操作信息构建操作指令。An operation instruction is constructed according to the operation information. 4.根据权利要求1或3任意一项所述的方法,其中,所述方法还包括:获取对应所述测试数据的测试结果信息,包括:4. The method according to any one of claims 1 or 3, wherein the method further comprises: acquiring test result information corresponding to the test data, comprising: 记录所述操作指令的执行信息和结果信息,其中,所述执行信息包括以下至少一项:指令内容、控件程序名称、执行时间,所述结果信息包括以下至少一项:指令内容、执行结果、执行结果输出时间。Record the execution information and result information of the operation instruction, wherein the execution information includes at least one of the following: instruction content, control program name, execution time, and the result information includes at least one of the following: instruction content, execution result, Execution result output time. 5.一种用于测试窗口的装置,应用于包含窗口的应用程序,包括:5. A device for testing a window, applied to an application comprising a window, comprising: 待测试窗口查询单元,被配置成查询对应测试数据的待测试窗口,其中,所述测试数据用于对窗口包含的控件进行测试,所述待测试窗口中所包括的控件没有对应的句柄;The window to be tested query unit is configured to query the window to be tested corresponding to the test data, wherein the test data is used to test the controls included in the window, and the controls included in the window to be tested do not have corresponding handles; 窗口属性获取单元,被配置成获取所述待测试窗口的窗口属性,其中,所述窗口属性包括至少一个控件信息,以及对应所述至少一个控件信息中控件信息的操作信息,所述窗口属性基于所述应用程序的安装文件、注册表信息、应用程序进程中至少一种确定;A window property acquiring unit, configured to acquire a window property of the window to be tested, wherein the window property includes at least one control information, and operation information corresponding to the control information in the at least one control information, the window property is based on At least one of the installation file, registry information, and application process of the application is determined; 待测试控件查询单元,被配置成根据所述窗口属性查询对应所述测试数据的待测试控件;a control-to-be-tested query unit, configured to query the control-to-be-tested control corresponding to the test data according to the window attribute; 测试单元,被配置成通过所述测试数据控制所述待测试控件;以及a test unit configured to control the control to be tested through the test data; and 响应于所述测试数据包括对应待测试控件名称的测试信息,所述测试单元包括:In response to the test data including test information corresponding to the name of the control to be tested, the test unit includes: 控件程序查找子单元,被配置成查找对应所述待测试控件的控件程序;A control program search subunit, configured to search for a control program corresponding to the control to be tested; 测试子单元,被配置成根据所述测试信息设置操作指令,并通过所述操作指令控制所述控件程序。The test subunit is configured to set operation instructions according to the test information, and control the control program through the operation instructions. 6.根据权利要求5所述的装置,其中,所述测试数据包括待测试控件名称,以及6. The apparatus of claim 5, wherein the test data includes the name of the control to be tested, and 所述待测试控件查询单元包括:The to-be-tested control query unit includes: 待测试控件查询子单元,被配置成根据所述待测试控件名称查询所述窗口属性中对应的控件信息,并将所述待测试窗口中的、与该控件信息对应的控件设置为待测试控件。The control to be tested query subunit is configured to query the corresponding control information in the window property according to the name of the control to be tested, and set the control corresponding to the control information in the window to be tested as the control to be tested . 7.根据权利要求6所述的装置,其中,所述测试子单元包括:7. The apparatus of claim 6, wherein the testing subunit comprises: 操作信息查询模块,被配置成查询所述待测试控件的对应所述测试信息的操作信息;an operation information query module, configured to query the operation information of the control to be tested corresponding to the test information; 操作指令构建模块,被配置成根据所述操作信息构建操作指令。The operation instruction construction module is configured to construct an operation instruction according to the operation information. 8.根据权利要求5或7任意一项所述的装置,其中,所述装置还包括:测试结果信息获取单元,被配置成获取对应所述测试数据的测试结果信息,所述测试结果信息获取单元包括:8. The device according to any one of claims 5 or 7, wherein the device further comprises: a test result information acquiring unit configured to acquire test result information corresponding to the test data, the test result information acquiring Units include: 测试结果信息获取子单元,被配置成记录所述操作指令的执行信息和结果信息,其中,所述执行信息包括以下至少一项:指令内容、控件程序名称、执行时间,所述结果信息包括以下至少一项:指令内容、执行结果、执行结果输出时间。The test result information acquisition subunit is configured to record the execution information and result information of the operation instruction, wherein the execution information includes at least one of the following: instruction content, control program name, execution time, and the result information includes the following At least one item: instruction content, execution result, and execution result output time. 9.一种电子设备,包括:9. An electronic device comprising: 一个或多个处理器;one or more processors; 存储器,其上存储有一个或多个程序,memory on which one or more programs are stored, 当所述一个或多个程序被所述一个或多个处理器执行时,使得所述一个或多个处理器执行权利要求1至4中任一所述的方法。The one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any one of claims 1 to 4. 10.一种计算机可读介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如权利要求1至4中任一所述的方法。10. A computer-readable medium on which a computer program is stored, characterized in that, when the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
CN201810918389.6A 2018-08-13 2018-08-13 Method and device for testing window Active CN109144864B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810918389.6A CN109144864B (en) 2018-08-13 2018-08-13 Method and device for testing window

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810918389.6A CN109144864B (en) 2018-08-13 2018-08-13 Method and device for testing window

Publications (2)

Publication Number Publication Date
CN109144864A CN109144864A (en) 2019-01-04
CN109144864B true CN109144864B (en) 2022-09-06

Family

ID=64792867

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810918389.6A Active CN109144864B (en) 2018-08-13 2018-08-13 Method and device for testing window

Country Status (1)

Country Link
CN (1) CN109144864B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651310B (en) * 2020-05-26 2023-04-07 惠州Tcl移动通信有限公司 Radio frequency debugging method and device, storage medium and electronic equipment
CN112256541A (en) * 2020-10-12 2021-01-22 麒麟软件有限公司 Method for testing display performance and pressure of graphical window of operating system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309797A (en) * 2012-03-09 2013-09-18 阿里巴巴集团控股有限公司 Automatic testing method and device of user interface
CN107368418A (en) * 2017-07-26 2017-11-21 网易有道信息技术(北京)有限公司 A kind of method, apparatus and medium for traveling through test

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102521129B (en) * 2011-12-08 2014-10-22 北京新媒传信科技有限公司 Testing method and testing device for owner-drawing window

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309797A (en) * 2012-03-09 2013-09-18 阿里巴巴集团控股有限公司 Automatic testing method and device of user interface
CN107368418A (en) * 2017-07-26 2017-11-21 网易有道信息技术(北京)有限公司 A kind of method, apparatus and medium for traveling through test

Also Published As

Publication number Publication date
CN109144864A (en) 2019-01-04

Similar Documents

Publication Publication Date Title
US9396046B2 (en) Graph based data model for API ecosystem insights
CN111340220A (en) Method and apparatus for training predictive models
CN111666201A (en) Regression testing method, device, medium and electronic equipment
CN110780874B (en) Method and device for generating information
WO2020199659A1 (en) Method and apparatus for determining push priority information
CN109697034B (en) Data writing method and device, electronic equipment and storage medium
CN115757400A (en) Data table processing method and device, electronic equipment and computer readable medium
US11669436B2 (en) System for providing interactive tools for design, testing, and implementation of system architecture
CN112256372B (en) Information processing method and device and electronic equipment
CN109144864B (en) Method and device for testing window
CN115145560B (en) Business orchestration method, apparatus, device, computer-readable medium, and program product
CN110806967A (en) A unit testing method and apparatus
US20190188623A1 (en) Cognitive and dynamic business process generation
CN110413920A (en) Method and device for generating pages
CN115374760A (en) Document editing method, device, device, computer readable medium and program product
CN111324470A (en) Method and apparatus for generating information
CN110554892A (en) Information acquisition method and device
CN112084115B (en) Method and device for flowsheet operation of software defects
CN111488386B (en) Data query method and device
CN111767290B (en) Method and device for updating user portrait
CN107341237A (en) Method and apparatus for processing information
CN112464039A (en) Data display method and device of tree structure, electronic equipment and medium
CN111385150A (en) Method and apparatus for obtaining information
CN111767447A (en) Method and apparatus for determining user traffic path
CN113760727B (en) Interface regression testing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant