Movatterモバイル変換


[0]ホーム

URL:


WO2021184725A1 - User interface test method and apparatus, storage medium, and computer device - Google Patents

User interface test method and apparatus, storage medium, and computer device
Download PDF

Info

Publication number
WO2021184725A1
WO2021184725A1PCT/CN2020/118917CN2020118917WWO2021184725A1WO 2021184725 A1WO2021184725 A1WO 2021184725A1CN 2020118917 WCN2020118917 WCN 2020118917WWO 2021184725 A1WO2021184725 A1WO 2021184725A1
Authority
WO
WIPO (PCT)
Prior art keywords
user interface
tested
tree
page
page element
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.)
Ceased
Application number
PCT/CN2020/118917
Other languages
French (fr)
Chinese (zh)
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co LtdfiledCriticalPing An Technology Shenzhen Co Ltd
Publication of WO2021184725A1publicationCriticalpatent/WO2021184725A1/en
Anticipated expirationlegal-statusCritical
Ceasedlegal-statusCriticalCurrent

Links

Classifications

Definitions

Landscapes

Abstract

Provided in the present application are a user interface (UI) test method and apparatus, a storage medium, and a computer device. The UI test method comprises: receiving a test request sent by a terminal device, the test request comprising an identifier of a UI to be tested; according to the identifier of said UI, acquiring a source code and a configuration file of said UI; according to the source code of said UI, determining each page element in said UI and generating a logical relationship tree for representing the logical relationship among the page elements; according to the configuration file, acquiring static position information of each page element of said UI, and generating an element tree according to the static position information of each page element and the logical relationship tree; performing depth traversal on the element tree to generate a measurement script corresponding to said UI; and according to the measurement script, measuring said UI. In the described method, a measurement script can be automatically written, reducing the workload of a UI test.

Description

Translated fromChinese
用户界面测试方法、装置、存储介质及计算机设备User interface testing method, device, storage medium and computer equipment

本申请要求于2020年3月16日提交中国专利局、申请号为202010183897.1,发明名称为“用户界面测试方法、装置、存储介质及计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on March 16, 2020 with the application number 202010183897.1 and the invention title "User Interface Testing Method, Device, Storage Medium and Computer Equipment", the entire content of which is incorporated by reference Incorporated in this application.

技术领域Technical field

本申请涉及研发管理领域,具体涉及一种用户界面测试方法、装置、存储介质及计算机设备。This application relates to the field of R&D management, and specifically relates to a user interface testing method, device, storage medium, and computer equipment.

背景技术Background technique

用户界面(User Interface,简称UI)是系统和用户之间进行交互和信息交换的媒介,它实现信息的内部形式与人类可以接受形式之间的转换。用户界面的目的在于使得用户能够方便有效率地去操作硬件以达成双向之交互,完成所希望借助硬件完成之工作。用户界面使用广泛,随着移动通信以及电子商务等技术的发展,装载于移动终端中的应用越来越多,例如外卖应用,即时通信应用等等,不同的应用的用户界面一般包含有适量的页面元素以实现应用之操作功能。在软件产品开发阶段,需要对其用户界面中的页面元素进行测试。User Interface (UI) is a medium for interaction and information exchange between the system and the user, and it realizes the conversion between the internal form of information and the form acceptable to humans. The purpose of the user interface is to enable the user to conveniently and efficiently operate the hardware to achieve two-way interaction, and to complete the work desired by the hardware. The user interface is widely used. With the development of mobile communication and e-commerce technologies, more and more applications are loaded in mobile terminals, such as food delivery applications, instant messaging applications, etc. The user interface of different applications generally contains an appropriate amount of Page elements in order to realize the operation function of the application. In the software product development phase, the page elements in its user interface need to be tested.

现有UI页面元素的测试方式主要包括人工点击页面元素进行测试的手动测试方式以及通过编写自动化脚本进行自动化测试的方式。发明人意识到,现有自动化测试方式中,整个测试流程通过编写一个自动化测试脚本实现,在每个页面元素测试时,均需手动配置页面元素定位代码以及测试代码,因此,现有的用户界面页面元素测试方法操作繁琐、工作量大。The existing UI page element testing methods mainly include a manual testing method of manually clicking on a page element for testing and a method of automated testing by writing an automated script. The inventor realizes that in the existing automated testing method, the entire testing process is realized by writing an automated testing script. When each page element is tested, it is necessary to manually configure the page element positioning code and the testing code. Therefore, the existing user interface The page element testing method is cumbersome and requires a lot of work.

技术问题technical problem

本申请实施例提供一种用户界面测试方法、装置、存储介质及计算机设备,用于解决现有技术中的用户界面页面元素测试方法操作繁琐、工作量大的问题。The embodiments of the present application provide a user interface testing method, device, storage medium, and computer equipment, which are used to solve the problems of cumbersome operation and heavy workload of the user interface page element testing method in the prior art.

技术解决方案Technical solutions

第一方面,本申请实施例提供一种用户界面测试方法,所述方法包括:In the first aspect, an embodiment of the present application provides a user interface testing method, and the method includes:

接收终端设备发送的测试请求,所述测试请求用于指示对待测试用户界面进行用户界面测试,所述测试请求包括所述待测试用户界面的标识;Receiving a test request sent by a terminal device, where the test request is used to instruct the user interface to be tested to perform a user interface test, and the test request includes the identifier of the user interface to be tested;

根据所述待测试用户界面的标识获取所述待测试用户界面的源代码及配置文件,其中,所述配置文件为xml格式的结构化文件;Obtaining the source code and configuration file of the user interface to be tested according to the identifier of the user interface to be tested, wherein the configuration file is a structured file in xml format;

根据所述待测试用户界面的源代码确定所述待测试用户界面中的各个页面元素以及生成用于表征所述各个页面元素之间逻辑关系的逻辑关系树;Determining, according to the source code of the user interface to be tested, each page element in the user interface to be tested and generating a logical relationship tree used to characterize the logical relationship between the various page elements;

根据所述配置文件获取所述待测试用户界面的各个页面元素的静态位置信息,根据所述各个页面元素的静态位置信息及所述逻辑关系树生成元素树;Obtaining static location information of each page element of the user interface to be tested according to the configuration file, and generating an element tree according to the static location information of each page element and the logical relationship tree;

对所述元素树进行深度遍历,生成与所述待测试用户界面对应的测量脚本;Traverse the element tree in depth, and generate a measurement script corresponding to the user interface to be tested;

根据所述测量脚本,对所述待测试用户界面进行测量,生成并显示测量结果。According to the measurement script, the user interface to be tested is measured, and the measurement result is generated and displayed.

可选地,所述获取所述各个页面元素中每个页面元素的静态位置信息,包括:Optionally, the obtaining the static position information of each page element in the various page elements includes:

调用Accessibility程序接口,根据每个所述页面元素的名称或者标识或者可扩展标记语言路径,从所述配置文件中查找到所述待测试用户界面中每个所述页面元素的静态位置信息。The Accessibility program interface is called, and the static location information of each page element in the user interface to be tested is found from the configuration file according to the name or identification of each page element or the extensible markup language path.

第二方面,本申请实施例提供了一种用户界面测试装置,包括:In the second aspect, an embodiment of the present application provides a user interface testing device, including:

接收模块,用于接收终端设备发送的测试请求,所述测试请求用于指示对待测试用户界面进行用户界面测试,所述测试请求包括所述待测试用户界面的标识;A receiving module, configured to receive a test request sent by a terminal device, where the test request is used to instruct a user interface to be tested to perform a user interface test, and the test request includes an identifier of the user interface to be tested;

获取模块,用于根据所述待测试用户界面的标识获取所述待测试用户界面的源代码及配置文件,其中,所述配置文件为xml格式的结构化文件;An obtaining module, configured to obtain the source code and configuration file of the user interface to be tested according to the identifier of the user interface to be tested, wherein the configuration file is a structured file in xml format;

第一生成模块,用于根据所述待测试用户界面的源代码确定所述待测试用户界面中的各个页面元素以及生成用于表征所述各个页面元素之间逻辑关系的逻辑关系树;The first generation module is configured to determine each page element in the user interface to be tested according to the source code of the user interface to be tested and to generate a logical relationship tree used to characterize the logical relationship between the various page elements;

第二生成模块,用于根据所述配置文件获取所述待测试用户界面的各个页面元素的静态位置信息,根据所述各个页面元素的静态位置信息及所述逻辑关系树生成元素树;The second generating module is configured to obtain static position information of each page element of the user interface to be tested according to the configuration file, and generate an element tree according to the static position information of each page element and the logical relationship tree;

第三生成模块,对所述元素树进行深度遍历,生成与所述待测试用户界面对应的测量脚本;及A third generation module, which traverses the element tree in depth, and generates a measurement script corresponding to the user interface to be tested; and

测量模块,用于根据所述测量脚本,对所述待测试用户界面进行测量,生成并显示测量结果。The measurement module is used to measure the user interface to be tested according to the measurement script, and generate and display the measurement result.

第三方面,本申请实施例提供了一种存储介质,所述存储介质包括存储的程序,其中,在所述程序运行时控制所述存储介质所在设备执行一种用户界面测试方法,其中所述户界面测试方法的步骤包括:In a third aspect, an embodiment of the present application provides a storage medium, the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute a user interface testing method, wherein the The steps of the user interface test method include:

接收终端设备发送的测试请求,所述测试请求用于指示对待测试用户界面进行用户界面测试,所述测试请求包括所述待测试用户界面的标识;Receiving a test request sent by a terminal device, where the test request is used to instruct the user interface to be tested to perform a user interface test, and the test request includes the identifier of the user interface to be tested;

根据所述待测试用户界面的标识获取所述待测试用户界面的源代码及配置文件,其中,所述配置文件为xml格式的结构化文件;Obtaining the source code and configuration file of the user interface to be tested according to the identifier of the user interface to be tested, wherein the configuration file is a structured file in xml format;

根据所述待测试用户界面的源代码确定所述待测试用户界面中的各个页面元素以及生成用于表征所述各个页面元素之间逻辑关系的逻辑关系树;Determining, according to the source code of the user interface to be tested, each page element in the user interface to be tested and generating a logical relationship tree used to characterize the logical relationship between the various page elements;

根据所述配置文件获取所述待测试用户界面的各个页面元素的静态位置信息,根据所述各个页面元素的静态位置信息及所述逻辑关系树生成元素树;Obtaining static location information of each page element of the user interface to be tested according to the configuration file, and generating an element tree according to the static location information of each page element and the logical relationship tree;

对所述元素树进行深度遍历,生成与所述待测试用户界面对应的测量脚本;Traverse the element tree in depth, and generate a measurement script corresponding to the user interface to be tested;

根据所述测量脚本,对所述待测试用户界面进行测量,生成并显示测量结果。According to the measurement script, the user interface to be tested is measured, and the measurement result is generated and displayed.

第四方面,本申请实施例提供了一种计算机设备,包括存储器和处理器,所述存储器用于存储包括程序指令的信息,所述处理器用于控制程序指令的执行,所述程序指令被处理器加载并执行时实现一种用户界面测试方法,其中所述户界面测试方法的步骤包括:In a fourth aspect, an embodiment of the present application provides a computer device, including a memory and a processor, the memory is used to store information including program instructions, the processor is used to control the execution of the program instructions, and the program instructions are processed. A user interface testing method is implemented when the device is loaded and executed, wherein the steps of the user interface testing method include:

接收终端设备发送的测试请求,所述测试请求用于指示对待测试用户界面进行用户界面测试,所述测试请求包括所述待测试用户界面的标识;Receiving a test request sent by a terminal device, where the test request is used to instruct the user interface to be tested to perform a user interface test, and the test request includes the identifier of the user interface to be tested;

根据所述待测试用户界面的标识获取所述待测试用户界面的源代码及配置文件,其中,所述配置文件为xml格式的结构化文件;Obtaining the source code and configuration file of the user interface to be tested according to the identifier of the user interface to be tested, wherein the configuration file is a structured file in xml format;

根据所述待测试用户界面的源代码确定所述待测试用户界面中的各个页面元素以及生成用于表征所述各个页面元素之间逻辑关系的逻辑关系树;Determining, according to the source code of the user interface to be tested, each page element in the user interface to be tested and generating a logical relationship tree used to characterize the logical relationship between the various page elements;

根据所述配置文件获取所述待测试用户界面的各个页面元素的静态位置信息,根据所述各个页面元素的静态位置信息及所述逻辑关系树生成元素树;Obtaining static location information of each page element of the user interface to be tested according to the configuration file, and generating an element tree according to the static location information of each page element and the logical relationship tree;

对所述元素树进行深度遍历,生成与所述待测试用户界面对应的测量脚本;Traverse the element tree in depth, and generate a measurement script corresponding to the user interface to be tested;

根据所述测量脚本,对所述待测试用户界面进行测量,生成并显示测量结果。According to the measurement script, the user interface to be tested is measured, and the measurement result is generated and displayed.

有益效果Beneficial effect

可以理解,本申请实施例确定待测试用户界面之后,再根据待测试用户界面中各个页面元素的静态位置信息和各个页面元素的预设逻辑关系,确定测试请求对应的测试脚本,最后根据测试脚本,进行待测试用户界面的测试使得软件开发人员不需要手工编辑测试脚本,就可以在自动对待测试用户界面进行测试,大大提高了用户界面测试效率,也节约了测试软件开发的大量资源。It can be understood that after the embodiment of the application determines the user interface to be tested, the test script corresponding to the test request is determined according to the static position information of each page element in the user interface to be tested and the preset logical relationship of each page element, and finally according to the test script , Testing the user interface to be tested allows software developers to automatically test the user interface to be tested without manually editing test scripts, which greatly improves the efficiency of user interface testing and saves a lot of resources for testing software development.

附图说明Description of the drawings

图1为本申请实施例提供的一种用户界面测试方法的流程图;FIG. 1 is a flowchart of a user interface testing method provided by an embodiment of the application;

图2为本申请实施例提供的一种示例性的逻辑关系树;Figure 2 is an exemplary logical relationship tree provided by an embodiment of the application;

图3为本申请实施例提供的另一种示例性的逻辑关系树;Fig. 3 is another exemplary logical relationship tree provided by an embodiment of the application;

图4为本申请实施例提供的一种用户界面测试装置的示意框图;4 is a schematic block diagram of a user interface testing device provided by an embodiment of the application;

图5为本申请实施例提供的一种计算机设备的示意框图。FIG. 5 is a schematic block diagram of a computer device provided by an embodiment of this application.

本发明的最佳实施方式The best mode of the present invention

为了更好的理解本申请的技术方案,下面结合附图对本申请实施例进行详细描述。In order to better understand the technical solutions of the present application, the following describes the embodiments of the present application in detail with reference to the accompanying drawings.

应当明确,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。It should be clear that the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.

在本申请实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其它含义。The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms of "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.

应当理解,本文中使用的术语“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。It should be understood that the term "and/or" used in this text is only an association relationship describing the associated objects, indicating that there can be three types of relationships, for example, A and/or B can mean that A alone exists, and both A and A exist at the same time. B, there are three cases of B alone. In addition, the character "/" in this text generally indicates that the associated objects before and after are in an "or" relationship.

具体实现中,本申请实施例中描述的终端包括但不限于诸如具有触摸敏感表面(例如,触摸屏显示器和/或触摸板)的移动电话、膝上型计算机或平板计算机之类的其它便携式设备。还应当理解的是,在某些实施例中,设备并非便携式通信设备,而是具有触摸敏感表面(例如,触摸屏显示器和/或触摸板)的台式计算机。In specific implementation, the terminals described in the embodiments of the present application include but are not limited to other portable devices such as mobile phones with touch-sensitive surfaces (for example, touch screen displays and/or touch pads), laptop computers, or tablet computers. It should also be understood that, in some embodiments, the device is not a portable communication device, but a desktop computer with a touch-sensitive surface (e.g., touch screen display and/or touch pad).

在接下来的讨论中,描述了包括显示器和触摸敏感表面的终端设备。然而,应当理解的是,终端设备可以包括诸如物理键盘、鼠标和/或控制杆的一个或多个其它物理用户接口设备。In the following discussion, a terminal device including a display and a touch-sensitive surface is described. However, it should be understood that the terminal device may include one or more other physical user interface devices such as a physical keyboard, mouse, and/or joystick.

终端设备支持各种应用程序,例如以下中的一个或多个:绘图应用程序、演示应用程序、文字处理应用程序、网站创建应用程序、盘刻录应用程序、电子表格应用程序、游戏应用程序、电话应用程序、视频会议应用程序、电子邮件应用程序、即时消息收发应用程序、锻炼支持应用程序、照片管理应用程序、数码相机应用程序、数字摄影机应用程序、web浏览应用程序、数字音乐播放器应用程序和/或数字视频播放器应用程序。The terminal device supports various applications, such as one or more of the following: drawing application, presentation application, word processing application, website creation application, disk burning application, spreadsheet application, game application, phone Apps, video conferencing apps, email apps, instant messaging apps, exercise support apps, photo management apps, digital camera apps, digital camera apps, web browsing apps, digital music player apps And/or digital video player application.

可以在终端设备上执行的各种应用程序可以使用诸如触摸敏感表面的至少一个公共物理用户接口设备。可以在应用程序之间和/或相应应用程序内调整和/或改变触摸敏感表面的一个或多个功能以及终端上显示的相应信息。这样,终端的公共物理架构(例如,触摸敏感表面)可以支持具有对用户而言直观且透明的用户界面的各种应用程序。Various application programs that can be executed on the terminal device can use at least one common physical user interface device such as a touch-sensitive surface. One or more functions of the touch-sensitive surface and corresponding information displayed on the terminal can be adjusted and/or changed between applications and/or within corresponding applications. In this way, the common physical architecture of the terminal (for example, a touch-sensitive surface) can support various applications with a user interface that is intuitive and transparent to the user.

请参阅附图1,本申请实施例提供一种用户界面测试方法,该方法应用于用户界面测试装置中,用户界面测试装置可用于众多通用或专用的计算系统环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器系统、包括以上任何系统或设备的分布式计算环境等等。用户界面测试方法包括:Referring to FIG. 1, an embodiment of the present application provides a user interface testing method, which is applied to a user interface testing device, and the user interface testing device can be used in many general or dedicated computing system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, distributed computing environments including any of the above systems or devices, and so on. User interface testing methods include:

步骤S01:接收终端设备发送的测试请求,测试请求用于指示对待测试用户界面进行用户界面测试,测试请求包括待测试用户界面的标识。Step S01: Receive a test request sent by the terminal device, the test request is used to instruct the user interface to be tested to perform a user interface test, and the test request includes the identifier of the user interface to be tested.

步骤S02:根据待测试用户界面的标识获取待测试用户界面的源代码及配置文件,其中,配置文件为xml格式的结构化文件。Step S02: Obtain the source code and configuration file of the user interface to be tested according to the identifier of the user interface to be tested, where the configuration file is a structured file in xml format.

步骤S03:根据待测试用户界面的源代码确定待测试用户界面中的各个页面元素以及生成用于表征各个页面元素之间逻辑关系的逻辑关系树。Step S03: According to the source code of the user interface to be tested, each page element in the user interface to be tested is determined and a logical relationship tree used to characterize the logical relationship between the various page elements is generated.

步骤S04:根据配置文件获取待测试用户界面的各个页面元素的静态位置信息,根据各个页面元素的静态位置信息及逻辑关系树生成元素树。Step S04: Obtain the static position information of each page element of the user interface to be tested according to the configuration file, and generate an element tree according to the static position information of each page element and the logical relationship tree.

步骤S05:对元素树进行深度遍历,生成与待测试用户界面对应的测量脚本。Step S05: Deeply traverse the element tree, and generate a measurement script corresponding to the user interface to be tested.

步骤S06:根据测量脚本,对待测试用户界面进行测量,生成并显示测量结果。Step S06: According to the measurement script, the user interface to be tested is measured, and the measurement result is generated and displayed.

可以理解,本申请实施例确定待测试用户界面之后,再根据待测试用户界面中各个页面元素的静态位置信息和各个页面元素的预设逻辑关系,确定测试请求对应的测试脚本,最后根据测试脚本,进行待测试用户界面的测试使得软件开发人员不需要手工编辑测试脚本,就可以在自动对待测试用户界面进行测试,大大提高了用户界面测试效率,也节约了测试软件开发的大量资源。It can be understood that after the embodiment of the application determines the user interface to be tested, the test script corresponding to the test request is determined according to the static position information of each page element in the user interface to be tested and the preset logical relationship of each page element, and finally according to the test script , Testing the user interface to be tested allows software developers to automatically test the user interface to be tested without manually editing test scripts, which greatly improves the efficiency of user interface testing and saves a lot of resources for testing software development.

下面再次结合附图1对本实施例提供的用户界面测试方法的具体技术方案进行详细的说明。The specific technical solution of the user interface testing method provided in this embodiment will be described in detail below with reference to FIG. 1 again.

针对步骤S01:接收终端设备发送的测试请求,测试请求用于指示对待测试用户界面进行用户界面测试,测试请求包括待测试用户界面的标识。Regarding step S01: receiving a test request sent by a terminal device, the test request is used to instruct the user interface to be tested to perform a user interface test, and the test request includes an identifier of the user interface to be tested.

其中,用户界面测试装置根据待测试用户界面的标识确定所要测试的对象。用户界面测试装置可以先主动向终端设备发起测试指令,使得终端设备根据测试指令生成测试请求,也可以是用户界面测试装置每隔固定周期判断是否有接收到来自终端设备的测试请求,本申请对此不做限定。Wherein, the user interface testing device determines the object to be tested according to the identifier of the user interface to be tested. The user interface testing device can actively initiate a test instruction to the terminal device first, so that the terminal device generates a test request according to the test instruction, or the user interface testing device determines whether it has received a test request from the terminal device at regular intervals. This is not limited.

其中,待测试用户界面具体为待进行交互功能测试的用户界面,待测试用户界面可以是应用中或网页中的用户界面,例如为电商网站、社交网站等网页或合同管理系统、邮箱等应用中的用户界面。Among them, the user interface to be tested is specifically the user interface to be tested for interactive functions, and the user interface to be tested can be a user interface in an application or a web page, for example, web pages such as e-commerce websites, social networking sites, or contract management systems, email applications, etc. The user interface in.

针对步骤S02:根据待测试用户界面的标识获取待测试用户界面的源代码及配置文件,其中,配置文件为xml格式的结构化文件。For step S02: Obtain the source code and configuration file of the user interface to be tested according to the identifier of the user interface to be tested, where the configuration file is a structured file in xml format.

源代码及配置文件通常位于待测试用户界面所对应的应用软件的数据包内,如果是对安卓(Android)操作系统下的应用软件的用户界面进行测试,上述数据包往往是指对应安卓应用的安卓数据包(Android Package,简称APK)。配置文件包括待测试用户界面中各个页面元素的配置信息,即保存了使用哪些页面元素、将页面元素绘制在界面中的哪个位置等配置信息,通常,配置文件是用xml(可扩展标记语言)格式的结构化文件通过节点来描述页面元素的配置信息。待测试用户界面的源代码定义了待测试用户界面的编写设置规则,通过待测试用户界面的源代码可以识别待测试用户界面的各个页面元素,从而获得各个页面元素的名称、标识和/或可扩展标记语言路径等信息。例如,可以根据源代码中带有“href”关键字的内容识别出超链接的页面元素信息。同时,还可以根据待测试用户界面的编写设置规则确定待测试用户界面中各个页面元素之间的逻辑关系。The source code and configuration files are usually located in the data package of the application software corresponding to the user interface to be tested. If the user interface of the application software under the Android operating system is tested, the above data package often refers to the corresponding Android application. Android Package (APK). The configuration file includes the configuration information of each page element in the user interface to be tested, that is, which page elements are used, where the page elements are drawn in the interface, and other configuration information. Usually, the configuration file uses xml (extensible markup language) The formatted structured file describes the configuration information of page elements through nodes. The source code of the user interface to be tested defines the rules for writing and setting the user interface to be tested. Through the source code of the user interface to be tested, each page element of the user interface to be tested can be identified, so as to obtain the name, identification and/or availability of each page element. Extend the markup language path and other information. For example, the page element information of the hyperlink can be identified based on the content with the "href" keyword in the source code. At the same time, the logical relationship between various page elements in the user interface to be tested can also be determined according to the writing and setting rules of the user interface to be tested.

其中,页面元素具体指的是可进行人机交互的页面元素(如输入框,按钮,超链接,上传控件,翻页控件,单选复选框等)。该些页面元素为通常进行页面操作时所操作的页面元素。本申请实施例对于页面元素的形式不做具体限制。Among them, page elements specifically refer to page elements that can perform human-computer interaction (such as input boxes, buttons, hyperlinks, upload controls, page turning controls, radio check boxes, etc.). These page elements are usually the page elements that are operated during page operations. The embodiment of the present application does not specifically limit the form of the page element.

针对步骤S03:根据待测试用户界面的源代码确定待测试用户界面中的各个页面元素以及生成用于表征各个页面元素之间逻辑关系的逻辑关系树。For step S03: Determine each page element in the user interface to be tested according to the source code of the user interface to be tested and generate a logical relationship tree for representing the logical relationship between the various page elements.

其中,逻辑关系树包括一个根节点和一个或多个分支路径,每个分支路径上至少有一个子节点,逻辑关系树中的每个节点对应一个页面元素,逻辑关系图中的每个节点的节点标识与其所对应的页面元素的标识或名称一致。Among them, the logical relationship tree includes a root node and one or more branch paths. Each branch path has at least one child node. Each node in the logical relationship tree corresponds to a page element. The node ID is consistent with the ID or name of the corresponding page element.

具体地,以待测试用户界面为登陆界面为例,对于登录界面,由于具有用户名输入框,密码输入框,下次自动登录,忘记密码按钮和登录按钮,因此可具有如附图2所示的逻辑关系树;当然,也可具有如附图3所示的逻辑关系树。Specifically, taking the user interface to be tested as the login interface as an example, the login interface has a user name input box, a password input box, automatic login next time, a forget password button, and a login button, so it can have a login interface as shown in Figure 2. The logical relationship tree; Of course, it can also have a logical relationship tree as shown in FIG. 3.

以附图2为例,图2所示的逻辑关系树反映了登录界面中各个页面元素的传承依赖属性,并由此依赖属性传递路由事件。图2所示的逻辑关系树包括5个节点,节点A“用户名输入框”,节点B“密码输入框”,节点C“下次自动登录”,节点D“忘记密码按钮”和节点E“登录按钮”,其中节点A没有父节点,因此节点A为根节点。在测试的过程中,在节点A测试通过之后,再进行节点B的测试,然后进行节点C或节点D或节点E的测试(节点C,节点D和节点E之间具有并列关系)。Taking Fig. 2 as an example, the logical relationship tree shown in Fig. 2 reflects the inheritance dependency attribute of each page element in the login interface, and thus the dependency attribute transfers routing events. The logical relationship tree shown in Figure 2 includes 5 nodes, node A "user name input box", node B "password input box", node C "automatically log in next time", node D "forgot password button" and node E " Login button", in which node A has no parent node, so node A is the root node. In the process of testing, after node A has passed the test, perform the test of node B, and then perform the test of node C or node D or node E (node C, node D and node E have a parallel relationship).

另外,需要说明的是,本实施例的图2和图3仅反映了对于登录界面的两种逻辑关系,在实际应用中,用户名输入框和密码输入框的先后顺序还可以调换,或用户名输入框和密码输入框还可具有并列逻辑关系。本实施例对上述逻辑关系的顺序不作任何限定,任何符合客观特性的逻辑关系均应落入本申请实施例的保护范围。In addition, it should be noted that Figures 2 and 3 of this embodiment only reflect the two logical relationships for the login interface. In practical applications, the sequence of the user name input box and the password input box can also be changed, or the user The name input box and the password input box can also have a parallel logical relationship. This embodiment does not limit the sequence of the foregoing logical relationships in any way, and any logical relationship that meets objective characteristics should fall within the protection scope of the embodiments of this application.

针对步骤S04:根据配置文件获取待测试用户界面的各个页面元素的静态位置信息,根据各个页面元素的静态位置信息及逻辑关系树生成元素树;For step S04: Obtain the static position information of each page element of the user interface to be tested according to the configuration file, and generate an element tree according to the static position information of each page element and the logical relationship tree;

进一步地,获取各个页面元素中每个页面元素的静态位置信息,包括:Further, obtaining the static position information of each page element in each page element includes:

S041:调用Accessibility程序接口,根据每个页面元素的名称或者标识或者可扩展标记语言路径,从配置文件中查找到与待测试用户界面的每个页面元素的静态位置信息。S041: Call the Accessibility program interface, and find the static location information of each page element of the user interface to be tested from the configuration file according to the name or identification of each page element or the extensible markup language path.

其中,Accessibility是一种以程序方式访问页面元素信息或操作这些页面元素的功能服务,在本申请实施例中,用户界面测试装置可以基于名称或者标识或者可扩展标记语言路径,然后调用Accessibility访问待测试用户界面并获取其中页面元素的静态位置信息,页面元素的静态位置信息例如可以为坐标参数等。Among them, Accessibility is a functional service for accessing page element information or operating these page elements in a programmatic manner. In the embodiment of the present application, the user interface testing device may be based on the name or the logo or the extensible markup language path, and then call Accessibility to access the waiting list. Test the user interface and obtain the static position information of the page elements therein. The static position information of the page elements may be, for example, coordinate parameters.

其中,android(安卓)版本的页面元素通常根据可扩展标记语言路径(即XPath)获取其中页面元素的静态位置信息,XPath是XML(eXtensible MarkupLanguage)Path的简称。在实际应用中,也可以将常用的或者与待测用户界面对应的定位方式设置在配置文件中。Among them, the page element of the android (Android) version usually obtains the static location information of the page element according to the extensible markup language path (ie XPath), and XPath is the abbreviation of XML (eXtensible Markup Language) Path. In practical applications, you can also set the commonly used positioning method or the positioning method corresponding to the user interface to be tested in the configuration file.

其中,页面元素的名称例如为按钮的名称,例如“注册”、“登录”、“确认下单”、“加购物车”等。页面元素的标识可以是分配唯一的标识(即ID,identification)。Among them, the name of the page element is, for example, the name of the button, such as "register", "login", "confirm order", "add shopping cart" and so on. The identification of the page element can be assigned a unique identification (ie ID, identification).

进一步地,根据各个页面元素的静态位置信息及逻辑关系树生成元素树,包括:Further, generating an element tree according to the static location information of each page element and the logical relationship tree includes:

S042:根据每个页面元素的标识,在逻辑关系树上查找到每个页面元素对应的节点,并将每个页面元素的静态位置信息添加至逻辑关系树中对应的节点内,以生成元素树,其中,逻辑关系树中包括多个与各个页面元素一一对应的节点,且每个节点的节点标识与所对应的页面元素的标识相同。S042: According to the identification of each page element, find the node corresponding to each page element in the logical relationship tree, and add the static position information of each page element to the corresponding node in the logical relationship tree to generate an element tree , Wherein the logical relationship tree includes a plurality of nodes corresponding to each page element one-to-one, and the node identifier of each node is the same as the identifier of the corresponding page element.

同样的,元素树包括一个根节点和一个或多个分支路径,每个分支路径上至少有一个子节点,元素树中的每个节点对应一个页面元素,元素树中的每个节点内存储有所对应得页面元素的静态位置信息。Similarly, the element tree includes a root node and one or more branch paths. Each branch path has at least one child node. Each node in the element tree corresponds to a page element. Each node in the element tree stores The static position information of the corresponding page element.

可以理解,通过步骤S042,可生成添加有页面元素的静态位置信息的元素树,这样,在测试过程中,便可获知操作页面对象的数据,以及页面对象的执行位置。这样,在根据测试请求,获取待测试用户界面之后,再根据待测试用户界面中各个页面元素的静态位置信息和各个页面元素的逻辑关系,确定测试请求对应的测试脚本,最后根据测试脚本,进行待测试用户界面的测试,并显示测试结果的方式可以提高用户界面测试的效率;同时,本申请实施例根据页面元素的静态位置信息和逻辑关系生成测试脚本的方式,由于可以在逻辑关系树中添加各页面元素的静态位置信息,这样,在测试结果为不通过时,便可通过查看测试中断点对应的静态位置信息,得到问题页面元素,实现对用户界面的进一步优化。另外,本申请实施例还可以减少手工编写脚本的比例,降低错误率。It can be understood that, through step S042, an element tree with static position information of the page elements can be generated, so that in the test process, the data of the operation page object and the execution position of the page object can be known. In this way, after obtaining the user interface to be tested according to the test request, the test script corresponding to the test request is determined according to the static position information of each page element in the user interface to be tested and the logical relationship of each page element, and finally the test script is performed according to the test script. The method of testing the user interface to be tested and displaying the test results can improve the efficiency of user interface testing; at the same time, the method of generating test scripts according to the static position information and logical relationships of page elements in the embodiment of the present application can be in the logical relationship tree Add the static location information of each page element, so that when the test result is not passed, you can obtain the problem page element by viewing the static location information corresponding to the test interruption point, and further optimize the user interface. In addition, the embodiments of the present application can also reduce the proportion of manual scripts and reduce the error rate.

针对执行步骤S05,对元素树进行深度遍历,生成与待测试用户界面对应的测量脚本。For step S05, the element tree is deeply traversed, and a measurement script corresponding to the user interface to be tested is generated.

具体地,本申请实施例在对元素树进行深度遍历,生成与测量请求对应的测量脚本之前,用户界面测试方法还包括:Specifically, in the embodiment of the present application, before performing a deep traversal of the element tree and generating a measurement script corresponding to the measurement request, the user interface testing method further includes:

建立动作模板库,动作模板库存储有多个用于操作页面元素的动作参数,动作参数包括执行脚本模板,其中每个执行脚本模板对应一个或多个页面元素或者一种页面元素类型。An action template library is established. The action template library stores multiple action parameters for operating page elements. The action parameters include execution script templates, where each execution script template corresponds to one or more page elements or a type of page element.

具体地,在实际应用中,对软件进行测试之前,软件开发人员首先建立动作模板库,用于存储操作多个页面元素的动作参数,动作参数包括标识信息以及与页面元素对应的执行脚本模板,标识信息可以是执行脚本模板所对应的页面元素的标识或者类型标识信息,可以理解,通过设置动作模板库,从而节省了大量编写脚本的工作。Specifically, in actual applications, before testing the software, the software developer first establishes an action template library for storing action parameters for operating multiple page elements. The action parameters include identification information and execution script templates corresponding to the page elements. The identification information may be the identification or type identification information of the page element corresponding to the execution script template. It can be understood that by setting the action template library, a lot of scripting work is saved.

进一步地,步骤S05,对元素树进行遍历,生成与测量请求对应的测量脚本,具体包括:Further, in step S05, the element tree is traversed to generate a measurement script corresponding to the measurement request, which specifically includes:

步骤S051:对元素树进行深度遍历,获取元素树中每个页面元素对应的静态位置信息及在动作模板库中提取元素树中每个页面元素对应的执行脚本模板;Step S051: Perform a deep traversal of the element tree, obtain the static position information corresponding to each page element in the element tree, and extract the execution script template corresponding to each page element in the element tree from the action template library;

其中,所谓深度遍历为基于深度优先规则进行遍历,即按照根节点对应的页面元素指向的逻辑路径逐级访问各个子节点,直至访问至最底层的子节点后再返回上一级节点,直到元素树中所有和根节点有路径相通的子节点都被访问到,深度遍历为本领域技术人员公知常识,在此不详细描述。Among them, the so-called depth traversal is traversal based on the depth-first rule, that is, follow the logical path pointed to by the page element corresponding to the root node to visit each child node step by step, until the lowest child node is visited, and then return to the previous node until the element All child nodes in the tree that have a path connected to the root node are visited. Deep traversal is common knowledge of those skilled in the art, and will not be described in detail here.

步骤S052:将每个页面元素对应的静态位置信息按照预设规则添加至对应的执行脚本模板中,生成每个页面元素对应的元素级测试脚本。Step S052: Add the static location information corresponding to each page element to the corresponding execution script template according to preset rules, and generate an element-level test script corresponding to each page element.

步骤S053:根据对元素树中页面元素的遍历顺序,对元素树中各个页面元素的对应的元素级测试脚本进行合成,生成测量请求对应的测量脚本。Step S053: According to the traversal sequence of the page elements in the element tree, synthesize the corresponding element-level test scripts of each page element in the element tree to generate a measurement script corresponding to the measurement request.

其中,测试脚本为用于对待测试用户界面进行测试的脚本程序,利用这些脚本程序可以执行对待测试用户界面的测试流程,可以在待测试用户界面上模拟键盘输入、鼠标点击等实际操作。Among them, the test script is a script program used to test the user interface to be tested. With these script programs, the test process of the user interface to be tested can be executed, and actual operations such as keyboard input and mouse clicks can be simulated on the user interface to be tested.

可以理解的是,利用本申请实施例中的用户界面测试方法可以通过建立动作模板库节省测试脚本的编写时间,生成的测试脚本可以由测试工具解析并执行,无需软件开发人员手工修改或者编辑,减少了编程过程中出现的人为错误,大大提高了软件测试过程中的软件测试效率;此外,动作模板库针对具体的动作而不是测试用例,大大提高了动作执行脚本的共享性,同时提高了脚本的可维护性和可管理性。It is understandable that using the user interface testing method in the embodiments of the present application can save the writing time of test scripts by establishing an action template library, and the generated test scripts can be parsed and executed by the testing tool without manual modification or editing by software developers. Reduce the human error in the programming process, greatly improve the software testing efficiency in the software testing process; in addition, the action template library is aimed at specific actions instead of test cases, which greatly improves the sharing of action execution scripts, and at the same time improves the scripts Maintainability and manageability.

可选地,生成测量结果之后,用户界面测试方法还包括:Optionally, after the measurement result is generated, the user interface testing method further includes:

存储测试结果,并将测试脚本与待测试用户界面的标识建立关联关系。The test result is stored, and the test script is associated with the identification of the user interface to be tested.

请参阅附图4,本申请实施例提供一种用户界面测试装置1,包括:Referring to FIG. 4, an embodiment of the present application provides a user interface testing device 1, including:

接收模块11,用于接收终端设备发送的测试请求,测试请求用于指示对待测试用户界面进行用户界面测试,测试请求包括待测试用户界面的标识;The receiving module 11 is configured to receive a test request sent by a terminal device, the test request is used to instruct the user interface to be tested to perform a user interface test, and the test request includes an identifier of the user interface to be tested;

获取模块12,用于根据待测试用户界面的标识获取待测试用户界面的源代码及配置文件,其中,配置文件为xml格式的结构化文件;The obtaining module 12 is used to obtain the source code and configuration file of the user interface to be tested according to the identifier of the user interface to be tested, where the configuration file is a structured file in xml format;

第一生成模块13,用于根据待测试用户界面的源代码确定待测试用户界面中的各个页面元素以及生成用于表征各个页面元素之间逻辑关系的逻辑关系树;The first generating module 13 is configured to determine each page element in the user interface to be tested according to the source code of the user interface to be tested and to generate a logical relationship tree used to characterize the logical relationship between the various page elements;

第二生成模块14,用于根据配置文件获取待测试用户界面的各个页面元素的静态位置信息,根据各个页面元素的静态位置信息及逻辑关系树生成元素树;The second generating module 14 is configured to obtain the static position information of each page element of the user interface to be tested according to the configuration file, and generate an element tree according to the static position information of each page element and the logical relationship tree;

第三生成模块15,对元素树进行深度遍历,生成与待测试用户界面对应的测量脚本;及The third generation module 15 traverses the element tree in depth, and generates a measurement script corresponding to the user interface to be tested; and

测量模块16,用于根据测量脚本,对待测试用户界面进行测量,生成并显示测量结果。The measurement module 16 is used to measure the user interface to be tested according to the measurement script, and generate and display the measurement result.

可选地,第二生成模块14包括:Optionally, the second generating module 14 includes:

定位单元,用于调用Accessibility程序接口,根据每个页面元素的名称或者标识或者可扩展标记语言路径,从配置文件中查找到与待测试用户界面的每个页面元素的静态位置信息。The positioning unit is used to call the Accessibility program interface, and find the static location information of each page element of the user interface to be tested from the configuration file according to the name or identification of each page element or the extensible markup language path.

可选地,第二生成模块14还包括:Optionally, the second generating module 14 further includes:

查找单元,用于根据每个页面元素的标识,在逻辑关系树上查找到每个页面元素对应的节点,并将每个页面元素的静态位置信息添加至逻辑关系树中对应的节点内,以生成元素树,其中,逻辑关系树中包括多个与各个页面元素一一对应的节点,且每个节点的节点标识与所对应的页面元素的标识相同。The search unit is used to find the node corresponding to each page element in the logical relationship tree according to the identification of each page element, and add the static position information of each page element to the corresponding node in the logical relationship tree to An element tree is generated, wherein the logical relationship tree includes a plurality of nodes corresponding to each page element one-to-one, and the node identifier of each node is the same as the identifier of the corresponding page element.

可选地,用户界面测试装置1还包括:Optionally, the user interface testing device 1 further includes:

建立模块,用于建立动作模板库,动作模板库存储有多个执行脚本模板,每个执行脚本模板对应至少一个页面元素。The establishment module is used to establish an action template library. The action template library stores multiple execution script templates, and each execution script template corresponds to at least one page element.

可选地,第三生成模块15还包括:Optionally, the third generation module 15 further includes:

深度遍历单元,用于对元素树进行深度遍历,获取元素树中每个页面元素对应的静态位置信息及在动作模板库中提取元素树中每个页面元素对应的执行脚本模板;The deep traversal unit is used to traverse the element tree in depth, obtain the static position information corresponding to each page element in the element tree, and extract the execution script template corresponding to each page element in the element tree from the action template library;

添加单元,用于将每个页面元素对应的静态位置信息按照预设规则添加至对应的执行脚本模板中,生成每个页面元素对应的元素级测试脚本;及The adding unit is used to add the static location information corresponding to each page element to the corresponding execution script template according to preset rules, and to generate an element-level test script corresponding to each page element; and

合成单元,用于根据对元素树中页面元素的遍历顺序,对元素树中各个页面元素的对应的元素级测试脚本进行合成,生成待测试用户界面对应的测量脚本。The synthesis unit is used to synthesize the corresponding element-level test scripts of each page element in the element tree according to the traversal sequence of the page elements in the element tree, and generate a measurement script corresponding to the user interface to be tested.

应该知道,为避免重复,本申请实施例中提供的用户界面测试装置中的进一步的细节以及其它实现方式可以参考本申请中其它实施例(例如方法实施例)中的相应内容。It should be understood that, in order to avoid repetition, for further details and other implementation manners of the user interface testing device provided in the embodiments of the present application, reference may be made to the corresponding content in other embodiments (for example, method embodiments) of the present application.

本申请实施例提供了一种存储介质,所述存储介质可以是非易失性,也可以是易失性的,该存储介质包括存储的程序,其中,在程序运行时控制存储介质所在设备执行实现一种用户界面测试方法,所述用户界面测试方法的步骤包括:The embodiments of the present application provide a storage medium. The storage medium may be non-volatile or volatile. The storage medium includes a stored program, wherein the device where the storage medium is located is controlled to execute when the program is running. A user interface testing method, the steps of the user interface testing method include:

接收终端设备发送的测试请求,所述测试请求用于指示对待测试用户界面进行用户界面测试,所述测试请求包括所述待测试用户界面的标识;Receiving a test request sent by a terminal device, where the test request is used to instruct the user interface to be tested to perform a user interface test, and the test request includes the identifier of the user interface to be tested;

根据所述待测试用户界面的标识获取所述待测试用户界面的源代码及配置文件,其中,所述配置文件为xml格式的结构化文件;Obtaining the source code and configuration file of the user interface to be tested according to the identifier of the user interface to be tested, wherein the configuration file is a structured file in xml format;

根据所述待测试用户界面的源代码确定所述待测试用户界面中的各个页面元素以及生成用于表征所述各个页面元素之间逻辑关系的逻辑关系树;Determining, according to the source code of the user interface to be tested, each page element in the user interface to be tested and generating a logical relationship tree used to characterize the logical relationship between the various page elements;

根据所述配置文件获取所述待测试用户界面的各个页面元素的静态位置信息,根据所述各个页面元素的静态位置信息及所述逻辑关系树生成元素树;Obtaining static location information of each page element of the user interface to be tested according to the configuration file, and generating an element tree according to the static location information of each page element and the logical relationship tree;

对所述元素树进行深度遍历,生成与所述待测试用户界面对应的测量脚本;Traverse the element tree in depth, and generate a measurement script corresponding to the user interface to be tested;

根据所述测量脚本,对所述待测试用户界面进行测量,生成并显示测量结果。According to the measurement script, the user interface to be tested is measured, and the measurement result is generated and displayed.

请参阅附图5,本申请实施例提供了一种计算机设备,该实施例的计算机设备50包括:处理器51、存储器52以及存储在存储器52中并可在处理器51上运行的计算机程序53,该计算机程序53被处理器51执行时实现实施例中的用户界面测试方法,所述用户界面测试方法的步骤包括:Referring to FIG. 5, an embodiment of the present application provides a computer device. The computer device 50 of this embodiment includes a processor 51, a memory 52, and a computer program 53 stored in the memory 52 and running on the processor 51. When the computer program 53 is executed by the processor 51, the user interface testing method in the embodiment is implemented, and the steps of the user interface testing method include:

接收终端设备发送的测试请求,所述测试请求用于指示对待测试用户界面进行用户界面测试,所述测试请求包括所述待测试用户界面的标识;根据所述待测试用户界面的标识获取所述待测试用户界面的源代码及配置文件,其中,所述配置文件为xml格式的结构化文件;根据所述待测试用户界面的源代码确定所述待测试用户界面中的各个页面元素以及生成用于表征所述各个页面元素之间逻辑关系的逻辑关系树;根据所述配置文件获取所述待测试用户界面的各个页面元素的静态位置信息,根据所述各个页面元素的静态位置信息及所述逻辑关系树生成元素树;对所述元素树进行深度遍历,生成与所述待测试用户界面对应的测量脚本;根据所述测量脚本,对所述待测试用户界面进行测量,生成并显示测量结果。或者,该计算机程序被处理器51执行时实现实施例中用户界面测试装置1中各模型/单元的功能,为避免重复,此处不一一赘述。Receive a test request sent by a terminal device, the test request is used to instruct the user interface to be tested to perform a user interface test, the test request includes the identifier of the user interface to be tested; the test request is obtained according to the identifier of the user interface to be tested The source code and configuration file of the user interface to be tested, where the configuration file is a structured file in xml format; according to the source code of the user interface to be tested, each page element in the user interface to be tested and the generation files are determined To characterize the logical relationship tree between the various page elements; obtain the static position information of each page element of the user interface to be tested according to the configuration file, according to the static position information of each page element and the The logical relationship tree generates an element tree; the element tree is traversed in depth to generate a measurement script corresponding to the user interface to be tested; according to the measurement script, the user interface to be tested is measured, and the measurement result is generated and displayed . Alternatively, when the computer program is executed by the processor 51, the function of each model/unit in the user interface testing device 1 in the embodiment is realized. In order to avoid repetition, it will not be repeated here.

计算机设备50可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。计算机设备50可包括但不仅限于处理器51、存储器52。本领域技术人员可以理解,图5仅仅是计算机设备50的示例,并不构成对计算机设备50的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如计算机设备还可以包括输入输出设备、网络接入设备、总线等。The computer device 50 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server. The computer device 50 may include but is not limited to a processor 51 and a memory 52. Those skilled in the art can understand that FIG. 5 is only an example of the computer device 50, and does not constitute a limitation on the computer device 50. It may include more or less components than those shown in the figure, or a combination of certain components, or different components. For example, computer equipment may also include input and output devices, network access devices, buses, and so on.

所称处理器51可以是中央处理单元(CentralProcessing Unit,CPU),还可以是其它通用处理器、数字信号处理器 (Digital Signal Processor,DSP)、专用集成电路 (Application Specific Integrated Circuit,ASIC)、现场可编程门阵列 (Field-Programmable Gate Array,FPGA) 或者其它可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called processor 51 may be a central processing unit (CentralProcessing Unit, CPU), it can also be other general-purpose processors, Digital Signal Processor (DSP), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.

存储器52可以是计算机设备50的内部存储单元,例如计算机设备50的硬盘或内存。存储器52也可以是计算机设备50的外部存储设备,例如计算机设备50上配备的插接式硬盘,智能存储卡(Smart Media Card, SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器52还可以既包括计算机设备50的内部存储单元也包括外部存储设备。存储器52用于存储计算机程序以及计算机设备所需的其它程序和数据。存储器52还可以用于暂时地存储已经输出或者将要输出的数据。The memory 52 may be an internal storage unit of the computer device 50, such as a hard disk or memory of the computer device 50. The memory 52 may also be an external storage device of the computer device 50, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), and a secure digital (Secure Digital,SD) card, flash card (Flash Card), etc. Further, the memory 52 may also include both an internal storage unit of the computer device 50 and an external storage device. The memory 52 is used to store computer programs and other programs and data required by the computer equipment. The memory 52 can also be used to temporarily store data that has been output or will be output.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of the description, the specific working process of the above-described system, device, and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.

作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional units.

上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能单元存储在一个存储介质中,包括若干指令用以使得一台计算机装置(可以是个人计算机,服务器,或者网络装置等)或处理器(Processor)执行本申请各个实施例方法的部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The above-mentioned integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The above-mentioned software functional unit is stored in a storage medium, and includes several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (Processor) execute part of the steps of the methods in the various embodiments of the present application . The aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code .

以上仅为本申请的较佳实施例而已,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。The above are only preferred embodiments of this application, and are not intended to limit this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included in the protection of this application. Within range.

Claims (20)

Translated fromChinese
一种用户界面测试方法,其中,所述方法包括:A user interface testing method, wherein the method includes:接收终端设备发送的测试请求,所述测试请求用于指示对待测试用户界面进行用户界面测试,所述测试请求包括所述待测试用户界面的标识;Receiving a test request sent by a terminal device, where the test request is used to instruct the user interface to be tested to perform a user interface test, and the test request includes the identifier of the user interface to be tested;根据所述待测试用户界面的标识获取所述待测试用户界面的源代码及配置文件,其中,所述配置文件为xml格式的结构化文件;Obtaining the source code and configuration file of the user interface to be tested according to the identifier of the user interface to be tested, wherein the configuration file is a structured file in xml format;根据所述待测试用户界面的源代码确定所述待测试用户界面中的各个页面元素以及生成用于表征所述各个页面元素之间逻辑关系的逻辑关系树;Determining, according to the source code of the user interface to be tested, each page element in the user interface to be tested and generating a logical relationship tree used to characterize the logical relationship between the various page elements;根据所述配置文件获取所述待测试用户界面的各个页面元素的静态位置信息,根据所述各个页面元素的静态位置信息及所述逻辑关系树生成元素树;Obtaining static location information of each page element of the user interface to be tested according to the configuration file, and generating an element tree according to the static location information of each page element and the logical relationship tree;对所述元素树进行深度遍历,生成与所述待测试用户界面对应的测量脚本;Traverse the element tree in depth, and generate a measurement script corresponding to the user interface to be tested;根据所述测量脚本,对所述待测试用户界面进行测量,生成并显示测量结果。According to the measurement script, the user interface to be tested is measured, and the measurement result is generated and displayed.根据权利要求1所述的用户界面测试方法,其中,所述根据所述配置文件获取所述待测试用户界面的各个页面元素的静态位置信息,包括:The user interface testing method according to claim 1, wherein the obtaining static position information of each page element of the user interface to be tested according to the configuration file comprises:调用Accessibility程序接口,根据每个所述页面元素的名称或者标识或者可扩展标记语言路径,从所述配置文件中查找到所述待测试用户界面中每个所述页面元素的静态位置信息。The Accessibility program interface is called, and the static location information of each page element in the user interface to be tested is found from the configuration file according to the name or identification of each page element or the extensible markup language path.根据权利要求2所述的方法,其中,所述根据各个所述页面元素的静态位置信息及所述逻辑关系树生成元素树,包括:The method according to claim 2, wherein said generating an element tree according to the static position information of each of the page elements and the logical relationship tree comprises:根据每个所述页面元素的标识,在所述逻辑关系树上查找到每个所述页面元素对应的节点,并将每个所述页面元素的静态位置信息添加至所述逻辑关系树中对应的节点内,以生成所述元素树,其中,所述逻辑关系树中包括多个与所述各个页面元素一一对应的节点,且每个所述节点的节点标识与所对应的页面元素的标识相同。According to the identifier of each page element, the node corresponding to each page element is found in the logical relationship tree, and the static position information of each page element is added to the logical relationship tree. To generate the element tree, wherein the logical relationship tree includes a plurality of nodes corresponding to each of the page elements one-to-one, and the node identifier of each node is associated with the corresponding page element The identity is the same.根据权利要求1-3任一项所述的用户界面测试方法,其中,所述对所述元素树进行深度遍历,生成与所述测量请求对应的测量脚本之前,所述方法还包括:The user interface testing method according to any one of claims 1 to 3, wherein before the deep traversal of the element tree and the generation of a measurement script corresponding to the measurement request, the method further comprises:建立动作模板库,所述动作模板库存储有多个执行脚本模板,每个所述执行脚本模板对应至少一个页面元素。An action template library is established, and the action template library stores a plurality of execution script templates, and each execution script template corresponds to at least one page element.根据权利要求4所述的用户界面测试方法,其中,所述对所述元素树进行深度遍历,生成与所述测量请求对应的测量脚本,包括:4. The user interface testing method according to claim 4, wherein the traversing the element tree in depth to generate a measurement script corresponding to the measurement request comprises:对所述元素树进行深度遍历,获取所述元素树中每个页面元素对应的静态位置信息及在所述动作模板库中提取所述元素树中每个页面元素对应的执行脚本模板;Traversing the element tree in depth, obtaining static location information corresponding to each page element in the element tree, and extracting the execution script template corresponding to each page element in the element tree from the action template library;将每个页面元素对应的静态位置信息按照预设规则添加至对应的执行脚本模板中,生成每个页面元素对应的元素级测试脚本;Add the static location information corresponding to each page element to the corresponding execution script template according to preset rules, and generate an element-level test script corresponding to each page element;根据对所述元素树中页面元素的遍历顺序,对所述元素树中各个页面元素的对应的元素级测试脚本进行合成,生成所述待测试用户界面对应的测量脚本。According to the traversal sequence of the page elements in the element tree, the corresponding element-level test scripts of each page element in the element tree are synthesized to generate a measurement script corresponding to the user interface to be tested.根据权利要求1所述的用户界面测试方法,其中,所述根据所述测量脚本,对所述待测试用户界面进行测量,生成并显示测量结果的步骤之后还包括:The user interface testing method according to claim 1, wherein the step of measuring the user interface to be tested according to the measurement script, and generating and displaying the measurement result further comprises:存储测试结果,并将测试脚本与待测试用户界面的标识建立关联关系。The test result is stored, and the test script is associated with the identification of the user interface to be tested.一种用户界面测试装置,其中,包括:A user interface testing device, which includes:接收模块,用于接收终端设备发送的测试请求,所述测试请求用于指示对待测试用户界面进行用户界面测试,所述测试请求包括所述待测试用户界面的标识;A receiving module, configured to receive a test request sent by a terminal device, where the test request is used to instruct a user interface to be tested to perform a user interface test, and the test request includes an identifier of the user interface to be tested;获取模块,用于根据所述待测试用户界面的标识获取所述待测试用户界面的源代码及配置文件,其中,所述配置文件为xml格式的结构化文件;An obtaining module, configured to obtain the source code and configuration file of the user interface to be tested according to the identifier of the user interface to be tested, wherein the configuration file is a structured file in xml format;第一生成模块,用于根据所述待测试用户界面的源代码确定所述待测试用户界面中的各个页面元素以及生成用于表征所述各个页面元素之间逻辑关系的逻辑关系树;The first generation module is configured to determine each page element in the user interface to be tested according to the source code of the user interface to be tested and to generate a logical relationship tree used to characterize the logical relationship between the various page elements;第二生成模块,用于根据所述配置文件获取所述待测试用户界面的各个页面元素的静态位置信息,根据所述各个页面元素的静态位置信息及所述逻辑关系树生成元素树;The second generating module is configured to obtain static position information of each page element of the user interface to be tested according to the configuration file, and generate an element tree according to the static position information of each page element and the logical relationship tree;第三生成模块,对所述元素树进行深度遍历,生成与所述待测试用户界面对应的测量脚本;及A third generation module, which traverses the element tree in depth, and generates a measurement script corresponding to the user interface to be tested; and测量模块,用于根据所述测量脚本,对所述待测试用户界面进行测量,生成并显示测量结果。The measurement module is used to measure the user interface to be tested according to the measurement script, and generate and display the measurement result.根据权利要求7所述的用户界面测试装置,其中,所述第二生成模块包括:8. The user interface testing device according to claim 7, wherein the second generating module comprises:定位单元,用于调用Accessibility程序接口,根据每个所述页面元素的名称或者标识或者可扩展标记语言路径,从所述配置文件中查找到与所述待测试用户界面的每个所述页面元素的静态位置信息。The positioning unit is used to call the Accessibility program interface, and find each of the page elements in the user interface to be tested from the configuration file according to the name or identification of each page element or the extensible markup language path Static location information.根据权利要求8所述的用户界面测试装置,其中,所述第二生成模块,还包括:8. The user interface testing device according to claim 8, wherein the second generating module further comprises:查找单元,用于根据每个所述页面元素的标识,在所述逻辑关系树上查找到每个所述页面元素对应的节点,并将每个所述页面元素的静态位置信息添加至所述逻辑关系树中对应的节点内,以生成所述元素树,其中,所述逻辑关系树中包括多个与所述各个页面元素一一对应的节点,且每个所述节点的节点标识与所对应的页面元素的标识相同。The searching unit is configured to find the node corresponding to each page element on the logical relationship tree according to the identifier of each page element, and add the static position information of each page element to the Within the corresponding node in the logical relationship tree to generate the element tree, wherein the logical relationship tree includes a plurality of nodes corresponding to each page element one-to-one, and the node identification of each node is The identifiers of the corresponding page elements are the same.一种存储介质,其中,所述存储介质包括存储的程序,其中,在所述程序运行时控制所述存储介质所在设备执行一种用户界面测试方法,其中所述户界面测试方法的步骤包括:A storage medium, wherein the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute a user interface testing method, wherein the steps of the user interface testing method include:接收终端设备发送的测试请求,所述测试请求用于指示对待测试用户界面进行用户界面测试,所述测试请求包括所述待测试用户界面的标识;Receiving a test request sent by a terminal device, where the test request is used to instruct the user interface to be tested to perform a user interface test, and the test request includes the identifier of the user interface to be tested;根据所述待测试用户界面的标识获取所述待测试用户界面的源代码及配置文件,其中,所述配置文件为xml格式的结构化文件;Obtaining the source code and configuration file of the user interface to be tested according to the identifier of the user interface to be tested, wherein the configuration file is a structured file in xml format;根据所述待测试用户界面的源代码确定所述待测试用户界面中的各个页面元素以及生成用于表征所述各个页面元素之间逻辑关系的逻辑关系树;Determining, according to the source code of the user interface to be tested, each page element in the user interface to be tested and generating a logical relationship tree used to characterize the logical relationship between the various page elements;根据所述配置文件获取所述待测试用户界面的各个页面元素的静态位置信息,根据所述各个页面元素的静态位置信息及所述逻辑关系树生成元素树;Obtaining static location information of each page element of the user interface to be tested according to the configuration file, and generating an element tree according to the static location information of each page element and the logical relationship tree;对所述元素树进行深度遍历,生成与所述待测试用户界面对应的测量脚本;Traverse the element tree in depth, and generate a measurement script corresponding to the user interface to be tested;根据所述测量脚本,对所述待测试用户界面进行测量,生成并显示测量结果。According to the measurement script, the user interface to be tested is measured, and the measurement result is generated and displayed.根据权利要求10所述的存储介质,其中,所述根据所述配置文件获取所述待测试用户界面的各个页面元素的静态位置信息,包括:11. The storage medium according to claim 10, wherein said obtaining static position information of each page element of the user interface to be tested according to the configuration file comprises:调用Accessibility程序接口,根据每个所述页面元素的名称或者标识或者可扩展标记语言路径,从所述配置文件中查找到所述待测试用户界面中每个所述页面元素的静态位置信息。The Accessibility program interface is called, and the static location information of each page element in the user interface to be tested is found from the configuration file according to the name or identification of each page element or the extensible markup language path.根据权利要求11所述的存储介质,其中,所述根据各个所述页面元素的静态位置信息及所述逻辑关系树生成元素树,包括:11. The storage medium according to claim 11, wherein said generating an element tree according to the static position information of each of the page elements and the logical relationship tree comprises:根据每个所述页面元素的标识,在所述逻辑关系树上查找到每个所述页面元素对应的节点,并将每个所述页面元素的静态位置信息添加至所述逻辑关系树中对应的节点内,以生成所述元素树,其中,所述逻辑关系树中包括多个与所述各个页面元素一一对应的节点,且每个所述节点的节点标识与所对应的页面元素的标识相同。According to the identifier of each page element, the node corresponding to each page element is found in the logical relationship tree, and the static position information of each page element is added to the logical relationship tree. To generate the element tree, wherein the logical relationship tree includes a plurality of nodes corresponding to each of the page elements one-to-one, and the node identifier of each of the nodes corresponds to the corresponding page element The identity is the same.根据权利要求10-12任一项所述的存储介质,其中,所述对所述元素树进行深度遍历,生成与所述测量请求对应的测量脚本之前,所述方法还包括:The storage medium according to any one of claims 10-12, wherein before the performing a deep traversal of the element tree and generating a measurement script corresponding to the measurement request, the method further comprises:建立动作模板库,所述动作模板库存储有多个执行脚本模板,每个所述执行脚本模板对应至少一个页面元素。An action template library is established, and the action template library stores a plurality of execution script templates, and each execution script template corresponds to at least one page element.根据权利要求13所述的存储介质,其中,所述对所述元素树进行深度遍历,生成与所述测量请求对应的测量脚本,包括:The storage medium according to claim 13, wherein said performing a deep traversal of said element tree to generate a measurement script corresponding to said measurement request comprises:对所述元素树进行深度遍历,获取所述元素树中每个页面元素对应的静态位置信息及在所述动作模板库中提取所述元素树中每个页面元素对应的执行脚本模板;Traversing the element tree in depth, obtaining static location information corresponding to each page element in the element tree, and extracting the execution script template corresponding to each page element in the element tree from the action template library;将每个页面元素对应的静态位置信息按照预设规则添加至对应的执行脚本模板中,生成每个页面元素对应的元素级测试脚本;Add the static location information corresponding to each page element to the corresponding execution script template according to preset rules, and generate an element-level test script corresponding to each page element;根据对所述元素树中页面元素的遍历顺序,对所述元素树中各个页面元素的对应的元素级测试脚本进行合成,生成所述待测试用户界面对应的测量脚本。According to the traversal sequence of the page elements in the element tree, the corresponding element-level test scripts of each page element in the element tree are synthesized to generate a measurement script corresponding to the user interface to be tested.根据权利要求10所述的存储介质,其中,所述根据所述测量脚本,对所述待测试用户界面进行测量,生成并显示测量结果的步骤之后还包括:11. The storage medium according to claim 10, wherein the step of measuring the user interface to be tested according to the measurement script, and generating and displaying the measurement result further comprises:存储测试结果,并将测试脚本与待测试用户界面的标识建立关联关系。The test result is stored, and the test script is associated with the identification of the user interface to be tested.一种计算机设备,包括存储器和处理器,所述存储器用于存储包括程序指令的信息,所述处理器用于控制程序指令的执行,其中:所述程序指令被处理器加载并执行时实现一种用户界面测试方法,其中,所述用户界面测试方法包括:A computer device, including a memory and a processor, the memory is used to store information including program instructions, the processor is used to control the execution of the program instructions, wherein: the program instructions are loaded and executed by the processor to achieve a The user interface testing method, wherein the user interface testing method includes:接收终端设备发送的测试请求,所述测试请求用于指示对待测试用户界面进行用户界面测试,所述测试请求包括所述待测试用户界面的标识;Receiving a test request sent by a terminal device, where the test request is used to instruct the user interface to be tested to perform a user interface test, and the test request includes the identifier of the user interface to be tested;根据所述待测试用户界面的标识获取所述待测试用户界面的源代码及配置文件,其中,所述配置文件为xml格式的结构化文件;Obtaining the source code and configuration file of the user interface to be tested according to the identifier of the user interface to be tested, wherein the configuration file is a structured file in xml format;根据所述待测试用户界面的源代码确定所述待测试用户界面中的各个页面元素以及生成用于表征所述各个页面元素之间逻辑关系的逻辑关系树;Determining, according to the source code of the user interface to be tested, each page element in the user interface to be tested and generating a logical relationship tree used to characterize the logical relationship between the various page elements;根据所述配置文件获取所述待测试用户界面的各个页面元素的静态位置信息,根据所述各个页面元素的静态位置信息及所述逻辑关系树生成元素树;Obtaining static location information of each page element of the user interface to be tested according to the configuration file, and generating an element tree according to the static location information of each page element and the logical relationship tree;对所述元素树进行深度遍历,生成与所述待测试用户界面对应的测量脚本;Traverse the element tree in depth, and generate a measurement script corresponding to the user interface to be tested;根据所述测量脚本,对所述待测试用户界面进行测量,生成并显示测量结果。According to the measurement script, the user interface to be tested is measured, and the measurement result is generated and displayed.根据权利要求16所述的计算机设备,其中,所述根据所述配置文件获取所述待测试用户界面的各个页面元素的静态位置信息,包括:The computer device according to claim 16, wherein said obtaining static position information of each page element of the user interface to be tested according to the configuration file comprises:调用Accessibility程序接口,根据每个所述页面元素的名称或者标识或者可扩展标记语言路径,从所述配置文件中查找到所述待测试用户界面中每个所述页面元素的静态位置信息。The Accessibility program interface is called, and the static location information of each page element in the user interface to be tested is found from the configuration file according to the name or identification of each page element or the extensible markup language path.根据权利要求17所述的计算机设备,其中,所述根据各个所述页面元素的静态位置信息及所述逻辑关系树生成元素树,包括:18. The computer device according to claim 17, wherein said generating an element tree according to the static position information of each of the page elements and the logical relationship tree comprises:根据每个所述页面元素的标识,在所述逻辑关系树上查找到每个所述页面元素对应的节点,并将每个所述页面元素的静态位置信息添加至所述逻辑关系树中对应的节点内,以生成所述元素树,其中,所述逻辑关系树中包括多个与所述各个页面元素一一对应的节点,且每个所述节点的节点标识与所对应的页面元素的标识相同。According to the identifier of each page element, the node corresponding to each page element is found in the logical relationship tree, and the static position information of each page element is added to the logical relationship tree. To generate the element tree, wherein the logical relationship tree includes a plurality of nodes corresponding to each of the page elements one-to-one, and the node identifier of each of the nodes corresponds to the corresponding page element The identity is the same.根据权利要求16-18任一项所述的计算机设备,其中,所述对所述元素树进行深度遍历,生成与所述测量请求对应的测量脚本之前,所述方法还包括:The computer device according to any one of claims 16-18, wherein before the performing a deep traversal of the element tree and generating a measurement script corresponding to the measurement request, the method further comprises:建立动作模板库,所述动作模板库存储有多个执行脚本模板,每个所述执行脚本模板对应至少一个页面元素。An action template library is established, and the action template library stores a plurality of execution script templates, and each execution script template corresponds to at least one page element.根据权利要求19所述的计算机设备,其中,所述对所述元素树进行深度遍历,生成与所述测量请求对应的测量脚本,包括:The computer device according to claim 19, wherein said performing a deep traversal of said element tree to generate a measurement script corresponding to said measurement request comprises:对所述元素树进行深度遍历,获取所述元素树中每个页面元素对应的静态位置信息及在所述动作模板库中提取所述元素树中每个页面元素对应的执行脚本模板;Traversing the element tree in depth, obtaining static location information corresponding to each page element in the element tree, and extracting the execution script template corresponding to each page element in the element tree from the action template library;将每个页面元素对应的静态位置信息按照预设规则添加至对应的执行脚本模板中,生成每个页面元素对应的元素级测试脚本;Add the static location information corresponding to each page element to the corresponding execution script template according to preset rules, and generate an element-level test script corresponding to each page element;根据对所述元素树中页面元素的遍历顺序,对所述元素树中各个页面元素的对应的元素级测试脚本进行合成,生成所述待测试用户界面对应的测量脚本。According to the traversal sequence of the page elements in the element tree, the corresponding element-level test scripts of each page element in the element tree are synthesized to generate a measurement script corresponding to the user interface to be tested.
PCT/CN2020/1189172020-03-162020-09-29User interface test method and apparatus, storage medium, and computer deviceCeasedWO2021184725A1 (en)

Applications Claiming Priority (2)

Application NumberPriority DateFiling DateTitle
CN202010183897.12020-03-16
CN202010183897.1ACN111552627A (en)2020-03-162020-03-16User interface testing method and device, storage medium and computer equipment

Publications (1)

Publication NumberPublication Date
WO2021184725A1true WO2021184725A1 (en)2021-09-23

Family

ID=71998099

Family Applications (1)

Application NumberTitlePriority DateFiling Date
PCT/CN2020/118917CeasedWO2021184725A1 (en)2020-03-162020-09-29User interface test method and apparatus, storage medium, and computer device

Country Status (2)

CountryLink
CN (1)CN111552627A (en)
WO (1)WO2021184725A1 (en)

Cited By (18)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113778905A (en)*2021-11-102021-12-10腾讯科技(深圳)有限公司UI design acceptance method, device, equipment and storage medium
CN113836037A (en)*2021-10-212021-12-24中国平安人寿保险股份有限公司Interface interaction test method, device, equipment and storage medium
CN113918460A (en)*2021-10-152022-01-11京东科技信息技术有限公司Page testing method, device, equipment and medium
CN114942889A (en)*2022-06-162022-08-26平安普惠企业管理有限公司Interface calling test method, device, equipment and storage medium
CN114968687A (en)*2022-06-092022-08-30腾讯科技(深圳)有限公司Traversal testing method, device, electronic equipment, program product and storage medium
CN115168193A (en)*2022-06-242022-10-11广州掌动智能科技有限公司Software performance testing and tuning system and control method thereof
CN115268719A (en)*2022-09-302022-11-01北京弘玑信息技术有限公司Method, medium and electronic device for positioning target element on interface
CN115809058A (en)*2022-12-092023-03-17深圳软牛科技有限公司 A method and related device for generating user interface frame logic tree
CN116048982A (en)*2023-01-032023-05-02深圳华为云计算技术有限公司 Page testing method, apparatus and cluster of computing devices
CN116094973A (en)*2023-03-062023-05-09深圳市华曦达科技股份有限公司Testing method and device for wide area network management protocol of user equipment
CN116149983A (en)*2022-11-172023-05-23中国人民财产保险股份有限公司 Script testing method, device, equipment and storage medium
CN116594916A (en)*2023-07-172023-08-15腾讯科技(深圳)有限公司Page control positioning method, device and storage medium
CN117407888A (en)*2023-12-142024-01-16远江盛邦(北京)网络安全科技股份有限公司Single-page application program page fuzzy test method and device and electronic equipment
CN118069538A (en)*2024-04-182024-05-24深圳市爱都科技有限公司User interface testing method and device, electronic equipment and medium
CN118170686A (en)*2024-05-132024-06-11浪潮通用软件有限公司Method, equipment and medium for generating UI (user interface) automatic test script
WO2024230503A1 (en)*2023-05-082024-11-14抖音视界有限公司Pop-up window processing method and apparatus, device, medium, and product
CN119415440A (en)*2025-01-072025-02-11天津大学 Application program testing method and device
CN119759353A (en)*2024-11-192025-04-04重庆赛力斯凤凰智创科技有限公司 A method, system, electronic device and storage medium for determining an automation script

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111552627A (en)*2020-03-162020-08-18平安科技(深圳)有限公司User interface testing method and device, storage medium and computer equipment
CN112000575A (en)*2020-08-212020-11-27探探文化发展(北京)有限公司Application interface display test method, system, equipment and storage medium
CN112214404A (en)*2020-09-272021-01-12航天信息股份有限公司 Test method, device, storage medium and electronic device for mobile application
CN112685308A (en)*2020-12-302021-04-20平安普惠企业管理有限公司Front-end code debugging method and device, computer equipment and computer storage medium
CN114712856A (en)*2021-01-052022-07-08北京字跳网络技术有限公司 Game scene object control method, apparatus, device and storage medium
CN113127354B (en)*2021-04-212023-08-11武汉思普崚技术有限公司Automatic test method, device, equipment and storage medium based on Web UI
CN113672518B (en)*2021-09-072024-06-18京东科技控股股份有限公司Test case construction method and related equipment
CN113568843A (en)*2021-09-182021-10-29深圳市明源云科技有限公司HTML element processing method and device and storage medium
CN113821437B (en)*2021-09-232024-06-11腾讯云计算(北京)有限责任公司Page test method, device, equipment and medium
CN114398263A (en)*2021-12-152022-04-26北京云测信息技术有限公司UI (user interface) testing method and device for WPF (Windows presentation Foundation) application program and electronic equipment
CN114416083A (en)*2021-12-302022-04-29北京五八信息技术有限公司Data processing method and device, electronic equipment and storage medium
CN114880233A (en)*2022-05-192022-08-09中国银行股份有限公司 Method and device for generating interface test case, storage medium and electronic device
CN115203616A (en)*2022-08-242022-10-18联想(北京)有限公司 Element positioning method and element positioning device
CN115687095A (en)*2022-10-132023-02-03超聚变数字技术有限公司Page testing method, device and equipment and computer readable storage medium
CN116306554A (en)*2023-03-212023-06-23上海中通吉网络技术有限公司Method, system, equipment and storage medium for contract quick initiation and test
CN117931652B (en)*2024-01-162024-09-10镁佳(北京)科技有限公司Automatic test script generation method and device, computer equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20120290920A1 (en)*2011-05-122012-11-15Peter CrossleyGraphical-user-interface-based method and system for designing and configuring web-site testing and analysis
CN106649100A (en)*2016-11-162017-05-10福建天晴数码有限公司Automatic test method and system
CN107861868A (en)*2017-10-312018-03-30郑州云海信息技术有限公司A kind of method and system for extracting automation test object
CN109471793A (en)*2018-09-292019-03-15天津大学 A deep learning-based web page automated testing defect location method
CN110297758A (en)*2019-05-202019-10-01深圳壹账通智能科技有限公司User interface automated testing method, device and computer readable storage medium
CN110781091A (en)*2019-10-312020-02-11北京奇艺世纪科技有限公司Application program testing method and device, electronic equipment and storage medium
CN111552627A (en)*2020-03-162020-08-18平安科技(深圳)有限公司User interface testing method and device, storage medium and computer equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US8522212B1 (en)*2010-07-212013-08-27Google Inc.Auto generation of test utility bots using compile time heuristics of user interface source code
CN103455414B (en)*2012-06-042017-08-01腾讯科技(深圳)有限公司Obtain the method and device of the logical place of control
CN103729285B (en)*2012-10-112018-06-05腾讯科技(深圳)有限公司A kind of webpage test method, equipment and system
CN109669873B (en)*2018-12-272022-06-21拉扎斯网络科技(上海)有限公司 User interface automatic testing method and device, electronic device and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20120290920A1 (en)*2011-05-122012-11-15Peter CrossleyGraphical-user-interface-based method and system for designing and configuring web-site testing and analysis
CN106649100A (en)*2016-11-162017-05-10福建天晴数码有限公司Automatic test method and system
CN107861868A (en)*2017-10-312018-03-30郑州云海信息技术有限公司A kind of method and system for extracting automation test object
CN109471793A (en)*2018-09-292019-03-15天津大学 A deep learning-based web page automated testing defect location method
CN110297758A (en)*2019-05-202019-10-01深圳壹账通智能科技有限公司User interface automated testing method, device and computer readable storage medium
CN110781091A (en)*2019-10-312020-02-11北京奇艺世纪科技有限公司Application program testing method and device, electronic equipment and storage medium
CN111552627A (en)*2020-03-162020-08-18平安科技(深圳)有限公司User interface testing method and device, storage medium and computer equipment

Cited By (26)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113918460A (en)*2021-10-152022-01-11京东科技信息技术有限公司Page testing method, device, equipment and medium
CN113836037A (en)*2021-10-212021-12-24中国平安人寿保险股份有限公司Interface interaction test method, device, equipment and storage medium
CN113836037B (en)*2021-10-212024-04-05中国平安人寿保险股份有限公司Interface interaction testing method, device, equipment and storage medium
CN113778905A (en)*2021-11-102021-12-10腾讯科技(深圳)有限公司UI design acceptance method, device, equipment and storage medium
CN113778905B (en)*2021-11-102022-02-08腾讯科技(深圳)有限公司UI design acceptance method, device, equipment and storage medium
CN114968687A (en)*2022-06-092022-08-30腾讯科技(深圳)有限公司Traversal testing method, device, electronic equipment, program product and storage medium
CN114968687B (en)*2022-06-092024-07-02腾讯科技(深圳)有限公司Traversal test method, apparatus, electronic device, program product, and storage medium
CN114942889A (en)*2022-06-162022-08-26平安普惠企业管理有限公司Interface calling test method, device, equipment and storage medium
CN115168193A (en)*2022-06-242022-10-11广州掌动智能科技有限公司Software performance testing and tuning system and control method thereof
CN115168193B (en)*2022-06-242023-02-24广州掌动智能科技有限公司Software performance testing and tuning system and control method thereof
CN115268719B (en)*2022-09-302022-12-20北京弘玑信息技术有限公司Method, medium and electronic device for positioning target element on interface
CN115268719A (en)*2022-09-302022-11-01北京弘玑信息技术有限公司Method, medium and electronic device for positioning target element on interface
CN116149983A (en)*2022-11-172023-05-23中国人民财产保险股份有限公司 Script testing method, device, equipment and storage medium
CN115809058A (en)*2022-12-092023-03-17深圳软牛科技有限公司 A method and related device for generating user interface frame logic tree
CN116048982A (en)*2023-01-032023-05-02深圳华为云计算技术有限公司 Page testing method, apparatus and cluster of computing devices
CN116094973A (en)*2023-03-062023-05-09深圳市华曦达科技股份有限公司Testing method and device for wide area network management protocol of user equipment
CN116094973B (en)*2023-03-062023-06-16深圳市华曦达科技股份有限公司Testing method and device for wide area network management protocol of user equipment
WO2024230503A1 (en)*2023-05-082024-11-14抖音视界有限公司Pop-up window processing method and apparatus, device, medium, and product
CN116594916B (en)*2023-07-172023-11-14腾讯科技(深圳)有限公司Page control positioning method, device and storage medium
CN116594916A (en)*2023-07-172023-08-15腾讯科技(深圳)有限公司Page control positioning method, device and storage medium
CN117407888A (en)*2023-12-142024-01-16远江盛邦(北京)网络安全科技股份有限公司Single-page application program page fuzzy test method and device and electronic equipment
CN117407888B (en)*2023-12-142024-03-15远江盛邦(北京)网络安全科技股份有限公司Single-page application program page fuzzy test method and device and electronic equipment
CN118069538A (en)*2024-04-182024-05-24深圳市爱都科技有限公司User interface testing method and device, electronic equipment and medium
CN118170686A (en)*2024-05-132024-06-11浪潮通用软件有限公司Method, equipment and medium for generating UI (user interface) automatic test script
CN119759353A (en)*2024-11-192025-04-04重庆赛力斯凤凰智创科技有限公司 A method, system, electronic device and storage medium for determining an automation script
CN119415440A (en)*2025-01-072025-02-11天津大学 Application program testing method and device

Also Published As

Publication numberPublication date
CN111552627A (en)2020-08-18

Similar Documents

PublicationPublication DateTitle
WO2021184725A1 (en)User interface test method and apparatus, storage medium, and computer device
US10705942B1 (en)Simulated testing of API
US10387292B2 (en)Determining application test results using screenshot metadata
US11797273B2 (en)System and method for enhancing component based development models with auto-wiring
CN110221968A (en)Method for testing software and Related product
CN111045653B (en)System generation method and device, computer readable medium and electronic equipment
CN111813385B (en) A web application-based page plug-in method, device and equipment
US10372760B2 (en)Building queries directed to objects hosted on clouds
CN117112060A (en) Component library construction method, device, electronic equipment and storage medium
CN112948264B (en)Method and device for executing test task, system, storage medium and electronic device
CN113448569A (en)Site page processing system, method, equipment and storage medium
WO2021013057A1 (en)Data management method and apparatus, and device and computer-readable storage medium
CN113778897A (en)Automatic test method, device, equipment and storage medium of interface
JP6505849B2 (en) Generation of element identifier
CN114048415A (en) Form generation method and apparatus, electronic device and computer-readable storage medium
CN116521285A (en)Application trial method and device, electronic equipment and storage medium
CN114579461A (en) Browser compatibility detection method and related equipment
CN114254232B (en) Cloud product page generation method, device, computer equipment and storage medium
WO2025036016A1 (en)Benefit information display method and electronic device
CN115033634B (en) Data collection method, device, electronic device and medium
CN115878699A (en)Method for processing Mock data of front-end equipment and front-end equipment
CN107562423A (en) UI page development method and device
CN113687881A (en)Metadata calling method and device, electronic equipment and storage medium
CN118626082A (en) Test material generation method, device, electronic device and computer readable medium
CN116820439A (en) Service interface generation method, device, equipment and storage medium

Legal Events

DateCodeTitleDescription
121Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number:20925182

Country of ref document:EP

Kind code of ref document:A1

NENPNon-entry into the national phase

Ref country code:DE

122Ep: pct application non-entry in european phase

Ref document number:20925182

Country of ref document:EP

Kind code of ref document:A1


[8]ページ先頭

©2009-2025 Movatter.jp