[go: up one dir, main page]

CN104516819B - The method of testing and device of the interface state change time of software - Google Patents

The method of testing and device of the interface state change time of software Download PDF

Info

Publication number
CN104516819B
CN104516819B CN201510005114.XA CN201510005114A CN104516819B CN 104516819 B CN104516819 B CN 104516819B CN 201510005114 A CN201510005114 A CN 201510005114A CN 104516819 B CN104516819 B CN 104516819B
Authority
CN
China
Prior art keywords
interface
time
color
record
state change
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
CN201510005114.XA
Other languages
Chinese (zh)
Other versions
CN104516819A (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 Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing 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 Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201510005114.XA priority Critical patent/CN104516819B/en
Priority claimed from CN201210089731.9A external-priority patent/CN102662839B/en
Publication of CN104516819A publication Critical patent/CN104516819A/en
Application granted granted Critical
Publication of CN104516819B publication Critical patent/CN104516819B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

本申请提供了一种软件的界面状态变化时间的测试方法和装置,以解决现有技术测试的软件的界面变化时间不准确的问题。所述的方法包括:触发改变测试界面状态的操作,将触发时刻记录为开始时间;检测到测试界面的基准目标发生预置变化,将所述检测时刻记录为结束时间;将所述结束时间和开始时间的时间间隔记录为界面状态变化时间。本申请根据在测试界面状态变化时基准目标会发生变化的特点,可以获知软件的界面呈现给用户的时间,即可以获知软件的真实的启动时间。

The present application provides a method and device for testing the interface state change time of software, so as to solve the problem of inaccurate interface change time of software tested in the prior art. The method includes: triggering the operation of changing the state of the test interface, recording the trigger moment as the start time; detecting that the benchmark target of the test interface has changed presetly, recording the detection moment as the end time; recording the end time and The time interval between the start time is recorded as the interface state change time. According to the characteristic that the benchmark target will change when the state of the test interface changes, the present application can know the time when the software interface is presented to the user, that is, the real startup time of the software can be known.

Description

软件的界面状态变化时间的测试方法和装置Method and device for testing software interface state change time

技术领域technical field

本申请涉及测试技术领域,特别是涉及一种软件的界面状态变化时间的测试方法和装置。The present application relates to the technical field of testing, in particular to a method and device for testing the change time of interface state of software.

背景技术Background technique

随着计算机的发展和普及,越来越多的人使用计算机,计算机中包含多种软件为用户提供相应的服务。为了给用户提供更好的服务,需要对软件的性能进行测试,以进一步提高软件的性能,其中一项就是测试软件的界面状态变化时间,例如测试软件的界面启动时间和界面关闭时间。With the development and popularization of computers, more and more people use computers, which contain a variety of software to provide users with corresponding services. In order to provide better services to users, it is necessary to test the performance of the software to further improve the performance of the software, one of which is to test the interface state change time of the software, such as the interface startup time and interface shutdown time of the test software.

通常测试软件的界面状态变化时间的方法是通过捕获API事件,即通过接口调用来监控软件的界面启动中的某些事件,事件发生后即可认定软件的界面状态变化完毕。Usually, the method of testing the interface state change time of the software is by capturing API events, that is, monitoring some events in the interface startup of the software through interface calls, and it can be determined that the interface state of the software has changed after the event occurs.

例如,测试软件的界面启动时间时,可以通过接口调用监控窗口标题的加载,所述窗口标题加载完毕即认为软件的界面完成启动,记录从软件的界面开始启动到窗口标题加载完毕的时间为启动时间。还可以通过接口调用监控dll(Dynamic Link Library,动态链接库)文件的加载,所述dll文件加载完毕即认为软件的界面完成启动,记录从软件的界面开始启动到dll文件加载完毕的时间为启动时间。For example, when testing the startup time of the interface of the software, the loading of the monitoring window title can be called through the interface. After the loading of the window title is completed, the software interface is considered to be started, and the time from the start of the software interface to the completion of the loading of the window title is recorded as the startup time. The loading of the monitoring dll (Dynamic Link Library, dynamic link library) file can also be called through the interface, and the interface of the software is considered to be completed when the dll file is loaded, and the time from the interface of the software to the loading of the dll file is recorded as starting time.

对每个用户来讲,软件的界面呈现给用户的时间就是该软件的真实的启动时间。但是通过上述方法进行测试时发现,通常测试出的启动时间比所述真实的启动时间短,例如,用户看到软件的界面的真实的启动时间是5s,但测试出的启动时间却是3s,即测试出的软件的启动时间不准确。测试出的启动时间让测试人员以为软件的启动性能比较好,但用户实际看到的启动时间却比较长,因而测试出的启动时间并没有真实的反应出软件的启动性能,进而无法对软件的启动性能进行提高。For each user, the time when the software interface is presented to the user is the real startup time of the software. However, when testing by the above method, it is found that the startup time usually tested is shorter than the real startup time. For example, the real startup time of the user's software interface is 5s, but the tested startup time is 3s. That is, the startup time of the tested software is inaccurate. The startup time tested made the testers think that the startup performance of the software is better, but the startup time actually seen by the user is relatively long, so the startup time tested does not truly reflect the startup performance of the software, and thus cannot evaluate the software startup performance. Startup performance was improved.

因而采取上述的方法并不能准确的测试出软件的界面状态变化时间,也就没有真实的反应出软件的界面状态变化性能,进而无法对软件的界面状态变化性能进行提高。Therefore, adopting the above-mentioned method cannot accurately test the interface state change time of the software, and does not truly reflect the interface state change performance of the software, and then cannot improve the interface state change performance of the software.

发明内容Contents of the invention

本申请提供一种软件的界面状态变化时间的测试方法和装置,以解决现有技术测试的软件的界面变化时间不准确的问题。The present application provides a method and device for testing the interface state change time of software, so as to solve the problem of inaccurate interface change time of the software tested in the prior art.

为了解决上述问题,本申请公开了一种软件的界面状态变化时间的测试方法,包括:In order to solve the above problems, the application discloses a test method for the interface state change time of the software, including:

触发改变测试界面状态的操作,将触发时刻记录为开始时间;Trigger the operation that changes the state of the test interface, and record the trigger time as the start time;

检测到测试界面中的基准目标发生预置变化,将所述检测时刻记录为结束时间;Detecting a preset change in the benchmark target in the test interface, recording the detection moment as the end time;

将所述结束时间和开始时间的时间间隔记录为界面状态变化时间。The time interval between the end time and the start time is recorded as the interface state change time.

优选的,所述界面状态变化时间包括:界面启动时间、界面关闭时间和界面切换时间。Preferably, the interface state change time includes: interface startup time, interface shutdown time and interface switching time.

优选的,所述基准目标为基准点,所述的方法还包括:Preferably, the reference target is a reference point, and the method also includes:

获取至少一个基准点的颜色并记录为开始颜色,其中,将测试界面状态变化前和界面状态变化后颜色不相同的点作为基准点。Obtain the color of at least one reference point and record it as the start color, where the point whose color is different before the test interface state changes and after the interface state change is used as the reference point.

优选的,所述在检测到测试界面中的基准目标发生预置变化,将所述检测时刻记录为结束时间包括:Preferably, when the reference target in the test interface is detected to have a preset change, recording the detection moment as the end time includes:

在检测到基准点的当前颜色与开始颜色不同时,将所述检测的时刻记录为结束时间。When it is detected that the current color of the reference point is different from the start color, record the detected time as the end time.

优选的,所述在检测到基准点的当前颜色与开始颜色不同,设置所述检测的时刻为结束时间,包括:Preferably, when the current color of the reference point is detected to be different from the start color, setting the moment of detection as the end time includes:

获取所述基准点的颜色,并记录为当前颜色;Obtain the color of the reference point and record it as the current color;

检测所述基准点的当前颜色是否等于开始颜色;detecting whether the current color of the reference point is equal to the starting color;

若不等于,则将所述检测时刻记录为结束时间;If not equal, then record the detection moment as the end time;

若等于,则获取下一时刻所述基准点的颜色。If equal, obtain the color of the reference point at the next moment.

优选的,所述的方法进一步包括:Preferably, the method further comprises:

预先获取至少一个在状态变化前和状态变化后颜色不相同的点作为基准点。Acquire in advance at least one point whose color is different before and after the state change as a reference point.

优选的,所述基准目标为基准图片,并且所述界面状态变化包括界面启动和界面切换,则所述检测到测试界面中的基准目标发生预置变化,将所述检测时刻记录为结束时间,包括:Preferably, the reference target is a reference picture, and the interface state change includes interface startup and interface switching, then the detected reference target in the test interface has a preset change, and the detection time is recorded as the end time, include:

分别获取基准图片中的颜色和/或形状并记录;Obtain and record the color and/or shape in the reference image respectively;

分别检测基准图片中的颜色和/或形状与对比图片中对应的颜色和/或形状是否相同;Detecting whether the color and/or shape in the reference picture and the corresponding color and/or shape in the comparison picture are the same;

若相同,则将所述检测时刻记录为结束时间;If they are the same, record the detection time as the end time;

若不相同,则获取下一时刻所述基准图片中的颜色和/或形状。If not, acquire the color and/or shape in the reference picture at the next moment.

优选的,所述基准目标为基准图片,并且所述界面状态变化为界面关闭,则所述检测到测试界面中的基准目标发生预置变化,将所述检测时刻记录为结束时间,包括:Preferably, the reference target is a reference picture, and the interface state changes to the interface is closed, then the detected reference target in the test interface has a preset change, and the detection time is recorded as the end time, including:

分别获取基准图片中的颜色和/或形状并记录;Obtain and record the color and/or shape in the reference image respectively;

分别检测基准图片中的颜色和/或形状与对比图片中对应的颜色和/或形状是否相同;Detecting whether the color and/or shape in the reference picture and the corresponding color and/or shape in the comparison picture are the same;

若不相同,则记录检测时刻为结束时间;If not the same, record the detection time as the end time;

若相同,则获取下一时刻所述基准图片中的颜色和/或形状。If they are the same, the color and/or shape in the reference picture at the next moment is acquired.

优选的,依据所述界面状态变化时间,执行对界面所属程序的优化操作。Preferably, an optimization operation on the program to which the interface belongs is performed according to the interface state change time.

优选的,所述执行对界面所属程序的优化操作,包括:Preferably, said performing an optimization operation on the program to which the interface belongs includes:

判断出所述界面状态变化时间超过预定阈值时,执行对界面所属程序的优化操作或提示操作。When it is determined that the interface state change time exceeds a predetermined threshold, an optimization operation or a prompt operation for the program to which the interface belongs is performed.

优选的,所述执行对界面所属程序的优化操作包括:Preferably, said performing an optimization operation on the program to which the interface belongs includes:

使用本地的程序优化工具进行界面所属程序的配置参数优化。Use the local program optimization tool to optimize the configuration parameters of the program to which the interface belongs.

优选的,述执行对界面所属程序的优化操作包括:Preferably, the execution of the optimization operation of the program to which the interface belongs includes:

向服务器发送界面的更新请求信息,以修复界面所属程序。Send interface update request information to the server to repair the program to which the interface belongs.

相应的,本申请还公开了一种软件的界面状态变化时间的测试装置,包括:Correspondingly, this application also discloses a testing device for the change time of the interface state of the software, including:

触发模块,用于触发改变测试界面状态的操作,同时将触发时刻记录设置为开始时间;The trigger module is used to trigger the operation of changing the state of the test interface, and simultaneously set the trigger time record as the start time;

检测模块,用于检测到测试界面中的基准目标发生预置变化,将所述检测的时刻记录为结束时间;A detection module, configured to detect a preset change in the benchmark target in the test interface, and record the detected moment as the end time;

变化时间记录模块,用于将所述结束时间和开始时间的时间间隔记录为界面状态变化时间;A change time recording module, configured to record the time interval between the end time and the start time as the interface state change time;

输出模块,用于输出所述界面状态变化时间。An output module, configured to output the interface state change time.

优选的,若所述基准目标为基准点,所述的装置还包括:Preferably, if the reference target is a reference point, the device further includes:

颜色获取模块,用于获取至少一个基准点的颜色并记录为开始颜色,其中,将测试界面状态变化前和状态变化后颜色不相同的点作为基准点。The color obtaining module is used to obtain the color of at least one reference point and record it as the starting color, wherein the point whose color is different before and after the state change of the test interface is used as the reference point.

优选的,所述检测及记录模块,用于在检测到基准点的当前颜色与开始颜色不同时,将所述检测的时刻记录为结束时间。Preferably, the detection and recording module is configured to record the time of detection as the end time when it is detected that the current color of the reference point is different from the start color.

优选的,所述检测及记录模块,包括:Preferably, the detection and recording module includes:

获取子模块,用于获取所述基准点的颜色,并记录为当前颜色;Obtaining a submodule, configured to obtain the color of the reference point and record it as the current color;

检测子模块,用于检测所述基准点的当前颜色是否等于开始颜色;A detection submodule, configured to detect whether the current color of the reference point is equal to the starting color;

记录时间子模块,用于将所述检测时刻记录为结束时间。The record time sub-module is used to record the detection time as the end time.

优选的,所述的装置还包括:Preferably, the device also includes:

获取基准点模块,用于预先获取至少一个在状态变化前和状态变化后颜色不相同的点作为基准点。The obtaining reference point module is used to obtain in advance at least one point whose color is different before the state change and after the state change as a reference point.

优选的,若所述基准目标为基准图片,并且所述界面状态变化包括界面启动和界面切换,所述检测及记录模块包括:Preferably, if the reference target is a reference picture, and the interface state changes include interface startup and interface switching, the detection and recording module includes:

获取子模块,用于分别获取基准图片中的颜色和/或形状并记录;Obtaining sub-modules for obtaining and recording the color and/or shape in the reference image respectively;

检测子模块,用于分别检测基准图片中的颜色和/或形状与对比图片中对应的颜色和/或形状是否相同;A detection submodule is used to respectively detect whether the color and/or shape in the reference picture is the same as the corresponding color and/or shape in the comparison picture;

记录时间子模块,用于记录检测时刻为结束时间。The record time sub-module is used to record the detection time as the end time.

优选的,所述基准目标为基准图片,并且所述界面状态变化为界面关闭,所述检测及记录模块包括:Preferably, the reference target is a reference picture, and the interface state changes to interface closing, and the detection and recording module includes:

获取子模块,用于分别获取基准图片中的颜色和/或形状并记录;Obtaining sub-modules for obtaining and recording the color and/or shape in the reference image respectively;

检测子模块,用于分别检测基准图片中的颜色和/或形状与对比图片中对应的颜色和/或形状是否相同;A detection submodule is used to respectively detect whether the color and/or shape in the reference picture is the same as the corresponding color and/or shape in the comparison picture;

记录时间子模块,用于记录检测时刻为结束时间。The record time sub-module is used to record the detection time as the end time.

优选的,所述的装置还包括:Preferably, the device also includes:

优化模块,用于依据所述界面状态变化时间,执行对界面所属程序的优化操作。The optimization module is configured to perform an optimization operation on the program to which the interface belongs according to the interface state change time.

优选的,所述优化模块包括:Preferably, the optimization module includes:

阈值判断子模块,用于判断出所述界面状态变化时间超过预定阈值时,执行对界面所属程序的优化操作或提示操作。The threshold judging sub-module is used to execute an optimization operation or a prompt operation for the program to which the interface belongs when it is judged that the interface state change time exceeds a predetermined threshold.

优选的,所述优化模块包括:Preferably, the optimization module includes:

参数优化子模块,用于使用本地的程序优化工具进行界面所属程序的配置参数优化。The parameter optimization sub-module is used to optimize the configuration parameters of the program to which the interface belongs using a local program optimization tool.

优选的,所述优化模块包括:Preferably, the optimization module includes:

更新子模块,用于向服务器发送界面的更新请求信息,以修复界面所属程序。The update submodule is used to send interface update request information to the server, so as to repair the program to which the interface belongs.

与现有技术相比,本申请包括以下优点:Compared with the prior art, the present application includes the following advantages:

首先,本申请以软件的界面呈现给用户的时间为依据,先触发改变测试界面状态的操作,同时将触发时刻记录为开始时间,检测到测试界面中的基准目标发生预置变化,将所述检测的时刻记录为结束时间,然后将所述结束时间和开始时间的时间间隔记录为界面状态变化时间。本申请根据在测试界面状态变化时基准目标会发生变化的特点,可以获知软件的界面呈现给用户的时间,即可以获知软件的真实的启动时间,进而可以更真实的体现出软件的状态变化性能,可以对软件的状态变化性能的提高提供依据。First, based on the time when the software interface is presented to the user, the application first triggers the operation of changing the state of the test interface, and records the trigger time as the start time at the same time. The detected moment is recorded as the end time, and then the time interval between the end time and the start time is recorded as the interface state change time. According to the characteristics that the benchmark target will change when the state of the test interface changes, the application can know the time when the software interface is presented to the user, that is, the real startup time of the software can be known, and then the state change performance of the software can be more truly reflected , which can provide a basis for improving the performance of software state changes.

其次,本申请在判断软件的界面状态变化时间时,所述的基准目标可以为基准图片,可以将基准图片颜色和/或形状与预置的对比图片的颜色和/或形状进行比较,来检测界面状态是否变化完毕,进而可以获知界面的状态变化时间。所述基准目标也可以为基准点,若检测到基准点的当前颜色与开始颜色不同,则说明软件的界面状态变化完毕,进而可以获知界面的状态变化时间。本申请中获取软件的界面状态变化时间的方法灵活、多样,可以满足各种软件的界面状态变化时间的测试需求。Secondly, when the present application judges the change time of the interface state of the software, the reference target can be a reference picture, and the color and/or shape of the reference picture can be compared with the color and/or shape of the preset comparison picture to detect Whether the interface state has changed completely, and then the state change time of the interface can be obtained. The reference target can also be a reference point. If it is detected that the current color of the reference point is different from the start color, it means that the interface state of the software has changed completely, and then the state change time of the interface can be known. In the present application, the methods for obtaining the interface state change time of the software are flexible and diverse, and can meet the testing requirements of the interface state change time of various software.

再次,本申请还可以根据界面状态变化时间,执行对界面所属程序的优化操作,包括:使用本地的程序优化工具进行界面所属程序的配置参数优化;向服务器发送界面的更新请求信息,以修复界面所属程序。本申请可以通过对界面的优化,缩短界面状态变化时间,提高用户的使用效果,更快的为用户提供服务。Again, this application can also perform optimization operations on the program to which the interface belongs according to the change time of the interface state, including: using a local program optimization tool to optimize the configuration parameters of the program to which the interface belongs; sending an interface update request message to the server to repair the interface belongs to the program. The present application can shorten the time for changing the state of the interface by optimizing the interface, improve the use effect of the user, and provide services for the user faster.

附图说明Description of drawings

为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For Those of ordinary skill in the art can also obtain other drawings based on these drawings without making creative efforts.

图1是本申请实施例所述一种软件的界面状态变化时间的测试方法流程图;Fig. 1 is the test method flowchart of the interface state change time of a kind of software described in the embodiment of the application;

图2是本申请优选实施例所述第一种软件的界面状态变化时间的测试方法流程图;Fig. 2 is the test method flowchart of the interface state change time of the first software described in the preferred embodiment of the present application;

图3是本申请实施例所述第一种软件的界面状态变化时间的优选测试装置结构图Fig. 3 is a preferred test device structure diagram of the interface state change time of the first software described in the embodiment of the present application

图4是本申请实施例所述第二种软件的界面状态变化时间的测试方法流程图;Fig. 4 is the flow chart of the test method of the interface state change time of the second software described in the embodiment of the present application;

图5是本申请实施例所述第二种软件的界面状态变化时间的测试方法中界面关闭方法流程图;Fig. 5 is the flow chart of the interface closing method in the test method of the interface state change time of the second software described in the embodiment of the present application;

图6是本申请实施例所述一种软件的界面状态变化时间的测试装置流程图;6 is a flow chart of a test device for the interface state change time of a software described in the embodiment of the present application;

图7是本申请实施例所述第一种软件的界面状态变化时间的测试装置流程图;Fig. 7 is a flow chart of the test device for the interface state change time of the first software described in the embodiment of the present application;

图8是本申请实施例所述第二种软件的界面状态变化时间的测试装置流程图;Fig. 8 is a flow chart of the test device for the interface state change time of the second software described in the embodiment of the present application;

图9是本申请实施例所述第二种软件的界面状态变化时间中界面关闭的测试装置流程图。Fig. 9 is a flow chart of the test device for interface closing during the interface state change time of the second software described in the embodiment of the present application.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

为了给用户提供更好的服务,需要对软件的性能进行测试,以进一步提高软件的性能,其中一项就是测试软件的界面状态变化时间。In order to provide users with better services, it is necessary to test the performance of the software to further improve the performance of the software, one of which is to test the interface state change time of the software.

通常测试软件的界面状态变化时间的方法是通过捕获API事件,即通过接口调用来监控软件的界面状态变化中的某些事件,事件发生后即可认定软件的界面状态变化完毕。但是现有技术测试软件的界面状态变化时间的方法不准确,测试出的界面状态变化时间并没有真实的反应出软件的界面状态变化性能,进而无法对软件的界面状态变化性能进行提高。Usually, the method of testing the interface state change time of the software is by capturing API events, that is, monitoring certain events in the interface state changes of the software through interface calls, and it can be determined that the interface state changes of the software are completed after the event occurs. However, the method for testing the interface state change time of software in the prior art is inaccurate, and the interface state change time tested does not truly reflect the interface state change performance of the software, and thus cannot improve the interface state change performance of the software.

本申请所述的方法可以获知软件的界面呈现给用户的时间,即可以获知软件的真实的界面状态变化时间,进而可以更真实的体现出软件的界面状态变化性能,可以对软件的界面状态变化性能进行提高提供依据。The method described in this application can know the time when the interface of the software is presented to the user, that is, the real interface state change time of the software can be known, and then the interface state change performance of the software can be more realistically reflected, and the interface state change of the software can be monitored. Provide a basis for performance improvement.

参照图1,给出了本申请实施例所述一种软件的界面状态变化时间的测试方法流程图。Referring to FIG. 1 , a flow chart of a method for testing the interface state change time of the software described in the embodiment of the present application is shown.

步骤11,触发改变测试界面状态的操作,将触发时刻记录为开始时间;Step 11, trigger the operation of changing the state of the test interface, and record the trigger time as the start time;

设开始时间为TimeStar,其中,获取触发时刻后无论是作为参数暂时保存,还是作为记录数据保存,都可以认为是将触发时刻记录为开始时间。Let the start time be TimeStar, wherein, whether the trigger time is temporarily saved as a parameter or saved as recorded data after the trigger time is obtained, it can be regarded as recording the trigger time as the start time.

步骤12,检测到测试界面中的基准目标发生预置变化,将检测时刻记录为结束时间;Step 12, detecting a preset change in the benchmark target in the test interface, and recording the detection time as the end time;

测试界面的状态变化可以导致测试界面中的基准目标产生变化,因此可以预先获取测试界面状态变化时基准目标的变化,若检测到测试界面中的基准目标发生预置变化,则记录检测的时刻为结束时间,设所述结束时间为TimeEnd。The state change of the test interface can lead to changes in the benchmark target in the test interface, so the change of the benchmark target when the state of the test interface changes can be obtained in advance. If the preset change of the benchmark target in the test interface is detected, the time of recording the detection is End time, set the end time as TimeEnd.

步骤13,将所述结束时间和开始时间的时间间隔记录为界面状态变化时间。Step 13, record the time interval between the end time and the start time as the interface state change time.

可以将TimeEnd-TimeStar得到时间间隔,即为界面状态变化时间。The time interval can be obtained from TimeEnd-TimeStar, which is the interface state change time.

其中,所述界面状态变化时间包括:界面启动时间、界面关闭时间和界面切换时间。Wherein, the interface state change time includes: interface startup time, interface shutdown time and interface switching time.

综上所述,本申请以软件的界面呈现给用户的时间为依据,先触发改变测试界面状态的操作,将触发时刻记录为开始时间,若检测到测试界面中的基准目标发生预置变化,将所述检测时刻记录为结束时间,然后将所述结束时间和开始时间的时间间隔记录为界面状态变化时间。本申请根据在测试界面状态变化时基准目标会发生变化的特点,可以获知软件的界面呈现给用户的时间,即可以获知软件的真实的启动时间,进而可以更真实的体现出软件的状态变化性能,可以为软件的状态变化性能的提高提供依据。To sum up, this application uses the time when the software interface is presented to the user as the basis, first triggers the operation of changing the state of the test interface, and records the trigger time as the start time. If a preset change in the benchmark target in the test interface is detected, The detection moment is recorded as an end time, and then the time interval between the end time and the start time is recorded as an interface state change time. According to the characteristics that the benchmark target will change when the state of the test interface changes, the application can know the time when the software interface is presented to the user, that is, the real startup time of the software can be known, and then the state change performance of the software can be more truly reflected , which can provide a basis for the improvement of the state change performance of the software.

本申请根据软件的界面状态变化会引起颜色变化的特性,根据不同的基准目标可以采取不同的测试方法。In this application, according to the characteristic that the change of the interface state of the software will cause the color change, different test methods can be adopted according to different benchmark targets.

一、若所述基准目标为基准点:1. If the reference target is a reference point:

参照图2,给出了本申请实施例所述第一种软件的界面状态变化时间的测试方法流程图。Referring to FIG. 2 , a flow chart of a test method for the interface state change time of the first software described in the embodiment of the present application is given.

步骤21,获取至少一个基准点的颜色并记录为开始颜色;Step 21, acquiring the color of at least one reference point and recording it as the starting color;

其中,将测试界面状态变化前和界面状态变化后颜色不相同的点作为基准点;Among them, the points with different colors before and after the test interface state change are taken as reference points;

通常系统桌面上展示的软件在界面状态变化前和界面状态变化后的颜色会发生变化,例如,某软件启动前系统桌面是黑色的,但是在启动后,软件的界面标题部分为蓝色,其他部分为白色。又如,软件一个标签中展示的内容是粉色的,另一个标签展示的内容是棕色的,两个标签在切换时展示的内容颜色不同。Usually, the color of the software displayed on the system desktop will change before and after the interface state changes. For example, the system desktop is black before a certain software is started, but after it is started, the title part of the software interface is blue. Some are white. For another example, the content displayed in one tab of the software is pink, and the content displayed in the other tab is brown, and the content displayed in the two tabs is different in color when switching.

本申请根据上述的特点,将测试界面状态变化前和界面状态变化后颜色不相同的点作为基准点,因此,首先获取至少一个基准点的颜色并记录为开始颜色,其中所述开始颜色为测试界面状态变化前基准点的颜色。According to the above-mentioned characteristics, the present application uses the points with different colors before and after the test interface state change as reference points. Therefore, first obtain the color of at least one reference point and record it as the start color, wherein the start color is the test color. The color of the fiducial point before the interface state changes.

其中,所述界面状态变化包括界面启动、界面关闭和界面标签切换。Wherein, the interface state changes include interface startup, interface shutdown, and interface label switching.

步骤22,触发改变测试界面状态的操作,将触发时刻记录为开始时间;Step 22, trigger the operation of changing the state of the test interface, and record the trigger time as the start time;

触发改变测试界面状态的操作,将触发时刻记录为开始时间TimeStar,则所述开始时间TimeStar即测试界面状态开始改变的时间。Trigger the operation of changing the state of the test interface, record the trigger time as the start time TimeStar, then the start time TimeStar is the time when the state of the test interface starts to change.

步骤23,若检测到基准点的当前颜色与开始颜色不同,将所述检测时刻记录为结束时间;Step 23, if it is detected that the current color of the reference point is different from the start color, record the detection time as the end time;

不断获取基准点的当前颜色,并检测基准点的颜色是否发生变化,若检测到基准点的当前颜色与上述记录的开始颜色不同,则说明测试界面状态变化完毕,可以将所述检测时刻记录为结束时间TimeEnd。Continuously acquire the current color of the reference point, and detect whether the color of the reference point changes. If it is detected that the current color of the reference point is different from the start color of the above record, it means that the state of the test interface has changed, and the detection time can be recorded as End time TimeEnd.

具体步骤包括:Specific steps include:

步骤231,获取所述基准点的颜色,并记录为当前颜色;Step 231, acquire the color of the reference point, and record it as the current color;

在A时刻获取所述基准点的颜色并记录为当前颜色。At time A, the color of the reference point is acquired and recorded as the current color.

步骤232,检测所述基准点的当前颜色是否等于开始颜色;Step 232, detecting whether the current color of the reference point is equal to the starting color;

若不等于,则执行步骤233,若等于,返回执行步骤231。If not, execute step 233; if equal, return to step 231.

将基准点的当前颜色和开始颜色进行比较,若当前颜色等于开始颜色,则软件的界面状态变化没有完成,则返回步骤231,获取下一时刻,即A+1时刻基准点的颜色并记录为当前颜色。若当前颜色不等于开始颜色,则软件的界面状态变化完成,执行步骤233。The current color of the reference point is compared with the start color, if the current color is equal to the start color, then the interface state change of the software is not completed, then return to step 231, and obtain the next moment, that is, the color of the reference point at A+1 moment and record as current color. If the current color is not equal to the start color, then the software interface status change is completed, and step 233 is executed.

步骤233,将所述检测时刻记录为结束时间;Step 233, recording the detection time as the end time;

若当前颜色不等于开始颜色,则软件的界面状态变化完成,将所述检测时刻记录为结束时间TimeEnd。If the current color is not equal to the start color, then the interface state change of the software is completed, and the detection time is recorded as the end time TimeEnd.

在实际处理中,可以每隔5~10ms获取一次基准点的当前颜色,同时检测所述当前颜色与开始颜色是否相等,若不相等,将所述检测时刻记录为结束时间;若相等,则过5~10ms后再重新获取并检测。In actual processing, the current color of the reference point can be acquired every 5-10 ms, and at the same time detect whether the current color is equal to the start color, if not, record the detection time as the end time; 5 ~ 10ms and then re-acquire and detect.

步骤24,将所述结束时间和开始时间的时间间隔记录为界面状态变化时间。Step 24, recording the time interval between the end time and the start time as the interface state change time.

上述记录了开始时间和结束时间,可以将开始时间TimeStar和结束时间TimeEnd的时间间隔作为界面状态变化的时间,记录所述界面状态变化的时间后,测试完毕。The start time and end time are recorded above, and the time interval between the start time TimeStar and the end time TimeEnd can be used as the time of the interface state change, and the test is completed after recording the time of the interface state change.

具体实施中的一种方法为:One method in concrete implementation is:

步骤241,将所述结束时间减去所述开始时间,得到对应的时间间隔;Step 241, subtracting the start time from the end time to obtain a corresponding time interval;

将结束时间TimeEnd减去开始时间TimeStar,计算得到的结果为时间间隔,即时间间隔X=TimeEnd-TimeStar。The end time TimeEnd is subtracted from the start time TimeStar, and the calculated result is a time interval, that is, time interval X=TimeEnd−TimeStar.

步骤242,将所述时间间隔记录为界面状态变化时间。Step 242, record the time interval as the interface state change time.

记录所述时间间隔X为界面状态变化时间。Record the time interval X as the interface state change time.

参照图3,给出了本申请实施例所述第一种软件的界面状态变化时间的优选测试方法流程图。Referring to FIG. 3 , a flow chart of an optimal testing method for the interface state change time of the first software described in the embodiment of the present application is given.

步骤301,预先获取至少一个在界面状态变化前和界面状态变化后颜色不相同的点作为基准点。Step 301, pre-obtaining at least one point whose color is different before the interface state changes and after the interface state changes as a reference point.

本申请正式在对测试界面状态变化时间进行测试之前,会预先启动所述软件以检测在界面状态变换前和界面状态变化后颜色会发生变化的点,将所述点作为基准点。Before testing the change time of the test interface state, the application will pre-start the software to detect the point where the color will change before and after the interface state change, and use the point as a reference point.

其中,对所述基准点的数量不做限定,可以根据不同的需求确定基准点的数量。The number of reference points is not limited, and the number of reference points can be determined according to different requirements.

例如,若是对软件的主框架顶部的显示时间进行测试,则可以只获取顶部的一点作为基准点;若是对软件的整体界面进行测试,则可以获取软件的界面的上部、下部、左部、右部和中间部分各取一点,分别作为基准点1~5。For example, if the display time at the top of the main frame of the software is tested, only one point on the top can be obtained as a reference point; if the overall interface of the software is tested, the upper, lower, left, and right points of the software interface can be obtained. Take one point at the bottom and the middle part, respectively, as reference points 1-5.

步骤302,获取至少一个基准点的颜色并记录为开始颜色;Step 302, acquiring the color of at least one reference point and recording it as the starting color;

例如,若测试软件的整体界面的启动时间,则首先获取预先确定的该软件的基准点1到基准点5的颜色,并分别记录为开始颜色1到开始颜色5。For example, if testing the start-up time of the overall interface of the software, first obtain the predetermined colors of the software's reference point 1 to reference point 5, and record them as start color 1 to start color 5 respectively.

其中,所述界面状态变化包括:界面启动、界面关闭和界面切换。将测试界面状态变化前和界面状态变化后颜色不相同的点作为基准点。Wherein, the interface state change includes: interface startup, interface shutdown, and interface switching. Use the points with different colors before and after the test interface state change as reference points.

步骤303,触发改变测试界面状态的操作,将触发时刻记录为开始时间;Step 303, trigger the operation of changing the state of the test interface, and record the trigger time as the start time;

上述获取基准点1到基准点5的颜色后,触发改变测试界面状态的操作,将触发时刻记录为开始时刻TimeStar,开始改变测试界面状态。After acquiring the colors of reference point 1 to reference point 5, trigger the operation of changing the state of the test interface, record the trigger time as the start time TimeStar, and start changing the state of the test interface.

步骤304,获取所述基准点的颜色,并记录为当前颜色;Step 304, acquiring the color of the reference point and recording it as the current color;

在A时刻分别获取所述基准点1到基准点5的颜色,并分别记录为当前颜色1到当前颜色5。At time A, the colors of the reference point 1 to the reference point 5 are obtained respectively, and recorded as current color 1 to current color 5 respectively.

步骤305,检测所述基准点的当前颜色是否等于开始颜色;Step 305, detecting whether the current color of the reference point is equal to the starting color;

若等于,则返回执行步骤304;若不等于,则执行步骤306。If it is equal, go back to step 304; if not, go to step 306.

分别检测每个基准点的当前颜色和开始颜色是否相等,只有当5个基准点的当前颜色和开始颜色都不相等时,才能说明测试界面启动完成,才执行步骤306,也就是说,即使5个基准点中仅有一个基准点的当前颜色和开始颜色相等,也同样要执行步骤304。Detect whether the current color and the start color of each reference point are equal, only when the current color and the start color of the 5 reference points are not equal, it can be explained that the test interface is started, and then step 306 is executed, that is to say, even if 5 If the current color of only one reference point among the reference points is equal to the starting color, step 304 will also be performed.

步骤306,将所述检测时刻记录为结束时间;Step 306, recording the detection time as the end time;

将所述检测时刻记录为结束时间TimeEnd。The detection time is recorded as the end time TimeEnd.

步骤307,将所述结束时间减去所述开始时间,得到对应的时间间隔;Step 307, subtracting the start time from the end time to obtain a corresponding time interval;

将所述结束时间TimeEnd减去所述开始时间TimeStar,计算的记过作为对应的时间间隔X。The start time TimeStar is subtracted from the end time TimeEnd, and the calculated demerit is used as the corresponding time interval X.

步骤308,将所述时间间隔记录为界面状态变化时间;Step 308, recording the time interval as the interface state change time;

所述时间间隔即为界面状态变化时间,测试结束。The time interval is the interface state change time, and the test ends.

步骤309,根据测试出的界面状态变化时间,对测试界面状态变化性能进行提高。Step 309, improve the test interface state change performance according to the tested interface state change time.

测试出软件的界面状态变化时间后,可以帮助了解软件的界面状态变化性能,对软件的界面状态变化性能进行提高。After testing the interface state change time of the software, it can help to understand the interface state change performance of the software, and improve the interface state change performance of the software.

例如,可以对多个浏览器的启动时间进行测试,比较各个浏览器的启动性能,还可以分别测试浏览器的各部分的状态变化时间,判断哪些部分状态变化较慢,然后重点进行优化。For example, you can test the start-up time of multiple browsers, compare the start-up performance of each browser, and test the state change time of each part of the browser separately to determine which parts change slowly, and then focus on optimization.

二、若所述基准目标为基准图片:2. If the benchmark target is a benchmark picture:

参照图4,给出了本申请实施例所述第种软件的界面状态变化时间的测试方法流程图。Referring to FIG. 4 , a flow chart of a test method for the interface state change time of the first software described in the embodiment of the present application is given.

步骤41,触发改变测试界面状态的操作,将触发时刻记录为开始时间;Step 41, trigger the operation of changing the state of the test interface, and record the trigger time as the start time;

步骤42,分别获取基准图片的颜色和/或形状并记录;Step 42, obtain and record the color and/or shape of the reference picture respectively;

通常测试界面状态变化前后有些图片会发生变化,例如在浏览器启动前没有浏览器图标,而软件启动后出现了浏览器图标,例如在界面切换前某个图片是灰色,界面切换后所述图片是蓝色等。Usually, some pictures will change before and after the state of the test interface changes. For example, there is no browser icon before the browser is started, but a browser icon appears after the software is started. is blue etc.

因此可以预先改变软件的界面状态,获取软件的界面状态变化前后发生变化的图片,将所述图片作为基准图片,因此在测试时可以是基准图片颜色改变,或是基准图片形状改变,当然也可以是基准图片的颜色和形状都改变,并且测试时可以至少确定一个基准图片,本申请对此不做限定。在界面状态变化完毕后,保存发生变化的图片为对比图片,并记录对比图片的颜色和/或形状。所述对比图片用于在测试界面状态发生变化是与基准图片进行比较。Therefore, the interface status of the software can be changed in advance, the pictures that change before and after the interface status of the software are obtained, and the pictures can be used as the reference pictures. Therefore, during testing, the color of the reference pictures can be changed, or the shape of the reference pictures can be changed. Both the color and the shape of the reference picture change, and at least one reference picture can be determined during the test, which is not limited in this application. After the interface state changes, save the changed picture as a comparison picture, and record the color and/or shape of the comparison picture. The comparison picture is used to compare with the reference picture when the state of the test interface changes.

因此可以根据测试前保存的对比图片的数据,来获取基准图片的数据,例如记录了对比图片的形状,则相应的要获取基准图片的形状,记录了对比图片的颜色,则相应的要获取基准图片的颜色。Therefore, the data of the benchmark picture can be obtained according to the data of the comparison picture saved before the test. The color of the picture.

例如,软件的界面启动前,软件图标是不存在的,界面启动完毕后,软件图标会出现,因此可以获取软件图标的颜色,也可以获取软件图标的形状。For example, before the interface of the software is started, the software icon does not exist, but after the interface is started, the software icon will appear, so the color of the software icon and the shape of the software icon can be obtained.

例如,测试时,在B时刻还要分别获取基准图片的颜色并记录。For example, during testing, at time B, the colors of the benchmark pictures are also acquired and recorded.

步骤43,分别检测基准图片的颜色和/或形状与对比图片中对应的颜色和/或形状是否相同;Step 43, respectively detecting whether the color and/or shape of the reference picture is the same as the corresponding color and/or shape in the comparison picture;

其中界面状态变化包括界面启动和界面切换。The interface status change includes interface startup and interface switching.

例如,预先保存了对比图片的颜色,在测试时最初基准图片可能是没有的,在界面状态变化完成后可以显示基准图片,因此若检测到基准图片颜色与对比图片的颜色相同,则可以认为界面状态变化完毕,否则,界面状态变化没有完毕。For example, if the color of the comparison picture is saved in advance, there may be no reference picture at the beginning of the test, and the reference picture can be displayed after the interface state change is completed. Therefore, if it is detected that the color of the reference picture is the same as the color of the comparison picture, the interface can be considered The state change is completed, otherwise, the interface state change is not completed.

若相同,则执行步骤44;若不相同,则返回执行步骤42,获取下一时刻所述基准图片的颜色。界面状态变化没有完毕,获取下一时刻即B+1时刻所述基准图片的颜色。If they are the same, execute step 44; if not, return to execute step 42 to obtain the color of the reference picture at the next moment. The interface state change is not completed, and the color of the reference picture at the next moment, that is, time B+1, is acquired.

预先保存了对比图片的形状,或预先保存了对比图片的颜色和形状时的判定方法与上述基本一致,因此此处不再赘述。The determination method when the shape of the comparison picture, or the color and shape of the comparison picture is stored in advance is basically the same as the above, so it will not be repeated here.

步骤44,将所述检测时刻记录为结束时间;Step 44, recording the detection time as the end time;

步骤45,将所述结束时间和开始时间的时间间隔记录为界面状态变化时间。Step 45, recording the time interval between the end time and the start time as the interface state change time.

参照图5,给出了本申请实施例所述第二种软件的界面状态变化时间的测试方法中界面关闭方法流程图。Referring to FIG. 5 , a flow chart of the method for closing the interface in the method for testing the interface state change time of the second software described in the embodiment of the present application is given.

由于具体实施中,各个用户系统桌面无法确定,因此在检测时所述基准图片可以是测试界面内的图片,如测试的是浏览器的界面,则基准图片可以是浏览器图标。因此在测试浏览器启动时,浏览器图标是由无到有,而测试浏览器关闭时,浏览器图标是由有到无,因此在判定浏览器启动和浏览器关闭时,针对基准图片的判定可以是不同的,因此一种测试界面关闭的判定方法如下:Since the desktop of each user system cannot be determined during specific implementation, the reference picture may be a picture in the test interface during detection, and if the test is a browser interface, the reference picture may be a browser icon. Therefore, when the test browser starts, the browser icon changes from nothing to existence, and when the test browser is closed, the browser icon changes from existence to nothing. Can be different, so a method of judging that the test interface is closed is as follows:

步骤51,触发测试界面关闭操作,将触发时刻记录为开始时间;Step 51, trigger the closing operation of the test interface, and record the trigger time as the start time;

步骤52,分别获取基准图片的颜色和/或形状并记录;Step 52, obtain and record the color and/or shape of the reference picture respectively;

步骤53,分别检测基准图片的颜色和/或形状与对比图片中对应的颜色和/或形状是否相同;Step 53, respectively detecting whether the color and/or shape of the reference picture is the same as the corresponding color and/or shape in the comparison picture;

若不相同,则执行步骤54;若相同,则返回执行步骤52,获取下一时刻所述基准图片的颜色和/或形状。If not, execute step 54; if identical, return to execute step 52 to acquire the color and/or shape of the reference picture at the next moment.

实际处理中,若检测基准图片的颜色和对比图片的颜色是否相同,由于基准图片可能包含多种的颜色,在检测时可以将基准图片中各个点的颜色分别与对比图片对应点的颜色进行比较。In actual processing, if the color of the reference image is the same as that of the comparison image, since the reference image may contain a variety of colors, the color of each point in the reference image can be compared with the color of the corresponding point in the comparison image during detection .

而在界面关闭后,桌面的颜色可能与基准图片的部分位置颜色相同,因此可以预先设置一个控制阈值,若基准图片与对比图片颜色不相同的点超过所述控制阈值,即可执行步骤54。例如设置所述控制阈值为40%,若检测到基准图片与对比图片颜色不相等的点超过40%,就可以执行步骤54。After the interface is closed, the color of the desktop may be the same as that of some parts of the reference picture, so a control threshold can be set in advance, and if the points with different colors between the reference picture and the comparison picture exceed the control threshold, step 54 can be executed. For example, the control threshold is set to 40%, and if it is detected that the color difference between the reference picture and the comparison picture exceeds 40%, step 54 can be executed.

步骤54,将所述检测时刻记录为结束时间;Step 54, recording the detection time as the end time;

步骤55,将所述结束时间和开始时间的时间间隔记录为界面关闭时间。Step 55, record the time interval between the end time and the start time as the interface closing time.

综上所述,本申请在判断软件的界面状态变化时间时,所述的基准目标可以为基准图片,可以将基准图片颜色和/或形状与预置的对比图片的颜色和/或形状进行比较,来检测界面状态是否变化完毕,进而可以获知界面的状态变化时间。所述基准目标也可以为基准点,若检测到基准点的当前颜色与开始颜色不同,则说明软件的界面状态变化完毕,进而可以获知界面的状态变化时间。本申请中获取软件的界面状态变化时间的方法灵活、多样,可以满足各种软件的界面状态变化时间的测试需求。To sum up, when the present application judges the change time of the interface state of the software, the reference target can be a reference picture, and the color and/or shape of the reference picture can be compared with the color and/or shape of the preset comparison picture , to detect whether the interface state has changed completely, and then the state change time of the interface can be known. The reference target can also be a reference point. If it is detected that the current color of the reference point is different from the start color, it means that the interface state of the software has changed completely, and then the state change time of the interface can be known. In the present application, the methods for obtaining the interface state change time of the software are flexible and diverse, and can meet the testing requirements of the interface state change time of various software.

软件(英文为Software)是一系列按照特定顺序组织的计算机数据和指令的集合。一般来讲软件被划分为编程语言、系统软件、应用软件和介于这两者之间的中间件。Software (Software in English) is a collection of computer data and instructions organized in a specific order. Generally speaking, software is divided into programming languages, system software, application software, and middleware between the two.

本申请可以适用于包含界面的各种软件。例如浏览器、办公软件、通讯软件,任务管理器等。This application can be applied to various software including interfaces. Such as browsers, office software, communication software, task managers, etc.

优选的,所述获取基准点颜色的方法包括:Preferably, the method for obtaining the color of the reference point includes:

方法1,先在获取颜色的函数中导入win32gui子模块,其中win32gui子模块为win32模块中的一个子模块,可以通过所述win32gui子模块来调用windowsAPI。然后使用函数win32gui.GetWindowDC(None)获取指定窗口的句柄传入到hwnd变量中;再使用函数win32gui.GetPixel(hwnd,x,y)获取坐标(x,y)的颜色。Method 1, first import the win32gui sub-module in the function of obtaining the color, wherein the win32gui sub-module is a sub-module in the win32 module, and the windowsAPI can be called through the win32gui sub-module. Then use the function win32gui.GetWindowDC(None) to obtain the handle of the specified window and pass it into the hwnd variable; then use the function win32gui.GetPixel(hwnd,x,y) to obtain the color of the coordinate (x,y).

其中,所述函数win32gui.GetWindowDC()对应的windowsAPI为GetWindowDC,函数win32gui.GetPixel()对应的windowsAPI为GetPixel。Wherein, the windows API corresponding to the function win32gui.GetWindowDC() is GetWindowDC, and the windows API corresponding to the function win32gui.GetPixel() is GetPixel.

方法2,先在获取颜色的函数中导入windll模块,可以通过所述windll模块来调用windowsAPI。然后使用函数windll.user32.GetDC(None)获取指定窗口的句柄传入到hwnd变量中;再使用函数windll.gdi32.GetPixel(hwnd,x,y)获取坐标(x,y)的颜色。Method 2, first import the windll module in the function of obtaining the color, and the windows API can be called through the windll module. Then use the function windll.user32.GetDC(None) to obtain the handle of the specified window and pass it into the hwnd variable; then use the function windll.gdi32.GetPixel(hwnd,x,y) to obtain the color of the coordinate (x,y).

其中,所述函数windll.user32.GetDC()对应的windowsAPI为GetDC,所述函数windll.gdi32.GetPixel()对应的windowsAPI为GetPixel。Wherein, the windows API corresponding to the function windll.user32.GetDC() is GetDC, and the windows API corresponding to the function windll.gdi32.GetPixel() is GetPixel.

所述Windows API就是windows应用程序接口,是针对microsoft windows操作系统家族的系统编程接口。The Windows API is the windows application programming interface, which is a system programming interface for the microsoft windows operating system family.

优选的,依据所述界面状态变化时间,执行对界面所属程序的优化操作。Preferably, an optimization operation on the program to which the interface belongs is performed according to the interface state change time.

进一步,判断出所述界面状态变化时间超过预定阈值时,执行对界面所属程序的优化操作或提示操作。Further, when it is determined that the interface state change time exceeds a predetermined threshold, an optimization operation or a prompt operation for the program to which the interface belongs is performed.

上述获取到界面状态变化时间后,可以依据所述界面状态变化时间,可以执行对界面所属程序的优化操作。当然在具体实施中可以预定一个阈值,若所述界面状态变化时间超过预定阈值时,就可以执行对界面所属程序的优化操作或提示操作。After the interface state change time is obtained, an optimization operation for the program to which the interface belongs can be performed according to the interface state change time. Of course, a threshold may be predetermined in specific implementation, and if the interface state change time exceeds the predetermined threshold, an optimization operation or a prompt operation for the program to which the interface belongs may be performed.

所述优化操作可以减少界面状态变化时间;所述提示操作可以提示用户可执行的操作,以减少界面状态变化时间,或解决界面状态变化长时间不变化的问题等。The optimization operation can reduce the interface state change time; the prompt operation can prompt the user to perform operations to reduce the interface state change time, or solve the problem that the interface state does not change for a long time.

例如,测试出浏览器的平均启动时间为10s,而某个浏览器的启动时间为15s,则可以提示对浏览器对应的程序执行优化操作。具体操作如,可以检测浏览器对应的程序,将其中包含的冗余代码删除等,本申请对具体的优化操作不做限定。For example, if it is tested that the average startup time of the browser is 10s, and the startup time of a certain browser is 15s, it may be prompted to perform an optimization operation on the program corresponding to the browser. For example, the specific operation may detect the program corresponding to the browser and delete the redundant code contained therein. This application does not limit the specific optimization operation.

优选的,所述执行对界面所属程序的优化操作包括:Preferably, said performing an optimization operation on the program to which the interface belongs includes:

1、使用本地的程序优化工具进行界面所属程序的配置参数优化。1. Use the local program optimization tool to optimize the configuration parameters of the program to which the interface belongs.

例如,使用本地的程序优化工具对界面所属程序进行优化,例如对配置参数进行优化等。For example, use a local program optimization tool to optimize the program to which the interface belongs, such as optimizing configuration parameters.

2、向服务器发送界面的更新请求信息,以修复界面所属程序。2. Send the update request information of the interface to the server, so as to repair the program to which the interface belongs.

界面状态变化时间比较长还有可能是由于软件版本比较旧,因此可以检测软件版本是否是最新的,若不是,可以向服务器发送界面的更新请求信息,以修复界面所属程序。It may be because the software version is relatively old that the interface state changes for a long time. Therefore, it can be detected whether the software version is the latest. If not, an interface update request message can be sent to the server to repair the program to which the interface belongs.

综上所述,本申请还可以根据界面状态变化时间,执行对界面所属程序的优化操作,包括:使用本地的程序优化工具进行界面所属程序的配置参数优化;向服务器发送界面的更新请求信息,以修复界面所属程序。本申请可以通过对界面的优化,缩短界面状态变化时间,提高用户的使用效果,更快的为用户提供服务。To sum up, this application can also perform optimization operations on the program to which the interface belongs according to the change time of the interface state, including: using a local program optimization tool to optimize the configuration parameters of the program to which the interface belongs; sending the update request information of the interface to the server, to repair the program that the interface belongs to. The present application can shorten the time for changing the state of the interface by optimizing the interface, improve the use effect of the user, and provide services for the user faster.

参照图6,给出了本申请实施例所述一种软件的界面状态变化时间的测试装置流程图。Referring to FIG. 6 , a flow chart of a testing device for the interface state change time of a software described in the embodiment of the present application is given.

相应的,本申请还提供了一种软件的界面状态变化时间的测试装置,包括触发及记录模块11、检测及记录模块12、变化时间记录模块13和输出模块14,其中,Correspondingly, the present application also provides a software interface state change time testing device, including a trigger and record module 11, a detection and record module 12, a change time record module 13 and an output module 14, wherein,

触发及记录模块11,用于触发改变测试界面状态的操作,将触发时刻记录为开始时间;Triggering and recording module 11 is used to trigger the operation of changing the state of the test interface, and the triggering moment is recorded as the start time;

检测及记录模块12,用于检测到测试界面中的基准目标发生预置变化,将所述检测时刻记录为结束时间;The detection and recording module 12 is used to detect that the reference target in the test interface has a preset change, and records the detection time as the end time;

变化时间记录模块13,用于将所述结束时间和开始时间的时间间隔记录为界面状态变化时间;The change time recording module 13 is used to record the time interval between the end time and the start time as the interface state change time;

输出模块14,用于输出所述界面状态变化时间。The output module 14 is configured to output the interface state change time.

其中,所述界面状态变化时间包括:界面启动时间、界面关闭时间和界面切换时间。Wherein, the interface state change time includes: interface startup time, interface shutdown time and interface switching time.

优选的,所述的装置还包括:Preferably, the device also includes:

优化模块15,用于依据所述界面状态变化时间,执行对界面所属程序的优化操作。The optimization module 15 is configured to perform an optimization operation on the program to which the interface belongs according to the interface state change time.

优选的,所述优化模块包括:Preferably, the optimization module includes:

阈值判断子模块151,用于判断出所述界面状态变化时间超过预定阈值时,执行对界面所属程序的优化操作或提示操作。The threshold judging sub-module 151 is configured to execute an optimization operation or a prompt operation for the program to which the interface belongs when it is judged that the interface state change time exceeds a predetermined threshold.

参数优化子模块152,用于使用本地的程序优化工具进行界面所属程序的配置参数优化;The parameter optimization sub-module 152 is configured to use a local program optimization tool to optimize the configuration parameters of the program to which the interface belongs;

更新子模块153,用于向服务器发送界面的更新请求信息,以修复界面所属程序。The update submodule 153 is configured to send interface update request information to the server, so as to repair the program to which the interface belongs.

一、若所述基准目标为基准点,在测试界面状态变化时间时,所述的装置包括:1. If the reference target is a reference point, when testing the state change time of the interface, the device includes:

参照图7,给出了本申请实施例所述第一种软件的界面状态变化时间的测试装置流程图。Referring to FIG. 7 , a flow chart of the test device for the interface state change time of the first software described in the embodiment of the present application is given.

颜色获取模块21,用于获取至少一个基准点的颜色并记录为开始颜色,其中,将测试界面状态变化前和界面状态变化后颜色不相同的点作为基准点;The color acquisition module 21 is used to obtain the color of at least one reference point and record it as the starting color, wherein the points whose colors are different before the test interface state changes and after the interface state changes are used as reference points;

触发及记录模块22,用于触发改变测试状态的操作,将触发时刻记录为开始时间;The trigger and record module 22 is used to trigger the operation of changing the test state, and record the trigger moment as the start time;

检测及记录模块23,用于若在检测到基准点的当前颜色与开始颜色不同是,则记录检测的时刻为结束时间;Detection and recording module 23, for if the current color of the reference point is detected to be different from the start color, the moment of recording detection is the end time;

变化时间记录模块24,用于将所述结束时间和开始时间的时间间隔记录为界面状态变化时间;The change time recording module 24 is used to record the time interval between the end time and the start time as the interface state change time;

输出模块25,用于输出所述界面状态变化时间。The output module 25 is configured to output the interface state change time.

优选的,所述检测及记录模块23,包括:Preferably, the detection and recording module 23 includes:

获取子模块231,用于获取所述基准点的颜色,并记录为当前颜色;An acquisition submodule 231, configured to acquire the color of the reference point and record it as the current color;

检测子模块232,用于检测所述基准点的当前颜色是否等于开始颜色;A detection submodule 232, configured to detect whether the current color of the reference point is equal to the starting color;

若不等于,则进入记录时间子模块233;若等于,则返回颜色获取子模块231。If not, enter the recording time submodule 233; if equal, return to the color acquisition submodule 231.

记录时间子模块233,用于将所述当前时刻记录为结束时间。The record time sub-module 233 is configured to record the current moment as the end time.

所述变化时间记录模块24,包括:The change time recording module 24 includes:

计算子模块241,用于将所述结束时间减去所述开始时间,得到对应的时间间隔;The calculation sub-module 241 is used to subtract the start time from the end time to obtain a corresponding time interval;

记录子模块242,用于将所述时间间隔记录为状态变化时间。The recording sub-module 242 is configured to record the time interval as state change time.

所述的装置还包括:The device also includes:

获取基准点模块20,用于预先获取至少一个在状态变化前和状态变化后颜色不相同的点作为基准点。Obtaining a reference point module 20, configured to obtain in advance at least one point whose color is different before the state change and after the state change as a reference point.

二、若所述基准目标为基准图片,在测试界面状态变化时间时:2. If the benchmark target is a benchmark picture, when testing the state change time of the interface:

1、当界面状态变化包括界面启动时间和界面切换时间时,所述的装置包括:1. When the interface state changes include interface startup time and interface switching time, the device includes:

参照图8,给出了本申请实施例所述第二种软件的界面状态变化时间的测试装置流程图。Referring to FIG. 8 , a flow chart of the test device for the interface state change time of the second software described in the embodiment of the present application is given.

触发及记录模块31,用于触发改变测试界面状态的操作,将触发时刻记录为开始时间;Triggering and recording module 31 is used to trigger the operation of changing the state of the test interface, and record the triggering moment as the start time;

检测及记录模块32包括:Detection and recording module 32 includes:

获取颜色子模块321,用于分别获取基准图片的颜色和/或形状并记录;Obtaining a color submodule 321, used to obtain and record the color and/or shape of the reference picture respectively;

检测颜色子模块322,用于分别检测基准图片的颜色和/或形状与对比图片中对应的颜色和/或形状是否相同;The detection color submodule 322 is used to respectively detect whether the color and/or shape of the reference picture is the same as the corresponding color and/or shape in the comparison picture;

若相同,则进入记录时间子模块323,若不相同,则返回获取颜色子模块321,以获取下一时刻所述基准图片的颜色和/或形状。If they are the same, then enter the recording time sub-module 323, if not, return to the acquiring color sub-module 321 to acquire the color and/or shape of the reference picture at the next moment.

记录时间子模块323,用于将所述检测时刻记录为结束时间;A record time submodule 323, configured to record the detection moment as the end time;

变化时间记录模块33,用于将所述结束时间和开始时间的时间间隔记录为界面状态变化时间,其中,所述界面状态变化包括界面启动和界面切换;The change time recording module 33 is used to record the time interval between the end time and the start time as the interface state change time, wherein the interface state change includes interface startup and interface switching;

输出模块34,用于输出所述界面状态变化时间。An output module 34, configured to output the interface state change time.

2、当界面状态变化为关闭时间时,所述的装置包括:2. When the interface state changes to the closing time, the device includes:

参照图9,给出了本申请实施例所述第二种软件的界面状态变化时间中界面关闭的测试装置流程图。Referring to FIG. 9 , it shows a flow chart of the test device for closing the interface during the interface state change time of the second software described in the embodiment of the present application.

触发及记录模块41,用于触发改变测试界面关闭操作,将触发时刻记录为开始时间;Triggering and recording module 41, used for triggering and changing the closing operation of the test interface, and recording the triggering moment as the start time;

检测及记录模块42包括:Detection and recording module 42 includes:

获取颜色子模块421,用于分别获取基准图片的颜色和/或形状并记录;Obtaining a color submodule 421, used to obtain and record the color and/or shape of the reference picture respectively;

检测颜色子模块422,用于分别检测基准图片的颜色和/或形状与对比图片中对应的颜色和/或形状是否相同;The detection color submodule 422 is used to respectively detect whether the color and/or shape of the reference picture is the same as the corresponding color and/or shape in the comparison picture;

若不相同,则进入记录时间子模块423,若相同,则返回获取及记录模块421,以获取下一时刻所述基准图片中各个点的颜色。If they are not the same, enter the recording time sub-module 423, and if they are the same, return to the acquiring and recording module 421 to acquire the color of each point in the reference picture at the next moment.

记录时间子模块423,用于将所述检测时刻记录为结束时间;The recording time submodule 423 is used to record the detection moment as the end time;

变化时间记录模块43,用于将所述结束时间和开始时间的时间间隔记录为界面关闭时间;The change time recording module 43 is used to record the time interval between the end time and the start time as the interface closing time;

输出模块44,用于输出所述界面关闭时间。An output module 44, configured to output the interface closing time.

其中,所述获取颜色的方法包括:Wherein, the method for obtaining the color includes:

方法1,先在获取颜色的函数中导入win32gui子模块,其中win32gui子模块为win32模块中的一个子模块,可以通过所述win32gui子模块来调用windowsAPI。然后使用函数win32gui.GetWindowDC(None)获取指定窗口的句柄传入到hwnd变量中;再使用函数win32gui.GetPixel(hwnd,x,y)获取坐标(x,y)的颜色。Method 1, first import the win32gui sub-module in the function of obtaining the color, wherein the win32gui sub-module is a sub-module in the win32 module, and the windowsAPI can be called through the win32gui sub-module. Then use the function win32gui.GetWindowDC(None) to obtain the handle of the specified window and pass it into the hwnd variable; then use the function win32gui.GetPixel(hwnd,x,y) to obtain the color of the coordinate (x,y).

其中,所述函数win32gui.GetWindowDC()对应的windowsAPI为GetWindowDC,函数win32gui.GetPixel()对应的windowsAPI为GetPixel。Wherein, the windows API corresponding to the function win32gui.GetWindowDC() is GetWindowDC, and the windows API corresponding to the function win32gui.GetPixel() is GetPixel.

方法2,先在获取颜色的函数中导入windll模块,可以通过所述windll模块来调用windowsAPI。然后使用函数windll.user32.GetDC(None)获取指定窗口的句柄传入到hwnd变量中;再使用函数windll.gdi32.GetPixel(hwnd,x,y)获取坐标(x,y)的颜色。Method 2, first import the windll module in the function of obtaining the color, and the windows API can be called through the windll module. Then use the function windll.user32.GetDC(None) to obtain the handle of the specified window and pass it into the hwnd variable; then use the function windll.gdi32.GetPixel(hwnd,x,y) to obtain the color of the coordinate (x,y).

其中,所述函数windll.user32.GetDC()对应的windowsAPI为GetDC,所述函数windll.gdi32.GetPixel()对应的windowsAPI为GetPixel。Wherein, the windows API corresponding to the function windll.user32.GetDC() is GetDC, and the windows API corresponding to the function windll.gdi32.GetPixel() is GetPixel.

所述状态变化时间包括:界面启动时间、界面关闭时间和界面切换时间。The state change time includes: interface startup time, interface shutdown time and interface switching time.

对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment.

本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。Each embodiment in this specification is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other.

本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。This application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including storage devices.

最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。Finally, it should also be noted that in this text, relational terms such as first and second etc. are only used to distinguish one entity or operation from another, and do not necessarily require or imply that these entities or operations, any such actual relationship or order exists. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of, or also include elements inherent in, such a process, method, commodity, or apparatus. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.

以上对本申请所提供的一种软件的界面状态变化时间的测试方法和装置,进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The test method and device for the interface state change time of a kind of software provided by the application have been introduced in detail above. In this paper, specific examples have been used to illustrate the principle and implementation of the application. The description of the above embodiments is only used To help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation and application scope. In summary, this specification The content should not be construed as a limitation of the application.

Claims (19)

1.一种软件的界面状态变化时间的测试方法,其特征在于,包括:1. a test method of the interface state change time of software, it is characterized in that, comprising: 触发改变测试界面状态的操作,将触发时刻记录为开始时间;Trigger the operation that changes the state of the test interface, and record the trigger time as the start time; 检测到测试界面中的基准目标发生预置变化,将所述检测时刻记录为结束时间;所述基准目标为基准图片;It is detected that the reference target in the test interface has a preset change, and the detection moment is recorded as the end time; the reference target is a reference picture; 将所述结束时间和开始时间的时间间隔记录为界面状态变化时间;Recording the time interval between the end time and the start time as the interface state change time; 当所述界面状态变化包括界面启动和界面切换时,所述检测到测试界面中的基准目标发生预置变化,将所述检测时刻记录为结束时间,包括:分别获取基准图片中的颜色和/或形状并记录;分别检测基准图片中的颜色和/或形状与对比图片中对应的颜色和/或形状是否相同;若相同,则将所述检测时刻记录为结束时间;若不相同,则获取下一时刻所述基准图片中的颜色和/或形状;When the interface state change includes interface startup and interface switching, the detected reference target in the test interface has a preset change, and the detection moment is recorded as the end time, including: acquiring the color and/or the reference picture respectively or shape and record; respectively detect whether the color and/or shape in the reference picture is the same as the corresponding color and/or shape in the comparison picture; if they are the same, record the detection moment as the end time; if not, obtain The color and/or shape in the reference picture at the next moment; 当所述界面状态变化为界面关闭时,所述检测到测试界面中的基准目标发生预置变化,将所述检测时刻记录为结束时间,包括:分别获取基准图片中的颜色和/或形状并记录;分别检测基准图片中的颜色和/或形状与对比图片中对应的颜色和/或形状是否相同;若不相同,则记录检测时刻为结束时间;若相同,则获取下一时刻所述基准图片中的颜色和/或形状。When the state of the interface changes to the interface being closed, it is detected that the reference target in the test interface has a preset change, and the detection moment is recorded as the end time, including: respectively acquiring the color and/or shape in the reference picture and Record; respectively detect whether the color and/or shape in the reference picture is the same as the corresponding color and/or shape in the comparison picture; if not, record the detection time as the end time; if they are the same, then obtain the reference at the next moment Color and/or shape in the picture. 2.根据权利要求1所述的方法,其特征在于,所述界面状态变化时间包括:界面启动时间、界面关闭时间和界面切换时间。2. The method according to claim 1, wherein the interface state change time comprises: interface startup time, interface shutdown time and interface switching time. 3.根据权利要求2所述的方法,其特征在于,所述基准目标为基准点,所述的方法还包括:3. method according to claim 2, is characterized in that, described datum target is datum point, and described method also comprises: 获取至少一个基准点的颜色并记录为开始颜色,其中,将测试界面状态变化前和界面状态变化后颜色不相同的点作为基准点。Obtain the color of at least one reference point and record it as the start color, where the point whose color is different before the test interface state changes and after the interface state change is used as the reference point. 4.根据权利要求3所述的方法,其特征在于,所述检测到测试界面中的基准目标发生预置变化,将所述检测时刻记录为结束时间包括:4. The method according to claim 3, wherein the detection of a preset change in the benchmark target in the test interface, and recording the detection moment as the end time includes: 在检测到基准点的当前颜色与开始颜色不同时,将所述检测的时刻记录为结束时间。When it is detected that the current color of the reference point is different from the start color, record the detected time as the end time. 5.根据权利要求4所述的方法,其特征在于,所述在检测到基准点的当前颜色与开始颜色不同,设置所述检测的时刻为结束时间,包括:5. The method according to claim 4, wherein the current color of the detected reference point is different from the start color, and the moment of the detection is set as the end time, comprising: 获取所述基准点的颜色,并记录为当前颜色;Obtain the color of the reference point and record it as the current color; 检测所述基准点的当前颜色是否等于开始颜色;detecting whether the current color of the reference point is equal to the starting color; 若不等于,则将所述检测时刻记录为结束时间;If not equal, then record the detection moment as the end time; 若等于,则获取下一时刻所述基准点的颜色。If equal, obtain the color of the reference point at the next moment. 6.根据权利要求3所述的方法,其特征在于,进一步包括:6. The method of claim 3, further comprising: 预先获取至少一个在状态变化前和状态变化后颜色不相同的点作为基准点。Acquire in advance at least one point whose color is different before and after the state change as a reference point. 7.根据权利要求1所述的方法,其特征在于,进一步包括:7. The method of claim 1, further comprising: 依据所述界面状态变化时间,执行对界面所属程序的优化操作。According to the interface state change time, an optimization operation is performed on the program to which the interface belongs. 8.根据权利要求7所述的方法,其特征在于,所述执行对界面所属程序的优化操作,包括:8. The method according to claim 7, wherein said performing an optimization operation on the program to which the interface belongs comprises: 判断出所述界面状态变化时间超过预定阈值时,执行对界面所属程序的优化操作或提示操作。When it is determined that the interface state change time exceeds a predetermined threshold, an optimization operation or a prompt operation for the program to which the interface belongs is performed. 9.根据权利要求7或8任一所述的方法,其特征在于,所述执行对界面所属程序的优化操作包括:9. The method according to any one of claims 7 or 8, wherein said performing an optimization operation on the program to which the interface belongs comprises: 使用本地的程序优化工具进行界面所属程序的配置参数优化。Use the local program optimization tool to optimize the configuration parameters of the program to which the interface belongs. 10.根据权利要求7或8任一所述的方法,其特征在于,所述执行对界面所属程序的优化操作包括:10. The method according to any one of claims 7 or 8, wherein said performing an optimization operation on the program to which the interface belongs comprises: 向服务器发送界面的更新请求信息,以修复界面所属程序。Send interface update request information to the server to repair the program to which the interface belongs. 11.一种软件的界面状态变化时间的测试装置,其特征在于,包括:11. A test device for the interface state change time of software, characterized in that, comprising: 触发及记录模块,用于触发改变测试界面状态的操作,同时将触发时刻记录为开始时间;The triggering and recording module is used to trigger the operation of changing the state of the test interface, and at the same time record the triggering time as the start time; 检测及记录模块,用于检测到测试界面中基准目标发生预置变化,将所述检测的时刻记录为结束时间;所述基准目标为基准图片;The detection and recording module is used to detect the preset change of the benchmark target in the test interface, and record the detected moment as the end time; the benchmark target is a benchmark picture; 变化时间记录模块,用于将所述结束时间和开始时间的时间间隔记录为界面状态变化时间;A change time recording module, configured to record the time interval between the end time and the start time as the interface state change time; 输出模块,用于输出所述界面状态变化时间;An output module, configured to output the interface state change time; 当所述界面状态变化包括界面启动和界面切换时,所述检测及记录模块包括:获取子模块,用于分别获取基准图片的颜色和/或形状并记录;检测子模块,用于分别检测基准图片的颜色和/或形状与对比图片中对应的颜色和/或形状是否相同;记录时间子模块,用于在基准图片中的颜色和/或形状与对比图片中对应的颜色和/或形状相同时,记录检测时刻为结束时间;When the interface state change includes interface startup and interface switching, the detection and recording module includes: an acquisition sub-module, which is used to obtain and record the color and/or shape of the reference picture respectively; a detection sub-module, which is used to respectively detect the reference Whether the color and/or shape of the picture is the same as the corresponding color and/or shape in the comparison picture; record the time sub-module for the color and/or shape in the reference picture to be the same as the corresponding color and/or shape in the comparison picture At the same time, record the detection time as the end time; 当所述界面状态变化为界面关闭时,所述检测及记录模块包括:获取子模块,用于分别获取基准图片的颜色和/或形状并记录;检测子模块,用于分别检测基准图片的颜色和/或形状与对比图片中对应的颜色和/或形状是否相同;记录时间子模块,用于在基准图片的颜色和/或形状与对比图片中对应的颜色和/或形状不相同时,记录检测时刻为结束时间。When the state of the interface changes to that the interface is closed, the detection and recording module includes: an acquisition submodule, which is used to respectively acquire and record the color and/or shape of the reference picture; a detection submodule, which is used to respectively detect the color of the reference picture and/or shape is the same as the corresponding color and/or shape in the comparison picture; the recording time sub-module is used to record when the color and/or shape of the reference picture is different from the corresponding color and/or shape in the comparison picture The detection time is the end time. 12.根据权利要求11所述的装置,其特征在于,若所述基准目标为基准点,所述的装置还包括:12. The device according to claim 11, wherein if the reference target is a reference point, the device further comprises: 颜色获取模块,用于获取至少一个基准点的颜色并记录为开始颜色,其中,将测试界面状态变化前和状态变化后颜色不相同的点作为基准点。The color obtaining module is used to obtain the color of at least one reference point and record it as the starting color, wherein the point whose color is different before and after the state change of the test interface is used as the reference point. 13.根据权利要求12所述的装置,其特征在于,所述检测及记录模块,用于在检测到基准点的当前颜色与开始颜色不同时,将所述检测的时刻记录为结束时间。13. The device according to claim 12, wherein the detecting and recording module is configured to record the detected time as the end time when it is detected that the current color of the reference point is different from the starting color. 14.根据权利要求13所述的装置,其特征在于,所述检测及记录模块,包括:14. The device according to claim 13, wherein the detection and recording module comprises: 获取子模块,用于获取所述基准点的颜色,并记录为当前颜色;Obtaining a submodule, configured to obtain the color of the reference point and record it as the current color; 检测子模块,用于检测所述基准点的当前颜色是否等于开始颜色;A detection submodule, configured to detect whether the current color of the reference point is equal to the starting color; 记录时间子模块,用于将所述检测时刻记录为结束时间。The record time sub-module is used to record the detection time as the end time. 15.根据权利要求12所述的装置,其特征在于,还包括:15. The device of claim 12, further comprising: 获取基准点模块,用于预先获取至少一个在状态变化前和状态变化后颜色不相同的点作为基准点。The obtaining reference point module is used to obtain in advance at least one point whose color is different before the state change and after the state change as a reference point. 16.根据权利要求11所述的装置,其特征在于,进一步包括:16. The apparatus of claim 11, further comprising: 优化模块,用于依据所述界面状态变化时间,执行对界面所属程序的优化操作。The optimization module is configured to perform an optimization operation on the program to which the interface belongs according to the interface state change time. 17.根据权利要求16所述的装置,其特征在于,所述优化模块,包括:17. The device according to claim 16, wherein the optimization module comprises: 阈值判断子模块,用于判断出所述界面状态变化时间超过预定阈值时,执行对界面所属程序的优化操作或提示操作。The threshold judging sub-module is used to execute an optimization operation or a prompt operation for the program to which the interface belongs when it is judged that the interface state change time exceeds a predetermined threshold. 18.根据权利要求16或17任一所述的装置,其特征在于,所述优化模块,包括:18. The device according to any one of claims 16 or 17, wherein the optimization module comprises: 参数优化子模块,用于使用本地的程序优化工具进行界面所属程序的配置参数优化。The parameter optimization sub-module is used to optimize the configuration parameters of the program to which the interface belongs using a local program optimization tool. 19.根据权利要求16或17任一所述的装置,其特征在于,所述优化模块,包括:19. The device according to any one of claims 16 or 17, wherein the optimization module comprises: 更新子模块,用于向服务器发送界面的更新请求信息,以修复界面所属程序。The update submodule is used to send interface update request information to the server, so as to repair the program to which the interface belongs.
CN201510005114.XA 2012-03-29 2012-03-29 The method of testing and device of the interface state change time of software Expired - Fee Related CN104516819B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510005114.XA CN104516819B (en) 2012-03-29 2012-03-29 The method of testing and device of the interface state change time of software

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510005114.XA CN104516819B (en) 2012-03-29 2012-03-29 The method of testing and device of the interface state change time of software
CN201210089731.9A CN102662839B (en) 2012-03-29 2012-03-29 A method and device for testing the interface state change time of software

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201210089731.9A Division CN102662839B (en) 2012-03-29 2012-03-29 A method and device for testing the interface state change time of software

Publications (2)

Publication Number Publication Date
CN104516819A CN104516819A (en) 2015-04-15
CN104516819B true CN104516819B (en) 2018-01-19

Family

ID=52792162

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510005114.XA Expired - Fee Related CN104516819B (en) 2012-03-29 2012-03-29 The method of testing and device of the interface state change time of software

Country Status (1)

Country Link
CN (1) CN104516819B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107729248A (en) * 2017-10-18 2018-02-23 北京奇虎科技有限公司 Application Program Interface performance test methods, device, computing device and storage medium
CN109324844A (en) * 2018-09-30 2019-02-12 武汉斗鱼网络科技有限公司 A kind of method, apparatus and computer equipment at detection window interface
CN113702001A (en) * 2021-08-19 2021-11-26 Oppo广东移动通信有限公司 Method and device for detecting color change response time of color change device and storage medium
CN113946503B (en) * 2021-09-26 2025-08-29 北京百度网讯科技有限公司 Method, device, storage medium and electronic device for determining interface status

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5781449A (en) * 1995-08-10 1998-07-14 Advanced System Technologies, Inc. Response time measurement apparatus and method
JP2003279679A (en) * 2002-03-27 2003-10-02 Seiko Instruments Inc Electronic timepiece
JP2008171341A (en) * 2007-01-15 2008-07-24 Sky Kk Multi-window control system
CN102103529A (en) * 2010-12-22 2011-06-22 华为技术有限公司 Method, device and system for processing dead screen of driver machine interface (DMI)

Also Published As

Publication number Publication date
CN104516819A (en) 2015-04-15

Similar Documents

Publication Publication Date Title
CN102662839B (en) A method and device for testing the interface state change time of software
US9342237B2 (en) Automated testing of gesture-based applications
US11061661B2 (en) Image based method and system for building object model and application states comparison and graphic-based interoperability with an application
CN104598380B (en) A control-based automated testing method and system
CN104951393B (en) Method of testing and test device
CN104424089A (en) Terminal testing method and device
CN112199301A (en) User interface automation test method, electronic device and storage medium
CN106126424A (en) A kind of visual automated testing method of script, device and mobile terminal
CN104516819B (en) The method of testing and device of the interface state change time of software
CN107102937B (en) User interface testing method and device
US6944795B2 (en) Method and apparatus for stabilizing GUI testing
JP2008508597A (en) Help utility application program
CN104809053A (en) Control style testing method and device
CN113127250B (en) Fault reporting method and device, electronic equipment and storage medium
CN105677689A (en) Log record method and device
CN113765731B (en) Information processing method, device, and computer-readable storage medium
JP2009223568A (en) Scenario-generating device and program
CN113094281A (en) Hybrid App testing method and device
CN118295927A (en) Browser testing method, device, equipment and computer readable storage medium
CN115878822A (en) PPT animation splitting method and device, storage medium and computer equipment
CN109979444A (en) Voice instruction automatic testing method, terminal and device
CN104572450A (en) Method and device for detecting resource allocation
CN112181809A (en) A Graphical User Interface Automated Testing Method Based on Multiple Positioning Methods
CN115098394B (en) A testing method, device, electronic device and computer readable medium
CN114154148B (en) Application behavior detection method and device

Legal Events

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

Granted publication date: 20180119

Termination date: 20210329