Automated testing method and device
By receiving the test instructions of the script executor in the automated testing method, finding and forwarding them to the corresponding equipment, the problem of low device management and utilization efficiency in the prior art is solved, and remote automated testing and efficient equipment management are realized.
Patent Information
- Application Number
- CN201910706775.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-08-01
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2039-08-01
AI Technical Summary
The existing automated testing methods have problems such as inefficient equipment management and utilization, inability to remotely manage equipment, and the cloud testing platform cannot support independent research and development of hardware equipment.
An automated testing method and device is provided, by receiving test instructions sent by the script execution machine, finding test nodes according to device encoding, and forwarding instructions to the corresponding device, realizing the return of remote test results and remote management of the device.
Remote automated testing of a large number of devices is realized, testing efficiency is improved, equipment management and maintenance is facilitated, and equipment utilization is maximized.
Smart Images

Figure CN112306851B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an automated testing method and device. Background Art
[0002] At present, there are more and more mobile phones and other smart devices on the market. When performing automated testing on applications on these devices, it is hoped that more devices can be covered to improve the compatibility of applications. However, the devices under test are usually expensive, especially some self-developed hardware devices. It is difficult to ensure that each tester has a set. A flexible and efficient system and method is needed to manage the existing devices under test and make full use of them.
[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0004] At present, there are several solutions for deploying the tested device during automated testing: connect the device to the local computer via USB cable and execute the test script directly on the local computer. Alternatively, connect the device to the server via USB cable and send the automated script to the server for execution. Alternatively, use a cloud testing platform (such as testin, mtc, etc.) to provide multiple devices for testing, send the test script to the platform, and select the corresponding device to execute.
[0005] Obviously, for the first type, testers need to constantly borrow and return equipment, which is very inefficient. For the second type, due to the limitations of the company's intranet, computers cannot access each other, the server can only be placed in the computer room, and the tested equipment cannot be put into the computer room for management. For the third type, a large number of devices can be provided for testing, but for security reasons, it is not convenient to put the company's internal applications outside for testing. At the same time, the cloud testing platform cannot provide testing for self-developed hardware equipment. Summary of the invention
[0006] In view of this, an embodiment of the present invention provides an automated testing method and apparatus, which can implement remote automated testing of a large number of devices.
[0007] To achieve the above-mentioned purpose, according to one aspect of an embodiment of the present invention, an automated testing method is provided, including receiving a test instruction sent by a script executor, searching for a corresponding test node according to the device under test code carried in the test instruction; forwarding the test instruction to the corresponding test node so that the test node sends the test instruction to the corresponding device under test; receiving the result of the device under test executing the test instruction, and returning it to the script executor.
[0008] Optionally, after receiving the test instruction sent by the script execution machine, the method further includes:
[0009] According to the device code carried in the test instruction, check whether the device is idle. If so, occupy the device. Otherwise, check whether the device is idle within the preset timeout period.
[0010] After receiving the result of the device under test executing the test instruction, the method includes: releasing the device under test.
[0011] Optionally, the occupying the device under test includes:
[0012] The interface of the device remote management system is called to upload the user ID to the device remote management system to occupy the device under test; wherein the user ID is an arbitrary string, generated in the page of the device remote management system, and associated with the user account.
[0013] Optionally, before receiving the test instruction sent by the script execution machine, the following steps are included:
[0014] A connection request from a script execution machine is received, and a connection is established with the script execution machine; wherein the connection is established with the script execution machine according to configuration information in the script.
[0015] In addition, according to one aspect of an embodiment of the present invention, an automated testing device is provided, including a receiving module for receiving a test instruction sent by a script executor, and searching for a corresponding test node according to a code of a device under test carried in the test instruction; a forwarding module for forwarding the test instruction to the corresponding test node, so that the test node sends the test instruction to the corresponding device under test; and a return module for receiving a result of the device under test executing the test instruction, and returning it to the script executor.
[0016] Optionally, after the receiving module receives the test instruction sent by the script execution machine, the receiving module includes:
[0017] According to the device code carried in the test instruction, check whether the device is idle. If so, occupy the device. Otherwise, check whether the device is idle within the preset timeout period.
[0018] After the return module receives the result of the device under test executing the test instruction, it includes: releasing the device under test.
[0019] Optionally, the receiving module occupies the device under test, including:
[0020] The interface of the device remote management system is called to upload the user ID to the device remote management system to occupy the device under test; wherein the user ID is an arbitrary string, generated in the page of the device remote management system, and associated with the user account.
[0021] Optionally, before the receiving module receives the test instruction sent by the script execution machine, it includes:
[0022] A connection request from a script execution machine is received, and a connection is established with the script execution machine; wherein the connection is established with the script execution machine according to configuration information in the script.
[0023] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, including:
[0024] one or more processors;
[0025] a storage device for storing one or more programs,
[0026] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the above automated testing embodiments.
[0027] According to another aspect of the embodiments of the present invention, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, any of the methods described above based on the automated testing embodiments is implemented.
[0028] One embodiment of the above invention has the following advantages or beneficial effects: the present invention receives the test instruction sent by the script execution machine, searches for the corresponding test node according to the tested device code carried in the test instruction; forwards the test instruction to the corresponding test node so that the test node sends the test instruction to the tested device corresponding thereto; receives the result of the tested device executing the test instruction, and returns it to the script execution machine. Therefore, the present invention can execute the local test script on the remote device, and makes the test device easy to manage and maintain, and maximizes the utilization rate.
[0029] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with specific implementation examples. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0031] Figure 1 is a schematic diagram of the main process of the automated testing method according to an embodiment of the present invention;
[0032] Figure 2 is a schematic diagram of a remote script distribution system according to an embodiment of the present invention;
[0033] Figure 3 is a schematic diagram of the main process of an automated testing method according to another embodiment of the present invention;
[0034] Figure 4 is a schematic diagram of the main process of an automated testing method according to another embodiment of the present invention;
[0035] Figure 5 is a schematic diagram of the main process of an automated testing method according to yet another embodiment of the present invention;
[0036] Figure 6 is a schematic diagram of main modules of an automated testing device according to an embodiment of the present invention;
[0037] Figure 7 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0038] Figure 8 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0039] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0040] Figure 1 is a schematic diagram of the main process of the automated testing method according to the first embodiment of the present invention. Based on a remote server, the automated testing method may include:
[0041] Step S101, receiving a test instruction sent by a script execution machine, and searching for a corresponding test node according to the device under test code carried in the test instruction.
[0042] Preferably, since the present invention can perform automated testing on a large number of devices under test, in order to creatively prevent device usage conflicts and effectively manage the devices under test, after executing step S101 to receive the test instruction sent by the script execution machine, it is possible to query whether the device under test is idle according to the device under test code carried in the test instruction. According to the query result, if it is idle, the device under test is occupied; if it is not idle, it is regularly queried whether the device under test is idle within a preset timeout period.
[0043] Furthermore, if the device under test is always busy (not idle) within the timeout period, the test operation is terminated and the reason is marked.
[0044] As a reference embodiment, before executing step S101, a connection request from a script execution machine may be received first, and then a connection may be established with the script execution machine, wherein the connection may be established with the script execution machine according to configuration information in the script.
[0045] The configuration information is the server initialization parameters (Desired Capabilities) of the Appium framework (Appium is an HttpServer written by the express framework of nodejs). For example, UDID is the unique code of the device under test. When establishing a connection with a remote server (the remote server can be used as a Selenium Grid Hub to receive test instructions), the remote server can obtain some necessary parameter information through the configuration information.
[0046] It is worth noting that Selenium Grid is a tool that supports distributed testing, which is divided into two roles: Selenium Grid Hub and Selenium Grid Node. Among them, Selenium Grid Hub is the center, there is only one, Selenium Grid Node is the node, there can be multiple, Selenium Grid Hub receives the test information to be executed, including on which platforms and which devices to execute, etc. Selenium Grid Hub knows the configuration of each registered Selenium GridNode. According to the test information, Selenium Grid Hub selects the Selenium Grid Node that meets the requirements for testing. In this embodiment, because the UDID (device unique number) of the device is specified in the test instruction, Selenium Grid Hub can ensure that the script is accurately distributed to the specified device under test for execution.
[0047] In addition, several test nodes can be set up on a local server, and the Selenium Grid Node (test node) corresponds to the device under test one by one. Further, each local server can be connected to multiple devices under test through a USB hub.
[0048] Step S102: forwarding the test instruction to the corresponding test node, so that the test node sends the test instruction to the corresponding device under test.
[0049] Step S103, receiving the result of the tested device executing the test instruction, and returning it to the script execution machine.
[0050] Preferably, if the device under test is occupied after receiving the test instruction sent by the script execution machine in step S101, the device under test can be released after receiving the result of the test instruction executed by the device under test in step S103.
[0051] It is worth noting that the present invention uses a device remote management system to occupy or release the device under test. The specific implementation process includes: calling the interface of the device remote management system and uploading the user identifier to the device remote management system to occupy the device under test.
[0052] The user ID is an arbitrary string, generated in the device remote management system page, and associated with the user account. The user is a tester, and the user account is an account of each tester in the device remote management system.
[0053] In addition, the device remote management system is such as STF, etc. Preferably, the present invention adopts the STF system. STF (smartphone test farm) is an open source Android device remote management system.
[0054] As a specific example, Figure 2 As shown in the figure, Test Script Executor is the script executor, Selenium Grid Hub Service is the remote server, and Service in office 1...n refers to local server 1...local server n. Among them, n Selenium Grid Node Services are set on each local server, and each Selenium Grid Node Service corresponds to a device under test.
[0055] As a further specific embodiment, the device remote management system can be built based on STF. STF (smartphone test farm) is an open source system that can remotely manage smart devices through a browser. The architecture of the STF system adopts a microservice architecture. Among them, the office computer that executes the script locally can access the STF system through a browser, remotely view the device screen, and remotely control the device. There can be multiple servers locally connected to the device under test, that is, local servers. The server in the computer room is the remote server, and all the modules of the STF main service are deployed on the remote server.
[0056] Preferably, if the server connected to the device under test in the STF system is a Windows system, it does not support the deployment of STF services. Therefore, the Provider module can also be deployed on the remote server, and the adbclient on the remote server is connected to the adb server on the local server (specify adbhost through the –H parameter of adb), thereby realizing the separation of the stf-provider module and the device under test.
[0057] Among them, adb is a general command line tool called Android Debug Bridge, which allows communication with an emulator instance or a connected Android device. adb is mainly divided into three parts:
[0058] adb daemon: a background program that runs on an Android device. When the developer mode of an Android device is turned on and the USB debugging function is enabled, the Android device or emulator will run an adb dadmon process.
[0059] adb server: This component manages the communication between the client and the background program. The server runs as a background process on the development computer.
[0060] adb client: This component sends commands. The client runs on the development computer. You can call the client from the command line terminal using adb commands. The adb client communicates with the local adb server by default, but can also communicate with the adb server of a remote machine by specifying parameters.
[0061] Therefore, according to the various embodiments described above, the present invention deploys STF and distributes scripts through the computer room transfer server, breaking through the limitation that the office network cannot access each other, and at the same time, the tested devices can be placed at the workstation, which is convenient for the management of a large number of tested devices. At the same time, in the process of remotely executing the automation script, the STF interface is introduced to occupy and release the remote device to avoid device use conflicts.
[0062] Figure 3 is a schematic diagram of the main process of an automated testing method according to another embodiment of the present invention. Based on a remote server, the automated testing method may include:
[0063] Step S301, receiving a connection request from a script execution machine, and then establishing a connection with the script execution machine.
[0064] In an embodiment, a connection is established with a script execution machine according to configuration information in the script.
[0065] Step S302, receiving a test instruction sent by a script execution machine.
[0066] Step S303, according to the device code carried in the test instruction, query whether the device under test is idle, if so, proceed to step S304, otherwise, regularly query whether the device under test is idle within the preset timeout period, that is, regularly execute step S303 within the preset timeout period.
[0067] Step S304, calling the interface of the device remote management system, uploading the user identification to the device remote management system to occupy the device under test.
[0068] Step S305: search for a corresponding test node according to the device under test code carried in the test instruction.
[0069] Step S306: forward the test instruction to the corresponding test node, so that the test node sends the test instruction to the corresponding device under test.
[0070] Step S307, receiving the result of the device under test executing the test instruction.
[0071] Step S308: calling the interface of the device remote management system to release the device under test.
[0072] Step S309, returning the result of executing the test instruction to the script execution machine.
[0073] Figure 4 is a schematic diagram of the main process of an automated testing method according to another embodiment of the present invention. Based on a script execution machine, a remote server and a local server, the automated testing method may include:
[0074] Step S401: the script execution machine establishes a connection with a remote server according to the configuration information in the script.
[0075] In an embodiment, when the script execution machine starts to execute the script, it will establish a connection with the remote server according to the configuration information in the script.
[0076] Preferably, a personal office computer is used as a script execution machine to execute the test script. The remote server can be placed in a remote computer room.
[0077] The configuration information is the server initialization parameters (Desired Capabilities) of the Appium framework (Appium is an HttpServer written by the express framework of nodejs). For example, UDID is the unique code of the device under test. When a connection is established with a remote server (the remote server can be used as a Selenium Grid Hub to receive test instructions), the remote server can obtain some necessary parameter information through the configuration information.
[0078] Step S402: The script executor sends the test instructions in the script to the remote server (Selenium GridHub).
[0079] The test instructions in the script are specific operations on the device under test during the test, for example, clicking a button, inputting some text, etc.
[0080] Step S403: the remote server searches for the corresponding test node according to the device code under test carried in the test instruction.
[0081] In the embodiment, the remote server specifies the UDID of the device under test according to the Capability information carried in the test instruction, and the UDID of the device under test is unique, thereby ensuring that each test instruction can be accurately sent to the specified device under test. Among them, the Selenium Grid Node (test node) corresponds to the device under test one by one.
[0082] Step S404, the remote server forwards the test instruction to the corresponding test node (Selenium Grid Node), and then the test node (Selenium Grid Node) sends the test instruction to the corresponding device under test.
[0083] In an embodiment, several Selenium Grid Node services are started on a local server, each service is associated with a device under test, and is registered on a remote server (Selenium Grid Hub).
[0084] Step S405: the device under test executes the test instruction and returns the execution result to the script execution machine.
[0085] In an embodiment, the device under test returns the execution result to the script execution machine through the test node and the remote server in sequence.
[0086] Figure 5 : is a schematic diagram of the main process of an automated testing method according to another embodiment of the present invention. Based on a script execution machine, a remote server and a local server, the automated testing method may include:
[0087] Step 501: The script executor establishes a connection with a remote server according to the configuration information in the script.
[0088] Step S502: the script executor sends the test instructions in the script to the remote server.
[0089] Step S503, the remote server queries whether the device under test is idle according to the device under test code carried in the test instruction, and if so, proceeds to step S504, otherwise, it periodically queries whether the device under test is idle within a preset timeout period.
[0090] Preferably, the remote server queries whether the device under test is idle through an interface provided by a device remote management system (such as STF) according to the device under test code carried in the test instruction. Further, if the device under test is not idle when queried through the interface provided by the device remote management system (such as STF), then within a preset timeout period, the remote server queries whether the device under test is idle through an interface provided by the device remote management system (such as STF) according to the device under test code carried in the test instruction at regular intervals. Once the device under test is idle, continue to execute step S504.
[0091] Preferably, if the device under test is always busy within the timeout period, the test is terminated (the process is exited) and the reason is marked.
[0092] As a specific embodiment, the HTTP interface provided by the STF system can be used to occupy and release the device under test in the test script, thereby avoiding conflicts that may occur when multiple scripts are executed.
[0093] Step S504: the remote server occupies the device under test.
[0094] Preferably, the remote server calls an interface of a device remote management system (such as STF) to occupy the device under test.
[0095] Furthermore, when the remote server calls the interface of the device remote management system to occupy the device under test, it needs to upload the user token to the device remote management system. The user token can be generated on the page of the device remote management system and associated with the user account. After the remote server occupies the device under test, the page of the device remote management system can show which user is using the device under test, and other users cannot use it.
[0096] The user is a tester, and the user account is an account of each tester on the device remote management system. Token is an arbitrary string.
[0097] In addition, STF (smartphone test farm) is an open source remote management system for Android devices.
[0098] Step S505: the remote server searches for the corresponding test node according to the device code carried in the test instruction.
[0099] Step S506: The remote server forwards the test instruction to the corresponding test node, and the test node then sends the test instruction to the corresponding device under test.
[0100] Step S507: the device under test executes the test instruction and returns the execution result to the script execution machine.
[0101] In an embodiment, the device under test returns the execution result to the script execution machine through the test node and the remote server in sequence.
[0102] Step S508: The remote server releases the device under test.
[0103] Figure 6 is an automated testing device according to an embodiment of the present invention, such as Figure 6 As shown, the automated testing device 600 includes a receiving module 601, a forwarding module 602 and a return module 603. The receiving module 601 receives the test instruction sent by the script execution machine, and searches for the corresponding test node according to the device under test code carried in the test instruction. The forwarding module 602 forwards the test instruction to the corresponding test node, so that the test node sends the test instruction to the device under test corresponding thereto. The return module 603 receives the result of the device under test executing the test instruction, and returns it to the script execution machine.
[0104] As a preferred embodiment, after receiving the test instruction sent by the script execution machine, the receiving module 601 can query whether the device under test is idle according to the device under test code carried in the test instruction, and if so, occupy the device under test, and find the corresponding test node according to the device under test code carried in the test instruction. Otherwise, within the preset timeout period, periodically query whether the device under test is idle.
[0105] In addition, after the return module 603 receives the result of the device under test executing the test instruction, it can release the device under test.
[0106] In a further embodiment, when the receiving module 601 occupies the device under test, it can call the interface of the device remote management system and upload the user identification to the device remote management system to occupy the device under test. The user identification is an arbitrary string, generated in the page of the device remote management system, and associated with the user account.
[0107] It is also worth noting that before the receiving module 601 receives the test instruction sent by the script execution machine, it needs to receive a connection request from the script execution machine and then establish a connection with the script execution machine, wherein the connection is established with the script execution machine according to the configuration information in the script.
[0108] It should be noted that the automated testing method and the automated testing device of the present invention have a corresponding relationship in terms of specific implementation contents, so the repeated contents will not be described again.
[0109] Figure 7 An exemplary system architecture 700 is shown to which an automated testing method or an automated testing device according to an embodiment of the present invention can be applied.
[0110] like Figure 7 As shown, system architecture 700 may include terminal devices 701, 702, 703, network 704 and server 705. Network 704 is used to provide a medium for communication links between terminal devices 701, 702, 703 and server 705. Network 704 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0111] Users can use terminal devices 701, 702, and 703 to interact with server 705 through network 704 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 701, 702, and 703, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).
[0112] The terminal devices 701 , 702 , and 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0113] The server 705 may be a server that provides various services, such as a backend management server (only for example) that supports shopping websites browsed by users using the terminal devices 701, 702, and 703. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only for example) to the terminal device.
[0114] It should be noted that the automated testing method provided in the embodiment of the present invention is generally executed by the server 705 , and accordingly, the automated testing device is generally disposed in the server 705 .
[0115] It should be understood that Figure 7 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0116] Reference below Figure 8 , which shows a schematic diagram of the structure of a computer system 800 of a terminal device suitable for implementing an embodiment of the present invention. Figure 8 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0117] like Figure 8As shown, the computer system 1100 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage part 1108 into the random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0118] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.
[0119] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above-mentioned functions defined in the system of the present invention are executed.
[0120] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0121] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0122] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor. For example, it may be described as follows: a processor includes a receiving module, a forwarding module, and a return module. The names of these modules do not, in some cases, constitute limitations on the modules themselves.
[0123] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: receiving a test instruction sent by a script executor, searching for a corresponding test node according to the device under test code carried in the test instruction; forwarding the test instruction to the corresponding test node so that the test node sends the test instruction to the device under test corresponding to it; receiving the result of the device under test executing the test instruction, and returning it to the script executor.
[0124] According to the technical solution of the embodiment of the present invention, remote automatic testing of a large number of devices can be achieved.
[0125] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An automated testing method, It is characterized in that include: The remote server receives the test instruction sent by the script execution machine, and searches for the corresponding test node according to the device under test code carried in the test instruction; wherein, in response to the device under test being busy within a preset timeout period, the test operation is terminated and the reason is marked, and the result is returned to the script execution machine; Call the interface of the device remote management system and upload the user ID to the device remote management system to occupy the device under test; Forwarding the test instruction to the corresponding test node so that the test node sends the test instruction to the corresponding device under test; wherein a plurality of test nodes are set on the local server, and each local server is connected to a plurality of devices under test; Receive the result of the test instruction executed by the device under test and return it to the script execution machine; wherein the device under test returns the execution result to the script execution machine through the test node and the remote server in sequence; Call the interface of the device remote management system to release the device under test.
2. The method according to claim 1, It is characterized in that After receiving the test instructions sent by the script execution machine, it includes: According to the device code carried in the test instruction, check whether the device is idle. If so, occupy the device. Otherwise, check whether the device is idle within the preset timeout period. After receiving the result of the device under test executing the test instruction, the method includes: releasing the device under test.
3. The method according to claim 1, It is characterized in that The user ID is an arbitrary string, generated in the device remote management system page, and associated with the user account.
4. The method according to any one of claims 1 to 3, It is characterized in that Before receiving the test instructions sent by the script execution machine, including: A connection request from a script execution machine is received, and a connection is established with the script execution machine; wherein the connection is established with the script execution machine according to configuration information in the script.
5. An automated testing device, It is characterized in that include: A receiving module is used for a remote server to receive a test instruction sent by a script execution machine, and to find a corresponding test node according to the device under test code carried in the test instruction; wherein, in response to the device under test being busy within a preset timeout period, the test operation is terminated and the reason is marked and returned to the script execution machine; Call the interface of the device remote management system and upload the user ID to the device remote management system to occupy the device under test; A forwarding module is used to forward the test instruction to the corresponding test node, so that the test node sends the test instruction to the corresponding device under test; wherein a plurality of test nodes are set on the local server, and each local server is connected to a plurality of devices under test; The return module is used to receive the result of the test instruction executed by the device under test and return it to the script execution machine; wherein the device under test returns the execution result to the script execution machine through the test node and the remote server in sequence; Call the interface of the device remote management system to release the device under test.
6. The device according to claim 5, It is characterized in that After the receiving module receives the test instruction sent by the script execution machine, it includes: According to the device code carried in the test instruction, check whether the device is idle. If so, occupy the device. Otherwise, check whether the device is idle within the preset timeout period. After the return module receives the result of the device under test executing the test instruction, it includes: releasing the device under test.
7. The device according to claim 5, It is characterized in that The user ID is an arbitrary string, generated in the device remote management system page, and associated with the user account.
8. The device according to any one of claims 5 to 7, It is characterized in that Before the receiving module receives the test instruction sent by the script execution machine, it includes: A connection request from a script execution machine is received, and a connection is established with the script execution machine; wherein the connection is established with the script execution machine according to configuration information in the script.
9. An electronic device, It is characterized in that include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.
10. A computer readable medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Automatic test method and device, storage medium and electronic equipment
CN107704398A
Application test method and apparatus
CN108694118A
Test method and test device of application program, and medium
CN108920376A