Movatterモバイル変換


[0]ホーム

URL:


CN113535590B - Program testing method and device - Google Patents

Program testing method and device
Download PDF

Info

Publication number
CN113535590B
CN113535590BCN202110965088.0ACN202110965088ACN113535590BCN 113535590 BCN113535590 BCN 113535590BCN 202110965088 ACN202110965088 ACN 202110965088ACN 113535590 BCN113535590 BCN 113535590B
Authority
CN
China
Prior art keywords
execution machine
execution
terminal device
sub
machine
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110965088.0A
Other languages
Chinese (zh)
Other versions
CN113535590A (en
Inventor
张强
马超
李敏
朱文洁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Wodong Tianjun Information Technology Co LtdfiledCriticalBeijing Wodong Tianjun Information Technology Co Ltd
Priority to CN202110965088.0ApriorityCriticalpatent/CN113535590B/en
Publication of CN113535590ApublicationCriticalpatent/CN113535590A/en
Application grantedgrantedCritical
Publication of CN113535590BpublicationCriticalpatent/CN113535590B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The disclosure provides a program testing method, which comprises the steps of determining at least one first execution machine which is in communication connection with a main control device, determining at least one second execution machine which is connected with a terminal device in the at least one first execution machine, and sending a test script to each execution machine in the at least one second execution machine, so that each execution machine tests an application program running on the terminal device connected with the execution machine by running the received test script. The present disclosure also provides a program testing apparatus, an electronic device, and a computer-readable storage medium.

Description

Program testing method and device
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a program testing method and apparatus.
Background
Program testing is an integral part of the development cycle of the product. With the continuous popularization of agile tests, business parties put new requirements on the delivery and iteration cycles of software products. However, since the developed product is oriented to both the brand side of the B-terminal (i.e., management platform) and the C-terminal (i.e., consumer, personal user side), how to quickly adapt the brand-side system to the mass browser on the market and the mainstream model of the C-terminal user becomes a challenge.
In the process of implementing the inventive concept of the present disclosure, the inventor found that at least the following problems exist in the related art:
In the related art, the test efficiency of the program test is not high.
Disclosure of Invention
One aspect of the present disclosure provides a program testing method, including determining at least one first execution machine having a communication connection with a main control device, determining at least one second execution machine having a terminal device connected thereto, and transmitting a test script to each of the at least one second execution machine, such that each of the at least one execution machines tests an application program running on a terminal device connected thereto by running the received test script.
Optionally, determining at least one second execution machine connected with the terminal equipment in the at least one first execution machine comprises querying a registry on each first execution machine in the at least one first execution machine to obtain at least one corresponding query result, wherein each query result corresponds to one first execution machine, and determining the at least one second execution machine connected with the terminal equipment in the at least one first execution machine based on the at least one query result.
Optionally, determining the at least one second execution machine connected with the terminal equipment in the at least one first execution machine based on the at least one query result comprises determining that the first execution machine corresponding to the current query result is connected with the terminal equipment by responding to version information related to the terminal equipment in the current query result characterization registry for each query result, and taking the first execution machine as a second execution machine.
Optionally, the method comprises the steps of sending the test script to each of the at least one second execution machine, wherein the method comprises the steps of sending the whole test script to each of the at least one second execution machine respectively, dividing the whole test script into a plurality of sub-scripts, and distributing the plurality of sub-scripts to corresponding execution machines of the at least one second execution machine according to a preset rule.
Optionally, distributing the plurality of sub-scripts to corresponding execution machines in the at least one second execution machine according to a preset rule, wherein the method comprises at least one of randomly sending each sub-script in the plurality of sub-scripts to one second execution machine in the at least one second execution machine under the condition that the number of the sub-scripts is smaller than the number of the second execution machines, enabling different sub-scripts to run on the different second execution machines, and evenly distributing the plurality of sub-scripts to each second execution machine in the at least one second execution machine under the condition that the number of the sub-scripts is larger than or equal to the number of the second execution machines and the number of the sub-scripts is integral multiple of the number of the second execution machines.
Optionally, the application program includes a program for implementing a UI interface.
Optionally, the program testing method further comprises responding to the current execution machine to successfully complete the program test, and acquiring and displaying a test result returned by the current execution machine for each execution machine in the at least one second execution machine.
Another aspect of the present disclosure provides a processing method for an execution machine, including generating a registry, storing the registry on the execution machine, and recording version information about the terminal device in the registry in response to a terminal device being connected to the execution machine, so that a master device having a communication connection with the execution machine can determine whether the execution machine is connected to the terminal device based on the information recorded in the registry.
Optionally, the program testing device further comprises deleting version information of the terminal equipment disconnected with the execution in the registry in response to disconnection of the terminal equipment from the execution.
Another aspect of the present disclosure provides a program testing apparatus, including a determining first executor module configured to determine that at least one first executor having a communication connection with a main control device exists, a determining second executor module configured to determine at least one second executor having a terminal device connected to the at least one first executor, and a transmitting test script module configured to transmit a test script to each of the at least one second executor, such that each of the at least one second executor tests an application running on the terminal device connected to itself by running the received test script.
Optionally, the determining second executor module comprises a query sub-module, a determining second executor sub-module and a determining second executor sub-module, wherein the query sub-module is used for querying a registry on each first executor in the at least one first executor to obtain at least one corresponding query result, each query result corresponds to one first executor, and the determining second executor sub-module is used for determining the at least one second executor connected with terminal equipment in the at least one first executor based on the at least one query result.
Optionally, the determining the second execution machine sub-module includes, for each query result, responding to version information about the terminal device in the current query result characterization registry, determining that the first execution machine corresponding to the current query result is connected with the terminal device, and taking the first execution machine as a second execution machine.
Optionally, the test script sending module comprises one of a script sending sub-module for respectively sending the whole test script to each of the at least one second executors, and a script distributing sub-module for dividing the whole test script into a plurality of sub-scripts and distributing the plurality of sub-scripts to corresponding executors in the at least one second executors according to a preset rule.
Optionally, the script distribution sub-module comprises at least one of a first distribution unit, a second distribution unit and a second distribution unit, wherein the first distribution unit randomly transmits each of the plurality of the sub-scripts to one of the at least one second execution machines under the condition that the number of the sub-scripts is smaller than the number of the second execution machines, so that different sub-scripts can run on different second execution machines, and the second distribution unit evenly distributes the plurality of the sub-scripts to each of the at least one second execution machines under the condition that the number of the sub-scripts is greater than or equal to the number of the second execution machines and the number of the sub-scripts is integral multiple of the number of the second execution machines.
Optionally, the application program includes a program for implementing a UI interface.
Optionally, the program testing method further comprises a display result unit, wherein the display result unit is used for responding to the current execution machine to successfully complete the program test and acquiring and displaying a test result returned by the current execution machine for each execution machine in the at least one second execution machine.
Another aspect of the present disclosure provides a processing apparatus for an execution machine, including a generation registry module for generating a registry, a storage module for storing the registry on the execution machine, and a first response module for recording version information about the terminal device in the registry in response to a connection of the terminal device to the execution machine, so that a master device having a communication connection with the execution machine can determine whether the terminal device is connected to the execution machine based on the information recorded in the registry.
Optionally, the program testing device further comprises a second response module, configured to delete version information of the terminal device disconnected from the execution machine in the registry in response to disconnection of the terminal device from the execution machine.
Another aspect of the present disclosure provides an electronic device comprising one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method as described above.
Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions that, when executed, are configured to implement a method as described above.
Another aspect of the present disclosure provides a computer program comprising computer executable instructions which, when executed, are adapted to carry out a method as described above.
Drawings
For a more complete understanding of the present disclosure and the advantages thereof, reference is now made to the following descriptions taken in conjunction with the accompanying drawings, in which:
FIG. 1 schematically illustrates a system architecture suitable for program testing methods and apparatus in accordance with embodiments of the present disclosure;
FIG. 2 schematically illustrates a flow chart of a program test method according to an embodiment of the disclosure;
FIG. 3 schematically illustrates a flow chart of a program test method according to another embodiment of the present disclosure;
FIG. 4 schematically illustrates a flow diagram of determining a second execution machine based on query results, according to another embodiment of the present disclosure;
FIG. 5 schematically illustrates a flow chart of a program test method according to another embodiment of the disclosure;
FIG. 6 schematically illustrates a flow chart of a program test method according to yet another embodiment of the disclosure;
FIG. 7 schematically illustrates a flow chart of a processing method for executing a machine according to an embodiment of the disclosure;
FIG. 8 schematically illustrates a block diagram of a program testing apparatus according to an embodiment of the disclosure;
FIG. 9 schematically illustrates a block diagram of determining a second executor module according to an embodiment of the present disclosure;
FIG. 10 schematically illustrates a block diagram of a send test script module, according to an embodiment of the present disclosure;
FIG. 11 schematically illustrates a block diagram of another send test script module, according to an embodiment of the present disclosure;
FIG. 12 schematically illustrates a block diagram of a script distribution sub-module, according to an embodiment of the present disclosure;
FIG. 13 schematically illustrates a block diagram of a program testing apparatus according to another embodiment of the present disclosure;
FIG. 14 schematically illustrates a block diagram of a processing device for an execution machine, in accordance with an embodiment of the present disclosure;
FIG. 15 schematically illustrates a block diagram of a processing device for an execution machine in accordance with another embodiment of the present disclosure, and
Fig. 16 schematically illustrates a block diagram of an electronic device adapted to implement the above-described method according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is only exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a convention should be interpreted in accordance with the meaning of one of skill in the art having generally understood the convention (e.g., "a system having at least one of A, B and C" would include, but not be limited to, systems having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
Some of the block diagrams and/or flowchart illustrations are shown in the figures. It will be understood that some blocks of the block diagrams and/or flowchart illustrations, or combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the instructions, when executed by the processor, create means for implementing the functions/acts specified in the block diagrams and/or flowchart. The techniques of this disclosure may be implemented in hardware and/or software (including firmware, microcode, etc.). Additionally, the techniques of this disclosure may take the form of a computer program product on a computer-readable storage medium having instructions stored thereon, the computer program product being for use by or in connection with an instruction execution system.
The embodiment of the disclosure provides a program testing method and a program testing device capable of applying the method. The method comprises the steps of determining at least one first execution machine which is in communication connection with a main control device, determining at least one second execution machine which is connected with a terminal device in the at least one first execution machine, and sending a test script to each execution machine in the at least one second execution machine, so that each execution machine tests an application program running on the terminal device connected with the execution machine by running the received test script.
Fig. 1 schematically illustrates a system architecture suitable for program testing methods and apparatus according to embodiments of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which embodiments of the present disclosure may be applied to assist those skilled in the art in understanding the technical content of the present disclosure, but does not mean that embodiments of the present disclosure may not be used in other devices, systems, environments, or scenarios.
As shown in fig. 1, the system architecture 100 includes terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and/or wireless communication links, and the like.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various communication client applications may be installed on the terminal devices 101, 102, 103, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients and/or social platform software, to name a few.
The terminal devices 101, 102, 103 may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (by way of example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and process the received data such as the user request, and feed back the processing result (e.g., the web page, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the program testing method provided by the embodiments of the present disclosure may be generally executed by the server 105. Accordingly, the program testing apparatus provided by the embodiments of the present disclosure may be generally disposed in the server 105. The program testing method provided by the embodiments of the present disclosure may also be performed by a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the program testing system provided by the embodiments of the present disclosure may also be provided in a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Or the program test method provided by the embodiment of the present disclosure may be executed by the terminal device 101, 102, or 103, or may be executed by another terminal device other than the terminal device 101, 102, or 103. Accordingly, the program testing apparatus provided by the embodiments of the present disclosure may also be provided in the terminal device 101, 102, or 103, or in another terminal device different from the terminal device 101, 102, or 103.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Fig. 2 schematically illustrates a flow chart of a program test method according to an embodiment of the disclosure.
As shown in FIG. 2, the method includes operations S210-S230.
In operation S210, it is determined that at least one first execution machine has a communication connection with the master device.
In this operation, the master control device may add one or more first execution machines, and each time the addition is completed, the master control device may establish a corresponding communication connection with the first execution machine.
The master control device can check the connection condition of each first execution machine and the master control device. If the master device cannot see a certain first execution machine, the characterization master device fails to add the first execution machine. And if the master control equipment cannot check the connection condition of a certain first execution machine and the master control equipment, the first execution machine is characterized to be not successfully connected with the master control equipment, or the communication connection between the first execution machine and the master control equipment is interrupted.
If the addition of the first execution machine by the master device fails, the operation of adding the first execution machine by the master device may be repeatedly executed until the master device successfully adds the first execution machine.
In operation S220, it is determined that at least one second execution machine of the at least one first execution machine to which the terminal device is connected.
In this operation, each first execution machine in operation S210 may be bound to the terminal device, and after the binding is completed, the terminal device may establish a connection with the first execution machine.
Each first execution machine can display the connection state of the terminal equipment. If a first execution machine displays that the connected terminal equipment is successfully connected, the first execution machine can be determined to be one of the second execution machines.
The first execution machine which is in communication connection with the master control equipment can be a plurality of first execution machines. Correspondingly, the number of the first execution machines successfully connected with the terminal equipment can be multiple, and correspondingly, the number of the second execution machines can be multiple.
In operation S230, the test script is transmitted to each of the at least one second execution machine, so that each execution machine tests an application running on a terminal device connected to itself by running the received test script.
In this operation, the test script is transmitted to each of the plurality of second executors in operation S220. And after each second execution machine receives the test script, running the test script, and testing the application program running on the terminal equipment connected with the second execution machine.
For example, each second execution machine may test the functions of the application program running on the terminal device connected to itself, test the running condition of each function of the application program, and display the test result.
For example, each second executor may test a UI (User Interface) running on a browser of a terminal device connected to itself, test each functional button on the UI, test whether operation and interaction of each button meets expected requirements, and display a test result.
It can be understood that according to the program testing method provided by the embodiment of the present disclosure, at least one first execution machine having communication connection with the main control device is determined, at least one second execution machine connected with the terminal device in the at least one first execution machine is determined, and a test script is sent to each of the at least one second execution machine, so that each execution machine tests an application program running on the terminal device connected with itself by running the received test script.
According to the program testing method provided by the embodiment of the disclosure, the first execution machine is added through the main control equipment, connection is established between the main control equipment and the first execution machine, the second execution machine which is connected with the terminal equipment is confirmed, the main control equipment can dynamically discover the terminal equipment, and the connection state of the terminal equipment is checked in real time. If the connection between the terminal equipment and the second execution machine is interrupted, the running interruption of the script can be known in real time, and the failed script is run again in real time, so that the efficiency of program test is improved. And testing the application program running on the terminal equipment connected with the second execution machine through the second execution machine, generating a test report of the application program, and returning to the main control equipment for display.
Fig. 3 schematically illustrates a flow chart of a program test method according to another embodiment of the present disclosure.
As shown in FIG. 3, the method includes operations S210, S310-S320, and S230.
In operation S210, it is determined that at least one first execution machine has a communication connection with the master device.
The present operation is the same as operation S210 shown in fig. 2, and will not be described again.
In operation S310, a registry on each of the at least one first execution machine is queried to obtain at least one corresponding query result, where each query result corresponds to one first execution machine.
In the operation, the main control equipment inquires a registry on each first execution machine to obtain a corresponding inquiry result on each first execution machine so as to judge the connection condition of the terminal equipment and the first execution machine.
For example, when testing the UI running on the browser of the terminal device, the main control device may query the registry on each first execution machine to obtain a corresponding query result on each first execution machine, so as to determine the connection situation of the terminal device and the first execution machine.
In operation S320, at least one second actuator to which the terminal device is connected among the at least one first actuator is determined based on the at least one query result.
In this operation, based on the query result on each first execution machine obtained by the master control device in operation S310, it is determined whether each first execution machine is connected with a terminal device, and a plurality of second execution machines are determined.
In operation S230, the test script is transmitted to each of the at least one second execution machine, so that each execution machine tests an application running on a terminal device connected to itself by running the received test script.
The present operation is the same as operation S230 shown in fig. 2, and will not be described again.
According to the program testing method of the embodiment of the disclosure, the main control equipment queries the registry on each first execution machine to obtain the corresponding query result on each first execution machine, so as to judge the connection condition of the terminal equipment and the first execution machines, and based on the connection condition, a plurality of second execution machines are determined.
According to the program testing method of the embodiment of the disclosure, the main control equipment adds a plurality of first executors, judges whether the addition of the plurality of first executors is successful, if so, circularly traverses the registry on each first executor, checks the connection state of each terminal equipment and the executors, and determines a second executor, thereby binding the terminal equipment and the second executors.
For example, a plurality of first actuators may be added through jenkins. It should be appreciated that Jenkins is an open-source, continuous integration tool that provides a friendly operator interface, primarily for continuously, automatically building or testing items of software, detecting the execution of external tasks.
After the main control equipment binds the terminal equipment and the second execution machines, traversing all the second execution machines, judging whether each second execution machine is connected with the main control equipment, if so, traversing the registry of each second execution machine, judging whether the terminal equipment is connected with the second execution machine, and displaying the connection state of the terminal equipment.
According to the program testing method of the embodiment of the disclosure, the main control device checks the connection state of each terminal device and the execution machine by adding a plurality of first execution machines, determines the second execution machine, queries the registry on each second execution machine, can dynamically find out the terminal device, and can check the connection state of each terminal device and the execution machine in real time, so that whether the program test of the terminal device is interrupted or not can be judged in real time.
Fig. 4 schematically illustrates a flow diagram of determining a second execution machine based on query results according to another embodiment of the present disclosure.
As shown in fig. 4, in operation S320, determining at least one second execution machine connected to a terminal device in at least one first execution machine based on at least one query result may include operations S321 to S323.
In operation S321, for each query result, version information about the terminal device in the registry is characterized in response to the current query result.
In operation S322, it is determined that a terminal device is connected to the first execution machine corresponding to the current query result for each query result.
In operation S323, the first execution machine is used as a second execution machine for each query result.
According to the program testing method of the embodiment of the disclosure, the registry on each first execution machine contains a lot of information. For example version information of the terminal device. For example browser version information run by the terminal device. The main control equipment can obtain version information related to the terminal equipment by inquiring a registry on each first execution machine, and judge the connection condition of the terminal equipment and the first execution machines in response to the version information related to the terminal equipment in the inquiry result.
It should be understood that, in the related art, before the program test, the configuration file needs to be manually modified so that the test script is adapted to the terminal device. According to the program testing method of the embodiment of the disclosure, the main control device obtains version information related to the terminal device by inquiring the registry on each first execution machine, and the operation of manually modifying the configuration file can be replaced by utilizing the version information. Therefore, during subsequent program testing of the terminal equipment, the configuration file in the test script does not need to be manually modified before each test, the connection is established between the main control equipment and the first execution machine, and the connection between the second execution machine and the terminal equipment is established, the main control equipment can dynamically discover the terminal equipment and check the connection state of the terminal equipment in real time, so that automatic program testing can be realized, the efficiency of program testing is improved, and the convenience of program testing is also improved.
For example, when testing the UI running on the browser of the terminal device, the main control device may query the registry on each first execution machine to obtain browser version information related to the running test UI of the terminal device, so as to determine the connection condition of the terminal device and the first execution machine.
According to the program testing method of the embodiment of the disclosure, the query result of the version information about the terminal device in the registry on each first execution machine obtained by the main control device can determine that each first execution machine connected with the terminal device is the second execution machine.
It can be understood that according to the program testing method of the embodiment of the present disclosure, the master control device may obtain version information related to the terminal device by querying a registry on each first execution machine, and in response to the version information related to the terminal device in the query result, may determine a connection condition between the terminal device and the first execution machine, and may determine that each first execution machine connected with the terminal device is a second execution machine.
According to the program testing method of the embodiment of the disclosure, based on version information about the terminal equipment in the registry on each first execution machine, whether the terminal equipment is connected with the execution machine can be judged, so that whether program testing on the terminal equipment is interrupted is judged.
According to the program testing method, the test script is sent to each of the at least one second execution machine, and the method comprises the steps of sending the whole test script to each of the at least one second execution machine respectively, dividing the whole test script into a plurality of sub-scripts, and distributing the plurality of sub-scripts to corresponding execution machines of the at least one second execution machine according to preset rules.
According to the program testing method disclosed by the embodiment of the disclosure, the main control equipment can respectively send the whole test script to each of the plurality of second execution machines.
According to the program testing method of the embodiment of the disclosure, the main control device may divide the entire test script into a plurality of sub-scripts, and then distribute the plurality of sub-scripts to corresponding execution machines in the plurality of second execution machines according to a preset rule.
According to the program testing method of the embodiment of the disclosure, the main control device may send the whole test script to each execution machine, or divide the whole test script into a plurality of sub-scripts, and then distribute the plurality of sub-scripts to corresponding execution machines in a plurality of second execution machines according to a preset rule, where the execution machines may run the whole script, or may run the sub-scripts, so that the running condition of the script may be known in detail.
Fig. 5 schematically illustrates a flow chart of a program test method according to another embodiment of the present disclosure.
As shown in FIG. 5, the method includes operations S210-S220, S510-S560.
In operation S210, it is determined that at least one first execution machine has a communication connection with the master device.
The present operation is the same as operation S210 shown in fig. 2, and will not be described again.
In operation S220, it is determined that at least one second execution machine of the at least one first execution machine to which the terminal device is connected.
This operation is the same as operation S220 shown in fig. 2, and will not be described again here.
In operation S510, the entire test script is divided into a plurality of sub-scripts.
In the operation, the whole test script is divided into a plurality of sub-scripts, for example, the scripts can be divided according to the tab or the drawer, so that the automatic program test of the terminal equipment can be conveniently carried out later.
In operation S520, it is determined whether the number of sub-scripts is less than the number of second executors, and if so, a subsequent operation S540 is performed. If not, a subsequent operation S530 is performed.
In this operation, it is determined whether the number of the plurality of sub-scripts obtained in operation S510 is smaller than the second execution machine number.
In operation S530, it is determined whether the number of sub-scripts is equal to or greater than the number of second execution machines and the number of sub-scripts is an integer multiple of the number of second execution machines, and if so, the subsequent operation S550 is performed.
In this operation, if the number of the plurality of sub-scripts obtained in operation S510 is not smaller than the number of the second execution machines, it is determined whether the number of the plurality of sub-scripts obtained in operation S510 is equal to or greater than the number of the second execution machines and the number of the sub-scripts is an integer multiple of the number of the second execution machines.
In operation S540, in the case that the number of the sub-scripts is smaller than the number of the second execution machines, each of the plurality of sub-scripts is randomly transmitted to one of the at least one second execution machine, so that different sub-scripts are run on different second execution machines.
In this operation, in the case where the number of the plurality of sub-scripts obtained in operation S510 is smaller than the number of the second execution machines, each of the plurality of sub-scripts is randomly transmitted to one of the at least one second execution machine, so that the different second execution machines run the different sub-scripts, and some of the second execution machines may not run the scripts.
In operation S550, in the case that the number of the sub-scripts is equal to or greater than the number of the second execution machines and the number of the sub-scripts is an integer multiple of the number of the second execution machines, the plurality of sub-scripts are equally distributed to each of the at least one second execution machine.
In this operation, when the number of the plurality of sub-scripts obtained in operation S510 is greater than or equal to the number of the second execution machines and the number of the sub-scripts is an integer multiple of the number of the second execution machines, the plurality of sub-scripts are distributed to each of the at least one second execution machine in an average manner, so that different second execution machines operate different sub-scripts, and the number of scripts operated by each second execution machine is the same.
In operation S560, each of the executors tests an application running on a terminal device connected to itself by running the received test script.
According to the program testing method of the embodiment of the disclosure, according to the number of the sub-scripts and the number of the second execution machines, the scripts are distributed, so that a plurality of the second execution machines execute different sub-scripts concurrently. Once the connection between the terminal equipment and the corresponding second execution machine is disconnected, the execution of the sub-script is stopped, and the knowledge of which terminal equipment tests which sub-script succeeds and which terminal equipment tests which sub-script fails can be obtained.
It should be understood that in the related art, in the program test, the entire script is executed concurrently on a plurality of execution machines, and once a certain terminal device is disconnected from the execution machine, the test of the terminal device is stopped, but the entire program test is not stopped yet, thereby causing a waste of time.
According to the program testing method of the embodiment of the disclosure, when the connection between a certain terminal device and a corresponding second execution machine is disconnected, the second execution machine stops executing the sub-script. Since the whole script is divided into a plurality of sub-scripts, even if the connection between the terminal device and the corresponding second execution machine is disconnected, it is possible to know which terminal devices failed to test which sub-scripts. The failed sub-script can be retested later instead of retesting the whole script, thereby saving the program test time and improving the program test efficiency.
According to the program testing method of the embodiment of the present disclosure, the application program may include a program implementing a UI interface.
For example, the program testing method of the embodiment of the present disclosure may test the functions of UI interfaces on different browsers of the terminal device. The second execution machine may run the script through Airtest.
Airtest is a cross-platform user interface automation test framework. Airtest use image recognition techniques to locate elements of the user interface. Airtest can easily run scripts on a large cluster of devices.
At present Airtest mainly supports concurrent execution of android equipment, and for PC equipment, a common automation script developer needs to perform complex configuration when developing scripts.
According to the program testing method of the embodiment of the disclosure, the main control equipment obtains the version information related to the terminal equipment by inquiring the registry on each first execution machine, and the configuration file in the test script is not required to be manually modified before each test by utilizing the version information, so that automatic program testing can be realized, the efficiency of program testing is further improved, and the convenience of program testing is also improved.
Airtest multiple scripts are not efficient to execute concurrently. According to the program testing method of the embodiment of the disclosure, the whole script is divided into a plurality of sub-scripts, and even if the connection between the terminal equipment and the corresponding second execution machine is disconnected, it is possible to know which terminal equipment fails to test which sub-scripts. The failed sub-script can be rerun in the follow-up process instead of retesting the whole script, so that the program test time is saved and the program test efficiency is improved.
Fig. 6 schematically illustrates a flow chart of a program test method according to a further embodiment of the present disclosure.
As shown in FIG. 6, the method includes operations S210-S230, S610.
In operation S210, it is determined that at least one first execution machine has a communication connection with the master device.
The present operation is the same as operation S210 shown in fig. 2, and will not be described again.
In operation S220, it is determined that at least one second execution machine of the at least one first execution machine to which the terminal device is connected.
This operation is the same as operation S220 shown in fig. 2, and will not be described again here.
In operation S230, the test script is transmitted to each of the at least one second execution machine, so that each execution machine tests an application running on a terminal device connected to itself by running the received test script.
The present operation is the same as operation S230 shown in fig. 2, and will not be described again.
In operation S610, for each of the at least one second execution machine, in response to the current execution machine successfully completing the program test, a test result returned by the current execution machine is obtained and displayed.
In the operation, for each of the plurality of second execution machines, the main control device responds to the current execution machine to successfully complete the program test, and obtains and displays the test result returned by the current execution machine.
For example, the master device may add a plurality of first execution machines through jenkins, confirm a second execution machine, and perform program testing on the second execution machine through Airtest. When program testing is performed through jenkins, tasks need to be created.
And creating main tasks according to the divided multiple sub-scripts, wherein each main task represents the final running condition of the corresponding sub-script. Creating subtasks corresponding to the main tasks according to the processing flows of distribution, operation and the like of each subtscript in the operation process of each subtscript, wherein each subtask characterizes the operation condition of the corresponding subtscript processing flow.
When the execution machine performs program test, the execution machine can acquire the task state as the main task in execution in real time, traverse a plurality of sub-tasks under the main task, and judge whether each sub-task fails. Once a failed subtask exists, the task state of the main task corresponding to the subtask is set as failed. And if the task state of the subtask under the main task is in execution, setting the task state of the main task corresponding to the subtask as in execution. And storing the execution conditions of all the main tasks when the task states of all the main tasks are completed and are successful.
After the current execution machine successfully completes the program test, the main control equipment acquires and displays the execution conditions of all main tasks, namely the final program test result.
Fig. 7 schematically illustrates a flow chart of a processing method for executing a machine according to an embodiment of the disclosure.
As shown in FIG. 7, the method includes operations S710-S730.
In operation S710, a registry is generated.
In operation S720, the registry is stored on the execution machine.
In response to the connection of the terminal device to the execution machine, version information about the terminal device is recorded in the registry so that the master device having a communication connection with the execution machine can determine whether the terminal device is connected to the execution machine based on the information recorded in the registry in operation S730.
According to the program testing method of the embodiment of the disclosure, when the terminal equipment is connected with the execution machine, the execution opportunity generates a registry and stores the registry on the execution machine. The registry contains version information about the terminal device, from which it can be determined whether the terminal device is connected to the execution machine.
According to the program testing method of the embodiment of the disclosure, when the terminal equipment is disconnected from the execution machine, the execution machine responds to the disconnection of the terminal equipment from the execution machine, and the version information of the terminal equipment disconnected from the execution machine at this time is deleted in the registry.
According to the program testing method disclosed by the embodiment of the disclosure, the execution machine can check the connection condition of the terminal equipment and the execution machine in real time based on the version information related to the terminal equipment in the registry on the execution machine, so as to judge the testing condition of the program test.
Fig. 8 schematically illustrates a block diagram of a program testing apparatus according to an embodiment of the present disclosure.
As shown in FIG. 8, the application program testing apparatus 800 includes a determine first executor module 810, a determine second executor module 820, and a send test script module 830. The program testing device may perform the method described above with reference to the method embodiment, and will not be described here again.
Specifically, the determine first execution machine module 810 may be used to determine at least one first execution machine that has a communication connection with the master device.
The determine second execution machine module 820 may be configured to determine at least one second execution machine of the at least one first execution machine to which the terminal device is connected.
The send test script module 830 may be configured to send a test script to each of the at least one second execution machine, so that each execution machine tests an application running on a terminal device connected to itself by running the received test script.
Fig. 9 schematically illustrates a block diagram of determining a second executor module according to an embodiment of the disclosure.
As shown in FIG. 9, determining the second execution machine module 820 includes querying the sub-module 821 and determining the second execution machine sub-module 822.
Specifically, the query sub-module 821 may be configured to query a registry on each of the at least one first execution machine to obtain at least one corresponding query result, where each query result corresponds to one first execution machine.
The determine second execution machine sub-module 822 may be configured to determine, based on at least one query result, at least one second execution machine of the at least one first execution machine to which the terminal device is connected.
The determine second execution machine sub-module 822 may, for each query result, characterize version information about the terminal device in the registry in response to the current query result, determine that the first execution machine corresponding to the current query result is connected to the terminal device, and use the first execution machine as a second execution machine.
FIG. 10 schematically illustrates a block diagram of a send test script module, according to an embodiment of the disclosure.
As shown in FIG. 10, the send test script module 830 may include a script send sub-module 831.
Specifically, the script sending submodule 831 is configured to send the entire test script to each of the at least one second execution machine.
FIG. 11 schematically illustrates a block diagram of another send test script module, according to an embodiment of the disclosure.
As shown in FIG. 11, the send test script module 830 may include a script distribution sub-module 832.
Specifically, the script distribution sub-module 832 is configured to divide the entire test script into a plurality of sub-scripts, and then distribute the plurality of sub-scripts to corresponding execution machines in the at least one second execution machine according to a preset rule.
Fig. 12 schematically illustrates a block diagram of a script distribution sub-module according to an embodiment of the present disclosure.
As shown in fig. 12, the script distribution sub-module 832 may include a first distribution unit 8321 and a second distribution unit 8322.
Specifically, the first distributing unit 8321 randomly sends each of the plurality of sub-scripts to one of the at least one second executor to enable different sub-scripts to run on different second executors when the number of the sub-scripts is smaller than the number of the second executors.
The second distributing unit 8322 distributes the plurality of sub-scripts to each of the at least one second execution machine on average, when the number of sub-scripts is equal to or greater than the number of second execution machines and the number of sub-scripts is an integer multiple of the number of second execution machines.
According to the program testing device of the embodiment of the present disclosure, the application program may include a program implementing a UI interface.
Fig. 13 schematically illustrates a block diagram of a program testing apparatus according to another embodiment of the present disclosure.
The application program testing apparatus 800 includes a determining first executor module 810, a determining second executor module 820, a transmitting test script module 830, and a presentation result unit 840.
Specifically, a first executor module 810 is determined, a second executor module 820 is determined, and a send test script module 830 is determined
And the display result unit 840 is configured to, for each of the at least one second execution machine, respond to the current execution machine to successfully complete the program test, and obtain and display a test result returned by the current execution machine.
Fig. 14 schematically illustrates a block diagram of a handler testing apparatus for an execution machine according to an embodiment of the present disclosure.
The application program testing device 900 includes a registry generation module 910, a storage module 920, and a first response module 930.
Specifically, a generate registry module 910 for generating a registry;
a storage module 920 for storing the registry on the execution machine, and
A first response module 930, configured to record version information about the terminal device in a registry in response to the connection of the terminal device to the execution machine, so that the master device having a communication connection with the execution machine can determine whether the terminal device is connected to the execution machine based on the information recorded in the registry.
Fig. 15 schematically illustrates a block diagram of a processing device for an execution machine according to another embodiment of the present disclosure.
The application program testing device 800 comprises a generation registry module 910, a storage module 920, a first response module 930, and a second response module 940.
Specifically, the second response module 940 is configured to delete, in the registry, version information of the terminal device disconnected from the execution at this time in response to disconnection of the terminal device from the execution.
It should be noted that, the embodiment mode of the device portion is similar to the embodiment mode of the method portion, and the achieved technical effects are similar, and are not described herein.
Any number of the modules, sub-modules and units, or at least some of the functionality of any number of the modules, sub-modules and units according to embodiments of the present disclosure, may be implemented in one module. Any one or more of the modules, units according to embodiments of the present disclosure may be implemented as split into multiple modules. Any one or more of the modules, units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or in hardware or firmware in any other reasonable manner of integrating or packaging the circuits, or in any one of or in any suitable combination of three of software, hardware, and firmware. Or one or more of the modules, units according to embodiments of the present disclosure may be at least partially implemented as computer program modules which, when executed, may perform the corresponding functions.
For example, any of the determining first execution machine module 810, determining second execution machine module 820, and transmitting test script module 830 may be combined in one module to be implemented, or any of the modules may be split into a plurality of modules. Or at least some of the functionality of one or more of the modules may be combined with, and implemented in, at least some of the functionality of other modules. According to embodiments of the present disclosure, at least one of determining the first execution machine module 810, determining the second execution machine module 820, and sending test script module 830 may be implemented, at least in part, as hardware circuitry, such as a Field Programmable Gate Array (FPGA), programmable Logic Array (PLA), system-on-chip, system-on-substrate, system-on-package, application Specific Integrated Circuit (ASIC), or in hardware or firmware, such as any other reasonable manner of integrating or packaging the circuitry, or in any one of or a suitable combination of three of software, hardware, and firmware. Or at least one of the first execution machine module 810, the second execution machine module 820, and the send test script module 830 may be implemented at least in part as a computer program module that, when executed, performs the corresponding functions.
Fig. 16 schematically illustrates a block diagram of an electronic device adapted to implement the above-described method according to an embodiment of the present disclosure. The electronic device shown in fig. 16 is merely an example, and should not impose any limitation on the functionality and scope of use of the embodiments of the present disclosure.
As shown in fig. 16, an electronic device 1000 according to an embodiment of the present disclosure includes a processor 1001 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 1002 or a program loaded from a storage section 1008 into a Random Access Memory (RAM) 1003. The processor 1001 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. The processor 1001 may also include on-board memory for caching purposes. The processor 1001 may include a single processing unit or multiple processing units for performing different actions of the method flows according to embodiments of the present disclosure.
In the RAM1003, various programs and data required for the operation of the system 1000 are stored. The processor 1001, the ROM 1002, and the RAM1003 are connected to each other by a bus 1004. The processor 1001 performs various operations of the method flow according to the embodiment of the present disclosure by executing programs in the ROM 1002 and/or the RAM 1003. Note that the program may be stored in one or more memories other than the ROM 1002 and the RAM 1003. The processor 1001 may also perform various operations of the method flow according to the embodiments of the present disclosure by executing programs stored in the one or more memories.
According to embodiments of the present disclosure, system 1000 may also include an input/output (I/O) interface 1005, with input/output (I/O) interface 1005 also connected to bus 1004. The system 1000 may also include one or more of an input section 1006 including a keyboard, mouse, etc., an output section 1007 including a Cathode Ray Tube (CRT), liquid Crystal Display (LCD), etc., and speakers, etc., a storage section 1008 including a hard disk, etc., and a communication section 1009 including a network interface card, such as a LAN card, modem, etc., connected to the I/O interface 1005. The communication section 1009 performs communication processing via a network such as the internet. The drive 1010 is also connected to the I/O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is installed as needed in the drive 1010, so that a computer program read out therefrom is installed as needed in the storage section 1008.
According to embodiments of the present disclosure, the method flow according to embodiments of the present disclosure may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 1009, and/or installed from the removable medium 1011. The above-described functions defined in the system of the embodiments of the present disclosure are performed when the computer program is executed by the processor 1001. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
The present disclosure also provides a computer-readable storage medium that may be included in the apparatus/device/system described in the above embodiments, or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs which, when executed, implement methods in accordance with embodiments of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Such as, but not limited to, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
For example, according to embodiments of the present disclosure, the computer-readable storage medium may include ROM 1002 and/or RAM 1003 and/or one or more memories other than ROM 1002 and RAM 1003 described above.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that the features recited in the various embodiments of the disclosure and/or in the claims may be combined in various combinations and/or combinations, even if such combinations or combinations are not explicitly recited in the disclosure. In particular, the features recited in the various embodiments of the present disclosure and/or the claims may be variously combined and/or combined without departing from the spirit and teachings of the present disclosure. All such combinations and/or combinations fall within the scope of the present disclosure.
The embodiments of the present disclosure are described above. These examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be made by those skilled in the art without departing from the scope of the disclosure, and such alternatives and modifications are intended to fall within the scope of the disclosure.

Claims (16)

Translated fromChinese
1.一种程序测试方法,包括:1. A program testing method, comprising:确定与主控设备之间存在通信连接的至少一个第一执行机;Determine at least one first execution machine that is in communication connection with the master control device;确定所述至少一个第一执行机中连接有终端设备的至少一个第二执行机;Determine at least one second execution machine of the at least one first execution machine connected to the terminal device;其中,所述确定所述至少一个第一执行机中连接有终端设备的至少一个第二执行机,包括:The step of determining that at least one of the at least one first execution machine is connected to at least one second execution machine of the terminal device comprises:查询所述至少一个第一执行机中每个第一执行机上的注册表,得到对应的至少一个查询结果,其中,每个查询结果对应于一个第一执行机;querying a registry on each of the at least one first execution machine to obtain at least one corresponding query result, wherein each query result corresponds to a first execution machine;基于所述至少一个查询结果,确定所述至少一个第一执行机中连接有终端设备的所述至少一个第二执行机,其中,所述查询结果中有关于终端设备的版本信息;Determine, based on the at least one query result, the at least one second execution machine connected to the terminal device in the at least one first execution machine, wherein the query result includes version information about the terminal device;其中,在有终端设备连接上执行机的情况下,在注册表中记录关于终端设备的版本信息;在终端设备与执行机断开连接的情况下,执行机响应于有终端设备与执行机断开连接,在注册表中删除本次与执行机断开连接的终端设备的版本信息;以及Wherein, when a terminal device is connected to the execution machine, version information about the terminal device is recorded in the registration table; when the terminal device is disconnected from the execution machine, the execution machine deletes the version information of the terminal device that is disconnected from the execution machine in the registration table in response to the disconnection of the terminal device from the execution machine; and将测试脚本发送至所述至少一个第二执行机中的每个执行机,使得所述每个执行机通过运行接收到的测试脚本来测试与自身相连接的终端设备上运行的应用程序。The test script is sent to each of the at least one second execution machine, so that each execution machine tests the application running on the terminal device connected to itself by running the received test script.2.根据权利要求1所述的方法,其中,基于所述至少一个查询结果,确定所述至少一个第一执行机中连接有终端设备的所述至少一个第二执行机,包括:针对每个查询结果,2. The method according to claim 1, wherein, based on the at least one query result, determining the at least one second execution machine connected to the terminal device in the at least one first execution machine comprises: for each query result,响应于当前查询结果表征注册表中有关于终端设备的版本信息,确定对应于该当前查询结果的第一执行机连接有终端设备,并将该第一执行机作为一个第二执行机。In response to the current query result indicating that there is version information about the terminal device in the registration table, it is determined that a first execution machine corresponding to the current query result is connected to the terminal device, and the first execution machine is used as a second execution machine.3.根据权利要求1至2中任一项所述的方法,其中,将测试脚本发送至所述至少一个第二执行机中的每个执行机,包括以下之一:3. The method according to any one of claims 1 to 2, wherein sending the test script to each of the at least one second execution machine comprises one of the following:将整个测试脚本分别发送至所述至少一个第二执行机中的每个执行机;Sending the entire test script to each of the at least one second execution machine respectively;先将整个测试脚本划分为多个子脚本,再按照预设规则将所述多个子脚本分发至所述至少一个第二执行机中对应的执行机。First, the entire test script is divided into a plurality of sub-scripts, and then the plurality of sub-scripts are distributed to corresponding execution machines in the at least one second execution machine according to a preset rule.4.根据权利要求3所述的方法,其中,按照预设规则将所述多个子脚本分发至所述至少一个第二执行机中对应的执行机,包括以下至少之一:4. The method according to claim 3, wherein distributing the plurality of sub-scripts to corresponding execution machines in the at least one second execution machine according to a preset rule comprises at least one of the following:在子脚本数目小于第二执行机数目的情况下,将所述多个子脚本中的每个子脚本随机发送至所述至少一个第二执行机中的一个第二执行机上,使不同的子脚本运行在不同的第二执行机上;When the number of sub-scripts is less than the number of second execution machines, randomly sending each sub-script of the plurality of sub-scripts to one of the at least one second execution machines, so that different sub-scripts are run on different second execution machines;在子脚本数目大于等于第二执行机数目且子脚本数目是第二执行机数目整数倍的情况下,将所述多个子脚本平均分配至所述至少一个第二执行机中的每个第二执行机上。When the number of sub-scripts is greater than or equal to the number of second execution machines and the number of sub-scripts is an integer multiple of the number of second execution machines, the plurality of sub-scripts are evenly distributed to each second execution machine in the at least one second execution machine.5.根据权利要求1所述的方法,其中,所述应用程序包括实现UI界面的程序。The method according to claim 1 , wherein the application program comprises a program for implementing a UI interface.6.根据权利要求1所述的方法,还包括:针对所述至少一个第二执行机中的每个执行机,6. The method according to claim 1, further comprising: for each execution machine of the at least one second execution machine,响应于当前执行机成功完成本次程序测试,获取并展示该当前执行机返回的测试结果。In response to the current execution machine successfully completing the current program test, the test result returned by the current execution machine is obtained and displayed.7.一种用于执行机的处理方法,包括:7. A processing method for an execution machine, comprising:生成注册表;Generate a registration form;将所述注册表存储在执行机上;以及storing the registry on an execution machine; and响应于有终端设备连接上所述执行机,在所述注册表中记录关于所述终端设备的版本信息,以便与所述执行机之间存在通信连接的主控设备能够基于所述注册表中记录的信息,确定所述执行机上是否连接有终端设备;In response to a terminal device being connected to the execution machine, recording version information about the terminal device in the registration table, so that a master control device having a communication connection with the execution machine can determine whether the terminal device is connected to the execution machine based on the information recorded in the registration table;其中,所述主控设备用于确定至少一个第一执行机中连接有终端设备的至少一个第二执行机;The main control device is used to determine at least one second execution machine connected to the terminal device in at least one first execution machine;其中,所述确定至少一个第一执行机中连接有终端设备的至少一个第二执行机,包括:The step of determining that at least one of the first execution machines is connected to at least one second execution machine of the terminal device includes:查询所述至少一个第一执行机中每个第一执行机上的注册表,得到对应的至少一个查询结果,其中,每个查询结果对应于一个第一执行机;querying a registry on each of the at least one first execution machine to obtain at least one corresponding query result, wherein each query result corresponds to a first execution machine;基于所述至少一个查询结果,确定所述至少一个第一执行机中连接有终端设备的所述至少一个第二执行机,其中,所述查询结果中有关于终端设备的版本信息;Determine, based on the at least one query result, the at least one second execution machine connected to the terminal device in the at least one first execution machine, wherein the query result includes version information about the terminal device;其中,所述方法还包括:Wherein, the method further comprises:响应于有终端设备与所述执行机断开连接,在所述注册表中删除本次与所述执行机断开连接的终端设备的版本信息。In response to a terminal device being disconnected from the execution machine, version information of the terminal device that is disconnected from the execution machine is deleted from the registration table.8.一种程序测试装置,包括:8. A program testing device, comprising:确定第一执行机模块,用于确定与主控设备之间存在通信连接的至少一个第一执行机;A first execution machine module is used to determine at least one first execution machine that is in communication connection with the main control device;确定第二执行机模块,用于确定所述至少一个第一执行机中连接有终端设备的至少一个第二执行机;A second execution machine determination module is used to determine at least one second execution machine connected to a terminal device among the at least one first execution machine;其中,所述确定第二执行机模块,包括:Wherein, the determining of the second execution machine module includes:查询子模块,用于查询所述至少一个第一执行机中每个第一执行机上的注册表,得到对应的至少一个查询结果,其中,每个查询结果对应于一个第一执行机;A query submodule, configured to query a registry on each of the at least one first execution machine to obtain at least one corresponding query result, wherein each query result corresponds to a first execution machine;确定第二执行机子模块,用于基于所述至少一个查询结果,确定所述至少一个第一执行机中连接有终端设备的所述至少一个第二执行机,其中,所述查询结果中有关于终端设备的版本信息;a second execution machine determination submodule, configured to determine, based on the at least one query result, the at least one second execution machine connected to the terminal device in the at least one first execution machine, wherein the query result includes version information about the terminal device;其中,在有终端设备连接上执行机的情况下,在注册表中记录关于终端设备的版本信息;在终端设备与执行机断开连接的情况下,执行机响应于有终端设备与执行机断开连接,在注册表中删除本次与执行机断开连接的终端设备的版本信息;以及Wherein, when a terminal device is connected to the execution machine, version information about the terminal device is recorded in the registration table; when the terminal device is disconnected from the execution machine, the execution machine deletes the version information of the terminal device that is disconnected from the execution machine in the registration table in response to the disconnection of the terminal device from the execution machine; and发送测试脚本模块,用于将测试脚本发送至所述至少一个第二执行机中的每个执行机,使得所述每个执行机通过运行接收到的测试脚本来测试与自身相连接的终端设备上运行的应用程序。The test script sending module is used to send the test script to each of the at least one second execution machine, so that each execution machine tests the application running on the terminal device connected to itself by running the received test script.9.根据权利要求8所述的装置,其中,所述确定第二执行机子模块,包括:针对每个查询结果,9. The apparatus according to claim 8, wherein the determining the second execution engine submodule comprises: for each query result,响应于当前查询结果表征注册表中有关于终端设备的版本信息,确定对应于该当前查询结果的第一执行机连接有终端设备,并将该第一执行机作为一个第二执行机。In response to the current query result indicating that there is version information about the terminal device in the registration table, it is determined that a first execution machine corresponding to the current query result is connected to the terminal device, and the first execution machine is used as a second execution machine.10.根据权利要求8至9中任一项所述的装置,其中,所述发送测试脚本模块,包括以下之一:10. The device according to any one of claims 8 to 9, wherein the sending test script module comprises one of the following:脚本发送子模块,用于将整个测试脚本分别发送至所述至少一个第二执行机中的每个执行机;A script sending submodule, used for sending the entire test script to each execution machine of the at least one second execution machine respectively;脚本分发子模块,用于先将整个测试脚本划分为多个子脚本,再按照预设规则将所述多个子脚本分发至所述至少一个第二执行机中对应的执行机。The script distribution submodule is used to first divide the entire test script into multiple sub-scripts, and then distribute the multiple sub-scripts to corresponding execution machines in the at least one second execution machine according to preset rules.11.根据权利要求10所述的装置,其中,所述脚本分发子模块,包括以下至少之一:11. The device according to claim 10, wherein the script distribution submodule comprises at least one of the following:第一分发单元,在子脚本数目小于第二执行机数目的情况下,将所述多个子脚本中的每个子脚本随机发送至所述至少一个第二执行机中的一个第二执行机上,使不同的子脚本运行在不同的第二执行机上;A first distribution unit, when the number of sub-scripts is less than the number of second execution machines, randomly sends each sub-script of the plurality of sub-scripts to one of the at least one second execution machines, so that different sub-scripts are run on different second execution machines;第二分发单元,在子脚本数目大于等于第二执行机数目且子脚本数目是第二执行机数目整数倍的情况下,将所述多个子脚本平均分配至所述至少一个第二执行机中的每个第二执行机上。The second distribution unit evenly distributes the plurality of sub-scripts to each second execution machine in the at least one second execution machine when the number of sub-scripts is greater than or equal to the number of second execution machines and the number of sub-scripts is an integer multiple of the number of second execution machines.12.根据权利要求8所述的装置,其中,所述应用程序包括实现UI界面的程序。12. The device according to claim 8, wherein the application program comprises a program for implementing a UI interface.13.根据权利要求8所述的装置,还包括:展示结果单元,用于针对所述至少一个第二执行机中的每个执行机,13. The apparatus according to claim 8, further comprising: a display result unit, configured to display the result of each execution machine in the at least one second execution machine,响应于当前执行机成功完成本次程序测试,获取并展示该当前执行机返回的测试结果。In response to the current execution machine successfully completing the current program test, the test result returned by the current execution machine is obtained and displayed.14.一种用于执行机的处理装置,包括:14. A processing device for an execution machine, comprising:生成注册表模块,用于生成注册表;Generate registry module, used to generate registry;存储模块,用于将所述注册表存储在执行机上;以及A storage module, used for storing the registration table on an execution machine; and第一响应模块,用于响应于有终端设备连接上所述执行机,在所述注册表中记录关于所述终端设备的版本信息,以便与所述执行机之间存在通信连接的主控设备能够基于所述注册表中记录的信息,确定所述执行机上是否连接有终端设备;A first response module is used for recording version information about the terminal device in the registration table in response to a terminal device being connected to the execution machine, so that the main control device having a communication connection with the execution machine can determine whether the terminal device is connected to the execution machine based on the information recorded in the registration table;其中,所述主控设备用于确定至少一个第一执行机中连接有终端设备的至少一个第二执行机;The main control device is used to determine at least one second execution machine connected to the terminal device in at least one first execution machine;其中,所述确定至少一个第一执行机中连接有终端设备的至少一个第二执行机,包括:The step of determining that at least one of the first execution machines is connected to at least one second execution machine of the terminal device includes:查询所述至少一个第一执行机中每个第一执行机上的注册表,得到对应的至少一个查询结果,其中,每个查询结果对应于一个第一执行机;querying a registry on each of the at least one first execution machine to obtain at least one corresponding query result, wherein each query result corresponds to a first execution machine;基于所述至少一个查询结果,确定所述至少一个第一执行机中连接有终端设备的所述至少一个第二执行机,其中,所述查询结果中有关于终端设备的版本信息;Determine, based on the at least one query result, the at least one second execution machine connected to the terminal device in the at least one first execution machine, wherein the query result includes version information about the terminal device;其中,所述装置还包括:Wherein, the device further comprises:第二响应模块,用于响应于有终端设备与所述执行机断开连接,在所述注册表中删除本次与所述执行机断开连接的终端设备的版本信息。The second response module is used for deleting the version information of the terminal device which is disconnected from the execution machine in the registration table in response to the terminal device being disconnected from the execution machine.15.一种电子设备,包括:15. An electronic device, comprising:一个或多个处理器;one or more processors;存储器,用于存储一个或多个程序,a memory for storing one or more programs,其中,当所述一个或多个程序被所述一个或多个处理器执行时,使得所述一个或多个处理器实现权利要求1至7中任一项所述的方法。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 7.16.一种计算机可读存储介质,存储有计算机可执行指令,所述指令在被执行时用于实现权利要求1至7中任一项所述的方法。16 . A computer-readable storage medium storing computer-executable instructions, wherein the instructions are used to implement the method according to claim 1 when executed.
CN202110965088.0A2021-08-202021-08-20 Program testing method and deviceActiveCN113535590B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202110965088.0ACN113535590B (en)2021-08-202021-08-20 Program testing method and device

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202110965088.0ACN113535590B (en)2021-08-202021-08-20 Program testing method and device

Publications (2)

Publication NumberPublication Date
CN113535590A CN113535590A (en)2021-10-22
CN113535590Btrue CN113535590B (en)2025-04-18

Family

ID=78122767

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202110965088.0AActiveCN113535590B (en)2021-08-202021-08-20 Program testing method and device

Country Status (1)

CountryLink
CN (1)CN113535590B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114706773A (en)*2022-03-292022-07-05网宿科技股份有限公司Automated testing method, automated testing equipment and readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN110032507A (en)*2018-12-252019-07-19阿里巴巴集团控股有限公司Applied program testing method, device, system, electronic equipment and storage medium
CN111752828A (en)*2020-06-042020-10-09武汉迎风聚智科技有限公司Performance test method and device for Web application

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102651700A (en)*2011-02-282012-08-29Sap股份公司Management test automation
CN105095034B (en)*2015-08-212018-10-23惠州市蓝微电子有限公司Product testing equipment and test method based on the product testing equipment
CN107195131B (en)*2017-04-132019-09-20深圳怡化电脑股份有限公司A kind of method and device of analog hardware equipment
CN108200046B (en)*2017-12-282020-12-08新华三技术有限公司Registration method and device of terminal equipment, terminal equipment and proxy server
CN109471789B (en)*2018-09-042023-04-11中国平安人寿保险股份有限公司Multi-device management method and device for testing, server and storage medium
CN111488268A (en)*2019-01-252020-08-04北京京东尚科信息技术有限公司 Scheduling method and scheduling device for automated testing
CN110377520B (en)*2019-07-222024-03-15中国工商银行股份有限公司Transaction scenario testing method and device, electronic equipment and readable storage medium
CN111258902B (en)*2020-01-172022-07-19深圳平安医疗健康科技服务有限公司Performance test method and performance test system based on SockJS server
CN112306887B (en)*2020-11-122024-08-06广州方硅信息技术有限公司 Program testing distribution method and its corresponding devices, equipment and media

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN110032507A (en)*2018-12-252019-07-19阿里巴巴集团控股有限公司Applied program testing method, device, system, electronic equipment and storage medium
CN111752828A (en)*2020-06-042020-10-09武汉迎风聚智科技有限公司Performance test method and device for Web application

Also Published As

Publication numberPublication date
CN113535590A (en)2021-10-22

Similar Documents

PublicationPublication DateTitle
US11762763B2 (en)Orchestration for automated performance testing
US9386079B2 (en)Method and system of virtual desktop infrastructure deployment studio
US20160077949A1 (en)Online application testing across browser environments
CN113312037A (en)Data processing method, device and equipment applied to microservice and storage medium
US20140331209A1 (en)Program Testing Service
US11843674B2 (en)Virtual workspace experience visualization and optimization
US11269756B1 (en)Self-healing web applications
CN113986258B (en) Business publishing method, device, equipment and storage medium
CN110717992A (en) Method, apparatus, computer system and readable storage medium for scheduling model
CN113434384A (en)Pressure testing method and device
CN112579447A (en)Browser testing method and device
CN113535590B (en) Program testing method and device
CN111930629A (en)Page testing method and device, electronic equipment and storage medium
CN110413675A (en) A control method, device, server and storage medium for real-time task computing
CN112395194B (en)Method and device for accessing test platform
US10291743B2 (en)Configuring service endpoints in native client applications
CN112882921B (en)Fault simulation method and device
CN113656326A (en)Program testing method, program testing device, computer system and storage medium
CN110955599A (en) Object creation method, apparatus, electronic device, and computer-readable storage medium
CN111226242A (en)Cloud computing network inspection technology
CN111859403B (en)Dependency vulnerability determination method and device, electronic equipment and storage medium
CN116503005A (en)Method, device, system and storage medium for dynamically modifying flow
CN111506340B (en)Business rule information processing method, device and system
US10097399B1 (en)Distributed computing management links
CN113094268A (en)Test method, device, equipment, medium and program product

Legal Events

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

[8]ページ先頭

©2009-2025 Movatter.jp