WO2023225801A1 - Automated testing method and apparatus for application - Google Patents

Automated testing method and apparatus for application Download PDF

Info

Publication number
WO2023225801A1
WO2023225801A1 PCT/CN2022/094507 CN2022094507W WO2023225801A1 WO 2023225801 A1 WO2023225801 A1 WO 2023225801A1 CN 2022094507 W CN2022094507 W CN 2022094507W WO 2023225801 A1 WO2023225801 A1 WO 2023225801A1
Authority
WO
WIPO (PCT)
Prior art keywords
test
instruction
terminal device
runtime service
communication method
Prior art date
Application number
PCT/CN2022/094507
Other languages
French (fr)
Chinese (zh)
Inventor
姚向阳
Original Assignee
北京小米移动软件有限公司
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 北京小米移动软件有限公司 filed Critical 北京小米移动软件有限公司
Priority to CN202280004086.8A priority Critical patent/CN117441163A/en
Priority to PCT/CN2022/094507 priority patent/WO2023225801A1/en
Publication of WO2023225801A1 publication Critical patent/WO2023225801A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software

Definitions

  • the present disclosure relates to the field of testing technology, and in particular, to an automated testing method and device for an application program.
  • the automated testing method of the application mainly involves modifying the browser in the device to receive test instructions sent by other devices for test processing.
  • the browser modification process requires a large workload and a long modification time, resulting in high testing costs and poor testing efficiency.
  • the present disclosure provides an automated testing method and device for an application program.
  • an automated testing method for an application is provided, which is applied to a browser.
  • the method includes: receiving a test instruction sent by a first terminal device through a runtime service, wherein the test instruction
  • the method includes: a target identifier and a test command; determining the execution script corresponding to the test command in the target application corresponding to the target identifier; running the execution script and obtaining the execution result of the execution script; converting the execution result Returned to the first terminal device through the runtime service.
  • receiving the test instruction sent by the first terminal device through the runtime service includes: receiving a startup instruction of the runtime service, wherein the startup instruction is provided by the runtime service according to The test instruction is sent; the runtime service receives the test instruction from the first terminal device through a first communication method; performs startup processing according to the startup instruction; receives the runtime service and sends it through a second communication method of the test instructions.
  • the first communication method is grpc communication method
  • the second communication method is post message communication method
  • determining the execution script corresponding to the test command in the target application corresponding to the target identification includes: obtaining at least one execution script and at least one test command in the target application. The corresponding relationship; query the corresponding relationship according to the test command, and obtain the execution script corresponding to the test command.
  • the method before receiving the test instruction sent by the first terminal device through the runtime service, the method further includes: receiving a configuration instruction of the first terminal device, wherein the configuration instruction includes: Correspondence between at least one execution script and at least one test command in the target application.
  • an automated testing device for an application program is also provided, which is applied to a browser.
  • the device includes: a receiving module configured to receive a test instruction sent by a first terminal device through a runtime service, Wherein, the test instruction includes: a target identifier and a test command; a determination module, used to determine the execution script corresponding to the test command in the target application corresponding to the target identifier; and a processing module, used to run the execution script , and obtain the execution result of the execution script; the sending module is configured to return the execution result to the first terminal device through the runtime service.
  • the receiving module is specifically configured to receive a startup instruction of the runtime service, wherein the startup instruction is sent by the runtime service according to the test instruction; the runtime The service receives the test instruction from the first terminal device through a first communication method; performs startup processing according to the startup instruction; and receives the test instruction sent by the runtime service through a second communication method.
  • the first communication method is grpc communication method
  • the second communication method is post message communication method
  • the determination module is specifically configured to obtain the corresponding relationship between at least one execution script and at least one test command in the target application program; query the corresponding relationship according to the test command, and obtain the corresponding relationship with The execution script corresponding to the test command.
  • the receiving module is further configured to receive a configuration instruction of the first terminal device, wherein the configuration instruction includes: at least one execution script in the target application program and at least one Test the correspondence between commands.
  • an electronic device including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to Implement automated testing methods for applications as described above.
  • a non-transitory computer-readable storage medium which when instructions in the storage medium are executed by a processor, enables the processor to execute the automation of the application program as described above. Test Methods.
  • test instruction sent by the first terminal device through the runtime service, wherein the test instruction includes: a target identifier and a test command; determine the execution script corresponding to the test command in the target application corresponding to the target identifier; run Describe the execution script, and obtain the execution result of the execution script; return the execution result to the first terminal device through the runtime service, so that when testing the target application in the device, the execution result can be
  • the runtime service receives the test instructions from the first terminal device and does not need to modify the browser in the device, thereby reducing test costs and improving test efficiency.
  • Figure 1 is a flow chart of an automated testing method for an application program according to an embodiment of the present disclosure
  • Figure 2 is a schematic structural diagram of an automated testing device for an application program according to an embodiment of the present disclosure
  • FIG. 3 is a structural block diagram of an electronic device according to an exemplary embodiment of the present disclosure.
  • FIG. 1 is a flow chart of an automated testing method for an application program according to an embodiment of the present disclosure.
  • the automated testing method of the application program in this embodiment is executed by the automated testing device of the application program.
  • the automated testing device of the application program can be implemented by software and/or hardware.
  • the automated testing device of the application program can be It is configured in an electronic device, which may include a mobile terminal (such as a mobile phone), a tablet computer and other terminal devices with a display screen and a browser.
  • the software is such as a browser on the terminal device, etc.
  • the following description takes the execution subject as the browser on the second terminal device as an example.
  • the method includes the following steps:
  • Step 101 Receive a test instruction sent by the first terminal device through a runtime service, where the test instruction includes: a target identifier and a test command.
  • the runtime service is used to convert the program language into machine language that the machine can understand.
  • This runtime service has some system permissions and system functions of the operating system.
  • different programs correspond to different runtime services.
  • the runtime service corresponding to a Java program is Java Runtime
  • the runtime service corresponding to an Android program is Android Runtime.
  • the runtime service is Java Runtime; if the program on the second terminal device is an Android program, the runtime service is Android Runtime. If the program on the second terminal device is a program in another language, the runtime service is a runtime service in the other language.
  • test commands such as obtaining a certain content on a certain page in the application, obtaining the page content after a control is clicked on a certain page in the application, obtaining attributes of a certain page in the application, etc.
  • the application program may be, for example, a web application program.
  • Web applications are applications accessed through a browser.
  • the target identifier is the identifier of the target application, which can uniquely identify the target application.
  • the target identifier can be the name, number, etc. of the target application, which can be set according to actual needs, and is not specifically limited here.
  • the first terminal device is provided with a test script for the target application on the second terminal device.
  • the process of sending a test instruction by the first terminal device may be, for example, running a test script of the target application, where the test script includes at least one test instruction, and the at least one test instruction during the running of the test script is passed through the second terminal device.
  • the runtime service is sent to the browser on the second terminal device.
  • the running of the target application is based on the browser on the second terminal device.
  • the browser may be a browser based on an operating system on the second terminal device.
  • the test script can be written in python language, for example.
  • the browser on the second terminal device performs step 101, for example, by receiving a startup instruction of the runtime service, where the startup instruction is sent by the runtime service according to the test instruction; the runtime service passes the first
  • the communication method receives the test instruction from the first terminal device; performs startup processing according to the startup instruction; and receives the test instruction sent by the runtime service through the second communication method.
  • the runtime service can communicate with the first terminal device through the first communication method, and the runtime service can communicate with the browser on the second terminal device through the second communication method, thereby realizing the communication between the browser on the second terminal device and Communication between first terminal devices.
  • the first communication method may be, for example, a remote invocation grpc communication method.
  • the second communication method may be, for example, a post message communication method.
  • the runtime service receives the test instruction sent by the first terminal device through the first communication method, if the test instruction is for the application, it needs to first determine whether the browser on the second terminal device is in a started state; if If the browser is in the startup state, the test instruction is sent to the target application corresponding to the target representation in the test instruction through the second communication method; if the browser is not in the startup state, the startup instruction is first sent to the browser through the second communication method; After the browser is successfully started, a test instruction is sent to the browser through the second communication method.
  • Step 102 Determine the execution script corresponding to the test command in the target application corresponding to the target identifier.
  • the browser on the second terminal device performs step 102, for example, by obtaining the corresponding relationship between at least one execution script and at least one test command in the target application; querying the corresponding relationship according to the test command, obtaining the corresponding relationship with The execution script corresponding to the test command.
  • the browser on the second terminal device may also perform the following process: receiving a configuration instruction from the first terminal device, where the configuration instruction includes: Correspondence between at least one execution script and at least one test command in the target application.
  • Step 103 Run the execution script and obtain the execution result of the execution script.
  • the browser on the second terminal device can run the execution script in the browser environment and obtain the execution result of the execution script.
  • the execution results for example, a certain content on a certain page in the application, the content of the page after the control is clicked on a certain page in the application, the properties of a certain page in the application, etc., can be set according to actual needs. There are no specific limitations.
  • Step 104 Return the execution result to the first terminal device through the runtime service.
  • the browser on the second terminal device may return the execution result to the runtime service through the second communication method, and the runtime service returns the execution result to the first terminal device through the first communication method.
  • the first terminal device determines the test result of the target application program on the second terminal device according to the expected execution result of the test instruction and the execution result.
  • the automated testing method of an application program in an embodiment of the present disclosure receives a test instruction sent by the first terminal device through a runtime service, wherein the test instruction includes: a target identifier and a test command; and determines the target application corresponding to the target identifier. the execution script corresponding to the test command; run the execution script, and obtain the execution result of the execution script; return the execution result to the first terminal device through the runtime service, so as to When the target application in the device is tested, the test instructions of the first terminal device can be received through the runtime service. There is no need to modify the browser in the device, thereby reducing testing costs and improving testing efficiency.
  • FIG. 2 is a schematic structural diagram of an automated testing device for an application program according to an embodiment of the present disclosure.
  • the automated testing device of the application may include: a receiving module 201, a determining module 202, a processing module 203 and a sending module 204; wherein,
  • the receiving module 201 is configured to receive a test instruction sent by the first terminal device through a runtime service, where the test instruction includes: a target identifier and a test command;
  • Determining module 202 used to determine the execution script corresponding to the test command in the target application corresponding to the target identification
  • the processing module 203 is used to run the execution script and obtain the execution result of the execution script
  • the sending module 204 is configured to return the execution result to the first terminal device through the runtime service.
  • the receiving module 201 is specifically configured to receive a startup instruction of the runtime service, wherein the startup instruction is sent by the runtime service according to the test instruction; the running The runtime service receives the test instruction from the first terminal device through the first communication method; performs startup processing according to the startup instruction; and receives the test instruction sent by the runtime service through the second communication method.
  • the first communication method is grpc communication method
  • the second communication method is post message communication method
  • the determination module 202 is specifically configured to obtain the corresponding relationship between at least one execution script and at least one test command in the target application program; query the corresponding relationship according to the test command, and obtain Execution script corresponding to the test command.
  • the receiving module 201 is further configured to receive a configuration instruction of the first terminal device, wherein the configuration instruction includes: at least one execution script in the target application and at least Correspondence of a test command.
  • the automated testing device for an application program in an embodiment of the present disclosure receives a test instruction sent by the first terminal device through a runtime service, where the test instruction includes: a target identifier and a test command; and determines the target application corresponding to the target identifier. the execution script corresponding to the test command; run the execution script, and obtain the execution result of the execution script; return the execution result to the first terminal device through the runtime service, so as to When the target application in the device is tested, the test instructions of the first terminal device can be received through the runtime service. There is no need to modify the browser in the device, thereby reducing testing costs and improving testing efficiency.
  • an electronic device including: a processor; and a memory for storing instructions executable by the processor, wherein the processor is configured to execute the instructions to implement the above application program. Automated testing methods.
  • the present disclosure also proposes a storage medium.
  • the electronic device When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is enabled to perform the above method.
  • the present disclosure also provides a computer program product.
  • the electronic device when the computer program product is executed by the processor of the electronic device, the electronic device can perform the above method.
  • FIG. 3 is a structural block diagram of an electronic device according to an exemplary embodiment.
  • the electronic device shown in FIG. 3 is only an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
  • the electronic device 1000 includes a processor 111, which can be loaded into a random access memory (RAM, Random Access Memory) 113 according to a program stored in a read-only memory (ROM, Read Only Memory) 112 or from a memory 116 perform various appropriate actions and processing according to the program in it.
  • RAM random access memory
  • ROM Read Only Memory
  • RAM random access memory
  • various programs and data required for the operation of the electronic device 1000 are also stored.
  • the processor 111, ROM 112 and RAM 113 are connected to each other through a bus 114.
  • An input/output (I/O, Input/Output) interface 115 is also connected to bus 114 .
  • the following components are connected to the I/O interface 115: a memory 116 including a hard disk, etc.; and a communication section 117 including a network interface card such as a Local Area Network (LAN) card, a modem, etc., which is executed via a network such as the Internet. Communication processing; driver 118 is also connected to I/O interface 115 as needed.
  • a memory 116 including a hard disk, etc.
  • a communication section 117 including a network interface card such as a Local Area Network (LAN) card, a modem, etc., which is executed via a network such as the Internet.
  • Communication processing driver 118 is also connected to I/O interface 115 as needed.
  • embodiments of the present disclosure include a computer program carried on a computer-readable medium, the computer program containing program code for performing the method illustrated in the flowchart.
  • the computer program can be downloaded and installed from the network via the communication section 117 .
  • the computer program is executed by the processor 111, the above-described functions defined in the method of the present disclosure are performed.
  • a storage medium including instructions such as a memory including instructions, which can be executed by the processor 111 of the electronic device 1000 to complete the above method is also provided.
  • the storage medium may be a non-transitory computer-readable storage medium.
  • the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc. .
  • a computer-readable storage medium may be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the foregoing.

Landscapes

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

Abstract

The present invention relates to an automated testing method and apparatus for an application. The method comprises: receiving, by means of a runtime service, a test instruction sent by a first terminal device, wherein the test instruction comprises a target identifier and a test command; determining an execution script corresponding to the test command in a target application corresponding to the target identifier; running the execution script, and obtaining an execution result of the execution script; and returning the execution result to the first terminal device by means of the runtime service.

Description

应用程序的自动化测试方法及装置Automated testing method and device for application programs 技术领域Technical field
本公开涉及测试技术领域,尤其涉及一种应用程序的自动化测试方法及装置。The present disclosure relates to the field of testing technology, and in particular, to an automated testing method and device for an application program.
背景技术Background technique
目前,针对设备中的应用程序,应用程序的自动化测试方法主要为,对设备中的浏览器进行改造处理,以接收其他设备发送的测试指令,以进行测试处理。上述方案中,对浏览器的改造处理,工作量大,改造时间长,导致测试成本高,测试效率差。Currently, for applications in a device, the automated testing method of the application mainly involves modifying the browser in the device to receive test instructions sent by other devices for test processing. In the above solution, the browser modification process requires a large workload and a long modification time, resulting in high testing costs and poor testing efficiency.
发明内容Contents of the invention
本公开提供一种应用程序的自动化测试方法及装置。The present disclosure provides an automated testing method and device for an application program.
根据本公开实施例的第一方面,提供一种应用程序的自动化测试方法,应用于浏览器,所述方法包括:通过运行时服务接收第一终端设备发送的测试指令,其中,所述测试指令包括:目标标识以及测试命令;确定所述目标标识对应的目标应用程序中与所述测试命令对应的执行脚本;运行所述执行脚本,并获取所述执行脚本的执行结果;将所述执行结果通过所述运行时服务返回给所述第一终端设备。According to a first aspect of an embodiment of the present disclosure, an automated testing method for an application is provided, which is applied to a browser. The method includes: receiving a test instruction sent by a first terminal device through a runtime service, wherein the test instruction The method includes: a target identifier and a test command; determining the execution script corresponding to the test command in the target application corresponding to the target identifier; running the execution script and obtaining the execution result of the execution script; converting the execution result Returned to the first terminal device through the runtime service.
在本公开的一个实施例中,所述通过运行时服务接收第一终端设备发送的测试指令,包括:接收所述运行时服务的启动指令,其中,所述启动指令由所述运行时服务根据所述测试指令发送;所述运行时服务通过第一通信方式从所述第一终端设备接收所述测试指令;根据所述启动指令进行启动处理;接收所述运行时服务通过第二通信方式发送的所述测试指令。In one embodiment of the present disclosure, receiving the test instruction sent by the first terminal device through the runtime service includes: receiving a startup instruction of the runtime service, wherein the startup instruction is provided by the runtime service according to The test instruction is sent; the runtime service receives the test instruction from the first terminal device through a first communication method; performs startup processing according to the startup instruction; receives the runtime service and sends it through a second communication method of the test instructions.
在本公开的一个实施例中,所述第一通信方式为grpc通信方式;所述第二通信方式为post message通信方式。In one embodiment of the present disclosure, the first communication method is grpc communication method; the second communication method is post message communication method.
在本公开的一个实施例中,所述确定所述目标标识对应的目标应用程序中与所述测试命令对应的执行脚本,包括:获取所述目标应用程序中至少一个执行脚本与至少一个测试命令的对应关系;根据所述测试命令查询所述对应关系,获取与所述测试命令对应的执行脚本。In one embodiment of the present disclosure, determining the execution script corresponding to the test command in the target application corresponding to the target identification includes: obtaining at least one execution script and at least one test command in the target application. The corresponding relationship; query the corresponding relationship according to the test command, and obtain the execution script corresponding to the test command.
在本公开的一个实施例中,在通过运行时服务接收第一终端设备发送的测试指令之前,所述方法还包括:接收所述第一终端设备的配置指令,其中,所述配置指令包括:所 述目标应用程序中至少一个执行脚本与至少一个测试命令的对应关系。In one embodiment of the present disclosure, before receiving the test instruction sent by the first terminal device through the runtime service, the method further includes: receiving a configuration instruction of the first terminal device, wherein the configuration instruction includes: Correspondence between at least one execution script and at least one test command in the target application.
根据本公开实施例的第二方面,还提供一种应用程序的自动化测试装置,应用于浏览器,所述装置包括:接收模块,用于通过运行时服务接收第一终端设备发送的测试指令,其中,所述测试指令包括:目标标识以及测试命令;确定模块,用于确定所述目标标识对应的目标应用程序中与所述测试命令对应的执行脚本;处理模块,用于运行所述执行脚本,并获取所述执行脚本的执行结果;发送模块,用于将所述执行结果通过所述运行时服务返回给所述第一终端设备。According to a second aspect of the embodiment of the present disclosure, an automated testing device for an application program is also provided, which is applied to a browser. The device includes: a receiving module configured to receive a test instruction sent by a first terminal device through a runtime service, Wherein, the test instruction includes: a target identifier and a test command; a determination module, used to determine the execution script corresponding to the test command in the target application corresponding to the target identifier; and a processing module, used to run the execution script , and obtain the execution result of the execution script; the sending module is configured to return the execution result to the first terminal device through the runtime service.
在本公开的一个实施例中,所述接收模块具体用于,接收所述运行时服务的启动指令,其中,所述启动指令由所述运行时服务根据所述测试指令发送;所述运行时服务通过第一通信方式从所述第一终端设备接收所述测试指令;根据所述启动指令进行启动处理;接收所述运行时服务通过第二通信方式发送的所述测试指令。In one embodiment of the present disclosure, the receiving module is specifically configured to receive a startup instruction of the runtime service, wherein the startup instruction is sent by the runtime service according to the test instruction; the runtime The service receives the test instruction from the first terminal device through a first communication method; performs startup processing according to the startup instruction; and receives the test instruction sent by the runtime service through a second communication method.
在本公开的一个实施例中,所述第一通信方式为grpc通信方式;所述第二通信方式为post message通信方式。In one embodiment of the present disclosure, the first communication method is grpc communication method; the second communication method is post message communication method.
在本公开的一个实施例中,所述确定模块具体用于,获取所述目标应用程序中至少一个执行脚本与至少一个测试命令的对应关系;根据所述测试命令查询所述对应关系,获取与所述测试命令对应的执行脚本。In one embodiment of the present disclosure, the determination module is specifically configured to obtain the corresponding relationship between at least one execution script and at least one test command in the target application program; query the corresponding relationship according to the test command, and obtain the corresponding relationship with The execution script corresponding to the test command.
在本公开的一个实施例中,所述接收模块,还用于,接收所述第一终端设备的配置指令,其中,所述配置指令包括:所述目标应用程序中至少一个执行脚本与至少一个测试命令的对应关系。In one embodiment of the present disclosure, the receiving module is further configured to receive a configuration instruction of the first terminal device, wherein the configuration instruction includes: at least one execution script in the target application program and at least one Test the correspondence between commands.
根据本公开实施例的第三方面,还提供一种电子设备,包括:处理器;用于存储所述处理器可执行指令的存储器;其中,所述处理器被配置为执行所述指令,以实现如上所述的应用程序的自动化测试方法。According to a third aspect of an embodiment of the present disclosure, an electronic device is further provided, including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to Implement automated testing methods for applications as described above.
根据本公开实施例的第四方面,还提供一种非临时性计算机可读存储介质,当所述存储介质中的指令由处理器执行时,使得处理器能够执行如上所述的应用程序的自动化测试方法。According to a fourth aspect of an embodiment of the present disclosure, a non-transitory computer-readable storage medium is also provided, which when instructions in the storage medium are executed by a processor, enables the processor to execute the automation of the application program as described above. Test Methods.
本公开的实施例提供的技术方案至少带来以下有益效果:The technical solutions provided by the embodiments of the present disclosure at least bring the following beneficial effects:
通过运行时服务接收第一终端设备发送的测试指令,其中,所述测试指令包括:目标标识以及测试命令;确定所述目标标识对应的目标应用程序中与所述测试命令对应的执行脚本;运行所述执行脚本,并获取所述执行脚本的执行结果;将所述执行结果通过所述运行时服务返回给所述第一终端设备,从而在对设备中的目标应用程序进行测试时,可以通 过运行时服务接收第一终端设备的测试指令,不需要对设备中的浏览器进行改造处理,从而降低测试成本,提高测试效率。Receive the test instruction sent by the first terminal device through the runtime service, wherein the test instruction includes: a target identifier and a test command; determine the execution script corresponding to the test command in the target application corresponding to the target identifier; run Describe the execution script, and obtain the execution result of the execution script; return the execution result to the first terminal device through the runtime service, so that when testing the target application in the device, the execution result can be The runtime service receives the test instructions from the first terminal device and does not need to modify the browser in the device, thereby reducing test costs and improving test efficiency.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only, and do not limit the present disclosure.
附图说明Description of the drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理,并不构成对本公开的不当限定。The drawings herein are incorporated into and constitute a part of this specification, illustrate embodiments consistent with the disclosure, and together with the description are used to explain the principles of the disclosure, and do not constitute undue limitations on the disclosure.
图1为本公开一个实施例的应用程序的自动化测试方法的流程图;Figure 1 is a flow chart of an automated testing method for an application program according to an embodiment of the present disclosure;
图2为本公开一个实施例的应用程序的自动化测试装置的结构示意图;Figure 2 is a schematic structural diagram of an automated testing device for an application program according to an embodiment of the present disclosure;
图3为根据本公开一示例性实施例示出的一种电子设备的结构框图。FIG. 3 is a structural block diagram of an electronic device according to an exemplary embodiment of the present disclosure.
具体实施方式Detailed ways
为了使本领域普通人员更好地理解本公开的技术方案,下面将结合附图,对本公开实施例中的技术方案进行清楚、完整地描述。In order to allow ordinary people in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本公开的实施例能够以除了在这里图示或描述的那些以外的顺序实施。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。It should be noted that the terms "first", "second", etc. in the description and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances so that the embodiments of the disclosure described herein can be practiced in sequences other than those illustrated or described herein. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with aspects of the disclosure as detailed in the appended claims.
图1为本公开一个实施例的应用程序的自动化测试方法的流程图。其中,需要说明的是,本实施例的应用程序的自动化测试方法由应用程序的自动化测试装置执行,该应用程序的自动化测试装置可以由软件和/或硬件实现,该应用程序的自动化测试装置可以配置在电子设备中,该电子设备可以包括移动终端(如手机)、平板电脑等具有显示屏以及浏览器的终端设备。其中,软件例如终端设备上的浏览器等。以下以执行主体为第二终端设备上的浏览器为例进行说明。Figure 1 is a flow chart of an automated testing method for an application program according to an embodiment of the present disclosure. Among them, it should be noted that the automated testing method of the application program in this embodiment is executed by the automated testing device of the application program. The automated testing device of the application program can be implemented by software and/or hardware. The automated testing device of the application program can be It is configured in an electronic device, which may include a mobile terminal (such as a mobile phone), a tablet computer and other terminal devices with a display screen and a browser. Among them, the software is such as a browser on the terminal device, etc. The following description takes the execution subject as the browser on the second terminal device as an example.
如图1所示,该方法包括以下步骤:As shown in Figure 1, the method includes the following steps:
步骤101,通过运行时服务接收第一终端设备发送的测试指令,其中,测试指令包括:目标标识以及测试命令。Step 101: Receive a test instruction sent by the first terminal device through a runtime service, where the test instruction includes: a target identifier and a test command.
在一些实施例中,运行时服务,用于将程序语言转换为机器能听懂的机器语言。该运行时服务,具有操作系统的一些系统权限和系统功能。其中,不同的程序,对应不同的运 行时服务。例如,Java程序对应的运行时服务为Java Runtime;Android程序对应的运行时服务为Android Runtime。In some embodiments, the runtime service is used to convert the program language into machine language that the machine can understand. This runtime service has some system permissions and system functions of the operating system. Among them, different programs correspond to different runtime services. For example, the runtime service corresponding to a Java program is Java Runtime; the runtime service corresponding to an Android program is Android Runtime.
其中,若第二终端设备上的程序为Java程序,则运行时服务为Java Runtime;若第二终端设备上的程序为Android程序,则运行时服务为Android Runtime。若第二终端设备上的程序为其他语言的程序,则运行时服务为其他语言的运行时服务。Among them, if the program on the second terminal device is a Java program, the runtime service is Java Runtime; if the program on the second terminal device is an Android program, the runtime service is Android Runtime. If the program on the second terminal device is a program in another language, the runtime service is a runtime service in the other language.
在一些实施例中,测试命令,例如获取应用程序中某个页面上的某项内容、获取应用程序中某个页面上控件点击后的页面内容、获取应用程序中某个页面的属性等,可以根据实际需要进行设置,此处不做具体限定。其中,应用程序例如可以为web应用程序等。Web应用程序为通过浏览器访问的应用程序。In some embodiments, test commands, such as obtaining a certain content on a certain page in the application, obtaining the page content after a control is clicked on a certain page in the application, obtaining attributes of a certain page in the application, etc., can be Set according to actual needs, no specific restrictions are made here. The application program may be, for example, a web application program. Web applications are applications accessed through a browser.
其中,目标标识为目标应用程序的标识,可以唯一标示目标应用程序。例如,目标标识可以为目标应用程序的名称、编号等,可以根据实际需要进行设置,此处不做具体限定。Among them, the target identifier is the identifier of the target application, which can uniquely identify the target application. For example, the target identifier can be the name, number, etc. of the target application, which can be set according to actual needs, and is not specifically limited here.
在一些实施例中,第一终端设备上设置有针对第二终端设备上目标应用程序的测试脚本。第一终端设备发送测试指令的过程例如可以为,运行目标应用程序的测试脚本,其中,测试脚本中包括至少一个测试指令,依次测试脚本运行过程中的至少一个测试指令通过第二终端设备上的运行时服务发送给第二终端设备上的浏览器。其中,目标应用程序的运行基于第二终端设备上的浏览器。其中,浏览器可以为基于第二终端设备上操作系统的浏览器。测试脚本例如可以采用python语言编写。In some embodiments, the first terminal device is provided with a test script for the target application on the second terminal device. The process of sending a test instruction by the first terminal device may be, for example, running a test script of the target application, where the test script includes at least one test instruction, and the at least one test instruction during the running of the test script is passed through the second terminal device. The runtime service is sent to the browser on the second terminal device. Wherein, the running of the target application is based on the browser on the second terminal device. The browser may be a browser based on an operating system on the second terminal device. The test script can be written in python language, for example.
在一些实施例中,第二终端设备上的浏览器执行步骤101的过程例如可以为,接收运行时服务的启动指令,其中,启动指令由运行时服务根据测试指令发送;运行时服务通过第一通信方式从第一终端设备接收测试指令;根据启动指令进行启动处理;接收运行时服务通过第二通信方式发送的测试指令。In some embodiments, the browser on the second terminal device performs step 101, for example, by receiving a startup instruction of the runtime service, where the startup instruction is sent by the runtime service according to the test instruction; the runtime service passes the first The communication method receives the test instruction from the first terminal device; performs startup processing according to the startup instruction; and receives the test instruction sent by the runtime service through the second communication method.
其中,运行时服务可以通过第一通信方式与第一终端设备进行通信,运行时服务可以通过第二通信方式与第二终端设备上的浏览器通信,从而实现第二终端设备上的浏览器与第一终端设备之间的通信。其中,第一通信方式例如可以为远程调用grpc通信方式。第二通信方式例如可以为post message通信方式。Wherein, the runtime service can communicate with the first terminal device through the first communication method, and the runtime service can communicate with the browser on the second terminal device through the second communication method, thereby realizing the communication between the browser on the second terminal device and Communication between first terminal devices. The first communication method may be, for example, a remote invocation grpc communication method. The second communication method may be, for example, a post message communication method.
其中,运行时服务在接收到第一终端设备通过第一通信方式发送的测试指令后,若测试指令是针对应用程序的,则需要先判断第二终端设备上的浏览器是否处于启动状态;若浏览器处于启动状态,则通过第二通信方式将测试指令发送给测试指令中目标表示对应的目标应用程序;若浏览器未处于启动状态,则先通过第二通信方式向浏览器发送启动指令;在浏览器成功启动后,再通过第二通信方式向浏览器发送测试指令。Among them, after the runtime service receives the test instruction sent by the first terminal device through the first communication method, if the test instruction is for the application, it needs to first determine whether the browser on the second terminal device is in a started state; if If the browser is in the startup state, the test instruction is sent to the target application corresponding to the target representation in the test instruction through the second communication method; if the browser is not in the startup state, the startup instruction is first sent to the browser through the second communication method; After the browser is successfully started, a test instruction is sent to the browser through the second communication method.
步骤102,确定目标标识对应的目标应用程序中与测试命令对应的执行脚本。Step 102: Determine the execution script corresponding to the test command in the target application corresponding to the target identifier.
在一些实施例中,第二终端设备上的浏览器执行步骤102的过程例如可以为,获取目 标应用程序中至少一个执行脚本与至少一个测试命令的对应关系;根据测试命令查询对应关系,获取与测试命令对应的执行脚本。In some embodiments, the browser on the second terminal device performs step 102, for example, by obtaining the corresponding relationship between at least one execution script and at least one test command in the target application; querying the corresponding relationship according to the test command, obtaining the corresponding relationship with The execution script corresponding to the test command.
其中,在确定目标标识对应的目标应用程序中与测试命令对应的执行脚本之前,第二终端设备上的浏览器还可以执行以下过程:接收第一终端设备的配置指令,其中,配置指令包括:目标应用程序中至少一个执行脚本与至少一个测试命令的对应关系。Before determining the execution script corresponding to the test command in the target application corresponding to the target identifier, the browser on the second terminal device may also perform the following process: receiving a configuration instruction from the first terminal device, where the configuration instruction includes: Correspondence between at least one execution script and at least one test command in the target application.
步骤103,运行执行脚本,并获取执行脚本的执行结果。Step 103: Run the execution script and obtain the execution result of the execution script.
其中,第二终端设备上的浏览器可以在浏览器环境中运行执行脚本,把那个获取执行脚本的执行结果。其中,执行结果例如,应用程序中某个页面上的某项内容、应用程序中某个页面上控件点击后的页面内容、应用程序中某个页面的属性等,可以根据实际需要进行设置,此处不做具体限定。Among them, the browser on the second terminal device can run the execution script in the browser environment and obtain the execution result of the execution script. Among them, the execution results, for example, a certain content on a certain page in the application, the content of the page after the control is clicked on a certain page in the application, the properties of a certain page in the application, etc., can be set according to actual needs. There are no specific limitations.
步骤104,将执行结果通过运行时服务返回给第一终端设备。Step 104: Return the execution result to the first terminal device through the runtime service.
在一些实施例中,第二终端设备上的浏览器可以将执行结果通过第二通信方式返回给运行时服务,由运行时服务通过第一通信方式将执行结果返回给第一终端设备。第一终端设备根据测试指令的预期执行结果与该执行结果,确定第二终端设备上目标应用程序的测试结果。In some embodiments, the browser on the second terminal device may return the execution result to the runtime service through the second communication method, and the runtime service returns the execution result to the first terminal device through the first communication method. The first terminal device determines the test result of the target application program on the second terminal device according to the expected execution result of the test instruction and the execution result.
本公开实施例的应用程序的自动化测试方法,通过运行时服务接收第一终端设备发送的测试指令,其中,所述测试指令包括:目标标识以及测试命令;确定所述目标标识对应的目标应用程序中与所述测试命令对应的执行脚本;运行所述执行脚本,并获取所述执行脚本的执行结果;将所述执行结果通过所述运行时服务返回给所述第一终端设备,从而在对设备中的目标应用程序进行测试时,可以通过运行时服务接收第一终端设备的测试指令,不需要对设备中的浏览器进行改造处理,从而降低测试成本,提高测试效率。The automated testing method of an application program in an embodiment of the present disclosure receives a test instruction sent by the first terminal device through a runtime service, wherein the test instruction includes: a target identifier and a test command; and determines the target application corresponding to the target identifier. the execution script corresponding to the test command; run the execution script, and obtain the execution result of the execution script; return the execution result to the first terminal device through the runtime service, so as to When the target application in the device is tested, the test instructions of the first terminal device can be received through the runtime service. There is no need to modify the browser in the device, thereby reducing testing costs and improving testing efficiency.
图2为本公开一个实施例的应用程序的自动化测试装置的结构示意图。FIG. 2 is a schematic structural diagram of an automated testing device for an application program according to an embodiment of the present disclosure.
如图2所示,该应用程序的自动化测试装置可以包括:接收模块201、确定模块202、处理模块203和发送模块204;其中,As shown in Figure 2, the automated testing device of the application may include: a receiving module 201, a determining module 202, a processing module 203 and a sending module 204; wherein,
接收模块201,用于通过运行时服务接收第一终端设备发送的测试指令,其中,所述测试指令包括:目标标识以及测试命令;The receiving module 201 is configured to receive a test instruction sent by the first terminal device through a runtime service, where the test instruction includes: a target identifier and a test command;
确定模块202,用于确定所述目标标识对应的目标应用程序中与所述测试命令对应的执行脚本;Determining module 202, used to determine the execution script corresponding to the test command in the target application corresponding to the target identification;
处理模块203,用于运行所述执行脚本,并获取所述执行脚本的执行结果;The processing module 203 is used to run the execution script and obtain the execution result of the execution script;
发送模块204,用于将所述执行结果通过所述运行时服务返回给所述第一终端设备。The sending module 204 is configured to return the execution result to the first terminal device through the runtime service.
在本公开的一个实施例中,所述接收模块201具体用于,接收所述运行时服务的启动 指令,其中,所述启动指令由所述运行时服务根据所述测试指令发送;所述运行时服务通过第一通信方式从所述第一终端设备接收所述测试指令;根据所述启动指令进行启动处理;接收所述运行时服务通过第二通信方式发送的所述测试指令。In one embodiment of the present disclosure, the receiving module 201 is specifically configured to receive a startup instruction of the runtime service, wherein the startup instruction is sent by the runtime service according to the test instruction; the running The runtime service receives the test instruction from the first terminal device through the first communication method; performs startup processing according to the startup instruction; and receives the test instruction sent by the runtime service through the second communication method.
在本公开的一个实施例中,所述第一通信方式为grpc通信方式;所述第二通信方式为post message通信方式。In one embodiment of the present disclosure, the first communication method is grpc communication method; the second communication method is post message communication method.
在本公开的一个实施例中,所述确定模块202具体用于,获取所述目标应用程序中至少一个执行脚本与至少一个测试命令的对应关系;根据所述测试命令查询所述对应关系,获取与所述测试命令对应的执行脚本。In one embodiment of the present disclosure, the determination module 202 is specifically configured to obtain the corresponding relationship between at least one execution script and at least one test command in the target application program; query the corresponding relationship according to the test command, and obtain Execution script corresponding to the test command.
在本公开的一个实施例中,所述接收模块201,还用于,接收所述第一终端设备的配置指令,其中,所述配置指令包括:所述目标应用程序中至少一个执行脚本与至少一个测试命令的对应关系。In one embodiment of the present disclosure, the receiving module 201 is further configured to receive a configuration instruction of the first terminal device, wherein the configuration instruction includes: at least one execution script in the target application and at least Correspondence of a test command.
其中,需要说明的是,前述对应用程序的自动化测试方法实施例的解释说明也适用于该实施例的应用程序的自动化测试装置,该实施例不再赘述。It should be noted that the foregoing explanation of the embodiment of the automated testing method for an application program is also applicable to the automated testing device for the application program in this embodiment, and this embodiment will not be described again.
本公开实施例的应用程序的自动化测试装置,通过运行时服务接收第一终端设备发送的测试指令,其中,所述测试指令包括:目标标识以及测试命令;确定所述目标标识对应的目标应用程序中与所述测试命令对应的执行脚本;运行所述执行脚本,并获取所述执行脚本的执行结果;将所述执行结果通过所述运行时服务返回给所述第一终端设备,从而在对设备中的目标应用程序进行测试时,可以通过运行时服务接收第一终端设备的测试指令,不需要对设备中的浏览器进行改造处理,从而降低测试成本,提高测试效率。The automated testing device for an application program in an embodiment of the present disclosure receives a test instruction sent by the first terminal device through a runtime service, where the test instruction includes: a target identifier and a test command; and determines the target application corresponding to the target identifier. the execution script corresponding to the test command; run the execution script, and obtain the execution result of the execution script; return the execution result to the first terminal device through the runtime service, so as to When the target application in the device is tested, the test instructions of the first terminal device can be received through the runtime service. There is no need to modify the browser in the device, thereby reducing testing costs and improving testing efficiency.
根据本公开实施例的第三方面,还提供一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器,其中,处理器被配置为执行指令,以实现如上的应用程序的自动化测试方法。According to a third aspect of an embodiment of the present disclosure, an electronic device is further provided, including: a processor; and a memory for storing instructions executable by the processor, wherein the processor is configured to execute the instructions to implement the above application program. Automated testing methods.
为了实现上述实施例,本公开还提出了一种存储介质。In order to implement the above embodiments, the present disclosure also proposes a storage medium.
其中,当存储介质中的指令由电子设备的处理器执行时,使得电子设备能够执行如上的方法。When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is enabled to perform the above method.
为了实现上述实施例,本公开还提供一种计算机程序产品。In order to implement the above embodiments, the present disclosure also provides a computer program product.
其中,该计算机程序产品由电子设备的处理器执行时,使得电子设备能够执行如上的方法。Wherein, when the computer program product is executed by the processor of the electronic device, the electronic device can perform the above method.
图3为根据一示例性实施例示出的一种电子设备的结构框图。图3示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。FIG. 3 is a structural block diagram of an electronic device according to an exemplary embodiment. The electronic device shown in FIG. 3 is only an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
如图3所示,电子设备1000包括处理器111,其可以根据存储在只读存储器(ROM, Read Only Memory)112中的程序或者从存储器116加载到随机访问存储器(RAM,Random Access Memory)113中的程序而执行各种适当的动作和处理。在RAM 113中,还存储有电子设备1000操作所需的各种程序和数据。处理器111、ROM 112以及RAM 113通过总线114彼此相连。输入/输出(I/O,Input/Output)接口115也连接至总线114。As shown in Figure 3, the electronic device 1000 includes a processor 111, which can be loaded into a random access memory (RAM, Random Access Memory) 113 according to a program stored in a read-only memory (ROM, Read Only Memory) 112 or from a memory 116 perform various appropriate actions and processing according to the program in it. In the RAM 113, various programs and data required for the operation of the electronic device 1000 are also stored. The processor 111, ROM 112 and RAM 113 are connected to each other through a bus 114. An input/output (I/O, Input/Output) interface 115 is also connected to bus 114 .
以下部件连接至I/O接口115:包括硬盘等的存储器116;以及包括诸如局域网(Local Area Network,LAN)卡、调制解调器等的网络接口卡的通信部分117,通信部分117经由诸如因特网的网络执行通信处理;驱动器118也根据需要连接至I/O接口115。The following components are connected to the I/O interface 115: a memory 116 including a hard disk, etc.; and a communication section 117 including a network interface card such as a Local Area Network (LAN) card, a modem, etc., which is executed via a network such as the Internet. Communication processing; driver 118 is also connected to I/O interface 115 as needed.
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分117从网络上被下载和安装。在该计算机程序被处理器111执行时,执行本公开的方法中限定的上述功能。In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program carried on a computer-readable medium, the computer program containing program code for performing the method illustrated in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication section 117 . When the computer program is executed by the processor 111, the above-described functions defined in the method of the present disclosure are performed.
在示例性实施例中,还提供了一种包括指令的存储介质,例如包括指令的存储器,上述指令可由电子设备1000的处理器111执行以完成上述方法。可选地,存储介质可以是非临时性计算机可读存储介质,例如,非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, a storage medium including instructions, such as a memory including instructions, which can be executed by the processor 111 of the electronic device 1000 to complete the above method is also provided. Optionally, the storage medium may be a non-transitory computer-readable storage medium. For example, the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc. .
在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。In this disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device . Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the foregoing.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Other embodiments of the disclosure will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure that follow the general principles of the disclosure and include common knowledge or customary technical means in the technical field that are not disclosed in the disclosure. . It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It is to be understood that the present disclosure is not limited to the precise structures described above and illustrated in the accompanying drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the disclosure is limited only by the appended claims.

Claims (12)

  1. 一种应用程序的自动化测试方法,其特征在于,应用于浏览器,所述方法包括:An automated testing method for an application, characterized in that it is applied to a browser, and the method includes:
    通过运行时服务接收第一终端设备发送的测试指令,其中,所述测试指令包括:目标标识以及测试命令;Receive the test instruction sent by the first terminal device through the runtime service, where the test instruction includes: a target identifier and a test command;
    确定所述目标标识对应的目标应用程序中与所述测试命令对应的执行脚本;Determine the execution script corresponding to the test command in the target application corresponding to the target identifier;
    运行所述执行脚本,并获取所述执行脚本的执行结果;Run the execution script and obtain the execution result of the execution script;
    将所述执行结果通过所述运行时服务返回给所述第一终端设备。Return the execution result to the first terminal device through the runtime service.
  2. 根据权利要求1所述的方法,其特征在于,所述通过运行时服务接收第一终端设备发送的测试指令,包括:The method according to claim 1, characterized in that receiving the test instruction sent by the first terminal device through the runtime service includes:
    接收所述运行时服务的启动指令,其中,所述启动指令由所述运行时服务根据所述测试指令发送;所述运行时服务通过第一通信方式从所述第一终端设备接收所述测试指令;Receive a startup instruction of the runtime service, wherein the startup instruction is sent by the runtime service according to the test instruction; the runtime service receives the test from the first terminal device through a first communication method instruction;
    根据所述启动指令进行启动处理;Perform startup processing according to the startup instruction;
    接收所述运行时服务通过第二通信方式发送的所述测试指令。Receive the test instruction sent by the runtime service through the second communication method.
  3. 根据权利要求2所述的方法,其特征在于,所述第一通信方式为grpc通信方式;The method according to claim 2, characterized in that the first communication method is grpc communication method;
    所述第二通信方式为post message通信方式。The second communication method is a post message communication method.
  4. 根据权利要求1所述的方法,其特征在于,所述确定所述目标标识对应的目标应用程序中与所述测试命令对应的执行脚本,包括:The method of claim 1, wherein determining the execution script corresponding to the test command in the target application corresponding to the target identifier includes:
    获取所述目标应用程序中至少一个执行脚本与至少一个测试命令的对应关系;Obtain the corresponding relationship between at least one execution script and at least one test command in the target application;
    根据所述测试命令查询所述对应关系,获取与所述测试命令对应的执行脚本。Query the corresponding relationship according to the test command, and obtain the execution script corresponding to the test command.
  5. 根据权利要求1或4所述的方法,其特征在于,在通过运行时服务接收第一终端设备发送的测试指令之前,所述方法还包括:The method according to claim 1 or 4, characterized in that, before receiving the test instruction sent by the first terminal device through the runtime service, the method further includes:
    接收所述第一终端设备的配置指令,其中,所述配置指令包括:所述目标应用程序中至少一个执行脚本与至少一个测试命令的对应关系。Receive a configuration instruction from the first terminal device, where the configuration instruction includes: a correspondence between at least one execution script and at least one test command in the target application.
  6. 一种应用程序的自动化测试装置,其特征在于,应用于浏览器,所述装置包括:An automated testing device for application programs, characterized in that it is applied to a browser, and the device includes:
    接收模块,用于通过运行时服务接收第一终端设备发送的测试指令,其中,所述测试指令包括:目标标识以及测试命令;A receiving module, configured to receive a test instruction sent by the first terminal device through a runtime service, where the test instruction includes: a target identifier and a test command;
    确定模块,用于确定所述目标标识对应的目标应用程序中与所述测试命令对应的执行脚本;Determining module, used to determine the execution script corresponding to the test command in the target application corresponding to the target identification;
    处理模块,用于运行所述执行脚本,并获取所述执行脚本的执行结果;A processing module, used to run the execution script and obtain the execution result of the execution script;
    发送模块,用于将所述执行结果通过所述运行时服务返回给所述第一终端设备。A sending module, configured to return the execution result to the first terminal device through the runtime service.
  7. 根据权利要求6所述的装置,其特征在于,所述接收模块具体用于,The device according to claim 6, characterized in that the receiving module is specifically used to:
    接收所述运行时服务的启动指令,其中,所述启动指令由所述运行时服务根据所述测试指令发送;所述运行时服务通过第一通信方式从所述第一终端设备接收所述测试指令;Receive a startup instruction of the runtime service, wherein the startup instruction is sent by the runtime service according to the test instruction; the runtime service receives the test from the first terminal device through a first communication method instruction;
    根据所述启动指令进行启动处理;Perform startup processing according to the startup instruction;
    接收所述运行时服务通过第二通信方式发送的所述测试指令。Receive the test instruction sent by the runtime service through the second communication method.
  8. 根据权利要求7所述的装置,其特征在于,所述第一通信方式为grpc通信方式;The device according to claim 7, characterized in that the first communication method is grpc communication method;
    所述第二通信方式为post message通信方式。The second communication method is a post message communication method.
  9. 根据权利要求6所述的装置,其特征在于,所述确定模块具体用于,The device according to claim 6, characterized in that the determining module is specifically used to:
    获取所述目标应用程序中至少一个执行脚本与至少一个测试命令的对应关系;Obtain the corresponding relationship between at least one execution script and at least one test command in the target application;
    根据所述测试命令查询所述对应关系,获取与所述测试命令对应的执行脚本。Query the corresponding relationship according to the test command, and obtain the execution script corresponding to the test command.
  10. 根据权利要求6或9所述的装置,其特征在于,所述接收模块,还用于,The device according to claim 6 or 9, characterized in that the receiving module is also used to:
    接收所述第一终端设备的配置指令,其中,所述配置指令包括:所述目标应用程序中至少一个执行脚本与至少一个测试命令的对应关系。Receive a configuration instruction from the first terminal device, where the configuration instruction includes: a correspondence between at least one execution script and at least one test command in the target application.
  11. 一种电子设备,其特征在于,包括:An electronic device, characterized by including:
    处理器;processor;
    用于存储所述处理器可执行指令的存储器;memory for storing instructions executable by the processor;
    其中,所述处理器被配置为执行所述指令,以实现如权利要求1至5中任一项所述的应用程序的自动化测试方法。Wherein, the processor is configured to execute the instructions to implement the automated testing method of the application program according to any one of claims 1 to 5.
  12. 一种非临时性计算机可读存储介质,当所述存储介质中的指令由处理器执行时,使得处理器能够执行如权利要求1至5中任一项所述的应用程序的自动化测试方法。A non-transitory computer-readable storage medium that, when instructions in the storage medium are executed by a processor, enables the processor to execute the automated testing method of an application program according to any one of claims 1 to 5.
PCT/CN2022/094507 2022-05-23 2022-05-23 Automated testing method and apparatus for application WO2023225801A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202280004086.8A CN117441163A (en) 2022-05-23 2022-05-23 Automatic testing method and device for application program
PCT/CN2022/094507 WO2023225801A1 (en) 2022-05-23 2022-05-23 Automated testing method and apparatus for application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/094507 WO2023225801A1 (en) 2022-05-23 2022-05-23 Automated testing method and apparatus for application

Publications (1)

Publication Number Publication Date
WO2023225801A1 true WO2023225801A1 (en) 2023-11-30

Family

ID=88918153

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/094507 WO2023225801A1 (en) 2022-05-23 2022-05-23 Automated testing method and apparatus for application

Country Status (2)

Country Link
CN (1) CN117441163A (en)
WO (1) WO2023225801A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117520210A (en) * 2024-01-05 2024-02-06 芯瞳半导体技术(山东)有限公司 System software testing method, target machine and remote testing central control machine

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103544083A (en) * 2013-10-29 2014-01-29 中国联合网络通信集团有限公司 Terminal testing method and explorer
CN104636251A (en) * 2014-12-30 2015-05-20 安科智慧城市技术(中国)有限公司 Testing method and system for compatibility of multiple browsers
CN106126414A (en) * 2016-06-14 2016-11-16 珠海格力电器股份有限公司 Application software testing method and system
CN108595329A (en) * 2018-04-23 2018-09-28 腾讯科技(深圳)有限公司 A kind of application testing method, device and computer storage media
US20190065349A1 (en) * 2017-08-24 2019-02-28 Salesforce.Com, Inc. Automatically executing stateless transactions with data dependency in test cases
CN111414309A (en) * 2020-03-27 2020-07-14 武汉联影医疗科技有限公司 Automatic test method of application program, computer equipment and storage medium
CN112241371A (en) * 2020-10-21 2021-01-19 四川长虹电器股份有限公司 Method for improving testing efficiency of Web application interface

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103544083A (en) * 2013-10-29 2014-01-29 中国联合网络通信集团有限公司 Terminal testing method and explorer
CN104636251A (en) * 2014-12-30 2015-05-20 安科智慧城市技术(中国)有限公司 Testing method and system for compatibility of multiple browsers
CN106126414A (en) * 2016-06-14 2016-11-16 珠海格力电器股份有限公司 Application software testing method and system
US20190065349A1 (en) * 2017-08-24 2019-02-28 Salesforce.Com, Inc. Automatically executing stateless transactions with data dependency in test cases
CN108595329A (en) * 2018-04-23 2018-09-28 腾讯科技(深圳)有限公司 A kind of application testing method, device and computer storage media
CN111414309A (en) * 2020-03-27 2020-07-14 武汉联影医疗科技有限公司 Automatic test method of application program, computer equipment and storage medium
CN112241371A (en) * 2020-10-21 2021-01-19 四川长虹电器股份有限公司 Method for improving testing efficiency of Web application interface

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
FU LING-LI, DAI JUN-QIU, LIU JIN-HE: "Automated Testing Solutions for Web Application", JOURNAL OF HEBEI UNIVERSITY OF TECHNOLOGY, vol. 39, no. 4, 15 August 2010 (2010-08-15), pages 23 - 26, XP093112061, DOI: 10.14081/j.cnki.hgdxb.2010.04.019 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117520210A (en) * 2024-01-05 2024-02-06 芯瞳半导体技术(山东)有限公司 System software testing method, target machine and remote testing central control machine
CN117520210B (en) * 2024-01-05 2024-04-16 芯瞳半导体技术(山东)有限公司 System software testing method, target machine and remote testing central control machine

Also Published As

Publication number Publication date
CN117441163A (en) 2024-01-23

Similar Documents

Publication Publication Date Title
US10791200B2 (en) Method, apparatus and server for providing voice service
CN111176626B (en) Cross-programming-language code calling method and device, medium and equipment
CN111290806B (en) Calling method and device of application program interface, computer equipment and storage medium
CN112860798B (en) Data processing method and device, electronic equipment and storage medium
WO2019015272A1 (en) Information processing method and device
CN110069308B (en) Page starting method and device, electronic equipment and storage medium
CN111209202A (en) Terminal application testing method and device
WO2023225801A1 (en) Automated testing method and apparatus for application
CN111221572A (en) Method, device, medium and equipment for automatically adapting to operating environment
CN112948272A (en) Production environment-based data test system function method and device and related equipment
CN110221840B (en) Function implementation method and device of application program, equipment and storage medium
US11113177B1 (en) Securely debugging different applications in a single short-lived container
CN113760397A (en) Interface call processing method, device, equipment and storage medium
CN109189591B (en) Method and device for calling application component
CN111611065A (en) Calling method and device of machine learning algorithm, storage medium and electronic equipment
CN112491940A (en) Request forwarding method and device of proxy server, storage medium and electronic equipment
CN113760490B (en) Method and device for processing micro-service, electronic equipment and storage medium
CN111338928A (en) Chrome-based browser testing method and device
CN110348226A (en) A kind of scan method of project file, device, electronic equipment and storage medium
CN113158195B (en) Distributed vulnerability scanning method and system based on POC script
CN113296911B (en) Cluster calling method, cluster calling device, electronic equipment and readable storage medium
CN115374207A (en) Service processing method and device, electronic equipment and computer readable storage medium
CN111273970B (en) Calling method, device, system, medium and electronic equipment of intelligent contract
CN112182083A (en) File generation method, device, equipment and storage medium
US20200067913A1 (en) Modifying an identity token based on a trusted service

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 202280004086.8

Country of ref document: CN

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

Ref document number: 22943009

Country of ref document: EP

Kind code of ref document: A1