[go: up one dir, main page]

CN114443453A - Test data recording method, device, equipment and computer storage medium - Google Patents

Test data recording method, device, equipment and computer storage medium Download PDF

Info

Publication number
CN114443453A
CN114443453A CN202011187265.9A CN202011187265A CN114443453A CN 114443453 A CN114443453 A CN 114443453A CN 202011187265 A CN202011187265 A CN 202011187265A CN 114443453 A CN114443453 A CN 114443453A
Authority
CN
China
Prior art keywords
event
target
network processing
operation event
sequence information
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.)
Granted
Application number
CN202011187265.9A
Other languages
Chinese (zh)
Other versions
CN114443453B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202011187265.9A priority Critical patent/CN114443453B/en
Publication of CN114443453A publication Critical patent/CN114443453A/en
Application granted granted Critical
Publication of CN114443453B publication Critical patent/CN114443453B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Landscapes

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

Abstract

本申请提供一种测试数据录制方法、装置、设备及计算机存储介质,涉及计算机技术领域,用以提升录制用户界面自动化测试的测试数据的完整度。该方法包括:监控用户界面中,针对目标测试场景触发的各个目标操作事件,获得各个目标操作事件形成的操作事件序列信息;监控各个目标操作事件引发的网络处理事件,获得每个目标操作事件关联的各个网络处理事件形成的网络处理序列信息;将所述网络处理序列信息和所述操作事件序列信息进行第一关联处理,获得针对所述目标测试场景录制的测试数据。该方法在录制测试数据时,同时录制了目标操作事件的信息和与目标操作事件关联的网络处理事件的信息,提升了录制的测试数据的完整度。

Figure 202011187265

The present application provides a test data recording method, device, device and computer storage medium, which relate to the field of computer technology and are used to improve the integrity of the test data recorded for the automated test of the user interface. The method includes: in the monitoring user interface, for each target operation event triggered by the target test scene, obtaining operation event sequence information formed by each target operation event; monitoring network processing events triggered by each target operation event, and obtaining the correlation of each target operation event The network processing sequence information formed by each of the network processing events; the first correlation processing is performed on the network processing sequence information and the operation event sequence information to obtain test data recorded for the target test scene. When recording the test data, the method simultaneously records the information of the target operation event and the information of the network processing event associated with the target operation event, thereby improving the integrity of the recorded test data.

Figure 202011187265

Description

一种测试数据录制方法、装置、设备及计算机存储介质A test data recording method, device, equipment and computer storage medium

技术领域technical field

本申请涉及计算机技术领域,尤其涉及一种测试数据录制方法、装置、设备及计算机存储介质。The present application relates to the field of computer technology, and in particular, to a test data recording method, apparatus, device, and computer storage medium.

背景技术Background technique

相关技术在对用户界面进行自动化测试的过程中,通过录制用户界面中的用户操作的形式录制测试场景,进而后期在针对测试场景的回放过程中回放录制的用户操作,以达到对界面功能的测试,但该过程中仅录制用户界面中的用户操作为测试场景的测试数据,测试数据的录制精度低、完整度低,进而降低了基于录制的测试数据,对测试场景进行用户界面自动化测试的准确度。In the process of automated testing of the user interface, the test scene is recorded in the form of recording the user operation in the user interface, and then the recorded user operation is played back later in the playback process for the test scene, so as to test the interface function. , but in this process, only the user operations in the user interface are recorded as the test data of the test scene, and the recording accuracy and integrity of the test data are low, thus reducing the accuracy of the test scene based on the recorded test data and the accuracy of the user interface automatic test for the test scene. Spend.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供一种测试数据录制方法、装置、设备及计算机存储介质,用于提升录制用户界面自动化测试的测试数据的完整度,以提升用户界面自动化测试的准确度。Embodiments of the present application provide a test data recording method, apparatus, device, and computer storage medium, which are used to improve the integrity of test data recorded for automated user interface testing, so as to improve the accuracy of automated user interface testing.

本申请第一方面,提供一种测试数据录制方法,包括:A first aspect of the present application provides a test data recording method, comprising:

监控用户界面中,针对目标测试场景触发的各个目标操作事件,获得各个目标操作事件形成的操作事件序列信息;In the monitoring user interface, for each target operation event triggered by the target test scenario, obtain the operation event sequence information formed by each target operation event;

监控各个目标操作事件引发的网络处理事件,获得每个目标操作事件关联的各个网络处理事件形成的网络处理序列信息;Monitor network processing events triggered by each target operation event, and obtain network processing sequence information formed by each network processing event associated with each target operation event;

基于所述网络处理序列信息和所述操作事件序列信息,将各个网络处理事件和各个目标操作事件进行第一关联处理,获得针对所述目标测试场景录制的测试数据。Based on the network processing sequence information and the operation event sequence information, each network processing event and each target operation event are subjected to first correlation processing to obtain test data recorded for the target test scene.

本申请第二方面,提供一种测试数据录制装置,包括:A second aspect of the present application provides a test data recording device, comprising:

第一监控单元,用于监控用户界面中,针对目标测试场景触发的各个目标操作事件,获得各个目标操作事件形成的操作事件序列信息;a first monitoring unit, configured to monitor each target operation event triggered by the target test scene in the user interface, and obtain operation event sequence information formed by each target operation event;

第二监控单元,用于监控各个目标操作事件引发的网络处理事件,获得每个目标操作事件关联的各个网络处理事件形成的网络处理序列信息;A second monitoring unit, configured to monitor network processing events caused by each target operation event, and obtain network processing sequence information formed by each network processing event associated with each target operation event;

处理单元,用于基于所述网络处理序列信息和所述操作事件序列信息,将各个网络处理事件和各个目标操作事件进行第一关联处理,获得针对所述目标测试场景录制的测试数据。The processing unit is configured to perform first correlation processing on each network processing event and each target operation event based on the network processing sequence information and the operation event sequence information, and obtain test data recorded for the target test scene.

在一种可能的实现方式中,所述网络处理事件包括执行目标操作事件中触发的网络请求和根据所述网络请求返回的网络响应,所述网络处理描述信息包括:In a possible implementation manner, the network processing event includes a network request triggered in the execution target operation event and a network response returned according to the network request, and the network processing description information includes:

所述网络请求的请求数据;the request data of the network request;

所述网络反馈的反馈数据。Feedback data fed back by the network.

在一种可能的实现方式中,所述网络处理描述信息还包括如下至少一种信息:In a possible implementation manner, the network processing description information further includes at least one of the following information:

所述网络请求关联的网络地址信息,所述网络地址信息用于确定在所述目标测试场景的回放中接收所述网络请求的网络地址;network address information associated with the network request, where the network address information is used to determine a network address for receiving the network request during playback of the target test scenario;

所述网络请求的请求方式。The request mode of the network request.

在一种可能的实现方式中,所述目标测试场景包括针对目标网站的测试场景,所述第一监控单元还用于:In a possible implementation manner, the target test scenario includes a test scenario for a target website, and the first monitoring unit is further configured to:

监控用户界面中,针对目标测试场景触发的各个目标操作事件之前,将打开所述目标网站的操作事件确定为初始目标操作事件,获得所述初始目标操作事件形成的初始操作事件序列信息;In the monitoring user interface, before each target operation event triggered by the target test scenario, the operation event of opening the target website is determined as the initial target operation event, and the initial operation event sequence information formed by the initial target operation event is obtained;

监控所述初始目标操作事件引发的初始网络处理事件,获得所述初始目标操作事件关联的初始网络处理事件形成的初始网络处理序列信息;Monitoring the initial network processing event triggered by the initial target operation event, and obtaining initial network processing sequence information formed by the initial network processing event associated with the initial target operation event;

基于初始网络处理序列信息和所述初始网络处理序列信息,将所述初始网络处理事件和所述初始目标操作事件进行第三关联处理,获得针对所述目标测试场景录制的初始化数据;Based on the initial network processing sequence information and the initial network processing sequence information, a third association process is performed on the initial network processing event and the initial target operation event to obtain initialization data recorded for the target test scenario;

所述处理单元还用于在所述测试数据中添加所述初始化数据。The processing unit is further configured to add the initialization data to the test data.

本申请第三方面,提供一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现第一方面中任一所述的方法。In a third aspect of the present application, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any one of the first aspects when executing the program. method described.

本申请第四方面,提供一种计算机程序产品,该计算机程序产品包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述第一方面的各种可能的实现方式中提供的方法。In a fourth aspect of the present application, a computer program product is provided, the computer program product includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform the methods provided in the various possible implementations of the first aspect above.

本申请第五方面,提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机指令,当所述计算机指令在计算机上运行时,使得计算机执行如第一方面及任一种可能的实施方式中任一所述的方法。In a fifth aspect of the present application, a computer-readable storage medium is provided, where computer instructions are stored in the computer-readable storage medium, and when the computer instructions are executed on a computer, the computer can execute the first aspect and any one of the possibilities. The method of any one of the embodiments of .

由于本申请实施例采用上述技术方案,至少具有如下技术效果:Because the embodiment of the present application adopts the above technical solution, it has at least the following technical effects:

本申请实施例中在录制目标测试场景的测试数据时,不仅录制了目标操作事件的信息,还录制了目标操作事件关联的网络处理事件的信息,提升了录制测试数据的完整度,有利于分析和定位对目标测试场景进行测试回放时出现的问题,且本申请实施例中基于网络处理序列信息和操作事件序列信息,将目标操作事件和网络处理事件进行了关联,从而提升了录制的测试数据的准确度,进而提升了对目标测试场景进行自动化测试的准确度。In the embodiment of the present application, when recording the test data of the target test scene, not only the information of the target operation event, but also the information of the network processing event associated with the target operation event is recorded, which improves the integrity of the recorded test data and facilitates analysis. and locating the problem that occurs when the target test scene is tested and played back, and in the embodiment of the present application, the target operation event and the network processing event are associated based on the network processing sequence information and the operation event sequence information, thereby improving the recorded test data. This improves the accuracy of automated testing of target test scenarios.

附图说明Description of drawings

图1为本申请实施例提供的一种应用场景的示意图;FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present application;

图2为本申请实施例提供的一种测试数据录制的流程的示例图;FIG. 2 is an exemplary diagram of a process for recording test data provided by an embodiment of the present application;

图3为本申请实施例提供的一种目标测试场景的回放过程的示意图;3 is a schematic diagram of a playback process of a target test scenario provided by an embodiment of the present application;

图4为本申请实施例提供的另一种目标测试场景的回放过程的示意图;4 is a schematic diagram of a playback process of another target test scenario provided by an embodiment of the present application;

图5为本申请实施例提供的一种引入组件库AopTest的代码段的示意图;5 is a schematic diagram of a code segment introduced into a component library AopTest provided by an embodiment of the present application;

图6为本申请实施例提供的一种配置录制引擎的参数的代码段的示意图;6 is a schematic diagram of a code segment for configuring parameters of a recording engine provided by an embodiment of the present application;

图7为本申请实施例提供的一种对测试数据进行录制的过程中产生的日志的示意图;7 is a schematic diagram of a log generated in a process of recording test data according to an embodiment of the present application;

图8为本申请实施例提供的一种录制的多个目标操作事件的操作事件序列信息的示意图;8 is a schematic diagram of operation event sequence information of a plurality of recorded target operation events according to an embodiment of the present application;

图9为本申请实施例提供的一种录制的多个网络处理事件的网络处理序列信息的示意图;9 is a schematic diagram of a recorded network processing sequence information of multiple network processing events provided by an embodiment of the present application;

图10为本申请实施例提供的一种对测试数据进行录制的流程示意图;10 is a schematic flowchart of recording test data according to an embodiment of the present application;

图11为本申请实施例提供的一种测试数据录制装置的结构图;11 is a structural diagram of a test data recording device provided by an embodiment of the application;

图12为本申请实施例提供的一种终端设备的结构图。FIG. 12 is a structural diagram of a terminal device according to an embodiment of the application.

具体实施方式Detailed ways

为了更好的理解本申请实施例提供的技术方案,下面将结合说明书附图以及具体的实施方式进行详细的说明。In order to better understand the technical solutions provided by the embodiments of the present application, detailed descriptions will be given below with reference to the accompanying drawings and specific implementation manners.

为了便于本领域技术人员更好地理解本申请的技术方案,下面对本申请涉及的技术名词进行说明。In order to facilitate those skilled in the art to better understand the technical solutions of the present application, the technical terms involved in the present application are described below.

测试场景和目标测试场景:本申请实施例中的测试场景可以但不局限于与UI自动化测试中需要测试的产品或用户界面的功能对应,如可以但不局限于直接将产品或用户界面的一个或多个功能设置为一个测试场景;如可以但不局限于将账户登录功能、账户注册的功能、购买商品的功能、发布或编辑信息流(如可以但不局限于包括音频、视频或图文等)的功能、观看或编辑或发布媒体流(如可以但不局限于包括音频或视频等)的功能等设置为测试场景;目标测试场景为需要录制测试数据的测试场景。Test scenarios and target test scenarios: The test scenarios in the embodiments of the present application may, but are not limited to, correspond to the functions of the products or user interfaces that need to be tested in the UI automation test. or multiple functions are set as a test scenario; such as, but not limited to, the account login function, the account registration function, the function of purchasing goods, the publishing or editing information flow (such as including but not limited to audio, video or graphic text) etc.) functions, viewing or editing or publishing media streams (such as but not limited to including audio or video, etc.) are set as test scenarios; the target test scenarios are test scenarios that need to record test data.

操作事件和目标操作事件:本申请实施例中的操作事件可以但不局限于通过用户界面实现的各种类型的用户操作,如可以但不局限于包括点击事件、滑动事件、输入事件、截图事件等;目标操作事件是针对目标测试场景进行自动化测试时需要测试的操作事件。Operation events and target operation events: The operation events in the embodiments of the present application may be, but are not limited to, various types of user operations implemented through the user interface, such as but not limited to including click events, sliding events, input events, and screenshot events. etc.; the target operation event is the operation event that needs to be tested when automated testing is performed for the target test scenario.

网络处理事件:本申请实施例中的测试场景一般在用户侧的终端设备上进行录制,网络处理事件包括终端设备和服务器之间交互的各种网络处理,即包括终端设备根据目标操作事件向服务器发送的网络请求,也包括服务器基于网络请求反馈资源信息的网络反馈等。Network processing events: The test scenarios in the embodiments of the present application are generally recorded on the terminal device on the user side. The network processing events include various network processing interactions between the terminal device and the server, that is, the terminal device reports to the server according to the target operation event. The sent network request also includes network feedback that the server feeds back resource information based on the network request.

下面对本申请的设计思想进行说明。The design concept of the present application will be described below.

在各种自动化测试技术中,最接近用户需求的是与用户交互相关的用户界面(UserInterface,UI)自动化测试,UI自动化测试技术主要是以模拟手工操作的方式,实现自动化的界面功能操作,达到对界面功能的测试;相关技术中,会将测试场景中的用户操作录制为测试数据,进而基于录制的测试数据对测试场景中的用户操作进行回放,回放中只是将录制的测试数据中的用户操作重新执行一遍,其输入是一个个的脚本(即上述测试数据),由于整个过程是与服务器耦合的,一些包含网络处理事件的脚本则无法重复运行对应的用户操作,如可针对账户注册操作,由于该脚本中缺乏网络处理事件的信息,因此回放该脚本无法完成账户注册过程,因此如何提升录制的UI自动化测试的测试数据的完整度,是一个需要考虑的问题。Among various automated testing technologies, the user interface (UserInterface, UI) automated testing related to user interaction is the closest to the user's needs. Testing of interface functions; in the related art, the user operations in the test scene are recorded as test data, and then the user operations in the test scene are played back based on the recorded test data, and only the user operations in the recorded test data are played back. The operation is executed again, and its input is one script (that is, the above test data). Since the whole process is coupled with the server, some scripts containing network processing events cannot repeatedly run the corresponding user operations, such as account registration operations. , due to the lack of network processing event information in the script, the account registration process cannot be completed by replaying the script, so how to improve the integrity of the test data of the recorded UI automation test is a problem that needs to be considered.

鉴于此,发明人设计了一种测试数据录制的方法、装置、设备及计算机存储介质;考虑到在目标测试场景中执行一些用户操作可能引发网络处理事件,因此本申请实施例中在录制目标操作事件的信息的同时,录制执行目标操作事件引发的网络处理事件的信息,获得测试数据,以便后期基于测试数据,对目标测试场景中的目标操作事件和网络处理事件进行完整的回放。这样录制的测试数据中既包括用户侧的目标操作事件,也包括目标操作事件引发的各个网络处理事件,使得录制的测试数据更加完整,基于测试数据的测试回放过程更加清晰。另外为了提升后期基于测试数据对目标测试场景进行回放的准确度,本申请实施例中还基于目标操作事件的信息和网络处理事件的信息,将目标测试场景中各个网络处理事件和对应的目标操作事件进行关联处理。In view of this, the inventor has designed a method, device, device and computer storage medium for recording test data; considering that performing some user operations in the target test scenario may trigger network processing events, in the embodiment of the present application, the target operation is recorded in the At the same time as the information of the event, the information of the network processing event caused by the execution of the target operation event is recorded, and the test data is obtained, so that the target operation event and the network processing event in the target test scene can be fully played back based on the test data later. The recorded test data includes not only the target operation event on the user side, but also various network processing events triggered by the target operation event, so that the recorded test data is more complete and the test playback process based on the test data is clearer. In addition, in order to improve the accuracy of replaying the target test scene based on the test data in the later stage, in the embodiment of the present application, each network processing event in the target test scene and the corresponding target operation are further based on the information of the target operation event and the information of the network processing event. Events are correlated.

进一步地,考虑到现有技术中基于录制好的测试数据,只能从目标测试场景的第一个用户操作开始进行回放至最后一个用户操作,而不能从目标测试场景的中间的用户操作进行回放,申请人进一步设计还可以获取各个目标操作事件关联的数据信息,并将各个目标操作事件关联的数据信息与对应的目标操作事件进行关联处理,获得测试数据,进一步提升录制的测试数据的完整度,以便后期基于测试数据实现从目标测试场景的中间的目标操作事件开始进行回放,且利于分析和定位对目标测试场景进行测试回放时出现的问题;上述中间的目标操作事件为除目标测试场景中第一个执行的目标操作事件和最后一个执行的目标操作事件之外的目标操作事件。Further, considering that in the prior art, based on the recorded test data, playback can only be performed from the first user operation of the target test scene to the last user operation, and cannot be played back from the user operation in the middle of the target test scene. , the applicant further designs that it can also obtain the data information associated with each target operation event, and associate the data information associated with each target operation event with the corresponding target operation event to obtain test data and further improve the integrity of the recorded test data. , in order to realize the playback from the target operation event in the middle of the target test scene based on the test data in the later stage, and it is conducive to analyzing and locating the problems that occur when the target test scene is tested and played back; the above-mentioned middle target operation event is except the target test scene A target action event other than the first executed target action event and the last executed target action event.

为了更清楚地理解本申请的设计思路,以下结合附图对本申请实施例进行详细说明。In order to understand the design idea of the present application more clearly, the following describes the embodiments of the present application in detail with reference to the accompanying drawings.

为了更清楚地理解本申请的设计思路,为了更清楚地理解本申请的设计思路,以下提供一种应用场景,请参照图1,该应用场景中包括至少一个终端设备100和测试服务器200,终端设备100和测试服务器200之间可以通过网络进行通信,其中:In order to understand the design idea of the present application more clearly, an application scenario is provided below, please refer to FIG. 1 , the application scenario includes at least one terminal device 100 and a test server 200, the terminal Communication between the device 100 and the test server 200 can be performed through a network, wherein:

终端设备100(如可以但不局限于包括图中的100-1或100-2)中可以呈现目标测试场景中需要的用户界面,如可以但不局限于通过终端设备100上安装的客户端展示上述用户界面;终端设备100可以基于监控到的用户界面中针对目标测试场景触发的各个目标操作事件以及各个目标操作事件引发的网络处理事件,获得针对上述目标测试场景录制的测试数据。The terminal device 100 (such as, but not limited to, including 100-1 or 100-2 in the figure) can present the user interface required in the target test scenario, such as, but not limited to, can be displayed through the client installed on the terminal device 100 The above user interface; the terminal device 100 can obtain test data recorded for the above target test scene based on each target operation event triggered by the target test scene in the monitored user interface and the network processing event triggered by each target operation event.

作为一种实施例,终端设备100上可以安装用于录制测试数据的录制引擎,进而由上述录制引擎监控用户界面中针对目标测试场景触发的各个目标操作事件以及各个目标操作事件引发的网络处理事件,获得针对上述目标测试场景录制的测试数据。As an embodiment, a recording engine for recording test data may be installed on the terminal device 100, and then the recording engine monitors each target operation event triggered by the target test scene in the user interface and the network processing event triggered by each target operation event. , to obtain the test data recorded for the above target test scene.

进一步地,终端设备100可以根据录制的测试数据进行目标测试场景的回放,或者将测试数据发送给测试服务器200。Further, the terminal device 100 may play back the target test scene according to the recorded test data, or send the test data to the test server 200 .

测试服务器200可以接收终端设备100发送的测试数据,并根据接收的测试数据进行上述目标测试场景的回放;测试服务器200可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN、以及大数据和人工智能平台等基础云计算服务的多个云服务器(如可以但不局限于包括图中示意出的服务器200-1、服务器200-2或服务器200-3);上述测试服务器200的功能可以由一个或多个云服务器实现,还可以由一个或多个云服务器集群实现等。The test server 200 can receive the test data sent by the terminal device 100, and perform the playback of the above-mentioned target test scene according to the received test data; the test server 200 can be an independent physical server, or a server cluster or distribution composed of multiple physical servers. It can also provide basic cloud services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Multiple cloud servers for computing services (such as, but not limited to, including server 200-1, server 200-2, or server 200-3 shown in the figure); the functions of the above-mentioned test server 200 may be provided by one or more cloud servers It can also be implemented by one or more cloud server clusters, etc.

本申请实施例中的终端设备100可以是移动终端、固定终端或便携式终端,例如移动手机、站点、单元、设备、多媒体计算机、多媒体平板、互联网节点、通信器、台式计算机、膝上型计算机、笔记本计算机、上网本计算机、平板计算机、个人通信系统(PCS)设备、个人导航设备、个人数字助理(PDA)、音频/视频播放器、数码相机/摄像机、定位设备、电视接收器、无线电广播接收器、电子书设备、游戏设备或者其任意组合,包括这些设备的配件和外设或者其任意组合。The terminal device 100 in this embodiment of the present application may be a mobile terminal, a fixed terminal or a portable terminal, such as a mobile phone, a site, a unit, a device, a multimedia computer, a multimedia tablet, an Internet node, a communicator, a desktop computer, a laptop computer, Notebook Computers, Netbook Computers, Tablet Computers, Personal Communication System (PCS) Devices, Personal Navigation Devices, Personal Digital Assistants (PDAs), Audio/Video Players, Digital Cameras/Camcorders, Positioning Devices, TV Receivers, Radio Broadcast Receivers , e-book devices, gaming devices, or any combination thereof, including accessories and peripherals for these devices, or any combination thereof.

基于图1的应用场景,下面对本申请实施例中涉及的测试数据录制方法进行示例说明;请参照图2,表示本申请实施例设计的测试数据录制方法的流程的示意图,应用于上述终端设备100或安装在上述终端设备100上的录制引擎,该过程具体如下:Based on the application scenario of FIG. 1 , the test data recording method involved in the embodiment of the present application is illustrated below; please refer to FIG. 2 , which is a schematic diagram showing the flow of the test data recording method designed by the embodiment of the present application, which is applied to the above-mentioned terminal device 100 Or the recording engine installed on the above-mentioned terminal device 100, the process is as follows:

步骤S201,监控用户界面中,针对目标测试场景触发的各个目标操作事件,获得各个目标操作事件形成的操作事件序列信息。Step S201 , in the monitoring user interface, for each target operation event triggered by the target test scenario, obtain operation event sequence information formed by each target operation event.

作为一种实施例,考虑到为减少对监控到目标操作事件的正常的数据的影响,本申请实施例中可以通过面向切面编程(Aspect Oriented Programming,AOP)技术,获取各个目标操作事件形成的操作事件序列信息;具体地,可以但不局限于通过操作事件监控函数,监控用户界面中的目标操作事件,如可以将下述第一代码段中的resize()函数作为操作事件监控函数,监控window中的目标操作事件,上述AOP技术是通过预编译方式和运行期间动态代理实现程序功能的统一维护的一种技术。As an example, in order to reduce the impact on the normal data of the monitored target operation event, in this embodiment of the present application, an aspect-oriented programming (Aspect Oriented Programming, AOP) technology may be used to obtain the operation formed by each target operation event Event sequence information; specifically, it is possible, but not limited to, through the operation event monitoring function to monitor the target operation event in the user interface. For example, the resize() function in the following first code segment can be used as the operation event monitoring function to monitor the window The target operation event in the above AOP technology is a technology that realizes the unified maintenance of program functions through pre-compilation and dynamic agents during runtime.

第一代码段的示例:Example of the first code snippet:

Window.addEventListener(‘resize’,functiond()){Window.addEventListener('resize', functiond()){

This.getChartint().resize();This.getChartint().resize();

}}

作为一种实施例,目标测试场景有可能包括针对目标网站的测试场景,在针对目标网站的目标测试场景中,测试人员首先需要打开目标网站才能进行后续的目标操作事件,因此在录制针对目标网站的目标测试场景的测试数据时,在上述步骤S201之前,还可以录制打开目标网站的操作事件的信息,将打开目标网站的操作事件作为目标测试场景中的第一个目标操作事件。As an example, the target test scenario may include a test scenario for the target website. In the target test scenario for the target website, the tester first needs to open the target website to perform subsequent target operation events. Therefore, when recording the target website When the test data of the target test scene is obtained, before the above step S201, the information of the operation event of opening the target website can also be recorded, and the operation event of opening the target website can be regarded as the first target operation event in the target test scene.

具体地,可以将打开上述目标网站的操作事件确定为初始目标操作事件,获得上述初始目标操作事件形成的初始操作事件序列信息;监控上述初始目标操作事件引发的初始网络处理事件,获得上述初始目标操作事件关联的初始网络处理事件形成的初始网络处理序列信息;基于初始网络处理序列信息和上述初始网络处理序列信息,将上述初始网络处理事件和上述初始目标操作事件进行第三关联处理,获得针对上述目标测试场景录制的初始化数据;进而获得针对上述目标测试场景录制的测试数据时,在上述测试数据中添加上述初始化数据。Specifically, the operation event of opening the above-mentioned target website can be determined as the initial target operation event, and the initial operation event sequence information formed by the above-mentioned initial target operation event can be obtained; the initial network processing event caused by the above-mentioned initial target operation event can be monitored, and the above-mentioned initial target operation event can be obtained. The initial network processing sequence information formed by the initial network processing event associated with the operation event; based on the initial network processing sequence information and the above-mentioned initial network processing sequence information, the above-mentioned initial network processing event and the above-mentioned initial target operation event are subjected to a third correlation process, and the target operation event is obtained. The initialization data recorded in the above target test scene; and when further test data recorded for the above target test scene is obtained, the above initialization data is added to the above test data.

步骤S202,监控各个目标操作事件引发的网络处理事件,获得每个目标操作事件关联的各个网络处理事件形成的网络处理序列信息。Step S202: Monitor network processing events triggered by each target operation event, and obtain network processing sequence information formed by each network processing event associated with each target operation event.

作为一种实施例,考虑到为减少对监控到网络处理事件的正常处理过程的影响,本申请实施例中可以通过网络的AOP技术,通过AOP技术中的HOOK函数复制监控到的各个网络处理事件的相关信息,并对复制的各个网络处理事件的相关信息进行处理,获取各个网络处理事件形成的网络处理序列信息。As an embodiment, in order to reduce the impact on the normal processing process of the monitored network processing events, in this embodiment of the present application, each monitored network processing event may be replicated through the HOOK function of the network AOP technology and the AOP technology. The relevant information of each network processing event is processed, and the network processing sequence information formed by each network processing event is obtained.

步骤S203,基于上述网络处理序列信息和上述操作事件序列信息,将各个网络处理事件和各个目标操作事件进行第一关联处理,获得针对上述目标测试场景录制的测试数据。Step S203 , based on the network processing sequence information and the operation event sequence information, perform first correlation processing on each network processing event and each target operation event to obtain test data recorded for the target test scenario.

具体地,在进行第一关联处理后,针对目标测试场景录制的测试数据中包括如下数据:监控到的各个目标操作事件形成的操作事件序列信息,每个目标操作事件关联的各个网络处理事件形成的网络处理序列信息,以及各个网络处理事件和各个目标操作事件进行第一关联处理的第一关联结果。Specifically, after the first correlation processing is performed, the test data recorded for the target test scenario includes the following data: operation event sequence information formed by each target operation event monitored, and each network processing event associated with each target operation event formed by The network processing sequence information, and the first correlation result of the first correlation processing performed on each network processing event and each target operation event.

作为一种实施例,在步骤S203之后,可以根据实际的测试需求,将上述测试数据保存在本地或发送给测试服务器200,以使上述测试服务器200进行上述目标测试场景的回放;如若测试需求为在获取测试数据后的较短时间内进行UI自动化测试,则终端设备100可以将获取的测试数据保存在本地,并在触发UI自动化测试后,根据上述测试数据进行目标测试场景的回放;若测试需求为在获取测试数据后的长时间段内进行UI自动化测试,则终端设备100可以将测试数据发给测试服务器200,以使测试服务器200在接收到回放指示后,基于测试数据进行目标测试场景的回放。As an embodiment, after step S203, according to actual test requirements, the above test data can be stored locally or sent to the test server 200, so that the above test server 200 can play back the above target test scene; if the test requirements are If the UI automation test is performed in a relatively short period of time after acquiring the test data, the terminal device 100 may save the acquired test data locally, and after triggering the UI automation test, playback the target test scene according to the above test data; If the requirement is to perform the UI automation test within a long period of time after acquiring the test data, the terminal device 100 can send the test data to the test server 200, so that the test server 200 can perform the target test scenario based on the test data after receiving the playback instruction. playback.

以下对本申请实施例中的目标操作事件、操作事件序列信息、网络处理事件以及网络处理序列信息进行详细的说明。The target operation event, operation event sequence information, network processing event, and network processing sequence information in the embodiments of the present application are described in detail below.

(一)目标操作事件和操作事件序列信息(1) Target operation event and operation event sequence information

本申请实施例中的操作事件可以但不局限于包括通过用户界面实现的用户操作,目标操作事件则可以为对目标测试场景进行自动化测试时需要测试的操作事件;操作事件可以包括不同操作类型的操作,上述操作类型可以但不局限于包括点击操作、长按操作、滑动操作、输入操作、滚动操作、截图操作等。The operation events in the embodiments of the present application may include, but are not limited to, user operations implemented through a user interface, and the target operation events may be operation events that need to be tested during automated testing of the target test scenario; the operation events may include different operation types. Operation, the above operation types may include, but are not limited to, a click operation, a long press operation, a sliding operation, an input operation, a scroll operation, a screenshot operation, and the like.

作为一种实施例,为了提升对目标测试场景进行回放的准确度,本申请实施例中一个目标操作事件的操作事件序列信息,可以是描述该目标操作事件的具体操作内容以及描述该目标操作事件在目标测试场景中的执行顺序的信息;具体地,上述操作事件序列信息可以包括目标操作事件的事件执行顺序信息和事件描述信息,事件执行顺序信息用于表征目标操作事件在目标测试场景中的执行顺序,事件描述信息用于表征目标操作事件的具体操作内容。As an example, in order to improve the accuracy of playing back the target test scene, the operation event sequence information of a target operation event in this embodiment of the present application may be a description of the specific operation content of the target operation event and a description of the target operation event. Execution sequence information in the target test scene; specifically, the above-mentioned operation event sequence information may include event execution sequence information and event description information of the target operation event, and the event execution sequence information is used to represent the target operation event in the target test scene. Execution sequence, event description information is used to represent the specific operation content of the target operation event.

作为一种实施例,为了便捷快速地获取目标操作事件的事件执行顺序信息,本申请实施例中可以将目标操作事件的操作序列号作为上述事件执行顺序信息,操作序列号可以通过数字(如阿拉伯数字)、字母(如26个英文字母的大小写形式等)、标点符合(如可以但不局限于包括“?”、“,”、“。”或“!”等)或特殊符号(如可以但不局限于包括@、#、%、*或&等)等中的至少一种字符的形式表示;此处为便于理解,以表1中展示出的操作序列号的形式进行示例性的说明。As an example, in order to conveniently and quickly obtain the event execution sequence information of the target operation event, in this embodiment of the present application, the operation sequence number of the target operation event can be used as the above-mentioned event execution sequence information, and the operation sequence number can be passed through numbers (such as Arabic numbers), letters (such as upper and lower case forms of 26 English letters, etc.), punctuation (such as but not limited to including "?", ",", "." or "!", etc.) or special symbols (such as However, it is not limited to be expressed in the form of at least one character including @, #, %, * or &etc.); for ease of understanding here, an exemplary description is made in the form of the operation sequence numbers shown in Table 1 .

表1:不同形式表示的操作序列号Table 1: Operation Sequence Numbers Represented in Different Forms

Figure BDA0002751723470000101
Figure BDA0002751723470000101

上述表1中“1、2、3”为以数字形式表示的操作序列号,“A、AA和AAA”是以字母形式表示的操作序列号,“A1、A2和A3”是以字母和数字的形式标识的操作序列号,本领域的技术人员还可以基于实际需求,通过除表1之外的其它形式表示上述操作序列号。In the above table 1, "1, 2, 3" are the operation sequence numbers in the form of numbers, "A, AA and AAA" are the operation sequence numbers in the form of letters, and "A1, A2 and A3" are the letters and numbers. The operation sequence number identified in the form of , those skilled in the art can also express the above-mentioned operation sequence number in other forms than Table 1 based on actual requirements.

作为一种实施例,由于同一目标测试场景中不同目标操作事件的触发时间一般不同,因此为了快速便捷的获得目标操作事件的事件执行顺序信息,可以直接将目标操作事件的事件触发时间信息作为上述事件执行顺序信息,如可以但不局限于将表征目标操作事件的触发时间的时间戳作为事件执行顺序信息。As an example, since the triggering times of different target operation events in the same target test scenario are generally different, in order to obtain the event execution sequence information of the target operation event quickly and conveniently, the event trigger time information of the target operation event can be directly used as the above-mentioned For the event execution sequence information, for example, but not limited to, a timestamp representing the trigger time of the target operation event may be used as the event execution sequence information.

作为一种实施例,考虑到针对不同操作类型的目标操作事件而言,其操作者事件的具体内容不同,则本申请实施例中不同操作类型的目标操作事件的事件描述信息的具体内容可以不同;本申请实施例中事件描述信息可以但不局限于包括目标操作事件的操作类型和操作关键参数信息,以下以实际例子对事件描述信息进行示例说明:As an example, considering that the specific contents of the operator events are different for target operation events of different operation types, the specific contents of the event description information of the target operation events of different operation types in the embodiment of the present application may be different ; The event description information in the embodiment of the present application may, but is not limited to, include the operation type and operation key parameter information of the target operation event. The event description information is exemplified below with an actual example:

目标操作事件为点击操作时,会有对应的操作位置(终端设备100的显示屏坐标系下的坐标),则可以将操作位置作为上述操作关键参数信息,例如某一目标操作事件为测试人员点击了某一UI控件,点击位置的二维坐标为(100,200),则可以但不局限于将该目标操作事件的事件描述信息表示为Click:x=100&y=200,其中Click表示该目标操作事件的操作类型为点击操作,“x=100&y=200”表示操作关键参数为点击位置(100,200);目标操作事件为滑动事件时,会有对应的滑动开始位置、滑动结束位置、滑动路径信息和滑动距离等,则滑动操作的事件描述信息中的操作关键参数信息可以包括滑动开始位置和滑动结束位置,上述操作关键参数信息也可以包括滑动开始位置、滑动结束位置和滑动路径信息,上述操作关键参数信息还可以包括滑动开始位置、滑动路径信息等,本领域的技术人员可根据实际需求设置不同类型的目标操作事件的操作关键参数信息。When the target operation event is a click operation, there will be a corresponding operation position (coordinates in the coordinate system of the display screen of the terminal device 100), then the operation position can be used as the key parameter information of the above-mentioned operation, for example, a target operation event is clicked by the tester If a UI control is selected, and the two-dimensional coordinates of the click position are (100, 200), the event description information of the target operation event can be represented as Click: x=100&y=200, where Click represents the target operation The operation type of the event is click operation, "x=100&y=200" means that the key parameter of the operation is the click position (100, 200); when the target operation event is a sliding event, there will be corresponding sliding start position, sliding end position, and sliding path information and sliding distance, etc., the operation key parameter information in the event description information of the sliding operation may include the sliding start position and the sliding end position, and the above-mentioned key operation parameter information may also include the sliding start position, the sliding end position and the sliding path information. The key operation parameter information may also include sliding start position, sliding path information, etc. Those skilled in the art can set the key operation parameter information of different types of target operation events according to actual requirements.

需要说明的是,目标操作事件可能有相应的操作对象,也可能没有相应的操作对象,若目标操作事件有相应的操作对象,则可以将操作对象也记录到上述事件描述信息中。It should be noted that the target operation event may or may not have a corresponding operation object. If the target operation event has a corresponding operation object, the operation object may also be recorded in the above event description information.

(二)网络处理事件和网络处理序列信息(2) Network processing events and network processing sequence information

为了提升对目标测试场景中的网络处理事件进行回放的准确度,本申请实施例中一个网络请求处理的网络处理序列信息,可以是描述该网络处理事件的具体网络处理内容以及描述该网络处理事件在目标测试场景中的执行顺序的信息;具体地,上述网络处理序列信息可以但不局限于包括网络处理事件的网络处理执行顺序信息和网络处理描述信息,网络处理执行顺序信息用于表征网络处理事件在目标测试场景中的执行顺序,或网络处理执行顺序信息用于表征一个网络处理事件在该网络处理事件关联的目标操作事件中的执行顺序,上述网络处理描述信息用于表征网络处理事件的具体网络处理内容。In order to improve the accuracy of replaying the network processing event in the target test scenario, the network processing sequence information of a network request processing in this embodiment of the present application may be the specific network processing content describing the network processing event and the network processing event describing the network processing event. Execution sequence information in the target test scenario; specifically, the above-mentioned network processing sequence information may include, but is not limited to, network processing execution sequence information and network processing description information including network processing events, and the network processing execution sequence information is used to represent network processing. The execution sequence of events in the target test scenario, or the network processing execution sequence information is used to represent the execution sequence of a network processing event in the target operation event associated with the network processing event, and the above network processing description information is used to represent the network processing event. Specific network processing content.

作为一种实施例,网络处理执行顺序信息可以是网络处理事件的网络处理序列号,网络处理序列号可以通过数字(如阿拉伯数字)、字母(如26个英文字母的大小写形式等)、标点符合(如可以但不局限于包括“?”、“,”、“。”或“!”等)或特殊符号(如可以但不局限于包括@、#、%、*或&等)等中的至少一种字符的形式表示,此处不做过多限定,本领域的技术人员可根据实际需求设置。As an example, the network processing execution sequence information may be the network processing sequence number of the network processing event, and the network processing sequence number may be composed of numbers (such as Arabic numerals), letters (such as upper and lower case forms of 26 English letters, etc.), punctuation Conforms (such as can include but not limited to "?", ",", "." or "!", etc.) or special symbols (such as can include but not limited to @, #, %, * or &, etc.), etc. is represented in the form of at least one character, which is not limited here, and can be set by those skilled in the art according to actual needs.

作为一种实施例,由于同一目标测试场景中不同网络处理事件的触发时间一般不同,同一个目标操作事件引发的多个网络处理事件中各个网络处理事件的触发时间一般也不同,因此为了快速便捷的获得网络处理事件的网络处理执行顺序信息,可以直接将网络处理事件的请求触发时间信息确定为上述网络处理执行顺序信息,如可以但不局限于将表征网络处理事件的触发时间的时间戳作为网络处理执行顺序信息。As an example, since the triggering time of different network processing events in the same target test scenario is generally different, the triggering time of each network processing event among the multiple network processing events triggered by the same target operation event is generally different. To obtain the network processing execution sequence information of the network processing event, the request trigger time information of the network processing event can be directly determined as the above-mentioned network processing execution sequence information, such as, but not limited to, the time stamp representing the trigger time of the network processing event can be used as Network processing execution order information.

作为一种实施例,为了完整的录制与目标操作事件相关的网络处理的信息,本申请实施例中的网络处理事件可以但不局限于包括执行目标操作事件的过程中触发的网络请求和根据上述网络请求返回的网络响应,故而上述网络请求处理的网络处理描述信息中可以包括网络请求的请求数据和上述网络反馈的反馈数据。As an embodiment, in order to completely record the network processing information related to the target operation event, the network processing event in this embodiment of the present application may include, but is not limited to, a network request triggered in the process of executing the target operation event and a The network response returned by the network request, so the network processing description information of the network request processing may include the request data of the network request and the feedback data fed back by the network.

作为一种实施例,为了提升录制的网络处理事件的信息的完整度,本申请实施例中的网络处理描述信息还可以包括如下至少一种信息:As an embodiment, in order to improve the completeness of the recorded network processing event information, the network processing description information in this embodiment of the present application may further include at least one of the following information:

上述网络请求关联的网络地址信息,上述网络地址信息用于确定在上述目标测试场景的回放中接收上述网络请求的网络地址;The network address information associated with the above-mentioned network request, the above-mentioned network address information is used to determine the network address for receiving the above-mentioned network request in the playback of the above-mentioned target test scenario;

上述网络请求的请求方式,该请求方式可以但不局限于包括post请求方式或get请求方式等。The request method of the above network request, the request method may include, but is not limited to, a post request method or a get request method.

作为一种实施例,基于上述内容介绍的目标操作事件、操作事件序列信息、网络处理事件以及网络处理序列信息,在上述步骤S203中进行第一关联处理时,若操作事件序列信息中包括目标操作事件的事件标识,网络处理序列信息中包括网络处理事件的网络处理标识,则可以根据各个操作事件序列信息中各个目标操作事件的事件标识,以及各个网络处理事件序列中各个网络处理事件的网络处理标识,将各个目标操作事件与各个网络处理事件进行关联处理。As an embodiment, based on the target operation event, the operation event sequence information, the network processing event, and the network processing sequence information introduced in the above content, when the first correlation processing is performed in the above step S203, if the operation event sequence information includes the target operation The event identifier of the event, the network processing sequence information includes the network processing identifier of the network processing event, then the event identifier of each target operation event in each operation event sequence information, and the network processing event of each network processing event sequence in each network processing event sequence can be used. The identifier is used to associate each target operation event with each network processing event.

具体地,可以将一个网络处理事件的网络处理标识和引发该网络处理事件的事件标识进行关联处理,上述事件标识可以是上述目标操作事件的事件执行顺序信息或事件触发时间信息,事件标识还可以为其它能标识目标操作事件的信息,上述网络处理标识可以是上述网络处理事件的网络处理执行顺序信息或请求触发时间信息,网络处理标识或其它能标识网络处理事件的信息;如可以但不局限于根据各个目标操作事件的事件执行顺序信息,以及各个网络处理事件的网络处理执行顺序信息,将各个目标操作事件与各个网络处理事件进行关联处理。Specifically, a network processing identifier of a network processing event and an event identifier that triggers the network processing event can be associated and processed. The event identifier can be event execution sequence information or event trigger time information of the target operation event, and the event identifier can also be For other information that identifies the target operation event, the above-mentioned network processing identifier may be the network processing execution sequence information or request trigger time information of the above-mentioned network processing event, the network processing identifier or other information that identifies the network processing event; if possible but not limited to Each target operation event is associated with each network processing event according to the event execution sequence information of each target operation event and the network processing execution sequence information of each network processing event.

在一些实施例中,可以根据触发关系将各个目标操作事件与各个网络处理事件进行关联处理,例如当目标操作事件是触发数据包发送事件的点击操作时,网络处理事件可以是数据包发送事件,此时可以将该目标操作时间与数据包发送事件关联起来。可以根据目标操作事件和网络处理事件的发生时间将两者关联起来,例如当目标操作事件和网络处理事件的发生时间之间的差值小于阈值时将两者关联起来,或者,目标操作事件和网络处理事件执行顺序将各个目标操作事件与各个网络处理事件进行关联处理。根据目标操作事件和网络处理事件的发生时间进行关联处理速度快,消耗存储和计算能力少,测试录制过程占用资源较少。在一些实施例中,为了进一步提高各个目标操作事件与各个网络处理事件进行关联处理的准确性,可以预先存储有会触发网络处理事件的目标操作事件类型,在根据目标操作事件和网络处理事件的发生时间进行关联时可以根据预先存储的目标操作事件类型筛选出会触发网络处理事件的目标操作事件,并且将筛选出的目标操作事件和网络处理事件进行关联,通过这种方式可以进一步提高目标操作事件和网络处理事件进行关联的准确度。可以理解,将各个目标操作事件关联的数据信息与各个目标操作事件进行第二关联处理时也可以与上述实施例中的目标操作事件和网络处理事件进行第一关联相同的方式进行,并且具有类似的技术效果,在此不再赘述。In some embodiments, each target operation event can be associated with each network processing event according to the trigger relationship. For example, when the target operation event is a click operation that triggers a data packet sending event, the network processing event can be a data packet sending event, At this point, the target operation time can be correlated with the packet send event. The two can be correlated based on the occurrence time of the target operation event and the network processing event, for example, when the difference between the occurrence time of the target operation event and the network processing event is less than a threshold, or the target operation event and the network processing event can be correlated. The network processing event execution sequence associates each target operation event with each network processing event. Correlation processing based on the occurrence time of target operation events and network processing events is fast, consumes less storage and computing power, and occupies less resources during the test recording process. In some embodiments, in order to further improve the accuracy of the correlation processing between each target operation event and each network processing event, the target operation event type that will trigger the network processing event may be pre-stored. When the occurrence time is correlated, the target operation event that will trigger the network processing event can be filtered out according to the pre-stored target operation event type, and the filtered target operation event and the network processing event can be correlated. In this way, the target operation can be further improved. The accuracy with which events are correlated with network processing events. It can be understood that the second association processing between the data information associated with each target operation event and each target operation event can also be performed in the same way as the first association between the target operation event and the network processing event in the above-mentioned embodiment, and has a similar method. The technical effect will not be repeated here.

作为一种实施例,上述步骤S203中,获得针对上述目标测试场景录制的测试数据之前,还可以获取各个目标操作事件关联的数据信息;并基于上述操作事件序列信息,将各个目标操作事件关联的数据信息与各个目标操作事件进行第二关联处理。As an embodiment, in the above-mentioned step S203, before obtaining the test data recorded for the above-mentioned target test scenario, data information associated with each target operation event may also be obtained; and based on the above-mentioned operation event sequence information, each target operation event is associated. The second association processing is performed on the data information and each target operation event.

上述一个目标操作事件关联的数据信息可以但不局限于包括:在目标测试场景中执行上述目标操作事件之前,目标测试场景中各操作事件访问的数据、新增的数据或修改的数据等。The data information associated with the above-mentioned one target operation event may include, but is not limited to, data accessed by each operation event in the target test scene, newly added data or modified data, etc. before the above-mentioned target operation event is executed in the target test scene.

即本申请实施例在进行第二关联处理后,针对目标测试场景录制的测试数据中包括如下数据:监控到的各个目标操作事件形成的操作事件序列信息,每个目标操作事件关联的各个网络处理事件形成的网络处理序列信息,各个网络处理事件和各个目标操作事件进行第一关联处理的第一关联结果,各个目标操作事件关联的数据信息,以及各个目标操作事件关联的数据信息与各个目标操作事件进行第二关联处理的第二关联结果。That is, after the second correlation processing is performed in this embodiment of the present application, the test data recorded for the target test scenario includes the following data: operation event sequence information formed by each monitored target operation event, and each network processing associated with each target operation event. The network processing sequence information formed by the event, the first correlation result of the first correlation processing between each network processing event and each target operation event, the data information associated with each target operation event, and the data information associated with each target operation event and each target operation The event performs the second correlation result of the second correlation process.

作为一种实施例,基于上述内容介绍的目标操作事件、操作事件序列信息、网络处理事件以及网络处理序列信息,在进行第二关联处理时,若操作事件序列信息中包括事件标识,则针对一个目标操作事件而言,可以将该目标操作事件关联的数据信息与该目标操作事件的事件标识进行关联处理;上述事件标识可以但不局限于是该目标操作事件的事件执行顺序信息或事件触发时间信息等。As an embodiment, based on the target operation event, operation event sequence information, network processing event, and network processing sequence information introduced in the above content, when performing the second correlation processing, if the operation event sequence information includes an event identifier, the operation event sequence information includes an event identifier. For the target operation event, the data information associated with the target operation event can be associated with the event identifier of the target operation event; the above-mentioned event identifier can be, but not limited to, the event execution sequence information or event trigger time information of the target operation event. Wait.

本申请实施例中获取的测试数据,可以用于对目标测试场景进行回放,请参见图3,以下提供一种根据测试数据进行目标测试场景的回放过程的示例,该回放过程具体包括:The test data obtained in the embodiment of the present application can be used to play back the target test scene. Referring to FIG. 3 , an example of the playback process of the target test scene according to the test data is provided below. The playback process specifically includes:

步骤S301,基于目标测试场景的测试数据中各个目标操作事件的事件执行顺序信息,确定上述各个目标操作事件的第一播放顺序。Step S301 , based on the event execution sequence information of each target operation event in the test data of the target test scene, determine the first play sequence of each of the above-mentioned target operation events.

步骤S302,基于各个目标操作事件的事件描述信息,按照第一播放顺序播放上述各个目标操作事件。Step S302, based on the event description information of each target operation event, play each of the above-mentioned target operation events according to the first playback order.

在步骤S302中,上述各个目标操作事件中的任意的一个目标操作事件的播放过程如下:In step S302, the playback process of any one of the above target operation events is as follows:

步骤S303,基于测试数据中的第一关联结果,确定该目标操作事件引发的各个网络处理事件。Step S303: Determine each network processing event triggered by the target operation event based on the first correlation result in the test data.

步骤S304,基于该目标操作事件引发的各个网络处理事件的网络处理执行顺序,确定该目标操作事件引发的各个网络处理事件的第二播放顺序。Step S304 , based on the network processing execution sequence of each network processing event triggered by the target operation event, determine a second playing sequence of each network processing event triggered by the target operation event.

步骤S305,基于该目标操作事件引发的各个网络处理事件的网络处理描述信息,按照第二播放顺序播放该目标操作事件引发的各个网络处理事件。Step S305 , based on the network processing description information of each network processing event triggered by the target operation event, play each network processing event triggered by the target operation event according to the second playback order.

请参见图4,以下提供另一种根据测试数据进行目标测试场景的回放过程的示例,该回放过程具体包括如下步骤:Referring to FIG. 4, another example of the playback process of the target test scene according to the test data is provided below. The playback process specifically includes the following steps:

步骤S401,接收测试人员触发的回放指令,该回放指令是针对目标测试场景中的目标操作事件触发的。Step S401: Receive a playback instruction triggered by a tester, where the playback instruction is triggered for a target operation event in a target test scene.

步骤S402,基于目标测试场景的目标测试数据中的第二关联结果,获取与回放指令指示的目标操作事件关联的数据信息。Step S402: Acquire data information associated with the target operation event indicated by the playback instruction based on the second association result in the target test data of the target test scene.

步骤S403,播放与回放指令指示的目标操作事件关联的数据信息,并监控与回放指令指示的目标操作事件。Step S403: Play the data information associated with the target operation event indicated by the playback instruction, and monitor the target operation event indicated by the playback instruction.

应当说明的是,上述两种回放过程可以应用于上述终端设备100,也可以应用于测试服务器200,且上述两种回放过程仅为示例性说明,本领域的技术人员可基于获得的测试数据,灵活的设置对目标测试场景进行回放的具体方式。It should be noted that the above-mentioned two playback processes can be applied to the above-mentioned terminal device 100, and can also be applied to the test server 200, and the above-mentioned two playback processes are only exemplary descriptions, and those skilled in the art can, based on the obtained test data, Flexibly set the specific way to play back the target test scene.

本申请实施例以下内容提供一个测试数据录制的具体示例。The following content of the embodiment of the present application provides a specific example of test data recording.

该示例中通过安装在终端设备100上的录制引擎进行针对目标测试场景的测试数据的录制,该录制引擎可以但不局限于用于所有网站服务类(又称web服务类)的UI自动化测试的录制流程中,可以将用户行为触发的目标操作事件完整的录制下来。In this example, the recording engine installed on the terminal device 100 is used to record the test data for the target test scenario. During the recording process, the target operation events triggered by user behaviors can be completely recorded.

在通过上述录制引擎录制针对目标测试场景的测试数据之前,需要对录制引擎和提供目标网站的网络服务进行配置,主要包括如下几个方面的配置:Before recording the test data for the target test scenario through the above recording engine, it is necessary to configure the recording engine and the network service that provides the target website, mainly including the following aspects:

第一方面的配置:将网站服务引入录制引擎:Configuration of the first aspect: Introducing the website service to the recording engine:

可以在目标网站的入口文件(即目标网站的首页文件)中引入AOP技术的组件库,如目标网站的网页是以javascript编程语言实现时,可以在首次打开目标网站的第一个页面的入口文件index.js中,引入组件库AopTest(即上述AOP技术的组件库),并该组件库AopTest放置于最先初始化的地方;具体地,请参见图5,可以但不局限于在index.js文件中通过图中的“import AopTest from’./AopTest/aop’;”的代码字段,引入上述组件库AopTest,并通过图中ReactDOM.render()方法中的<AopTest/>实现组件库AopTest的调用。The component library of AOP technology can be introduced into the entry file of the target website (that is, the homepage file of the target website). For example, when the webpage of the target website is implemented in javascript programming language, the entry file of the first page of the target website can be opened for the first time. In index.js, the component library AopTest (that is, the component library of the above-mentioned AOP technology) is introduced, and the component library AopTest is placed in the first initialization place; specifically, see Figure 5, which can be but not limited to the index.js file Through the code field of "import AopTest from'./AopTest/aop';" in the figure, the above-mentioned component library AopTest is introduced, and the component library AopTest is called through <AopTest/> in the ReactDOM.render() method in the figure. .

第二方面的配置:配置录制引擎Configuration of the second aspect: configure the recording engine

本申请实施例中主要对录制引擎的特性及功能等参数进行配置,请参见图6,主要配置的录制引擎的参数可以但不局限于包括如下几个:In the embodiment of the present application, parameters such as the characteristics and functions of the recording engine are mainly configured, please refer to FIG. 6 , the parameters of the recording engine that are mainly configured may include, but are not limited to, the following:

网络地址参数url(Uniform Resource Location,统一资源定位符):又称为网络地址,即接收终端设备100发送的测试数据的测试服务器200的网络地址,测试服务器200主要用于接收终端设备100发送的测试数据并将测试数据存储至数据库。Network address parameter url (Uniform Resource Location, Uniform Resource Locator): also known as network address, that is, the network address of the test server 200 that receives the test data sent by the terminal device 100 , and the test server 200 is mainly used to receive the data sent by the terminal device 100 Test data and store test data to database.

产品参数product:用于区分不同的产品,product的参数值可以是目标测试场景对应的产品的产品名称或产品编号等。Product parameter product: used to distinguish different products, the parameter value of product can be the product name or product number of the product corresponding to the target test scenario.

测试场景参数scene:本次录制的目标测试场景的名称,该名称可以但不局限于是该目标测试场景需实现的功能,如可以但不局限于是账户登录、购买商品等功能。Test scene parameter scene: The name of the target test scene recorded this time, the name can be but not limited to the functions to be implemented in the target test scene, such as account login, purchase of goods and other functions.

存储表参数table_info:上述测试服务器200中用于存储测试数据的表的名称;测试服务器200将接收的测试数据存储至名为“table_info”的表中。Storage table parameter table_info: the name of the table used to store the test data in the test server 200; the test server 200 stores the received test data in a table named "table_info".

初始目标操作事件参数init_event_id:首次打开目标网站的初始目标操作事件的事件标识,初始目标操作事件的事件标识可以但不局限于为初始目标操作事件的事件执行顺序信息或事件触发时间信息等,init_event_id用于将初始目标操作事件和其它的目标操作事件进行区分,来达到模拟首次打开目标网站的操作事件,最终完成网络处理流关联。Initial target operation event parameter init_event_id: the event identifier of the initial target operation event when the target website is opened for the first time, the event identifier of the initial target operation event can be but not limited to the event execution sequence information or event trigger time information of the initial target operation event, etc., init_event_id It is used to distinguish the initial target operation event from other target operation events, so as to simulate the operation event of opening the target website for the first time, and finally complete the network processing flow association.

第三方面的配置:启动目标网站的网络服务Configuration of the third aspect: start the network service of the target website

即可以但不局限于包括启动为目标网站提供服务的服务器,保证网络通信环境可用等。That is, it may include, but is not limited to, starting a server that provides services for the target website, ensuring that the network communication environment is available, and the like.

在进行完上面第一方面至第三方面的配置后,即可以利用录制引擎获取目标测试场景的测试数据;其中在对测试数据进行录制的过程中会产生如图7所示的日志,该日志可以在浏览器如chrome中的console中查看,若该日志没有报错,则说明录制成功。After the configuration of the first to third aspects above, the recording engine can be used to obtain the test data of the target test scene; the log as shown in Figure 7 will be generated during the recording of the test data. You can view it in the console of a browser such as chrome. If the log does not report an error, the recording is successful.

录制引擎获取测试数据后,会通过配置的url、table_info等信息,将测试数据发送给对应的测试服务器200,其中为便于理解,此处给出一个操作事件流(即录制的多个目标操作事件的操作事件序列信息)的示例,请参见图8,从左之后的每列,依次表示目标操作事件的事件标识(此处以目标操作事件的时间戳作为事件标识为例进行说明)、目标测试场景对应的产品的产品名称、目标测试场景的测试场景名称以及目标操作事件的事件描述信息。After the recording engine obtains the test data, it will send the test data to the corresponding test server 200 through the configured url, table_info and other information. For ease of understanding, an operation event stream (that is, the recorded multiple target operation events) is given here. Please refer to Figure 8 for an example of the operation event sequence information of the The product name of the corresponding product, the test scenario name of the target test scenario, and the event description information of the target operation event.

此处给出一个网络处理流(即录制的多个网络处理事件的网络处理序列信息)的示例,请参见图9,从左之后的每列,依次表示网络处理事件关联的目标操作事件的事件标识(此处以目标操作事件的时间戳作为事件标识为例进行说明)、网络处理事件的网络处理标识(此处以网络处理事件中网络请求的时间戳作为事件标识为例进行说明)时间戳、目标测试场景对应的产品的产品名称、目标测试场景的测试场景名称、网络处理事件中的网络请求的请求方式(如可以但不局限于包括post方式或get方式)以及上述网络请求关联的网络地址信息。Here is an example of a network processing flow (that is, the network processing sequence information of multiple recorded network processing events), please refer to Figure 9. Each column from the left represents the events of the target operation event associated with the network processing event in turn. Identifier (here, the timestamp of the target operation event is used as the event identifier for illustration), the network processing identifier of the network processing event (here, the timestamp of the network request in the network processing event is used as the event identifier for illustration) timestamp, target The product name of the product corresponding to the test scenario, the test scenario name of the target test scenario, the request method of the network request in the network processing event (such as but not limited to including the post method or the get method), and the network address information associated with the above network request .

请参见图10,利用录制引擎录制测试数据的过程中,首先由测试人员确定目标测试场景,并触发开始目标测试场景,进而由测试人员打开目标网站后,触发执行测试过程。Referring to Figure 10, in the process of recording test data using the recording engine, the tester first determines the target test scene, triggers the start of the target test scene, and then triggers the execution of the test process after the tester opens the target website.

录制引擎监控到打开目标网站的操作后,将打开目标网站的操作初始化为初始目标操作事件;以及录制引擎通过AOP技术中的HOOK网络监控目标测试场景中的各个目标操作事件以及各个目标操作事件引发的网络处理事件,获取各个目标操作事件形成的操作事件序列信息,获得各个网络处理事件形成的网络处理序列信息,并基于网络处理序列信息和操作事件序列信息,将各个网络处理事件和各个目标操作事件进行第一关联处理,以及获取各个目标操作事件关联的数据信息;并将各个目标操作事件关联的数据信息与各个目标操作事件进行第二关联处理,获得测试数据。After the recording engine monitors the operation of opening the target website, it initializes the operation of opening the target website as the initial target operation event; and the recording engine monitors each target operation event in the target test scene through the HOOK network in the AOP technology and the triggering of each target operation event network processing events, obtain the operation event sequence information formed by each target operation event, obtain the network processing sequence information formed by each network processing event, and based on the network processing sequence information and operation event sequence information, each network processing event and each target operation The event is subjected to first association processing, and data information associated with each target operation event is obtained; and the data information associated with each target operation event is subjected to second association processing with each target operation event to obtain test data.

应当说明的是,图10中HOOK网络中的hook click event函数用于监控点击操作,获取点击操作的操作事件序列信息并上传给测试服务器200;图中的hook scroll event函数用于监控滚动操作,获取监控到的滚动操作的操作事件序列信息并上传给测试服务器200;hook keyup event函数用于监控输入事件,获取输入事件的操作事件序列信息并上传给测试服务器200;hook compositioned event函数用于监控中文输入操作,获取中文输入操作的操作事件序列信息并上传给测试服务器200。It should be noted that the hook click event function in the HOOK network in FIG. 10 is used to monitor the click operation, obtain the operation event sequence information of the click operation and upload it to the test server 200; the hook scroll event function in the figure is used to monitor the scroll operation, Obtain the operation event sequence information of the monitored scroll operation and upload it to the test server 200; the hook keyup event function is used to monitor the input event, obtain the operation event sequence information of the input event and upload it to the test server 200; the hook composed event function is used to monitor For the Chinese input operation, the operation event sequence information of the Chinese input operation is obtained and uploaded to the test server 200 .

本申请实施例中同时录制了目标操作事件的信息和目标操作事件关联的网络处理事件的信息,这样录制的测试数据中既包括用户侧的目标操作事件,也包括目标操作事件触发的各个网络处理事件,使得测试数据更加完整,测试回放过程更加清晰,且将目标操作事件和网络处理事件进行了关联,从而提升了录制的测试数据的准确度,进而基于测试数据对目标测试场景进行回放时,能自动基于测试数据形成目标操作事件的完整的操作事件流和网络处理事件的网络处理流,进而可以提升基于测试数据对目标测试场景进行自动化测试的准确度。In the embodiment of the present application, the information of the target operation event and the information of the network processing event associated with the target operation event are recorded at the same time, so that the recorded test data includes not only the target operation event on the user side, but also the various network processing events triggered by the target operation event. events, which makes the test data more complete, the test playback process is clearer, and the target operation events and network processing events are correlated, thereby improving the accuracy of the recorded test data, and then when the target test scene is played back based on the test data, The complete operation event flow of the target operation event and the network processing flow of the network processing event can be automatically formed based on the test data, thereby improving the accuracy of automated testing of the target test scenario based on the test data.

请参照图11,基于同一发明构思,本申请实施例提供一种测试数据录制装置1100,包括:Please refer to FIG. 11 , based on the same inventive concept, an embodiment of the present application provides a test data recording device 1100 , including:

第一监控单元1101,用于监控用户界面中,针对目标测试场景触发的各个目标操作事件,获得各个目标操作事件形成的操作事件序列信息;The first monitoring unit 1101 is configured to monitor, in the user interface, for each target operation event triggered by the target test scenario, obtain operation event sequence information formed by each target operation event;

第二监控单元1102,用于监控各个目标操作事件引发的网络处理事件,获得每个目标操作事件关联的各个网络处理事件形成的网络处理序列信息;The second monitoring unit 1102 is configured to monitor network processing events caused by each target operation event, and obtain network processing sequence information formed by each network processing event associated with each target operation event;

处理单元1103,用于基于上述网络处理序列信息和上述操作事件序列信息,将各个网络处理事件和各个目标操作事件进行第一关联处理,获得针对上述目标测试场景录制的测试数据。The processing unit 1103 is configured to perform first correlation processing on each network processing event and each target operation event based on the network processing sequence information and the operation event sequence information, and obtain test data recorded for the target test scenario.

作为一种实施例,处理单元1103还用于:获得针对上述目标测试场景录制的测试数据之前,获取各个目标操作事件关联的数据信息;并基于上述操作事件序列信息,将各个目标操作事件关联的数据信息与各个目标操作事件进行第二关联处理。As an embodiment, the processing unit 1103 is further configured to: obtain data information associated with each target operation event before obtaining the test data recorded for the above target test scenario; and based on the above operation event sequence information, associate each target operation event with data information. The second association processing is performed on the data information and each target operation event.

作为一种实施例,处理单元1103还用于:根据上述测试数据进行上述目标测试场景的回放,或者将上述测试数据发给测试服务器200,以使上述测试服务器200进行上述目标测试场景的回放。As an embodiment, the processing unit 1103 is further configured to: play back the target test scene according to the test data, or send the test data to the test server 200 so that the test server 200 can play back the target test scene.

作为一种实施例,上述操作事件序列信息包括各个目标操作事件的事件执行顺序信息和事件描述信息,各个目标操作事件的事件执行顺序信息用于确定各个目标操作事件在上述目标测试场景中的执行顺序,上述事件描述信息用于播放各个目标操作事件;As an embodiment, the above-mentioned operation event sequence information includes event execution sequence information and event description information of each target operation event, and the event execution sequence information of each target operation event is used to determine the execution of each target operation event in the above-mentioned target test scenario sequence, the above-mentioned event description information is used to play each target operation event;

上述网络处理序列信息包括各个网络处理事件的网络处理执行顺序信息和网络处理描述信息,上述网络处理执行顺序信息用于确定各个网络处理事件在上述目标测试场景的中的执行顺序,上述网络处理描述信息用于播放各个网络处理事件。The above-mentioned network processing sequence information includes network processing execution sequence information and network processing description information of each network processing event. The above-mentioned network processing execution sequence information is used to determine the execution sequence of each network processing event in the above-mentioned target test scenario. The above-mentioned network processing description The information is used to broadcast various network processing events.

作为一种实施例,处理单元1103具体用于:根据各个操作事件序列信息中各个目标操作事件的事件执行顺序信息,以及各个网络处理事件序列中各个网络处理事件的网络处理执行顺序信息,将各个目标操作事件与各个网络处理事件进行关联处理。As an embodiment, the processing unit 1103 is specifically configured to: according to the event execution sequence information of each target operation event in each operation event sequence information, and the network processing execution sequence information of each network processing event in each network processing event sequence, to The target operation event is associated with each network processing event.

作为一种实施例,上述网络处理事件包括执行目标操作事件中触发的网络请求和根据上述网络请求返回的网络响应,上述网络处理描述信息包括:As an embodiment, the above-mentioned network processing event includes a network request triggered in the execution of the target operation event and a network response returned according to the above-mentioned network request, and the above-mentioned network processing description information includes:

上述网络请求的请求数据;上述网络反馈的反馈数据。The request data of the above-mentioned network request; the feedback data of the above-mentioned network feedback.

作为一种实施例,上述网络处理描述信息还包括如下至少一种信息:As an embodiment, the foregoing network processing description information further includes at least one of the following information:

上述网络请求关联的网络地址信息,上述网络地址信息用于确定在上述目标测试场景的回放中接收上述网络请求的网络地址;The network address information associated with the above-mentioned network request, the above-mentioned network address information is used to determine the network address for receiving the above-mentioned network request in the playback of the above-mentioned target test scenario;

上述网络请求的请求方式。The request method of the above network request.

作为一种实施例,上述目标测试场景包括针对目标网站的测试场景,第一监控单元1101还用于:As an embodiment, the above-mentioned target test scenario includes a test scenario for a target website, and the first monitoring unit 1101 is further configured to:

监控用户界面中,针对目标测试场景触发的各个目标操作事件之前,将打开上述目标网站的操作事件确定为初始目标操作事件,获得上述初始目标操作事件形成的初始操作事件序列信息;In the monitoring user interface, before each target operation event triggered by the target test scenario, the operation event of opening the above-mentioned target website is determined as the initial target operation event, and the initial operation event sequence information formed by the above-mentioned initial target operation event is obtained;

监控上述初始目标操作事件引发的初始网络处理事件,获得上述初始目标操作事件关联的初始网络处理事件形成的初始网络处理序列信息;Monitoring the initial network processing event triggered by the above-mentioned initial target operation event, and obtaining the initial network processing sequence information formed by the initial network processing event associated with the above-mentioned initial target operation event;

基于初始网络处理序列信息和上述初始网络处理序列信息,将上述初始网络处理事件和上述初始目标操作事件进行第三关联处理,获得针对上述目标测试场景录制的初始化数据;Based on the initial network processing sequence information and the above-mentioned initial network processing sequence information, the above-mentioned initial network processing event and the above-mentioned initial target operation event are subjected to a third association process to obtain initialization data recorded for the above-mentioned target test scene;

处理单元1103还用于在上述测试数据中添加上述初始化数据。The processing unit 1103 is further configured to add the above-mentioned initialization data to the above-mentioned test data.

作为一种实施例,图11中的装置可以用于实现前文论述的任意一种测试数据录制方法。As an embodiment, the apparatus in FIG. 11 can be used to implement any of the test data recording methods discussed above.

基于同一发明构思,本申请实施例提供一种终端设备100,下面对该终端设备100进行介绍。Based on the same inventive concept, an embodiment of the present application provides a terminal device 100, and the terminal device 100 is introduced below.

请参照图12,该终端设备100包括显示单元1240、处理器1280以及存储器1220,其中,显示单元1240包括显示面板1241,用于显示由用户输入的信息或提供给用户的信息以各种操作页面等,在本申请实施例中主要用于显示终端设备100中已安装的客户端的页面、快捷窗口等。Referring to FIG. 12, the terminal device 100 includes a display unit 1240, a processor 1280 and a memory 1220, wherein the display unit 1240 includes a display panel 1241 for displaying the information input by the user or the information provided to the user for various operation pages etc., in the embodiment of the present application, it is mainly used to display the page, the shortcut window, etc. of the client installed in the terminal device 100 .

可选的,可以采用液晶显示器(Liquid Crystal Display,LCD)或有机发光二极管OLED(Organic Light-Emitting Diode)等形式来配置显示面板1241。Optionally, the display panel 1241 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD) or an OLED (Organic Light-Emitting Diode).

处理器1280用于读取计算机程序,然后执行计算机程序定义的方法,例如处理器1280读取各应用等,从而在该终端设备100上运行应用,在显示单元1240上显示应用的页面。处理器1280可以包括一个或多个通用处理器,还可包括一个或多个DSP(DigitalSignal Processor,数字信号处理器),用于执行相关操作,以实现本申请实施例所提供的技术方案。The processor 1280 is configured to read the computer program and then execute the method defined by the computer program. For example, the processor 1280 reads each application, so as to run the application on the terminal device 100 and display the page of the application on the display unit 1240 . The processor 1280 may include one or more general-purpose processors, and may further include one or more DSPs (Digital Signal Processors, digital signal processors), which are configured to perform related operations to implement the technical solutions provided by the embodiments of the present application.

存储器1220一般包括内存和外存,内存可以为随机存储器(RAM),只读存储器(ROM),以及高速缓存(CACHE)等。外存可以为硬盘、光盘、USB盘、软盘或磁带机等。存储器1220用于存储计算机程序和其他数据,该计算机程序包括客户端对应的应用程序等,其他数据可包括操作系统或应用程序被运行后产生的数据,该数据包括系统数据(例如操作系统的配置参数)和用户数据。本申请实施例中程序指令存储在存储器1220中,处理器1280执行存储器1220中的程序指令,实现前文图论述的任意的一种测试数据录制方法。The memory 1220 generally includes internal memory and external memory. The internal memory can be random access memory (RAM), read only memory (ROM), and cache memory (CACHE). The external storage can be a hard disk, an optical disk, a USB disk, a floppy disk or a tape drive. The memory 1220 is used to store computer programs and other data, the computer programs include application programs corresponding to the client, and the other data may include data generated after the operating system or the application program is executed, and the data includes system data (such as the configuration of the operating system). parameters) and user data. In this embodiment of the present application, the program instructions are stored in the memory 1220, and the processor 1280 executes the program instructions in the memory 1220 to implement any one of the test data recording methods discussed in the preceding figures.

此外,终端设备100还可以包括显示单元1240,用于接收输入的数字信息、字符信息或接触式触摸操作或非接触式手势,以及产生与终端设备100的用户设置以及功能控制有关的信号输入等。具体地,本申请实施例中,该显示单元1240可以包括显示面板1241。显示面板1241例如触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在显示面板1241上或在显示面板1241的操作),并根据预先设定的程式驱动相应的连接装置。可选的,显示面板1241可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器1280,并能接收处理器1280发来的命令并加以执行。在本申请实施例中,若用户进行点击操作或滑动操作,则在显示面板1241中的触摸检测装置检测到触摸操作,则将检测到的触摸操作对应的信号发送的触摸控制器,触摸控制器将信号转换成触点坐标发送给处理器1280,处理器1280根据接收到的触点坐标进行后续操作。In addition, the terminal device 100 may further include a display unit 1240 for receiving input digital information, character information or contact touch operation or non-contact gesture, and generating signal input related to user settings and function control of the terminal device 100, etc. . Specifically, in this embodiment of the present application, the display unit 1240 may include a display panel 1241 . The display panel 1241, such as a touch screen, can collect the user's touch operations on or near it (such as the user's operations on the display panel 1241 or on the display panel 1241 using a finger, a stylus, and any other suitable objects or accessories), and according to preset The specified program drives the corresponding connection device. Optionally, the display panel 1241 may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the touch controller. To the processor 1280, and can receive the command sent by the processor 1280 and execute it. In the embodiment of the present application, if the user performs a click operation or a slide operation, the touch detection device in the display panel 1241 detects the touch operation, and then the touch controller that sends the signal corresponding to the detected touch operation, the touch controller The signal is converted into contact coordinates and sent to the processor 1280, and the processor 1280 performs subsequent operations according to the received contact coordinates.

其中,显示面板1241可以采用电阻式、电容式、红外线以及表面声波等多种类型实现。除了显示单元1240,终端设备100还可以包括输入单元1230,输入单元1230可以但不限于包括图像输入设备1231和其他输入设备1232,如物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。Among them, the display panel 1241 can be realized by various types such as resistive type, capacitive type, infrared ray and surface acoustic wave. In addition to the display unit 1240, the terminal device 100 may also include an input unit 1230. The input unit 1230 may include, but is not limited to, an image input device 1231 and other input devices 1232, such as a physical keyboard, function keys (such as volume control keys, switch keys, etc.), One or more of a trackball, mouse, joystick, etc.

除以上之外,终端设备100还可以包括用于给其他模块供电的电源1290、音频电路1260、近场通信模块1270和RF电路1210。终端设备100还可以包括一个或多个传感器1250,例如加速度传感器、光传感器、压力传感器等。音频电路1260具体包括扬声器1261和麦克风1262等,例如终端设备100可以通过麦克风1262采集用户的声音,进行相应的操作等。In addition to the above, the terminal device 100 may further include a power supply 1290 for powering other modules, an audio circuit 1260 , a near field communication module 1270 and an RF circuit 1210 . The terminal device 100 may also include one or more sensors 1250, such as an acceleration sensor, a light sensor, a pressure sensor, and the like. The audio circuit 1260 specifically includes a speaker 1261, a microphone 1262, and the like. For example, the terminal device 100 can collect the user's voice through the microphone 1262, and perform corresponding operations.

作为一种实施例,处理器1280的数量可以是一个或多个,处理器1280和存储器1220可以是耦合设置,也可以是相对独立设置。As an embodiment, the number of processors 1280 may be one or more, and the processors 1280 and the memory 1220 may be coupled or relatively independent.

作为一种实施例,图12中的处理器1280可以用于实现如图11中第一监控单元1101、第二监控单元1102和处理单元1103的功能。As an embodiment, the processor 1280 in FIG. 12 may be used to implement the functions of the first monitoring unit 1101 , the second monitoring unit 1102 and the processing unit 1103 in FIG. 11 .

作为一种实施例,本申请实施例提供的测试数据录制方法的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当程序产品在计算机设备上运行时,程序代码用于使计算机设备执行本说明书上述描述的根据本申请各种示例性实施方式的测试数据录制方法中的步骤。As an embodiment, various aspects of the test data recording method provided by the embodiments of the present application may also be implemented in the form of a program product, which includes program codes, and when the program product runs on a computer device, the program codes are used to make The computer device executes the steps in the test data recording method according to various exemplary embodiments of the present application described above in this specification.

本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by program instructions related to hardware, the aforementioned program can be stored in a computer-readable storage medium, and when the program is executed, execute Including the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: a mobile storage device, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk and other various A medium on which program code can be stored.

或者,发明上述集成的单元如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、服务器、或者网络设备等)执行本发明各个实施例上述方法的全部或部分。而前述的存储介质包括:移动存储设备、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Alternatively, if the above-mentioned integrated unit of the invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present invention may be embodied in the form of software products in essence or the parts that make contributions to the prior art. The computer software products are stored in a storage medium and include several instructions for A computer device (which may be a personal computer, a server, or a network device, etc.) is caused to execute all or part of the above-mentioned methods of the various embodiments of the present invention. The aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic disk or an optical disk and other mediums that can store program codes.

基于同一技术构思,本申请实施例还一种计算机可读存储介质,该计算机可读存储介质存储有计算机指令,当上述计算机指令在计算机上运行时,使得计算机执行如前文论述的测试数据录制方法。Based on the same technical concept, an embodiment of the present application further provides a computer-readable storage medium, where computer instructions are stored in the computer-readable storage medium, and when the computer instructions are executed on a computer, the computer can execute the test data recording method as discussed above. .

本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by those skilled in the art, the embodiments of the present application may be provided as a method, a system, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims (15)

1. A method for recording test data, comprising:
in the monitoring user interface, aiming at each target operation event triggered by a target test scene, obtaining operation event sequence information formed by each target operation event;
monitoring network processing events caused by each target operation event, and acquiring network processing sequence information formed by each network processing event related to each target operation event;
and performing first association processing on each network processing event and each target operation event based on the network processing sequence information and the operation event sequence information to obtain test data recorded aiming at the target test scene.
2. The method of claim 1, wherein prior to obtaining the recorded test data for the target test scenario, the method further comprises:
acquiring data information related to each target operation event; and are
And performing second association processing on the data information associated with each target operation event and each target operation event based on the operation event sequence information.
3. The method of claim 2, wherein the method further comprises:
playback of the target test scene is carried out according to the test data, or;
and sending the test data to a test server so that the test server plays back the target test scene.
4. The method according to claim 3, wherein the operational event sequence information includes event execution sequence information and event description information of each target operational event, the event execution sequence information of each target operational event is used for determining the execution sequence of each target operational event in the target test scenario, and the event description information is used for playing each target operational event;
the network processing sequence information includes network processing execution sequence information and network processing description information of each network processing event, the network processing execution sequence information is used for determining an execution sequence of each network processing event in the target test scenario, and the network processing description information is used for playing each network processing event.
5. The method of claim 4, wherein the performing a first correlation process on each network processing event and each target operational event based on the network processing sequence information and the operational event sequence information comprises:
and performing association processing on each target operation event and each network processing event according to the event execution sequence information of each target operation event in each operation event sequence information and the network processing execution sequence information of each network processing event in each network processing event sequence.
6. The method of claim 4, wherein the network processing event comprises executing a network request triggered in a target operation event and a network response returned according to the network request, and the network processing description information comprises:
request data of the network request;
feedback data fed back by the network.
7. The method of claim 6, wherein the network process description information further comprises at least one of:
network address information associated with the network request, the network address information being used to determine a network address at which the network request is received in playback of the target test scenario;
the request mode of the network request.
8. The method of claim 1 or 2, wherein the target test scenario comprises a test scenario for a target website, and wherein the monitoring user interface, before each target operation event triggered for the target test scenario, further comprises:
determining the operation event for opening the target website as an initial target operation event, and acquiring initial operation event sequence information formed by the initial target operation event;
monitoring an initial network processing event caused by the initial target operation event, and acquiring initial network processing sequence information formed by the initial network processing event related to the initial target operation event;
performing third association processing on the initial network processing event and the initial target operation event based on initial network processing sequence information and the initial network processing sequence information to obtain initialization data recorded aiming at the target test scene;
when the test data recorded for the target test scenario is obtained, the method further includes:
adding the initialization data to the test data.
9. A test data recording apparatus, comprising:
the first monitoring unit is used for monitoring each target operation event triggered by a target test scene in a user interface and acquiring operation event sequence information formed by each target operation event;
the second monitoring unit is used for monitoring the network processing events caused by the target operation events and acquiring network processing sequence information formed by the network processing events related to each target operation event;
and the processing unit is used for performing first association processing on each network processing event and each target operation event based on the network processing sequence information and the operation event sequence information to obtain the test data recorded aiming at the target test scene.
10. The apparatus as recited in claim 9, said processing unit to further:
acquiring data information related to each target operation event before acquiring the test data recorded aiming at the target test scene; and are
And performing second association processing on the data information associated with each target operation event and each target operation event based on the operation event sequence information.
11. The apparatus as recited in claim 10, said processing unit to further:
playback of the target test scene is carried out according to the test data, or;
and sending the test data to a test server so that the test server plays back the target test scene.
12. The apparatus of claim 11, wherein the operational event sequence information includes event execution sequence information and event description information of each target operational event, the event execution sequence information of each target operational event is used to determine an execution sequence of each target operational event in the target test scenario, and the event description information is used to play each target operational event;
the network processing sequence information includes network processing execution sequence information and network processing description information of each network processing event, the network processing execution sequence information is used for determining an execution sequence of each network processing event in the target test scenario, and the network processing description information is used for playing each network processing event.
13. The apparatus as claimed in claim 12, wherein said processing unit is specifically configured to:
and performing association processing on each target operation event and each network processing event according to the event execution sequence information of each target operation event in each operation event sequence information and the network processing execution sequence information of each network processing event in each network processing event sequence.
14. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1-8 are implemented when the program is executed by the processor.
15. A computer-readable storage medium having stored thereon computer instructions which, when executed on a computer, cause the computer to perform the method of any one of claims 1-8.
CN202011187265.9A 2020-10-30 2020-10-30 A test data recording method, device, equipment and computer storage medium Active CN114443453B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011187265.9A CN114443453B (en) 2020-10-30 2020-10-30 A test data recording method, device, equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011187265.9A CN114443453B (en) 2020-10-30 2020-10-30 A test data recording method, device, equipment and computer storage medium

Publications (2)

Publication Number Publication Date
CN114443453A true CN114443453A (en) 2022-05-06
CN114443453B CN114443453B (en) 2025-03-28

Family

ID=81356890

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011187265.9A Active CN114443453B (en) 2020-10-30 2020-10-30 A test data recording method, device, equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN114443453B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114924964A (en) * 2022-05-24 2022-08-19 招银云创信息技术有限公司 Software testing method, apparatus and computer equipment
CN115098371A (en) * 2022-06-25 2022-09-23 平安银行股份有限公司 Interface testing method, device, storage medium and electronic equipment
CN116107911A (en) * 2023-03-29 2023-05-12 杭州海康威视数字技术股份有限公司 Privacy compliance automatic auditing method, device and system based on event replay

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020103664A1 (en) * 2000-10-20 2002-08-01 Anders Olsson Event collection architecture
US20090063968A1 (en) * 2007-08-31 2009-03-05 Tealeaf Technology, Inc. Replaying captured network interactions
WO2009092302A1 (en) * 2008-01-10 2009-07-30 Huawei Technologies Co., Ltd. Method and device for realizing a recording service
US20140026123A1 (en) * 2012-07-20 2014-01-23 Infosys Limited Systems and methods for replication of test results in a network environment
US9049105B1 (en) * 2012-05-11 2015-06-02 Amazon Technologies, Inc. Systems and methods for tracking and managing event records associated with network incidents
CN111274105A (en) * 2018-12-04 2020-06-12 阿里巴巴集团控股有限公司 Webpage operation playback and collection method, computing device, storage medium and system
CN111694757A (en) * 2020-08-04 2020-09-22 北京字节跳动网络技术有限公司 Application program testing method and device, electronic equipment and computer readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020103664A1 (en) * 2000-10-20 2002-08-01 Anders Olsson Event collection architecture
US20090063968A1 (en) * 2007-08-31 2009-03-05 Tealeaf Technology, Inc. Replaying captured network interactions
WO2009092302A1 (en) * 2008-01-10 2009-07-30 Huawei Technologies Co., Ltd. Method and device for realizing a recording service
US9049105B1 (en) * 2012-05-11 2015-06-02 Amazon Technologies, Inc. Systems and methods for tracking and managing event records associated with network incidents
US20140026123A1 (en) * 2012-07-20 2014-01-23 Infosys Limited Systems and methods for replication of test results in a network environment
CN111274105A (en) * 2018-12-04 2020-06-12 阿里巴巴集团控股有限公司 Webpage operation playback and collection method, computing device, storage medium and system
CN111694757A (en) * 2020-08-04 2020-09-22 北京字节跳动网络技术有限公司 Application program testing method and device, electronic equipment and computer readable storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114924964A (en) * 2022-05-24 2022-08-19 招银云创信息技术有限公司 Software testing method, apparatus and computer equipment
CN115098371A (en) * 2022-06-25 2022-09-23 平安银行股份有限公司 Interface testing method, device, storage medium and electronic equipment
CN116107911A (en) * 2023-03-29 2023-05-12 杭州海康威视数字技术股份有限公司 Privacy compliance automatic auditing method, device and system based on event replay

Also Published As

Publication number Publication date
CN114443453B (en) 2025-03-28

Similar Documents

Publication Publication Date Title
US11822919B2 (en) Auto-generation of API documentation via implementation-neutral analysis of API traffic
Gomez et al. Reran: Timing-and touch-sensitive record and replay for android
US9747191B1 (en) Tool to replicate actions across devices in real time for improved efficiency during manual application testing
EP3756150B1 (en) Techniques for identifying issues related to digital interactions on websites
US9342237B2 (en) Automated testing of gesture-based applications
Fazzini et al. Barista: A technique for recording, encoding, and running platform independent android tests
US10268350B2 (en) Automatically capturing user interactions and evaluating user interfaces in software programs using field testing
CN103984538B (en) Application scenario identification method, power consumption management method, devices and terminal equipment
US9436449B1 (en) Scenario-based code trimming and code reduction
US20170289338A1 (en) Enabling stateful dynamic links in mobile applications
CN109074278B (en) Validating stateful dynamic links in mobile applications
CN114443453A (en) Test data recording method, device, equipment and computer storage medium
CN110888781B (en) Application blockage detection method and detection device
US10983625B2 (en) Systems and methods for measurement of unsupported user interface actions
CN112817790B (en) Method for simulating user behavior
US12161942B2 (en) Videogame telemetry data and game asset tracker for session recordings
WO2015043352A1 (en) Method and apparatus for selecting test nodes on webpages
CN118585980A (en) Verification method, device, equipment and storage medium
CN112988304B (en) Recording method and device of operation mode, electronic equipment and storage medium
WO2015039585A1 (en) Method and device for testing software reliability
CN114159797B (en) A text processing method, device, computer equipment and storage medium
US11500759B2 (en) Information processing system, information processing method, and development apparatus
Park et al. Gesto: Mapping UI events to gestures and voice commands
CN112860543A (en) Method and electronic equipment for detecting page operation
CN106371992B (en) Browser error detection method and error detector element

Legal Events

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