Movatterモバイル変換


[0]ホーム

URL:


CN113342645B - Method, device, equipment and storage medium for testing business function - Google Patents

Method, device, equipment and storage medium for testing business function
Download PDF

Info

Publication number
CN113342645B
CN113342645BCN202110600656.7ACN202110600656ACN113342645BCN 113342645 BCN113342645 BCN 113342645BCN 202110600656 ACN202110600656 ACN 202110600656ACN 113342645 BCN113342645 BCN 113342645B
Authority
CN
China
Prior art keywords
service function
terminal
target
target service
instruction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110600656.7A
Other languages
Chinese (zh)
Other versions
CN113342645A (en
Inventor
芦蓉
李亚文
尚尔乐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kuxun Technology Co Ltd
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sankuai Online Technology Co LtdfiledCriticalBeijing Sankuai Online Technology Co Ltd
Priority to CN202110600656.7ApriorityCriticalpatent/CN113342645B/en
Publication of CN113342645ApublicationCriticalpatent/CN113342645A/en
Application grantedgrantedCritical
Publication of CN113342645BpublicationCriticalpatent/CN113342645B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本申请公开了一种测试业务功能的方法、装置、设备及存储介质,属于互联网技术领域。所述方法包括:接收第二终端发送的所述目标应用程序的目标业务功能对应的预处理指令,其中,所述预处理指令中携带有所述目标业务功能对应的执行基础数据的下载链接;基于所述下载链接,获取所述执行基础数据;接收所述第二终端发送的所述目标业务功能对应的测试控制指令,基于所述测试控制指令以及所述执行基础数据对所述目标业务功能进行测试,得到所述目标业务功能对应的测试结果。采用本申请能够提高对应用程序的测试效率。

Figure 202110600656

The present application discloses a method, device, device and storage medium for testing service functions, which belong to the technical field of the Internet. The method includes: receiving a preprocessing instruction corresponding to a target service function of the target application sent by a second terminal, wherein the preprocessing instruction carries a download link of execution basic data corresponding to the target service function; Acquire the execution basic data based on the download link; receive a test control instruction corresponding to the target service function sent by the second terminal, and perform an analysis of the target service function based on the test control instruction and the execution basic data. A test is performed to obtain a test result corresponding to the target service function. The application can improve the testing efficiency of the application.

Figure 202110600656

Description

Translated fromChinese
测试业务功能的方法、装置、设备及存储介质Method, device, device and storage medium for testing service function

技术领域technical field

本申请涉及互联网技术领域,特别涉及一种测试业务功能的方法、装置、设备及存储介质。The present application relates to the field of Internet technologies, and in particular, to a method, apparatus, device and storage medium for testing service functions.

背景技术Background technique

随着互联网技术的发展,各种应用程序可实现的业务功能越来越多,其中,用户在使用应用程序的过程中,应用程序可能会生成执行基础数据并存储在本地,一些业务功能在执行时,需要获取本地存储的执行基础数据,然后在根据执行基础数据执行对应的业务功能。例如,业务功能为自动显示搜索记录功能,用户可以平时在通过搜索框搜索数据时,应用程序可以将用户搜索的文本作为执行基础数据保存在本地。当用户再次点击搜索框时,搜索框的下方可以显示历史搜索记录,即保存在本地的搜索文本。With the development of Internet technology, more and more business functions can be implemented by various applications. In the process of using the application, the application may generate and execute basic data and store it locally. Some business functions are being executed. , you need to obtain the execution basic data stored locally, and then execute the corresponding business function according to the execution basic data. For example, the business function is the function of automatically displaying search records. When a user searches for data through the search box, the application can save the text searched by the user locally as the basic data for execution. When the user clicks the search box again, the lower part of the search box can display the historical search records, that is, the search text saved locally.

一般在一款应用程序在开发出来后,一般需要通过测试人员测试开发出来的应用程序的各个业务功能是否能够按照设计的要求正常实现。其中在测试对应有执行基础数据的业务功能时,需要测试人员先操作应用程序,使应用程序生成对应的执行基础数据并存储在终端,然后再对相应的业务功能进行测试。例如需要测试的业务功能为自动显示搜索记录功能,则测试人员在测试该业务功能之前需要打开搜索页面,在搜索页面对应的搜索框中搜索一些关键词,如“明天天气”,再关闭搜索页面,然后再次打开搜索页面并点击搜索框,查看搜索框的下方是否能够正常显示“明天天气”。Generally, after an application is developed, testers generally need to test whether the various business functions of the developed application can be implemented normally according to the design requirements. When testing the business function corresponding to the execution basic data, the tester needs to operate the application first, so that the application generates the corresponding execution basic data and stores it in the terminal, and then tests the corresponding business function. For example, the business function that needs to be tested is to automatically display the search record function. Before testing the business function, the tester needs to open the search page, search for some keywords in the search box corresponding to the search page, such as "tomorrow's weather", and then close the search page. , then open the search page again and click the search box to see if "Tomorrow's Weather" is displayed normally below the search box.

在实现本申请的过程中,发明人发现相关技术至少存在以下问题:In the process of realizing this application, the inventor found that the related art has at least the following problems:

在测试对应有执行基础数据的业务功能时,需要测试人员手动操作应用程序,使应用程序生成对应的执行基础数据,然后才能测试相应的业务功能。使得测试人员不能直接测试相应的业务功能,从而导致测试人员对应用程序的测试效率较低。When testing the business function corresponding to the execution basic data, the tester needs to manually operate the application program, so that the application program generates the corresponding execution basic data, and then the corresponding business function can be tested. As a result, the tester cannot directly test the corresponding business function, which leads to the low efficiency of the tester's testing of the application.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供了一种测试业务功能的方法、装置、系统、设备及存储介质,能够提高对应用程序的业务功能的测试效率。所述技术方案如下:The embodiments of the present application provide a method, apparatus, system, device and storage medium for testing a service function, which can improve the efficiency of testing the service function of an application program. The technical solution is as follows:

第一方面,提供了一种测试业务功能的方法,所述方法用于第一终端,其中所述第一终端中安装有目标应用程序,所述方法包括:In a first aspect, a method for testing a service function is provided, and the method is used in a first terminal, wherein a target application is installed in the first terminal, and the method includes:

接收第二终端发送的所述目标应用程序的目标业务功能对应的预处理指令,其中,所述预处理指令中携带有所述目标业务功能对应的执行基础数据的下载链接;receiving a preprocessing instruction corresponding to the target service function of the target application sent by the second terminal, wherein the preprocessing instruction carries a download link of the execution basic data corresponding to the target service function;

基于所述下载链接,获取所述执行基础数据;obtaining the basic execution data based on the download link;

接收所述第二终端发送的所述目标业务功能对应的测试控制指令,基于所述测试控制指令以及所述执行基础数据对所述目标业务功能进行测试,得到所述目标业务功能对应的测试结果。Receive the test control instruction corresponding to the target service function sent by the second terminal, test the target service function based on the test control instruction and the execution basic data, and obtain a test result corresponding to the target service function .

可选的,所述执行基础数据中包括目标业务功能标识,所述基于所述下载链接,获取所述执行基础数据之后,所述方法还包括:Optionally, the execution basic data includes a target service function identifier, and after acquiring the execution basic data based on the download link, the method further includes:

基于预设的业务功能标识与执行基础数据在所述目标应用程序中的存储位置的对应关系,确定目标业务功能标识对应的目标存储位置,将所述执行基础数据存储在所述目标存储位置。Based on the corresponding relationship between the preset business function identifier and the storage location of the execution basic data in the target application program, a target storage location corresponding to the target business function identifier is determined, and the execution basic data is stored in the target storage location.

可选的,所述测试控制指令包括至少一个操作控制指令和结果验证指令,每个操作控制指令分别为点击指令、滑动指令或文本输入指令中的一种,所述结果验证指令中携带有目标控件标识;Optionally, the test control instruction includes at least one operation control instruction and a result verification instruction, each operation control instruction is one of a click instruction, a sliding instruction or a text input instruction, and the result verification instruction carries a target. control ID;

所述接收所述第二终端发送的所述目标业务功能对应的测试控制指令,基于所述测试控制指令以及所述执行基础数据对所述目标业务功能进行测试,得到所述目标业务功能对应的测试结果,包括:The test control instruction corresponding to the target service function sent by the second terminal is received, and the target service function is tested based on the test control instruction and the execution basic data to obtain the corresponding test control instruction of the target service function. Test results, including:

接收所述第二终端顺序发送的至少一个操作控制指令,每接收到一个操作控制指令时,基于当前接收的操作控制指令进行操作;Receive at least one operation control instruction sequentially sent by the second terminal, and each time an operation control instruction is received, operate based on the currently received operation control instruction;

当检测到所述目标业务功能被触发时,基于所述执行基础数据执行所述目标业务功能;When it is detected that the target service function is triggered, the target service function is executed based on the execution basic data;

基于所述目标业务功能的执行结果,确定对所述目标业务功能的测试结果。Based on the execution result of the target service function, a test result of the target service function is determined.

可选的,所述测试控制指令中包括操作指示信息和目标控件标识,其中,所述操作指示信息包括点击操作信息、滑动操作信息、文本输入操作信息中的至少一种;Optionally, the test control instruction includes operation instruction information and a target control identifier, wherein the operation instruction information includes at least one of click operation information, sliding operation information, and text input operation information;

所述接收所述第二终端发送的所述目标业务功能对应的测试控制指令,基于所述测试控制指令以及所述执行基础数据对所述目标业务功能进行测试,得到所述目标业务功能对应的测试结果,包括:The test control instruction corresponding to the target service function sent by the second terminal is received, and the target service function is tested based on the test control instruction and the execution basic data to obtain the corresponding test control instruction of the target service function. Test results, including:

接收所述第二终端发送的所述目标业务功能对应的测试控制指令,基于所述测试控制指令中包括的操作指示信息进行操作;Receive the test control instruction corresponding to the target service function sent by the second terminal, and operate based on the operation instruction information included in the test control instruction;

当检测到所述目标业务功能被触发时,基于所述执行基础数据执行所述目标业务功能;When it is detected that the target service function is triggered, the target service function is executed based on the execution basic data;

基于所述目标业务功能的执行结果,确定对所述目标业务功能的测试结果。Based on the execution result of the target service function, a test result of the target service function is determined.

可选的,所述基于所述目标业务功能的执行结果,确定对所述目标业务功能的测试结果,包括:Optionally, determining the test result of the target service function based on the execution result of the target service function, including:

在所述目标业务功能执行后,基于所述测试控制指令包括的目标控件标识,检测所述目标应用程序的当前界面中是否包括所述目标控件标识对应的控件,基于检测结果确定对所述目标业务功能的测试结果。After the target service function is executed, based on the target widget identifier included in the test control instruction, it is detected whether the current interface of the target application includes a widget corresponding to the target widget identifier, and the target widget is determined based on the detection result. Test results of business functions.

可选的,所述得到所述目标业务功能对应的测试结果之后,所述方法还包括:Optionally, after obtaining the test result corresponding to the target service function, the method further includes:

将所述目标业务功能对应的测试结果发送至所述第二终端。Send the test result corresponding to the target service function to the second terminal.

第二方面,提供了一种测试业务功能的方法,所述方法用于第二终端,所述方法包括:In a second aspect, a method for testing a service function is provided, the method is used for a second terminal, and the method includes:

向第一终端发送目标应用程序的目标业务功能对应的预处理指令,其中,所述预处理指令中携带有所述目标业务功能对应的执行基础数据的下载链接,所述预处理指令用于指示所述第一终端基于所述下载链接,获取所述执行基础数据;Send a preprocessing instruction corresponding to the target service function of the target application to the first terminal, wherein the preprocessing instruction carries a download link of the execution basic data corresponding to the target service function, and the preprocessing instruction is used to indicate The first terminal acquires the basic execution data based on the download link;

向第一终端发送所述目标业务功能对应的测试控制指令,所述测试控制指令用于指示所述第一终端基于所述测试控制指令以及所述执行基础数据对所述目标业务功能进行测试,得到所述目标业务功能对应的测试结果。sending a test control instruction corresponding to the target service function to the first terminal, where the test control instruction is used to instruct the first terminal to test the target service function based on the test control instruction and the execution basic data, A test result corresponding to the target service function is obtained.

可选的,所述向第一终端发送所述目标业务功能对应的测试控制指令,包括:Optionally, the sending the test control instruction corresponding to the target service function to the first terminal includes:

在向所述第一终端发送所述目标应用程序的目标业务功能对应的预处理指令后的时长达到预设时长时,向所述第一终端发送所述目标业务功能对应的测试控制指令。When the time period after the preprocessing instruction corresponding to the target service function of the target application is sent to the first terminal reaches a preset time period, the test control instruction corresponding to the target service function is sent to the first terminal.

第三方面,提供了一种测试业务功能的装置,所述装置包括:In a third aspect, a device for testing service functions is provided, the device comprising:

接收模块,用于接收第二终端发送的所述目标应用程序的目标业务功能对应的预处理指令,其中,所述预处理指令中携带有所述目标业务功能对应的执行基础数据的下载链接;a receiving module, configured to receive a preprocessing instruction corresponding to the target service function of the target application sent by the second terminal, wherein the preprocessing instruction carries a download link of the execution basic data corresponding to the target service function;

下载模块,用于基于所述下载链接,获取所述执行基础数据;a download module, configured to obtain the basic execution data based on the download link;

测试模块,用于接收所述第二终端发送的所述目标业务功能对应的测试控制指令,基于所述测试控制指令以及所述执行基础数据对所述目标业务功能进行测试,得到所述目标业务功能对应的测试结果。A test module, configured to receive a test control instruction corresponding to the target service function sent by the second terminal, test the target service function based on the test control instruction and the execution basic data, and obtain the target service The test result corresponding to the function.

可选的,所述装置还包括存储模块,用于:Optionally, the device further includes a storage module for:

基于预设的业务功能标识与执行基础数据在所述目标应用程序中的存储位置的对应关系,确定目标业务功能标识对应的目标存储位置,将所述执行基础数据存储在所述目标存储位置。Based on the corresponding relationship between the preset business function identifier and the storage location of the execution basic data in the target application program, a target storage location corresponding to the target business function identifier is determined, and the execution basic data is stored in the target storage location.

可选的,所述测试控制指令包括至少一个操作控制指令和结果验证指令,每个操作控制指令分别为点击指令、滑动指令或文本输入指令中的一种,所述结果验证指令中携带有目标控件标识;Optionally, the test control instruction includes at least one operation control instruction and a result verification instruction, each operation control instruction is one of a click instruction, a sliding instruction or a text input instruction, and the result verification instruction carries a target. control ID;

测试模块,用于:接收所述第二终端顺序发送的至少一个操作控制指令,每接收到一个操作控制指令时,基于当前接收的操作控制指令进行操作;a test module, configured to: receive at least one operation control instruction sequentially sent by the second terminal, and operate based on the currently received operation control instruction every time an operation control instruction is received;

当检测到所述目标业务功能被触发时,基于所述执行基础数据执行所述目标业务功能;When it is detected that the target service function is triggered, the target service function is executed based on the execution basic data;

基于所述目标业务功能的执行结果,确定对所述目标业务功能的测试结果。Based on the execution result of the target service function, a test result of the target service function is determined.

可选的,所述测试控制指令中包括操作指示信息和目标控件标识,其中,所述操作指示信息包括点击操作信息、滑动操作信息、文本输入操作信息中的至少一种;Optionally, the test control instruction includes operation instruction information and a target control identifier, wherein the operation instruction information includes at least one of click operation information, sliding operation information, and text input operation information;

所述测试模块,用于接收所述第二终端发送的所述目标业务功能对应的测试控制指令,基于所述测试控制指令中包括的操作指示信息进行操作;The test module is configured to receive a test control instruction corresponding to the target service function sent by the second terminal, and operate based on the operation instruction information included in the test control instruction;

当检测到所述目标业务功能被触发时,基于所述执行基础数据执行所述目标业务功能;When it is detected that the target service function is triggered, the target service function is executed based on the execution basic data;

基于所述目标业务功能的执行结果,确定对所述目标业务功能的测试结果。Based on the execution result of the target service function, a test result of the target service function is determined.

可选的,所述测试模块,用于:Optionally, the test module is used for:

在所述目标业务功能执行后,基于所述测试控制指令包括的目标控件标识,检测所述目标应用程序的当前界面中是否包括所述目标控件标识对应的控件,基于检测结果确定对所述目标业务功能的测试结果。After the target service function is executed, based on the target widget identifier included in the test control instruction, it is detected whether the current interface of the target application includes a widget corresponding to the target widget identifier, and the target widget is determined based on the detection result. Test results of business functions.

可选的,所述得到所述目标业务功能对应的测试结果之后,所述装置还包括发送模块,用于:将所述目标业务功能对应的测试结果发送至所述第二终端。Optionally, after obtaining the test result corresponding to the target service function, the apparatus further includes a sending module, configured to: send the test result corresponding to the target service function to the second terminal.

第四方面,提供了一种测试业务功能的装置,所述装置包括:In a fourth aspect, a device for testing service functions is provided, the device comprising:

第一发送模块,用于向第一终端发送目标应用程序的目标业务功能对应的预处理指令,其中,所述预处理指令中携带有所述目标业务功能对应的执行基础数据的下载链接,所述预处理指令用于指示所述第一终端基于所述下载链接,获取所述执行基础数据;The first sending module is configured to send the preprocessing instruction corresponding to the target service function of the target application to the first terminal, wherein the preprocessing instruction carries the download link of the execution basic data corresponding to the target service function, so the The preprocessing instruction is used to instruct the first terminal to acquire the basic execution data based on the download link;

第二发送模块,用于向第一终端发送所述目标业务功能对应的测试控制指令,所述测试控制指令用于指示所述第一终端基于所述测试控制指令以及所述执行基础数据对所述目标业务功能进行测试,得到所述目标业务功能对应的测试结果。The second sending module is configured to send a test control instruction corresponding to the target service function to the first terminal, where the test control instruction is used to instruct the first terminal to perform a The target business function is tested, and the test result corresponding to the target business function is obtained.

可选的,所述第二发送模块,用于:Optionally, the second sending module is used for:

在向所述第一终端发送所述目标应用程序的目标业务功能对应的预处理指令后的时长达到预设时长时,向所述第一终端发送所述目标业务功能对应的测试控制指令。When the time period after the preprocessing instruction corresponding to the target service function of the target application is sent to the first terminal reaches a preset time period, the test control instruction corresponding to the target service function is sent to the first terminal.

第五方面,提供了一种测试业务功能的系统,所述系统包括第一终端和第二终端,其中,In a fifth aspect, a system for testing service functions is provided, the system includes a first terminal and a second terminal, wherein,

所述第一终端中安装有目标应用程序,用于接收第二终端发送的所述目标应用程序的目标业务功能对应的预处理指令,其中,所述预处理指令中携带有所述目标业务功能对应的执行基础数据的下载链接;基于所述下载链接,获取所述执行基础数据;接收所述第二终端发送的所述目标业务功能对应的测试控制指令,基于所述测试控制指令以及所述执行基础数据对所述目标业务功能进行测试,得到所述目标业务功能对应的测试结果;A target application program is installed in the first terminal for receiving a preprocessing instruction corresponding to the target service function of the target application program sent by the second terminal, wherein the preprocessing instruction carries the target service function The download link of the corresponding execution basic data; obtain the execution basic data based on the download link; receive the test control instruction corresponding to the target service function sent by the second terminal, based on the test control instruction and the Execute basic data to test the target business function, and obtain a test result corresponding to the target business function;

所述第二终端,用于向所述第一终端发送所述目标应用程序的目标业务功能对应的预处理指令,其中,所述预处理指令中携带有所述目标业务功能对应的执行基础数据的下载链接,所述预处理指令用于指示所述第一终端基于所述下载链接,获取所述执行基础数据;向第一终端发送所述目标业务功能对应的测试控制指令,所述测试控制指令用于指示所述第一终端基于所述测试控制指令以及所述执行基础数据对所述目标业务功能进行测试,得到所述目标业务功能对应的测试结果。The second terminal is configured to send the preprocessing instruction corresponding to the target service function of the target application to the first terminal, wherein the preprocessing instruction carries the execution basic data corresponding to the target service function the download link, the preprocessing instruction is used to instruct the first terminal to obtain the execution basic data based on the download link; send the test control instruction corresponding to the target service function to the first terminal, the test control The instruction is used to instruct the first terminal to test the target service function based on the test control instruction and the execution basic data, and obtain a test result corresponding to the target service function.

第六方面,提供了一种第一终端,所述第一终端包括处理器和存储器,所述存储器中存储有至少一条指令,所述至少一条指令由所述处理器加载并执行以实现如第一方面所述的测试业务功能的方法所执行的操作。In a sixth aspect, a first terminal is provided, the first terminal includes a processor and a memory, the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the Operations performed by the method for testing business functions described in one aspect.

第七方面,提供了一种第二终端,所述第二终端包括处理器和存储器,所述存储器中存储有至少一条指令,所述至少一条指令由所述处理器加载并执行以实现如第二方面所述的测试业务功能的方法所执行的操作。In a seventh aspect, a second terminal is provided, the second terminal includes a processor and a memory, the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to achieve the Operations performed by the method for testing business functions described in the second aspect.

第七方面,提供了一种计算机可读存储介质,所述存储介质中存储有至少一条指令,所述至少一条指令由处理器加载并执行以实现如第一方面和第二方面所述的测试业务功能的方法所执行的操作。In a seventh aspect, a computer-readable storage medium is provided, the storage medium stores at least one instruction, and the at least one instruction is loaded and executed by a processor to implement the tests described in the first and second aspects The action performed by the method of the business function.

本申请实施例提供的技术方案带来的有益效果是:The beneficial effects brought by the technical solutions provided in the embodiments of the present application are:

通过第一终端在接收到预处理指令之后,可以通过预处理指令中携带下载链接,下载目标业务功能对应的执行基础数据,然后再根据第二终端发送测试控制指令对目标业务功能进行测试,得到测试结果。显然在本申请中无需测试人员手动操作目标应用程序以生成对应的执行基础数据,并能够根据对应的测试控制指令测试目标业务功能,因此可以提高对应用程序的测试效率。After receiving the preprocessing instruction, the first terminal can download the execution basic data corresponding to the target service function by carrying the download link in the preprocessing instruction, and then test the target service function according to the test control instruction sent by the second terminal, and obtain Test Results. Obviously, in the present application, the tester does not need to manually operate the target application to generate corresponding execution basic data, and can test the target business function according to the corresponding test control instruction, so the test efficiency of the application can be improved.

附图说明Description of drawings

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

图1是本申请实施例提供的一种测试业务功能的方法流程图;1 is a flowchart of a method for testing a service function provided by an embodiment of the present application;

图2是本申请实施例提供的一种测试业务功能的方法流程图;2 is a flowchart of a method for testing a service function provided by an embodiment of the present application;

图3是本申请实施例提供的一种测试业务功能的方法流程图;3 is a flowchart of a method for testing a service function provided by an embodiment of the present application;

图4是本申请实施例提供的一种测试业务功能的装置结构示意图;4 is a schematic structural diagram of an apparatus for testing a service function provided by an embodiment of the present application;

图5是本申请实施例提供的一种测试业务功能的装置结构示意图;5 is a schematic structural diagram of an apparatus for testing a service function provided by an embodiment of the present application;

图6是本申请实施例提供的终端结构示意图。FIG. 6 is a schematic structural diagram of a terminal provided by an embodiment of the present application.

具体实施方式Detailed ways

为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.

本申请提供的测试业务功能的方法可以由终端实现。终端中可以安装有待进行测试的应用程序。该终端可以实体终端,即在终端中可以具备有处理器、存储器、显示屏等硬件设备,例如可以是手机、平板电脑、智能穿戴设备、台式计算机、笔记本电脑等。该终端也可以是虚拟终端,例如运行在其他实体终端上的虚拟设备。The method for testing service functions provided by the present application may be implemented by a terminal. Applications to be tested can be installed in the terminal. The terminal may be a physical terminal, that is, the terminal may have hardware devices such as a processor, a memory, and a display screen, for example, a mobile phone, a tablet computer, a smart wearable device, a desktop computer, a notebook computer, and the like. The terminal may also be a virtual terminal, such as a virtual device running on other physical terminals.

在技术人员开发出应用程序之后,一般需要测试人员对应用程序的各个业务功能进行测试,如拍照、发送信息、搜索数据等,以确保新开发的应用程序可以不出差错的实现预先设计的各种业务功能。例如测试人员可以直接在手机中安装待进行测试的应用程序,然后操控待进行测试的应用程序,逐个使用各个业务功能,然后查看对应的功能是否能正常执行,以确定进行测试的应用程序是否存在问题。而有些需要执行基础数据的业务功能测试过程会比较繁琐,测试人员在测试需要执行基础数据的业务功能时,需要预先操作正在进行测试的应用程序生成对应的执行基础数据,然后再去测试对应的业务功能是否能够正常执行。其中,执行基础数据可以是应用程序下载到本地的数据,如多媒体文件;也可以是记录的用户的使用应用程序的相关数据,如用户使用各个业务功能的次数、用户的聊天记录等等。After technicians develop an application, testers are generally required to test various business functions of the application, such as taking pictures, sending information, searching for data, etc., to ensure that the newly developed application can realize the pre-designed business function. For example, the tester can directly install the application to be tested in the mobile phone, then manipulate the application to be tested, use each business function one by one, and then check whether the corresponding function can be executed normally, so as to determine whether the application to be tested exists. question. And some business function testing process that needs to execute basic data will be cumbersome. When testing the business function that needs to execute basic data, testers need to pre-operate the application under test to generate the corresponding execution basic data, and then test the corresponding basic data. Whether the business function can be performed normally. Wherein, the basic execution data may be data downloaded to the local by the application, such as multimedia files; or may be recorded data related to the user's use of the application, such as the number of times the user uses various business functions, the user's chat history, and so on.

例如,业务功能为自动显示搜索记录功能,则测试人员需要在进行测试的应用程序的搜索页面中点击搜索框,然后搜索框中搜索一些关键字,进行测试的应用程序可以将关键字存储在本地,存储的关键字即为执行基础数据。然后测试人员需要再次在进行测试的应用程序的搜索页面中点击搜索框,并查看搜索框的下方是否显示历史搜索记录,如果正常显示历史搜索记录,则确定自动显示搜索记录功能不存在问题。而在对应的业务功能不能够正常执行时,可以确定进行测试的应用程序存在问题。而本申请实施例提供的测试业务功能的方法,在测试需要执行基础数据的业务功能时,不需要预先操作进行测试的应用程序生成对应的执行基础数据,能够直接构建出具有执行基础数据的环境。For example, if the business function is to automatically display the search record function, the tester needs to click the search box on the search page of the application under test, and then search for some keywords in the search box. The application under test can store the keywords locally , the stored keyword is the execution basic data. Then the tester needs to click the search box on the search page of the application under test again, and check whether the historical search record is displayed below the search box. If the historical search record is displayed normally, it is determined that there is no problem with the function of automatically displaying the search record. When the corresponding business function cannot be executed normally, it can be determined that there is a problem with the application under test. However, in the method for testing business functions provided by the embodiments of the present application, when testing a business function that needs to execute basic data, it is not necessary to pre-operate the application program for testing to generate corresponding basic execution data, and an environment with basic data for execution can be directly constructed. .

图1是本申请实施例提供的一种测试业务功能的方法流程图,该方法用于第一终端,其中第一终端中安装有目标应用程序,如图1所示,该方法包括:1 is a flowchart of a method for testing service functions provided by an embodiment of the present application. The method is used in a first terminal, where a target application program is installed in the first terminal. As shown in FIG. 1 , the method includes:

步骤101、接收第二终端发送的目标应用程序的目标业务功能对应的预处理指令,其中,预处理指令中携带有目标业务功能对应的执行基础数据的下载链接。Step 101: Receive a preprocessing instruction corresponding to the target service function of the target application sent by the second terminal, wherein the preprocessing instruction carries a download link of basic execution data corresponding to the target service function.

步骤102、基于下载链接,获取执行基础数据。Step 102: Acquire basic execution data based on the download link.

其中,在获取执行基础数据后,可以将获取到的执行基础数据存储到第一终端中存储目标业务功能对应执行基础数据的位置。Wherein, after acquiring the basic execution data, the acquired basic execution data may be stored in the first terminal where the basic execution data corresponding to the target service function is stored.

步骤103、接收第二终端发送的目标业务功能对应的测试控制指令,基于测试控制指令以及执行基础数据对目标业务功能进行测试,得到目标业务功能对应的测试结果。Step 103: Receive a test control instruction corresponding to the target service function sent by the second terminal, test the target service function based on the test control instruction and the basic execution data, and obtain a test result corresponding to the target service function.

图2是本申请实施例提供的一种测试业务功能的方法流程图,方法用于第二终端,如图2所示,该方法包括:FIG. 2 is a flowchart of a method for testing a service function provided by an embodiment of the present application. The method is used for a second terminal. As shown in FIG. 2 , the method includes:

步骤201、向第一终端发送目标应用程序的目标业务功能对应的预处理指令,其中,预处理指令中携带有目标业务功能对应的执行基础数据的下载链接,预处理指令用于指示第一终端基于下载链接,获取执行基础数据;Step 201: Send a preprocessing instruction corresponding to the target service function of the target application to the first terminal, wherein the preprocessing instruction carries a download link of the execution basic data corresponding to the target service function, and the preprocessing instruction is used to instruct the first terminal Based on the download link, obtain the execution basic data;

步骤202、向第一终端发送目标业务功能对应的测试控制指令,测试控制指令用于指示第一终端基于测试控制指令以及执行基础数据对目标业务功能进行测试,得到目标业务功能对应的测试结果。Step 202: Send a test control instruction corresponding to the target service function to the first terminal, where the test control instruction is used to instruct the first terminal to test the target service function based on the test control instruction and execution basic data to obtain a test result corresponding to the target service function.

图3是本申请实施例提供的一种测试业务功能的方法流程图,该方法用于第一终端和第二终端之间的交互,如图3所示,该方法包括:FIG. 3 is a flowchart of a method for testing a service function provided by an embodiment of the present application. The method is used for interaction between a first terminal and a second terminal. As shown in FIG. 3 , the method includes:

步骤301、第二终端向第一终端发送目标应用程序的目标业务功能对应的预处理指令。Step 301: The second terminal sends a preprocessing instruction corresponding to the target service function of the target application to the first terminal.

其中,预处理指令中携带有目标业务功能对应的执行基础数据的下载链接。第二终端可以与第一终端建立连接,例如建立网络连接、蓝牙连接或是通过数据线进行连接等。当第一终端为虚拟设备时,则第一终端可以运行在第二终端中。例如第二终端可以是电脑,第一终端为安卓虚拟机。可以将需要进行测试的目标应用程序(下文中简称目标应用程序)安装在第一终端。The preprocessing instruction carries a download link of the execution basic data corresponding to the target business function. The second terminal may establish a connection with the first terminal, for example, establish a network connection, a Bluetooth connection, or a connection through a data line. When the first terminal is a virtual device, the first terminal may run in the second terminal. For example, the second terminal may be a computer, and the first terminal is an Android virtual machine. The target application that needs to be tested (hereinafter referred to as the target application) can be installed on the first terminal.

在实施中,技术人员可以预先编写对目标应用程序中各个业务功能的测试脚本,测试脚本中可以包括对目标应用程序中各个业务功能的测试操作程序,例如点击操作、滑动操作等。除此之外,在测试脚本中还可以包括对目标应用程序的目标业务功能进行预处理的程序,即在目标业务功能进行测试之前进行的处理步骤。例如第二终端可以通过运行测试脚本,向第一终端发送启动目标应用程序的指令,以指示目标应用程序数据下载处理的指令等。In implementation, technicians may pre-write test scripts for each business function in the target application, and the test script may include test operation procedures for each business function in the target application, such as click operations, sliding operations, and the like. Besides, the test script may also include a program for preprocessing the target business function of the target application, that is, the processing steps performed before the target business function is tested. For example, by running a test script, the second terminal may send an instruction to start the target application to the first terminal, so as to instruct the instruction to download data of the target application, and the like.

其中,预处理指令中可以包括用于启动目标应用程序的命令行。在命令行可以包括目标应用程序的应用程序标识,第一终端在接收到命令行之后,可以根据启动命令行中包括的应用程序标识启动目标应用程序。在命令行中可以携带目标业务功能对应的执行基础数据的下载链接。例如对于Android系统(一种移动操作系统)的手机的命令行可以是adbshell am start+包名/.Activity--escache“http://XXX.com/XXX”。对于IOS系统(一种移动操作系统)的手机的命令行可以是open myapp.app--args-cache“http://XXX.com/XXX”,其中“http://XXX.com/XXX”即为执行基础数据的下载链接。或者,在第二终端中可以安装有Appium(一种自动化测试工具)。在实施中,第二终端可以启动Appium server,并执行测试脚本,测试脚本可以将相应的预处理指令等发至Appium server,由Appium server再向第一终端发送对应的预处理指令等。其中向第一终端发送的启动目标应用程序的预处理指令中可以携带有目标业务功能对应的执行基础数据的下载链接。The preprocessing instruction may include a command line for starting the target application. The command line may include an application identifier of the target application, and after receiving the command line, the first terminal may start the target application according to the application identifier included in the startup command line. The command line can carry the download link of the execution basic data corresponding to the target business function. For example, the command line for a mobile phone of the Android system (a mobile operating system) may be adbshell am start+package name/.Activity--escache "http://XXX.com/XXX". For IOS system (a mobile operating system) mobile phone command line can be open myapp.app--args-cache "http://XXX.com/XXX", where "http://XXX.com/XXX" It is the download link of the execution basic data. Alternatively, Appium (an automated testing tool) may be installed in the second terminal. In implementation, the second terminal may start the Appium server and execute the test script, the test script may send corresponding preprocessing instructions to the Appium server, and the Appium server then sends the corresponding preprocessing instructions to the first terminal. The preprocessing instruction for starting the target application sent to the first terminal may carry a download link of basic execution data corresponding to the target service function.

步骤302、第一终端基于下载链接,获取执行基础数据。Step 302: The first terminal acquires basic execution data based on the download link.

在实施中,技术人员可以根据目标应用程序中需要进行测试的各个业务功能,预先设置对应的执行基础数据。例如对于自动显示搜索记录功能,可以预先设置搜索数据;对于聊天记录功能查找功能,可以预先设置聊天记录数据。然后对于每个需要进行测试的业务功能,可以将对应的执行基础数据存储在服务器中,并设置不同的下载链接。当第一终端接收到预处理指令后,可以根据预处理指令中携带的下载链接,下载目标业务功能对应的执行基础数据。In the implementation, the technical personnel can preset corresponding execution basic data according to each business function that needs to be tested in the target application. For example, for the function of automatically displaying the search record, search data may be preset; for the search function of the chat record function, the chat record data may be preset. Then, for each business function that needs to be tested, the corresponding execution basic data can be stored in the server, and different download links can be set. After receiving the preprocessing instruction, the first terminal may download the execution basic data corresponding to the target service function according to the download link carried in the preprocessing instruction.

步骤303、基于预设的业务功能标识与执行基础数据在目标应用程序中的存储位置的对应关系,确定目标业务功能标识对应的目标存储位置,将执行基础数据存储在目标存储位置。Step 303: Determine the target storage location corresponding to the target business function identifier based on the correspondence between the preset business function identifier and the storage location of the execution basic data in the target application, and store the execution basic data in the target storage location.

其中,在执行基础数据中可以包括该执行基础数据对应的业务功能标识。The execution basic data may include a business function identifier corresponding to the execution basic data.

由于一般在应用程序中不同的业务功能的执行基础数据可以存在不同的路径下,在执行任一业务功能时,可以通过对应的路径获取执行基础数据,然后可以根据获取的执行基础数据执行对应的业务功能。所以在目标应用程序程序下载执行基础数据之后,还可以将下载的执行基础数据保存在业务功能对应的存储路径下。Since the execution basic data of different business functions in the application program may exist in different paths, when any business function is executed, the execution basic data can be obtained through the corresponding path, and then the corresponding execution basic data can be executed according to the obtained execution basic data. Business functions. Therefore, after the target application program downloads the execution basic data, the downloaded execution basic data can also be stored in the storage path corresponding to the business function.

在实施中,可以根据目标应用程序中各个业务功能对应的基础存储数据的存储路径,设置业务功能标识与执行基础数据在目标应用程序中的存储位置(存储路径)的对应关系。第一终端在下载目标业务功能对应的执行基础数据之后,可以根据执行基础数据中包括的业务功能标识确定对应的目标存储位置。然后将下载的目标业务功能对应的执行基础数据存储至目标存储位置。这样,虽然目标业务功能对应的执行基础数据不是通过操作目标应用程序生成的,但是其存储的位置与目标应用程序生成的对应目标业务功能的执行基础数据存储的位置相同,也就是说,通过下载执行基础数据,可以为目标业务功能预先构建具有执行基础数据的业务场景,测试人员不需要再操作目标应用程序生成对应的执行基础数据,以构建具有执行基础数据的业务场景。In implementation, the corresponding relationship between the service function identifier and the storage location (storage path) of the execution basic data in the target application can be set according to the storage path of the basic storage data corresponding to each business function in the target application. After downloading the execution basic data corresponding to the target service function, the first terminal may determine the corresponding target storage location according to the service function identifier included in the execution basic data. Then, the downloaded execution basic data corresponding to the target service function is stored in the target storage location. In this way, although the execution basic data corresponding to the target business function is not generated by operating the target application, its storage location is the same as the location where the execution basic data corresponding to the target business function generated by the target application is stored, that is, by downloading Execution basic data can pre-build a business scenario with execution basic data for the target business function, and testers do not need to operate the target application to generate corresponding execution basic data to build a business scenario with execution basic data.

在一种可实现的方式中,技术人员可以在目标应用程序中设置业务上报功能。目标应用程序在被操作的过程中,当读或写业务场景对应的执行基础数据时可以进行数据上报,将对应执行基础数据的相关信息上报至服务器。In an achievable manner, the technician can set the business reporting function in the target application. In the process of being operated, the target application can perform data reporting when reading or writing the execution basic data corresponding to the business scenario, and report the relevant information corresponding to the execution basic data to the server.

其中,写对应的执行基础数据可以是用户在使用目标应用程序过程中,目标应用程序向目标存储位置写入由用户的操作生成的第一执行基础数据。此时的业务上报功能可以是将写入的第一执行基础数据、写入时间、对应的目标业务场景等上报至服务器,这样技术人员可以根据上报的第一执行基础数据,对相应的业务场景设置第二执行基础数据。其中第二执行基础数据为对目标应用程序进行测试时,由目标应用程序根据预处理指令下载的执行基础数据。或者,写对应的执行基础数据还可以是在目标应用程序测试的过程中,目标应用程序向目标存储位置写入下载的第二执行基础数据。这样技术人员可以根据上报的执行基础数据确定是否对目标应用程序中成功构造了对应有执行基础数据的业务场景。The writing corresponding execution basic data may be that the target application writes the first execution basic data generated by the user's operation to the target storage location during the process of using the target application by the user. At this time, the service reporting function may be to report the written first execution basic data, writing time, corresponding target business scenario, etc. to the server, so that the technician can report the corresponding business scenario according to the reported first execution basic data. Set the second execution base data. The second execution basic data is the execution basic data downloaded by the target application according to the preprocessing instruction when the target application is tested. Alternatively, writing the corresponding execution basic data may also be that the target application writes the downloaded second execution basic data to the target storage location in the process of testing the target application. In this way, the technician can determine whether a business scenario corresponding to the basic execution data has been successfully constructed in the target application according to the reported basic execution data.

读对应的执行基础数据可以是目标应用程序为向目标存储位置读取已经存储的执行基础数据。该执行基础数据可以是根据预处理指令下载的第二执行基础数据。此时的业务上报功能可以是将读取的下载的第二执行基础数据、读取时间、对应的目标业务场景等上报至服务器。这样技术人员可以根据上报的数据,确定目标应用程序是否成功读取到下载的第二执行基础数据。Reading the corresponding execution basic data may be that the target application reads the stored execution basic data to the target storage location. The execution basic data may be second execution basic data downloaded according to the preprocessing instruction. The service reporting function at this time may be to report the read and downloaded second execution basic data, the read time, the corresponding target service scenario, and the like to the server. In this way, the technician can determine whether the target application successfully reads the downloaded second execution basic data according to the reported data.

另外需要说明的是,本申请实施例还可以测试在没有设置执行基础数据的场景下的业务功能是否正常执行。例如可以将根据预处理指令下载的执行基础数据中只设置对应业务场景标识,将对应的执行数据设置为空。在根据预处理指令下载后执行基础数据后,可以将下载的执行基础数据覆盖写入对应的目标存储位置,这样目标业务场景即使存在历史执行基础数据,由于覆盖写入了执行数据为空的执行基础数据,这样目标业务场景对应的执行基础数据就为空,即成功构造了无执行基础数据的场景,当再执行目标业务场景时,即可以测试在没有设置执行基础数据的场景下的业务功能是否正常执行。In addition, it should be noted that, in this embodiment of the present application, it is also possible to test whether the business function is normally executed in a scenario in which no basic data for execution is set. For example, only the corresponding business scenario identifier may be set in the execution basic data downloaded according to the preprocessing instruction, and the corresponding execution data may be set to be empty. After the basic data is downloaded and executed according to the preprocessing instruction, the downloaded execution basic data can be overwritten and written to the corresponding target storage location. In this way, even if there is historical execution basic data in the target business scenario, the execution data with empty execution data is overwritten and written. Basic data, so that the execution basic data corresponding to the target business scenario is empty, that is, a scenario without execution basic data is successfully constructed. When the target business scenario is executed again, the business function in the scenario without execution basic data can be tested. whether it is executed normally.

步骤304、第二终端向第一终端发送目标业务功能对应的测试控制指令。Step 304: The second terminal sends a test control instruction corresponding to the target service function to the first terminal.

第二终端可以通过Appium server向第一终端发送目标业务功能对应的测试控制指令。在测试控制指令中可以设置有超时时长,第一终端可以在超时时长内或超时时长后执行下述步骤305。这样可以为第一终端预留出根据预处理指令中的下载链接,下载执行基础数据的时间。该超时时长可以由技术人员根据执行基础数据的大小等设置,此处不对具体的时长进行限定。The second terminal may send a test control instruction corresponding to the target service function to the first terminal through the Appium server. A timeout period may be set in the test control instruction, and the first terminal may execute the following step 305 within the timeout period or after the timeout period. In this way, time for downloading and executing the basic data according to the download link in the preprocessing instruction can be reserved for the first terminal. The timeout period can be set by the technician according to the size of the basic execution data, etc., and the specific period is not limited here.

步骤305、第一终端基于测试控制指令以及执行基础数据对目标业务功能进行测试,得到目标业务功能对应的测试结果。Step 305: The first terminal tests the target service function based on the test control instruction and the execution basic data, and obtains a test result corresponding to the target service function.

在实施中,第二终端在向第一终端发送预处理指令后,可以向第一终端发送目标业务功能对应的测试控制指令。如通过Appium server向第一终端发送对应测试控制指令。第一终端在接收到发送的目标业务功能对应的测试控制指令后,可以根据测试控制指令对目标应用程序进行操作,例如,根据测试控制指令在当前目标应用程序的界面进行相应的点击、滑动,以触发目标应用程序中的目标业务功能。以使目标应用程序在检测到目标业务功能被触发后,可以执行目标业务功能。然后可以根据目标业务功能的执行结果确定对目标业务功能的测试结果。In implementation, after sending the preprocessing instruction to the first terminal, the second terminal may send the test control instruction corresponding to the target service function to the first terminal. For example, the corresponding test control instruction is sent to the first terminal through the Appium server. After receiving the sent test control instruction corresponding to the target service function, the first terminal can operate the target application program according to the test control instruction, for example, according to the test control instruction, perform corresponding clicks and slides on the interface of the current target application program, to trigger the target business function in the target application. So that the target application can execute the target business function after detecting that the target business function is triggered. Then, the test result of the target business function can be determined according to the execution result of the target business function.

可选的,测试控制指令包括至少一个操作控制指令和结果验证指令,每个操作控制指令分别为点击指令、滑动指令或文本输入指令中的一种,对应的步骤305的处理可以如下:Optionally, the test control instruction includes at least one operation control instruction and a result verification instruction, and each operation control instruction is one of a click instruction, a sliding instruction or a text input instruction, and the corresponding processing of step 305 may be as follows:

步骤a1、接收第二终端顺序发送的至少一个操作控制指令,每接收到一个操作控制指令时,基于当前接收的操作控制指令进行操作;Step a1: Receive at least one operation control instruction sequentially sent by the second terminal, and each time an operation control instruction is received, operate based on the currently received operation control instruction;

在实施中,测试脚本可以与Appium Server建立连接进行通信,第二终端可以运行测试脚本,向Appium Server发送测试脚本生成对应的操作控制指令,例如点击指令、滑动指令、文本输入指令等等,其中,点击指令可以是点击目标应用程序中某个控件,可以是单击、双击等,滑动指令可以是在目标应用程序中某个页面的进行快速滑动、多指滑动等,文本输入指令可以是在指定的文本框输入预设的文字。Appium Server可以接收到的操作控制指令发送至第一终端。第一终端在接收到各个操作控制指令之后,可以根据接收到的操作控制指令对目标应用程序的界面进行点击、滑动、输入文本等操作,以代替测试人员手动操作目标应用程序触发目标业务功能。In implementation, the test script can establish a connection with the Appium Server to communicate, and the second terminal can run the test script and send the test script to the Appium Server to generate corresponding operation control instructions, such as click instructions, sliding instructions, text input instructions, etc., wherein , the click command can be a click on a control in the target application, it can be a single click, a double click, etc., the slide command can be a fast slide, multi-finger slide, etc. on a page in the target application, and the text input command can be in the Enter the preset text in the specified text box. The operation control instruction that can be received by the Appium Server is sent to the first terminal. After receiving each operation control instruction, the first terminal can click, slide, input text, etc. on the interface of the target application program according to the received operation control instruction, so as to replace the tester manually operating the target application program to trigger the target service function.

步骤a2、当检测到目标业务功能被触发时,基于执行基础数据执行目标业务功能。Step a2: When it is detected that the target service function is triggered, the target service function is executed based on the execution basic data.

在实施中,当目标应用程序检测到目标业务功能被触发时,可以根据下载的执行基础数据执行目标业务功能。其中,由上述步骤202可知下载的执行基础数据存储的位置,与目标应用程序生成的执行基础数据的位置相同。所以目标应用程序在执行目标业务功能无需添加额外的执行代码,只需要正常执行目标业务功能即可。In implementation, when the target application detects that the target service function is triggered, it can execute the target service function according to the downloaded execution basic data. Wherein, it can be known from theabove step 202 that the location where the downloaded execution basic data is stored is the same as the location of the execution basic data generated by the target application. Therefore, the target application does not need to add additional execution code to execute the target business function, and only needs to execute the target business function normally.

步骤a3、基于的目标业务功能的执行结果,确定对目标业务功能的测试结果。Step a3: Determine the test result of the target service function based on the execution result of the target service function.

在实施中,技术人员可以预先根据目标业务功能的在有执行基础数据时的执行结果,设置对应的验证方法,以确定目标业务功能是否执行成功。在得到目标业务功能的执行结果后,可以第一终端可以将执行结果发送至Appium Server。再由Appium Server回传给测试脚本。In the implementation, the technician can set a corresponding verification method in advance according to the execution result of the target service function when the execution basic data exists, so as to determine whether the target service function is successfully executed. After obtaining the execution result of the target service function, the first terminal may send the execution result to the Appium Server. It is then sent back to the test script by Appium Server.

技术人员可以预先根据目标业务功能的在有执行基础数据时的执行结果,设置对应的验证方法,例如,目标业务功能为广告展示功能,执行基础数据为广告展示图片。在本地存储有广告展示图片时,目标业务功能可以直接读取本地存储的广告展示图片,对广告展示图片进行显示,在本地没有存储广告展示图片时,目标应用程序可以向业务服务器发送广告展示图片获取通知。因此,当目标业务功能为广告展示功能时,可以检测目标应用程序是否向业务服务器发送广告展示图片获取通知,或者,页面中是否展示有广告展示图片,从而确定目标业务功能是否执行成功。The technician can set the corresponding verification method in advance according to the execution result of the target business function when the basic data is available. For example, the target business function is the advertisement display function, and the execution basic data is the advertisement display picture. When there is an advertisement display image stored locally, the target service function can directly read the locally stored advertisement display image and display the advertisement display image. When the advertisement display image is not stored locally, the target application can send the advertisement display image to the service server. Get notifications. Therefore, when the target service function is an advertisement display function, it can be detected whether the target application sends an advertisement display image acquisition notification to the service server, or whether an advertisement display image is displayed on the page, so as to determine whether the target service function is successfully executed.

可选的,测试控制指令中还可以包括结果验证指令,第一终端还可以接收第二终端发送结果验证指令,根据结果验证指令中携带的目标控件标识,对目标应用程序的当前界面中是否包括目标控件标识对应的控件进行检测,基于检测结果确定目标业务功能对应的测试结果。Optionally, the test control instruction may also include a result verification instruction, the first terminal may also receive a result verification instruction sent by the second terminal, and, according to the target control identifier carried in the result verification instruction, check whether the current interface of the target application includes the result verification instruction. The target control identifies the corresponding control for detection, and determines the test result corresponding to the target business function based on the detection result.

在实施中,第二终端可以向第一终端发送结果验证指令,以确定目标业务功能的执行结果。一般业务功能在执行结束后,在目标应用程序当前的显示页面会出现对应的执行结果控件。例如,目标业务功能为自动显示搜索记录功能,在目标业务功能执行之后,即点击搜索框后,在搜索框下方显示历史搜索记录,其中显示的历史搜索记录可以通过文本控件进行显示,所以可以通过检测当前目标应用程序的界面中是否包括对应的文本控件以确定目标业务功能是否执行成功。对于检测文本类的控件,在结果验证指令中还可以包括控件中的内容,即还可以在检测到对应的文本控件之后,还可以对文本控件中的内容进行检测,以确定目标业务功能是否执行成功。In implementation, the second terminal may send a result verification instruction to the first terminal to determine the execution result of the target service function. After the general business function is executed, the corresponding execution result control will appear on the current display page of the target application. For example, the target business function is the function of automatically displaying search records. After the target business function is executed, that is, after clicking the search box, the historical search records are displayed below the search box. The displayed historical search records can be displayed through the text control, so you can use the Detect whether the interface of the current target application includes a corresponding text control to determine whether the target business function is successfully executed. For controls that detect text classes, the result verification instruction can also include the contents of the controls, that is, after the corresponding text controls are detected, the contents of the text controls can also be detected to determine whether the target business function is executed. success.

其中,需要说明的,不同的验证方法可以由技术人员根据不同的业务功能分别在有执行基础数据下的业务执行逻辑和没有执行基础数据下的业务执行逻辑分别设置,此处不再一一列举。Among them, it should be noted that different verification methods can be separately set by technicians according to different business functions in the business execution logic with execution basic data and the business execution logic without execution basic data, which will not be listed one by one here. .

可选的,测试控制指令中包括操作指示信息和目标控件标识,对应的步骤305的处理可以如下:Optionally, the test control instruction includes the operation instruction information and the target control identifier, and the corresponding processing of step 305 may be as follows:

步骤b1、接收第二终端发送的目标业务功能对应的测试控制指令,基于测试控制指令中包括的操作指示信息,进行点击操作、滑动操作或文本输入操作。Step b1: Receive a test control instruction corresponding to the target service function sent by the second terminal, and perform a click operation, a slide operation or a text input operation based on the operation instruction information included in the test control instruction.

在实施中,测试控制指令中包括的操作指示信息可以是对应触发目标业务功能的操作顺序生成的操作标识信息,例如点击操作标识、滑动操作标识或文本输入操作标识等。第一终端在接收到测试控制指令之后,可以根据测试控制指令中包括的操作标识信息进行操作,例如进行点击操作、滑动操作或文本输入操作,以触发目标业务程序。In implementation, the operation indication information included in the test control instruction may be operation identification information generated corresponding to the operation sequence that triggers the target service function, such as a click operation identification, a sliding operation identification, or a text input operation identification. After receiving the test control instruction, the first terminal may perform an operation according to the operation identification information included in the test control instruction, such as a click operation, a sliding operation or a text input operation, to trigger the target service program.

步骤b2、当检测到目标业务功能被触发时,基于执行基础数据执行目标业务功能。Step b2: When it is detected that the target service function is triggered, the target service function is executed based on the execution basic data.

在实施中,当目标应用程序检测到目标业务功能被触发时,可以根据下载的执行基础数据执行目标业务功能。其中,由上述步骤202可知下载的执行基础数据存储的位置,与目标应用程序生成的执行基础数据的位置相同。所以目标应用程序在执行目标业务功能无需添加额外的执行代码,只需要正常执行目标业务功能即可。In implementation, when the target application detects that the target service function is triggered, it can execute the target service function according to the downloaded execution basic data. Wherein, it can be known from theabove step 202 that the location where the downloaded execution basic data is stored is the same as the location of the execution basic data generated by the target application. Therefore, the target application does not need to add additional execution code to execute the target business function, and only needs to execute the target business function normally.

步骤b3、基于的目标业务功能的执行结果,确定对所述目标业务功能的测试结果。Step b3: Determine the test result of the target service function based on the execution result of the target service function.

其中,步骤b3的处理与上述步骤a3的处理相同,此处不再赘述。Wherein, the processing of step b3 is the same as the processing of the above-mentioned step a3, which is not repeated here.

另外,在第二终端在接收到第一终端发送的目标业务功能的测试结果之后,第二终端可以向第一终端发送用于测试其他业务功能的预处理指令以及测试指令,以完成对其他业务功能的测试。In addition, after the second terminal receives the test result of the target service function sent by the first terminal, the second terminal may send a preprocessing instruction and a test instruction for testing other service functions to the first terminal, so as to complete the testing of other services. Functional testing.

本申请实施例通过第一终端在接收到预处理指令之后,可以通过预处理指令中携带下载链接,下载目标业务功能对应的执行基础数据,然后再根据第二终端发送测试控制指令对目标业务功能进行测试,得到测试结果。显然在本申请中无需测试人员手动操作目标应用程序以生成对应的执行基础数据,并能够根据对应的测试控制指令测试目标业务功能,因此可以提高对应用程序的测试效率。In this embodiment of the present application, after receiving the preprocessing instruction through the first terminal, the preprocessing instruction can carry a download link to download the execution basic data corresponding to the target service function, and then send a test control instruction to the target service function according to the second terminal. Run the test and get the test result. Obviously, in the present application, the tester does not need to manually operate the target application to generate corresponding execution basic data, and can test the target business function according to the corresponding test control instruction, so the test efficiency of the application can be improved.

上述所有可选技术方案,可以采用任意结合形成本公开的可选实施例,在此不再一一赘述。All the above-mentioned optional technical solutions can be combined arbitrarily to form optional embodiments of the present disclosure, which will not be repeated here.

本申请实施例提供的还一种测试业务功能的系统,该系统包括第一终端和第二终端,其中,Another system for testing service functions provided by the embodiments of the present application includes a first terminal and a second terminal, wherein,

第一终端中安装有目标应用程序,用于接收第二终端发送的目标应用程序的目标业务功能对应的预处理指令,其中,预处理指令中携带有目标业务功能对应的执行基础数据的下载链接;基于下载链接,获取执行基础数据;接收第二终端发送的目标业务功能对应的测试控制指令,基于测试控制指令以及执行基础数据对目标业务功能进行测试,得到目标业务功能对应的测试结果;A target application program is installed in the first terminal for receiving a preprocessing instruction corresponding to the target service function of the target application program sent by the second terminal, wherein the preprocessing instruction carries a download link of the execution basic data corresponding to the target service function ; Obtain execution basic data based on the download link; receive the test control instruction corresponding to the target service function sent by the second terminal, test the target service function based on the test control instruction and the execution basic data, and obtain the test result corresponding to the target service function;

第二终端,用于向第一终端发送目标应用程序的目标业务功能对应的预处理指令,其中,预处理指令中携带有目标业务功能对应的执行基础数据的下载链接,预处理指令用于指示第一终端基于下载链接,获取执行基础数据;向第一终端发送目标业务功能对应的测试控制指令,测试控制指令用于指示第一终端基于测试控制指令以及执行基础数据对目标业务功能进行测试,得到目标业务功能对应的测试结果。The second terminal is configured to send a preprocessing instruction corresponding to the target service function of the target application to the first terminal, wherein the preprocessing instruction carries a download link of the execution basic data corresponding to the target service function, and the preprocessing instruction is used to indicate The first terminal acquires execution basic data based on the download link; sends a test control instruction corresponding to the target service function to the first terminal, where the test control instruction is used to instruct the first terminal to test the target service function based on the test control instruction and the execution basic data, Obtain the test results corresponding to the target business function.

图4是本申请实施例提供的一种测试业务功能的装置,该装置可以为上述实施例中的第一终端,该装置包括:FIG. 4 is a device for testing a service function provided by an embodiment of the present application. The device may be the first terminal in the foregoing embodiment, and the device includes:

接收模块410,用于接收第二终端发送的所述目标应用程序的目标业务功能对应的预处理指令,其中,所述预处理指令中携带有所述目标业务功能对应的执行基础数据的下载链接;A receiving module 410, configured to receive a preprocessing instruction corresponding to the target service function of the target application sent by the second terminal, wherein the preprocessing instruction carries a download link of the execution basic data corresponding to the target service function ;

下载模块420,用于基于所述下载链接,获取所述执行基础数据;a download module 420, configured to acquire the basic execution data based on the download link;

测试模块430,用于接收所述第二终端发送的所述目标业务功能对应的测试控制指令,基于所述测试控制指令以及所述执行基础数据对所述目标业务功能进行测试,得到所述目标业务功能对应的测试结果。The test module 430 is configured to receive the test control instruction corresponding to the target service function sent by the second terminal, test the target service function based on the test control instruction and the execution basic data, and obtain the target service function The test result corresponding to the business function.

可选的,所述装置还包括存储模块,用于:Optionally, the device further includes a storage module for:

基于预设的业务功能标识与执行基础数据在所述目标应用程序中的存储位置的对应关系,确定目标业务功能标识对应的目标存储位置,将所述执行基础数据存储在所述目标存储位置。Based on the corresponding relationship between the preset business function identifier and the storage location of the execution basic data in the target application program, a target storage location corresponding to the target business function identifier is determined, and the execution basic data is stored in the target storage location.

可选的,所述测试控制指令包括至少一个操作控制指令和结果验证指令,每个操作控制指令分别为点击指令、滑动指令或文本输入指令中的一种,所述结果验证指令中携带有目标控件标识;Optionally, the test control instruction includes at least one operation control instruction and a result verification instruction, each operation control instruction is one of a click instruction, a sliding instruction or a text input instruction, and the result verification instruction carries a target. control ID;

所述测试模块430,用于:接收所述第二终端顺序发送的至少一个操作控制指令,每接收到一个操作控制指令时,基于当前接收的操作控制指令进行操作;The test module 430 is configured to: receive at least one operation control instruction sequentially sent by the second terminal, and operate based on the currently received operation control instruction every time an operation control instruction is received;

当检测到所述目标业务功能被触发时,基于所述执行基础数据执行所述目标业务功能;When it is detected that the target service function is triggered, the target service function is executed based on the execution basic data;

基于所述目标业务功能的执行结果,确定对所述目标业务功能的测试结果。Based on the execution result of the target service function, a test result of the target service function is determined.

可选的,所述测试控制指令中包括操作指示信息和目标控件标识,其中,所述操作指示信息包括点击操作信息、滑动操作信息、文本输入操作信息中的至少一种;Optionally, the test control instruction includes operation instruction information and a target control identifier, wherein the operation instruction information includes at least one of click operation information, sliding operation information, and text input operation information;

所述测试模块430,用于接收所述第二终端发送的所述目标业务功能对应的测试控制指令,基于所述测试控制指令中包括的操作指示信息进行操作;The test module 430 is configured to receive the test control instruction corresponding to the target service function sent by the second terminal, and operate based on the operation instruction information included in the test control instruction;

当检测到所述目标业务功能被触发时,基于所述执行基础数据执行所述目标业务功能;When it is detected that the target service function is triggered, the target service function is executed based on the execution basic data;

基于所述目标业务功能的执行结果,确定对所述目标业务功能的测试结果。Based on the execution result of the target service function, a test result of the target service function is determined.

可选的,所述测试模块430,用于:Optionally, the test module 430 is used for:

在所述目标业务功能执行后,基于所述测试控制指令包括的目标控件标识,检测所述目标应用程序的当前界面中是否包括所述目标控件标识对应的控件,基于检测结果确定对所述目标业务功能的测试结果。After the target service function is executed, based on the target widget identifier included in the test control instruction, it is detected whether the current interface of the target application includes a widget corresponding to the target widget identifier, and the target widget is determined based on the detection result. Test results of business functions.

可选的,所述得到所述目标业务功能对应的测试结果之后,所述装置还包括发送模块,用于:将所述目标业务功能对应的测试结果发送至所述第二终端。Optionally, after obtaining the test result corresponding to the target service function, the apparatus further includes a sending module, configured to: send the test result corresponding to the target service function to the second terminal.

图5是本申请实施例提供的一种测试业务功能的装置,该装置可以是上述实施例中的第二终端,该装置包括:FIG. 5 is a device for testing a service function provided by an embodiment of the present application. The device may be the second terminal in the foregoing embodiment, and the device includes:

第一发送模块510,用于向第一终端发送目标应用程序的目标业务功能对应的预处理指令,其中,所述预处理指令中携带有所述目标业务功能对应的执行基础数据的下载链接,所述预处理指令用于指示所述第一终端基于所述下载链接,获取所述执行基础数据;The first sending module 510 is configured to send the preprocessing instruction corresponding to the target service function of the target application to the first terminal, wherein the preprocessing instruction carries the download link of the execution basic data corresponding to the target service function, The preprocessing instruction is used to instruct the first terminal to acquire the basic execution data based on the download link;

第二发送模块520,用于向第一终端发送所述目标业务功能对应的测试控制指令,所述测试控制指令用于指示所述第一终端基于所述测试控制指令以及所述执行基础数据对所述目标业务功能进行测试,得到所述目标业务功能对应的测试结果。The second sending module 520 is configured to send a test control instruction corresponding to the target service function to the first terminal, where the test control instruction is used to instruct the first terminal to pair based on the test control instruction and the execution basic data The target service function is tested, and a test result corresponding to the target service function is obtained.

可选的,所述第二发送模块520,用于:Optionally, the second sending module 520 is configured to:

在向所述第一终端发送所述目标应用程序的目标业务功能对应的预处理指令后的时长达到预设时长时,向所述第一终端发送所述目标业务功能对应的测试控制指令。When the time period after the preprocessing instruction corresponding to the target service function of the target application is sent to the first terminal reaches a preset time period, the test control instruction corresponding to the target service function is sent to the first terminal.

需要说明的是:上述实施例提供的测试业务功能的装置在测试业务功能时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的测试业务功能的装置与测试业务功能的方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that: when the apparatus for testing service functions provided in the above embodiments tests service functions, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions may be allocated to different functional modules as required. To complete, that is, to divide the internal structure of the device into different functional modules to complete all or part of the functions described above. In addition, the apparatus for testing a service function provided in the above embodiment and the method embodiment for testing a service function belong to the same concept, and the specific implementation process thereof is detailed in the method embodiment, which will not be repeated here.

图6示出了本申请一个示例性实施例提供的电子设备600的结构框图。该电子设备600可以是便携式移动终端,比如:智能手机、平板电脑、MP3播放器(Moving PictureExperts Group Audio Layer III,动态影像专家压缩标准音频层面3)、MP4(MovingPicture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器、笔记本电脑或台式电脑。电子设备600还可能被称为用户设备、便携式终端、膝上型终端、台式终端等其他名称。FIG. 6 shows a structural block diagram of anelectronic device 600 provided by an exemplary embodiment of the present application. Theelectronic device 600 may be a portable mobile terminal, such as a smart phone, a tablet computer, an MP3 player (Moving PictureExperts Group Audio Layer III, moving picture experts compression standard audio layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, moving picture Expert Compression Standard Audio Layer 4) Player, Laptop or Desktop.Electronic device 600 may also be called user equipment, portable terminal, laptop terminal, desktop terminal, and the like by other names.

通常,电子设备600包括有:处理器601和存储器602。Generally, theelectronic device 600 includes: aprocessor 601 and amemory 602 .

处理器601可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器601可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器601也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central ProcessingUnit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器601可以集成有GPU(Graphics Processing Unit,图像处理器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器601还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。Theprocessor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. Theprocessor 601 may adopt at least one hardware form among DSP (Digital Signal Processing, digital signal processing), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array, programmable logic array) accomplish. Theprocessor 601 may also include a main processor and a coprocessor. The main processor is a processor used to process data in a wake-up state, also called a CPU (Central Processing Unit, central processing unit); A low-power processor for processing data in a standby state. In some embodiments, theprocessor 601 may be integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is used for rendering and drawing the content that needs to be displayed on the display screen. In some embodiments, theprocessor 601 may further include an AI (Artificial Intelligence, artificial intelligence) processor, where the AI processor is used to process computing operations related to machine learning.

存储器602可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。存储器602还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。在一些实施例中,存储器602中的非暂态的计算机可读存储介质用于存储至少一个指令,该至少一个指令用于被处理器601所执行以实现本申请中方法实施例提供的测试业务功能的方法。Memory 602 may include one or more computer-readable storage media, which may be non-transitory.Memory 602 may also include high-speed random access memory, as well as non-volatile memory, such as one or more disk storage devices, flash storage devices. In some embodiments, the non-transitory computer-readable storage medium in thememory 602 is used to store at least one instruction, and the at least one instruction is used to be executed by theprocessor 601 to implement the testing service provided by the method embodiments in this application function method.

在一些实施例中,电子设备600还可选包括有:外围设备接口603和至少一个外围设备。处理器601、存储器602和外围设备接口603之间可以通过总线或信号线相连。各个外围设备可以通过总线、信号线或电路板与外围设备接口603相连。具体地,外围设备包括:射频电路604、显示屏605、摄像头组件606、音频电路607、定位组件608和电源609中的至少一种。In some embodiments, theelectronic device 600 may also optionally include: aperipheral device interface 603 and at least one peripheral device. Theprocessor 601, thememory 602 and theperipheral device interface 603 may be connected through a bus or a signal line. Each peripheral device can be connected to theperipheral device interface 603 through a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of aradio frequency circuit 604 , adisplay screen 605 , acamera assembly 606 , anaudio circuit 607 , apositioning assembly 608 and apower supply 609 .

外围设备接口603可被用于将I/O(Input/Output,输入/输出)相关的至少一个外围设备连接到处理器601和存储器602。在一些实施例中,处理器601、存储器602和外围设备接口603被集成在同一芯片或电路板上;在一些其他实施例中,处理器601、存储器602和外围设备接口603中的任意一个或两个可以在单独的芯片或电路板上实现,本实施例对此不加以限定。Theperipheral device interface 603 may be used to connect at least one peripheral device related to I/O (Input/Output) to theprocessor 601 and thememory 602 . In some embodiments,processor 601,memory 602, and peripherals interface 603 are integrated on the same chip or circuit board; in some other embodiments, any one ofprocessor 601,memory 602, and peripherals interface 603 or The two can be implemented on a separate chip or circuit board, which is not limited in this embodiment.

射频电路604用于接收和发射RF(Radio Frequency,射频)信号,也称电磁信号。射频电路604通过电磁信号与通信网络以及其他通信设备进行通信。射频电路604将电信号转换为电磁信号进行发送,或者,将接收到的电磁信号转换为电信号。可选地,射频电路604包括:天线系统、RF收发器、一个或多个放大器、调谐器、振荡器、数字信号处理器、编解码芯片组、用户身份模块卡等等。射频电路604可以通过至少一种无线通信协议来与其它终端进行通信。该无线通信协议包括但不限于:万维网、城域网、内联网、各代移动通信网络(2G、3G、4G及5G)、无线局域网和/或WiFi(Wireless Fidelity,无线保真)网络。在一些实施例中,射频电路604还可以包括NFC(Near Field Communication,近距离无线通信)有关的电路,本申请对此不加以限定。Theradio frequency circuit 604 is used for receiving and transmitting RF (Radio Frequency, radio frequency) signals, also called electromagnetic signals. Theradio frequency circuit 604 communicates with the communication network and other communication devices via electromagnetic signals. Theradio frequency circuit 604 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, theradio frequency circuit 604 includes an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and the like. Theradio frequency circuit 604 may communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: World Wide Web, Metropolitan Area Network, Intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), wireless local area network and/or WiFi (Wireless Fidelity, Wireless Fidelity) network. In some embodiments, theradio frequency circuit 604 may further include a circuit related to NFC (Near Field Communication, short-range wireless communication), which is not limited in this application.

显示屏605用于显示UI(User Interface,用户界面)。该UI可以包括图形、文本、图标、视频及其它们的任意组合。当显示屏605是触摸显示屏时,显示屏605还具有采集在显示屏605的表面或表面上方的触摸信号的能力。该触摸信号可以作为控制信号输入至处理器601进行处理。此时,显示屏605还可以用于提供虚拟按钮和/或虚拟键盘,也称软按钮和/或软键盘。在一些实施例中,显示屏605可以为一个,设置在电子设备600的前面板;在另一些实施例中,显示屏605可以为至少两个,分别设置在电子设备600的不同表面或呈折叠设计;在另一些实施例中,显示屏605可以是柔性显示屏,设置在电子设备600的弯曲表面上或折叠面上。甚至,显示屏605还可以设置成非矩形的不规则图形,也即异形屏。显示屏605可以采用LCD(Liquid Crystal Display,液晶显示屏)、OLED(Organic Light-Emitting Diode,有机发光二极管)等材质制备。Thedisplay screen 605 is used to display a UI (User Interface). The UI can include graphics, text, icons, video, and any combination thereof. When thedisplay screen 605 is a touch display screen, thedisplay screen 605 also has the ability to acquire touch signals on or above the surface of thedisplay screen 605 . The touch signal may be input to theprocessor 601 as a control signal for processing. At this time, thedisplay screen 605 may also be used to provide virtual buttons and/or virtual keyboards, also referred to as soft buttons and/or soft keyboards. In some embodiments, there may be onedisplay screen 605, which is arranged on the front panel of theelectronic device 600; in other embodiments, there may be at least twodisplay screens 605, which are respectively arranged on different surfaces of theelectronic device 600 or are folded Design; In other embodiments, thedisplay screen 605 may be a flexible display screen disposed on a curved or folded surface of theelectronic device 600 . Even, thedisplay screen 605 can also be set as a non-rectangular irregular figure, that is, a special-shaped screen. Thedisplay screen 605 can be made of materials such as LCD (Liquid Crystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode, organic light emitting diode).

摄像头组件606用于采集图像或视频。可选地,摄像头组件606包括前置摄像头和后置摄像头。通常,前置摄像头设置在终端的前面板,后置摄像头设置在终端的背面。在一些实施例中,后置摄像头为至少两个,分别为主摄像头、景深摄像头、广角摄像头、长焦摄像头中的任意一种,以实现主摄像头和景深摄像头融合实现背景虚化功能、主摄像头和广角摄像头融合实现全景拍摄以及VR(Virtual Reality,虚拟现实)拍摄功能或者其它融合拍摄功能。在一些实施例中,摄像头组件606还可以包括闪光灯。闪光灯可以是单色温闪光灯,也可以是双色温闪光灯。双色温闪光灯是指暖光闪光灯和冷光闪光灯的组合,可以用于不同色温下的光线补偿。Thecamera assembly 606 is used to capture images or video. Optionally, thecamera assembly 606 includes a front camera and a rear camera. Usually, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth-of-field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth-of-field camera to realize the background blur function, the main camera It is integrated with the wide-angle camera to achieve panoramic shooting and VR (Virtual Reality, virtual reality) shooting functions or other integrated shooting functions. In some embodiments,camera assembly 606 may also include a flash. The flash can be a single color temperature flash or a dual color temperature flash. Dual color temperature flash refers to the combination of warm light flash and cold light flash, which can be used for light compensation under different color temperatures.

音频电路607可以包括麦克风和扬声器。麦克风用于采集用户及环境的声波,并将声波转换为电信号输入至处理器601进行处理,或者输入至射频电路604以实现语音通信。出于立体声采集或降噪的目的,麦克风可以为多个,分别设置在电子设备600的不同部位。麦克风还可以是阵列麦克风或全向采集型麦克风。扬声器则用于将来自处理器601或射频电路604的电信号转换为声波。扬声器可以是传统的薄膜扬声器,也可以是压电陶瓷扬声器。当扬声器是压电陶瓷扬声器时,不仅可以将电信号转换为人类可听见的声波,也可以将电信号转换为人类听不见的声波以进行测距等用途。在一些实施例中,音频电路607还可以包括耳机插孔。Audio circuitry 607 may include a microphone and speakers. The microphone is used to collect the sound waves of the user and the environment, convert the sound waves into electrical signals and input them to theprocessor 601 for processing, or to theradio frequency circuit 604 to realize voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively disposed in different parts of theelectronic device 600 . The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert the electrical signal from theprocessor 601 or theradio frequency circuit 604 into sound waves. The loudspeaker can be a traditional thin-film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves inaudible to humans for distance measurement and other purposes. In some embodiments, theaudio circuit 607 may also include a headphone jack.

定位组件608用于定位电子设备600的当前地理位置,以实现导航或LBS(LocationBased Service,基于位置的服务)。定位组件608可以是基于美国的GPS(GlobalPositioning System,全球定位系统)、中国的北斗系统或俄罗斯的伽利略系统的定位组件。Thepositioning component 608 is used to locate the current geographic location of theelectronic device 600 to implement navigation or LBS (Location Based Service, location-based service). Thepositioning component 608 may be a positioning component based on the GPS (Global Positioning System, global positioning system) of the United States, the Beidou system of China or the Galileo system of Russia.

电源609用于为电子设备600中的各个组件进行供电。电源609可以是交流电、直流电、一次性电池或可充电电池。当电源609包括可充电电池时,该可充电电池可以是有线充电电池或无线充电电池。有线充电电池是通过有线线路充电的电池,无线充电电池是通过无线线圈充电的电池。该可充电电池还可以用于支持快充技术。Power supply 609 is used to power various components inelectronic device 600 . Thepower source 609 may be alternating current, direct current, disposable batteries or rechargeable batteries. When thepower source 609 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. Wired rechargeable batteries are batteries that are charged through wired lines, and wireless rechargeable batteries are batteries that are charged through wireless coils. The rechargeable battery can also be used to support fast charging technology.

在一些实施例中,电子设备600还包括有一个或多个传感器610。该一个或多个传感器610包括但不限于:加速度传感器611、陀螺仪传感器612、压力传感器613、指纹传感器614、光学传感器615以及接近传感器616。In some embodiments, theelectronic device 600 also includes one or more sensors 610 . The one or more sensors 610 include, but are not limited to, an acceleration sensor 611 , a gyro sensor 612 , a pressure sensor 613 , a fingerprint sensor 614 , an optical sensor 615 and a proximity sensor 616 .

加速度传感器611可以检测以电子设备600建立的坐标系的三个坐标轴上的加速度大小。比如,加速度传感器611可以用于检测重力加速度在三个坐标轴上的分量。处理器601可以根据加速度传感器611采集的重力加速度信号,控制显示屏605以横向视图或纵向视图进行用户界面的显示。加速度传感器611还可以用于游戏或者用户的运动数据的采集。The acceleration sensor 611 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by theelectronic device 600 . For example, the acceleration sensor 611 can be used to detect the components of the gravitational acceleration on the three coordinate axes. Theprocessor 601 can control thedisplay screen 605 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 611 . The acceleration sensor 611 can also be used for game or user movement data collection.

陀螺仪传感器612可以检测电子设备600的机体方向及转动角度,陀螺仪传感器612可以与加速度传感器611协同采集用户对电子设备600的3D动作。处理器601根据陀螺仪传感器612采集的数据,可以实现如下功能:动作感应(比如根据用户的倾斜操作来改变UI)、拍摄时的图像稳定、游戏控制以及惯性导航。The gyroscope sensor 612 can detect the body direction and rotation angle of theelectronic device 600 , and the gyroscope sensor 612 can cooperate with the acceleration sensor 611 to collect 3D actions of the user on theelectronic device 600 . Theprocessor 601 can implement the following functions according to the data collected by the gyro sensor 612 : motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.

压力传感器613可以设置在电子设备600的侧边框和/或显示屏605的下层。当压力传感器613设置在电子设备600的侧边框时,可以检测用户对电子设备600的握持信号,由处理器601根据压力传感器613采集的握持信号进行左右手识别或快捷操作。当压力传感器613设置在显示屏605的下层时,由处理器601根据用户对显示屏605的压力操作,实现对UI界面上的可操作性控件进行控制。可操作性控件包括按钮控件、滚动条控件、图标控件、菜单控件中的至少一种。The pressure sensor 613 may be disposed on the side frame of theelectronic device 600 and/or the lower layer of thedisplay screen 605 . When the pressure sensor 613 is disposed on the side frame of theelectronic device 600 , the user's holding signal of theelectronic device 600 can be detected, and theprocessor 601 can perform left and right hand identification or quick operation according to the holding signal collected by the pressure sensor 613 . When the pressure sensor 613 is disposed on the lower layer of thedisplay screen 605, theprocessor 601 controls the operability controls on the UI interface according to the user's pressure operation on thedisplay screen 605. The operability controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.

指纹传感器614用于采集用户的指纹,由处理器601根据指纹传感器614采集到的指纹识别用户的身份,或者,由指纹传感器614根据采集到的指纹识别用户的身份。在识别出用户的身份为可信身份时,由处理器601授权该用户执行相关的敏感操作,该敏感操作包括解锁屏幕、查看加密信息、下载软件、支付及更改设置等。指纹传感器614可以被设置在电子设备600的正面、背面或侧面。当电子设备600上设置有物理按键或厂商Logo时,指纹传感器614可以与物理按键或厂商Logo集成在一起。The fingerprint sensor 614 is used to collect the user's fingerprint, and theprocessor 601 identifies the user's identity according to the fingerprint collected by the fingerprint sensor 614, or the fingerprint sensor 614 identifies the user's identity according to the collected fingerprint. When the user's identity is identified as a trusted identity, theprocessor 601 authorizes the user to perform relevant sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. The fingerprint sensor 614 may be disposed on the front, back, or side of theelectronic device 600 . When theelectronic device 600 is provided with physical buttons or a manufacturer's logo, the fingerprint sensor 614 may be integrated with the physical buttons or the manufacturer's logo.

光学传感器615用于采集环境光强度。在一个实施例中,处理器601可以根据光学传感器615采集的环境光强度,控制显示屏605的显示亮度。具体地,当环境光强度较高时,调高显示屏605的显示亮度;当环境光强度较低时,调低显示屏605的显示亮度。在另一个实施例中,处理器601还可以根据光学传感器615采集的环境光强度,动态调整摄像头组件606的拍摄参数。Optical sensor 615 is used to collect ambient light intensity. In one embodiment, theprocessor 601 may control the display brightness of thedisplay screen 605 according to the ambient light intensity collected by the optical sensor 615 . Specifically, when the ambient light intensity is high, the display brightness of thedisplay screen 605 is increased; when the ambient light intensity is low, the display brightness of thedisplay screen 605 is decreased. In another embodiment, theprocessor 601 may also dynamically adjust the shooting parameters of thecamera assembly 606 according to the ambient light intensity collected by the optical sensor 615 .

接近传感器616,也称距离传感器,通常设置在电子设备600的前面板。接近传感器616用于采集用户与电子设备600的正面之间的距离。在一个实施例中,当接近传感器616检测到用户与电子设备600的正面之间的距离逐渐变小时,由处理器601控制显示屏605从亮屏状态切换为息屏状态;当接近传感器616检测到用户与电子设备600的正面之间的距离逐渐变大时,由处理器601控制显示屏605从息屏状态切换为亮屏状态。Proximity sensor 616 , also referred to as a distance sensor, is typically provided on the front panel ofelectronic device 600 . Proximity sensor 616 is used to collect the distance between the user and the front ofelectronic device 600 . In one embodiment, when the proximity sensor 616 detects that the distance between the user and the front of theelectronic device 600 gradually decreases, theprocessor 601 controls thedisplay screen 605 to switch from the bright screen state to the off screen state; when the proximity sensor 616 detects When the distance between the user and the front of theelectronic device 600 gradually increases, theprocessor 601 controls thedisplay screen 605 to switch from the off-screen state to the bright-screen state.

本领域技术人员可以理解,图6中示出的结构并不构成对电子设备600的限定,可以包括比图示更多或更少的组件,或者组合某些组件,或者采用不同的组件布置。Those skilled in the art can understand that the structure shown in FIG. 6 does not constitute a limitation on theelectronic device 600, and may include more or less components than the one shown, or combine some components, or adopt different component arrangements.

在示例性实施例中,还提供了一种计算机可读存储介质,例如包括指令的存储器,上述指令可由终端中的处理器执行以完成上述实施例中测试业务功能的方法。该计算机可读存储介质可以是非暂态的。例如,所述计算机可读存储介质可以是ROM(Read-OnlyMemory,只读存储器)、RAM(Random Access Memory,随机存取存储器)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, a computer-readable storage medium, such as a memory including instructions, is also provided, and the instructions can be executed by a processor in a terminal to complete the method for testing a service function in the foregoing embodiment. The computer-readable storage medium may be non-transitory. For example, the computer-readable storage medium may be ROM (Read-Only Memory, read only memory), RAM (Random Access Memory, random access memory), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.

本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, etc.

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

Claims (14)

CN202110600656.7A2021-05-312021-05-31Method, device, equipment and storage medium for testing business functionActiveCN113342645B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202110600656.7ACN113342645B (en)2021-05-312021-05-31Method, device, equipment and storage medium for testing business function

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202110600656.7ACN113342645B (en)2021-05-312021-05-31Method, device, equipment and storage medium for testing business function

Publications (2)

Publication NumberPublication Date
CN113342645A CN113342645A (en)2021-09-03
CN113342645Btrue CN113342645B (en)2022-09-16

Family

ID=77472677

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202110600656.7AActiveCN113342645B (en)2021-05-312021-05-31Method, device, equipment and storage medium for testing business function

Country Status (1)

CountryLink
CN (1)CN113342645B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN116578565B (en)*2023-05-122025-09-26烽火通信科技股份有限公司 Business data management method and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109582579B (en)*2018-11-302022-04-15腾讯音乐娱乐科技(深圳)有限公司Application program testing method and device, electronic equipment and storage medium
CN110297759B (en)*2019-05-222022-04-12深圳壹账通智能科技有限公司Method, device, equipment and storage medium for manufacturing test page script
CN112000576A (en)*2020-08-252020-11-27北京三快在线科技有限公司Code data detection method, device, equipment and storage medium

Also Published As

Publication numberPublication date
CN113342645A (en)2021-09-03

Similar Documents

PublicationPublication DateTitle
CN107908929B (en)Method and device for playing audio data
CN107885533B (en)Method and device for managing component codes
CN110308956B (en)Application interface display method and device and mobile terminal
CN110413501B (en)Browser compatibility testing method, device and system and readable storage medium
CN110288689B (en)Method and device for rendering electronic map
CN111177013A (en)Log data acquisition method and device, computer equipment and storage medium
CN111752666A (en)Window display method and device and terminal
CN111858382A (en) Application testing method, device, server, system and storage medium
CN111752817A (en) Method, device, device and storage medium for determining page loading time
CN112052167B (en) Method and device for generating test script code
CN112230910A (en)Page generation method, device, equipment and storage medium of embedded program
CN112256320A (en)Version number generation method, device, terminal and storage medium
CN113688043A (en)Application program testing method, device, server, iOS device and medium
CN109634872B (en)Application testing method, device, terminal and storage medium
CN109684123B (en)Problem resource positioning method, device, terminal and storage medium
CN107943484B (en)Method and device for executing business function
CN113157570B (en) Method, device and storage medium for determining trigger subject information
CN113342645B (en)Method, device, equipment and storage medium for testing business function
CN113051485A (en)Group searching method, device, terminal and storage medium
CN113971123A (en)Application program testing method and device, testing terminal and storage medium
CN111752719A (en) Method and Device for Detecting Caton
CN114168120B (en) Data acquisition method, device, computer equipment and storage medium
CN112463603B (en) Memory leak detection method, device, terminal and storage medium
CN114071119B (en)Resource testing method and device, electronic equipment and storage medium
CN114706741A (en)Performance test method, performance test device, computer equipment and medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant
TR01Transfer of patent right
TR01Transfer of patent right

Effective date of registration:20230220

Address after:Room 507, Floor 5, Building 2, Yard 18, Haidian Suzhou Street, Haidian District, Beijing 100080

Patentee after:BEIJING KUXUN TECHNOLOGY Co.,Ltd.

Patentee after:BEIJING SANKUAI ONLINE TECHNOLOGY Co.,Ltd.

Address before:100080 2106-030, 9 North Fourth Ring Road, Haidian District, Beijing.

Patentee before:BEIJING SANKUAI ONLINE TECHNOLOGY Co.,Ltd.


[8]ページ先頭

©2009-2025 Movatter.jp