CN111817916B - Test method, device, equipment and storage medium based on mobile terminal cluster - Google Patents

Test method, device, equipment and storage medium based on mobile terminal cluster Download PDF

Info

Publication number
CN111817916B
CN111817916B CN202010634578.8A CN202010634578A CN111817916B CN 111817916 B CN111817916 B CN 111817916B CN 202010634578 A CN202010634578 A CN 202010634578A CN 111817916 B CN111817916 B CN 111817916B
Authority
CN
China
Prior art keywords
mobile terminal
application program
current application
program interface
cluster
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
CN202010634578.8A
Other languages
Chinese (zh)
Other versions
CN111817916A (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.)
Zhejiang Tonghuashun Intelligent Technology Co Ltd
Original Assignee
Zhejiang Tonghuashun Intelligent 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 Zhejiang Tonghuashun Intelligent Technology Co Ltd filed Critical Zhejiang Tonghuashun Intelligent Technology Co Ltd
Priority to CN202010634578.8A priority Critical patent/CN111817916B/en
Publication of CN111817916A publication Critical patent/CN111817916A/en
Application granted granted Critical
Publication of CN111817916B publication Critical patent/CN111817916B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Debugging And Monitoring (AREA)
  • Telephone Function (AREA)

Abstract

The application relates to a test method, a test device, test equipment and a storage medium based on a mobile terminal cluster. The method is applied to the mobile terminals in the mobile terminal cluster connected with the main server through the cluster server, and comprises the following steps: receiving a control instruction transmitted by the main server and forwarded by the cluster server; when the control instruction is a depth traversal test instruction, traversing the current application program interface of the mobile terminal to obtain a locatable element for testing; and when the current application program interface also comprises untested elements, carrying out element positioning on the current application program interface based on a preset image, and testing the positioned elements. Therefore, the embodiment of the invention can solve the problems of high cost and low efficiency of the existing automatic test.

Description

Test method, device, equipment and storage medium based on mobile terminal cluster
Technical Field
The present application relates to the field of testing technologies, and in particular, to a testing method, an apparatus, a device, and a storage medium based on a mobile terminal cluster.
Background
The remote cluster control of the mobile terminal refers to the deployment of thousands of Android and iOS real machine devices in a dust-free machine room, and a user can select one or more devices to perform remote control, debugging and automatic testing anytime and anywhere by opening a webpage. The system can provide efficient equipment debugging for enterprises, provide automatic script testing and non-intrusive Monkey random testing services, reduce the cost of purchasing the equipment of the enterprises, and solve the problems of single or insufficient equipment models of the enterprises and the like.
According to different configurations, a single server in a mobile terminal remote cluster control system generally has about 20 to 50 mobile terminals which can be borne on the premise of ensuring normal operation equipment, and when the situation that a page needing manual interference or an unsettable element exists in a currently tested page or the like sometimes happens in an automatic test of a mobile terminal cluster through the mobile terminal remote cluster control system, various operation tests of the element or the page cannot be normally carried out; especially, when the number of the mobile terminals controlled by the remote cluster control system of the mobile terminal reaches hundreds or even thousands, it is very important to automatically implement the test of the mobile terminals.
The realization methods of the automatic test applied to the remote cluster control system of the mobile terminal at present comprise the following steps:
1) the automatic test based on script writing is realized by positioning control elements in the application to be tested through a script language and executing operations such as clicking, sliding, long pressing and the like on the control elements, although the precision is high, the development threshold is high, the script writing capability has higher requirements, and the labor input and the maintenance cost are higher;
2) based on the automatic test of recording playback, when a tester operates the mobile terminal, certain operation is coded and stored in real time in a preset certain protocol format, then the operation is decoded, and playback is performed on other mobile equipment, so that batch and automatic test is achieved. However, scripts recorded in the method have poor compatibility, high recording failure rate and greatly influenced test efficiency.
In summary, an automatic test scheme with low cost, strong versatility and high test efficiency is needed to meet the requirement of automatic testing of a mobile terminal cluster.
Disclosure of Invention
In order to solve the problems, the invention provides a test method, a test device, test equipment and a storage medium based on a mobile terminal cluster, which are used for solving the problems of high cost and low efficiency of the existing automatic test.
In a first aspect, an embodiment of the present application provides a mobile terminal cluster-based testing method, where the method is applied to a mobile terminal in a mobile terminal cluster connected to a main server through a cluster server, and includes:
receiving a control instruction transmitted by the main server and forwarded by the cluster server;
when the control instruction is a depth traversal test instruction, traversing the current application program interface of the mobile terminal to obtain a locatable element for testing;
and when the current application program interface also comprises untested elements, carrying out element positioning on the current application program interface based on a preset image, and testing the positioned elements.
Further, the method further comprises:
and when the control instruction is a preset user-defined test instruction, executing the preset user-defined test instruction on the mobile terminal.
Further, the method further comprises:
and when the control instruction is a picture synchronization instruction, starting screen recording operation, and transmitting the obtained video stream after being coded and compressed to the main server through socket communication.
Traversing the current application program interface of the mobile terminal, and acquiring a locatable element for testing, wherein the method comprises the following steps:
traversing the current application program interface of the mobile terminal according to a preset element determination rule, acquiring a locatable element and storing the locatable element according to a tree structure;
and executing corresponding operation on the elements stored in the tree structure according to a preset element operation corresponding relation, wherein the operation comprises one or more of clicking, sliding or long pressing.
Wherein the element positioning of the current application program interface based on the preset image comprises
Sequentially comparing a preset image with the current application program interface to determine the similarity;
determining a preset image with the maximum similarity as an image to be positioned of the current application program interface;
and determining the elements in the image to be positioned as the elements obtained by positioning the current application program interface.
Wherein, the testing the elements obtained by positioning comprises:
and executing corresponding operation on the positioned elements according to a preset element operation corresponding relation, wherein the operation comprises one or more of clicking, sliding, inputting or long pressing.
Further, the method further comprises:
and when the test is finished, reporting the test result to the main server.
In a second aspect, an embodiment of the present application provides a testing apparatus based on a mobile terminal cluster, where the apparatus is applied to a mobile terminal in the mobile terminal cluster connected to a main server through a cluster server, and the apparatus includes: the device comprises a receiving unit, a depth traversal testing unit and an image identification testing unit; wherein the content of the first and second substances,
the receiving unit is configured to receive a control instruction sent by the master server and forwarded by the cluster server;
the depth traversal testing unit is used for traversing the current application program interface of the mobile terminal to obtain the locatable element for testing when the control instruction is a depth traversal testing instruction;
the image identification testing unit is used for positioning elements of the current application program interface based on a preset image and testing the positioned elements when the current application program interface also comprises untested elements.
Further, the apparatus may further include: and the user-defined test unit is used for executing the preset user-defined test instruction to the mobile terminal when the control instruction is the preset user-defined test instruction.
Further, the apparatus further comprises: and the picture synchronization unit is used for starting screen recording operation when the control instruction is a picture synchronization instruction, and transmitting the obtained video stream after being coded and compressed to the main server through socket communication.
The deep traversal testing unit is configured to traverse a current application program interface of the mobile terminal, and acquire a locatable element for testing, and specifically includes:
traversing the current application program interface of the mobile terminal according to a preset element determination rule, acquiring a locatable element and storing the locatable element according to a tree structure;
and executing corresponding operation on the elements stored in the tree structure according to a preset element operation corresponding relation, wherein the operation comprises one or more of clicking, sliding or long pressing.
The image recognition test unit is used for carrying out element positioning on the current application program interface based on a preset image, and specifically comprises
Sequentially comparing a preset image with the current application program interface to determine the similarity;
determining a preset image with the maximum similarity as an image to be positioned of the current application program interface;
and determining the elements in the image to be positioned as the elements obtained by positioning the current application program interface.
The image recognition test unit is used for testing the elements obtained by positioning, and is specifically used for:
and executing corresponding operation on the positioned elements according to a preset element operation corresponding relation, wherein the operation comprises one or more of clicking, sliding, inputting or long-time pressing.
Preferably, the apparatus further comprises: and the reporting unit is used for reporting the test result to the main server after the test is finished.
In a third aspect, an embodiment of the present application provides an electronic device, including:
one or more processors;
a memory communicatively coupled to the one or more processors;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the methods described above.
In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the method described above.
In a fifth aspect, a mobile terminal cluster control system is characterized in that the system includes: the mobile terminal cluster comprises a main server, a cluster server and a mobile terminal cluster connected with the main server through the cluster server; wherein the content of the first and second substances,
the main server is used for receiving a control instruction input by a user and forwarding the control instruction to the cluster server;
the cluster server is used for receiving the control instruction forwarded by the main server and sending the control instruction to the corresponding mobile terminal cluster;
the mobile terminal cluster comprises at least one mobile terminal and is used for receiving a control instruction which is transmitted by the main server and forwarded by the cluster server; when the control instruction is a depth traversal test instruction, traversing the current application program interface of the mobile terminal to obtain a locatable element for testing; and when the current application program interface also comprises untested elements, carrying out element positioning on the current application program interface based on a preset image, and testing the positioned elements.
In this way, the method, the device, the equipment and the storage medium for testing based on the mobile terminal cluster provided by the embodiment of the invention are applied to the mobile terminal in the mobile terminal cluster connected with the main server through the cluster server, and the control instruction transmitted by the main server and forwarded by the cluster server is received; when the control instruction is a depth traversal test instruction, traversing the current application program interface of the mobile terminal to obtain a locatable element for testing; and when the current application program interface also comprises untested elements, carrying out element positioning on the current application program interface based on a preset image, and testing the positioned elements. In the embodiment of the invention, the mobile terminal is connected with the main server through the cluster server to realize remote control, the remote control of large-scale mobile terminal clusters can be realized, when the control instruction received by the mobile terminal is a depth traversal test instruction, the depth traversal test of the current application program interface of the mobile terminal can be automatically realized, and if the current application program interface has elements which cannot be tested by depth traversal, the element positioning can be further carried out on the current application program interface based on the preset image, so that the complete test of the application program interface is realized, the test automation degree is improved, the test coverage rate and the test efficiency are improved, and the test cost is reduced.
Drawings
Fig. 1 is a schematic flow chart illustrating an implementation of a test method based on a mobile terminal cluster according to an embodiment of the present invention;
fig. 2 is a schematic flow chart illustrating an implementation of step 102 in the testing method based on the mobile terminal cluster according to the embodiment of the present application;
fig. 3 is a schematic flow chart illustrating an implementation of step 103 in the test method based on the mobile terminal cluster according to the embodiment of the present application;
fig. 4 is a schematic structural diagram of a testing apparatus based on a mobile terminal cluster according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In some of the flows described in the specification and claims of the present application and in the above-described figures, a number of operations are included that occur in a particular order, but it should be clearly understood that the flows may include more or less operations, and that the operations may be performed sequentially or in parallel.
Based on this, the embodiment of the application provides a test method, a device, equipment and a storage medium based on a mobile terminal cluster; specifically, fig. 1 is a schematic diagram of an implementation flow of a test method based on a mobile terminal cluster according to an embodiment of the present invention, and as shown in fig. 1, the method is applied to a mobile terminal in a mobile terminal cluster connected to a main server through a cluster server, and includes:
step 101, receiving a control instruction transmitted by the main server and forwarded by the cluster server;
here, the user may be connected to the main server through a network through a remote control terminal, such as a notebook, a desktop, or an intelligent mobile device, to perform a remote control operation; the main server receives the control instruction sent by the user and forwards the control instruction to the mobile terminal through the cluster server.
In the embodiment of the invention, the cluster server serves as an intermediate server, can receive the control instruction sent by the main server and forward the control instruction to the mobile terminal, and can report the information fed back by the mobile terminal to the main server, and the cluster server can directly realize two-way communication between the main server and the mobile terminal.
102, when the control instruction is a depth traversal test instruction, traversing a current application program interface of the mobile terminal to obtain a locatable element for testing;
the deep traversal test is usually only to carry out the random test of elements on the current interface, and mainly relates to the random operations of clicking, long pressing and the like of the elements; here, after acquiring the locatable element, the corresponding random operation is performed according to the element attribute to perform the test.
103, when the current application program interface further comprises untested elements, carrying out element positioning on the current application program interface based on a preset image, and testing the positioned elements.
In the testing process, it may happen that an element such as an input box exists in the interface and needs to input content for testing, and at this time, the testing cannot be completed through the depth traversal testing, so that the pre-stored interface image can be compared with the current application program interface by pre-storing the interface image corresponding to the element which cannot be subjected to the depth traversal testing based on the preset image, and after the element is located, the testing can be performed according to the attribute of the element.
Preferably, the method further comprises:
and when the control instruction is a preset user-defined test instruction, executing the preset user-defined test instruction on the mobile terminal. Here, when the control instruction is a custom test instruction implemented by a script, the script may be directly executed to perform a test.
Preferably, the method further comprises:
and when the control instruction is a picture synchronization instruction, starting screen recording operation, and transmitting the obtained video stream after being coded and compressed to the main server through socket communication. When the mobile terminal receives a picture synchronization instruction, a screen recording interface carried by the mobile terminal is started, an obtained video stream is coded and compressed and then transmitted to a main server for display, and at present, picture synchronization is usually realized by using a screenshot, so that the speed is low, and the picture is fed back to a front end for display, and the picture is often discontinuous and stuck; and the size of the picture obtained by screenshot is large, and the bandwidth per second is very high when the picture is converted into binary stream for transmission, so that the load in a local area network is high, and the problems of frame loss, blocking and the like can also be caused. The embodiment of the invention uses a screen recording interface of the mobile terminal to replace the existing screenshot mode, the obtained frame picture is encoded by a preset protocol and then compressed and then transmitted back to the main server, the front end decompresses the data after receiving the data, and the decoded video stream is displayed to the front end interface. Therefore, the definition of the picture can be ensured, the jamming problem is optimized, and the transmission bandwidth of the data stream can be greatly reduced.
Referring to fig. 2, in step 102 in the above testing method based on a mobile terminal cluster, traversing a current application program interface of the mobile terminal to obtain a locatable element for testing, includes:
step 201, traversing the current application program interface of the mobile terminal according to a preset element determination rule, acquiring a locatable element and storing the locatable element according to a tree structure;
step 202, according to a preset element operation corresponding relation, corresponding operation is executed on elements stored in the tree structure, wherein the operation comprises one or more of clicking, sliding and long pressing.
Referring to fig. 3, in step 103 of the above-mentioned test method based on a mobile terminal cluster, the performing element positioning on the current application program interface based on the preset image includes
Step 301, comparing a preset image with the current application program interface in sequence to determine similarity;
the preset images can include a plurality of preset images, and each preset image is compared with the current application program interface in sequence in an image identification mode to obtain a similarity comparison result;
step 302, determining a preset image with the maximum similarity as an image to be positioned of the current application program interface;
the preset image with the maximum similarity is the image closest to the current application program interface, and the elements to be tested in the preset image are stored in advance, so that the element test of the current application program interface can be realized only by testing the elements in the preset image according to the pre-stored elements to be tested.
Step 303, determining the elements in the image to be positioned as the elements obtained by positioning the current application program interface.
Wherein, the testing the elements obtained by positioning comprises:
and executing corresponding operation on the positioned elements according to a preset element operation corresponding relation, wherein the operation comprises one or more of clicking, sliding, inputting or long pressing.
Further, the method further comprises:
and after the test is finished, reporting the test result to the main server.
The test method based on the mobile terminal cluster is applied to the mobile terminals in the mobile terminal cluster which is connected with a main server through a cluster server, and receives a control instruction which is transmitted by the main server and is forwarded by the cluster server; when the control instruction is a depth traversal test instruction, traversing the current application program interface of the mobile terminal to obtain a locatable element for testing; and when the current application program interface also comprises untested elements, carrying out element positioning on the current application program interface based on a preset image, and testing the positioned elements. In the embodiment of the invention, the mobile terminal is connected with the main server through the cluster server to realize remote control, the remote control of large-scale mobile terminal clusters can be realized, when the control instruction received by the mobile terminal is a depth traversal test instruction, the depth traversal test of the current application program interface of the mobile terminal can be automatically realized, and if the current application program interface has elements which cannot be tested by depth traversal, the element positioning can be further carried out on the current application program interface based on the preset image, the complete test of the application program interface is realized, the automation degree of the test is improved, the test coverage rate and the test efficiency are improved, the technical threshold of common testers is greatly reduced, the script recording time and the labor cost are improved, and the script accuracy and the playback success rate are improved. And when the control instruction received by the mobile terminal is a picture synchronization instruction, picture synchronization can be performed by using a self-contained screen recording interface, so that the synchronous picture quality is improved, and the delay and the transmission bandwidth are reduced.
The embodiment of the present application further provides a testing apparatus based on a mobile terminal cluster, where the apparatus is applied to a mobile terminal in the mobile terminal cluster connected with a main server through a cluster server, as shown in fig. 4, the apparatus includes: a receiving unit 41, a depth traversal testing unit 42, an image recognition testing unit 43; wherein the content of the first and second substances,
the receiving unit 41 is configured to receive a control instruction sent by the master server and forwarded by the cluster server;
the depth traversal testing unit 42 is configured to traverse a current application program interface of the mobile terminal to obtain a locatable element for testing when the control instruction is a depth traversal testing instruction;
the image recognition testing unit 43 is configured to, when the current application program interface further includes untested elements, perform element positioning on the current application program interface based on a preset image, and test the positioned elements.
Further, the apparatus may further include: and the user-defined test unit is used for executing the preset user-defined test instruction to the mobile terminal when the control instruction is the preset user-defined test instruction.
Further, the apparatus further comprises: and the picture synchronization unit is used for starting screen recording operation when the control instruction is a picture synchronization instruction, and transmitting the obtained video stream after being coded and compressed to the main server through socket communication.
The deep traversal testing unit 42 is configured to traverse a current application program interface of the mobile terminal, and obtain a locatable element for testing, and specifically includes:
traversing the current application program interface of the mobile terminal according to a preset element determination rule, acquiring a locatable element and storing the locatable element according to a tree structure;
and executing corresponding operation on the elements stored in the tree structure according to a preset element operation corresponding relation, wherein the operation comprises one or more of clicking, sliding or long pressing.
The image recognition testing unit 43 is configured to perform element positioning on the current application program interface based on a preset image, and specifically includes
Sequentially comparing a preset image with the current application program interface to determine the similarity;
determining a preset image with the maximum similarity as an image to be positioned of the current application program interface;
and determining the elements in the image to be positioned as the elements obtained by positioning the current application program interface.
The image recognition testing unit 42 is configured to test the elements obtained by positioning, and specifically is configured to:
and executing corresponding operation on the positioned elements according to a preset element operation corresponding relation, wherein the operation comprises one or more of clicking, sliding, inputting or long pressing.
Preferably, the apparatus further comprises: and the reporting unit is used for reporting the test result to the main server after the test is finished.
Here, it should be noted that: the descriptions of the embodiments of the apparatus are similar to the descriptions of the methods, and have the same advantages as the embodiments of the methods, and therefore are not repeated herein. For technical details that are not disclosed in the embodiments of the apparatus of the present invention, those skilled in the art should refer to the description of the embodiments of the method of the present invention to understand, and for brevity, will not be described again here.
The test method and device based on the mobile terminal cluster provided by the embodiment of the invention can be applied to the mobile terminal in the mobile terminal cluster connected with the main server through the cluster server, and the control instruction transmitted by the main server and forwarded by the cluster server is received; when the control instruction is a depth traversal test instruction, traversing the current application program interface of the mobile terminal to obtain a locatable element for testing; and when the current application program interface also comprises untested elements, carrying out element positioning on the current application program interface based on a preset image, and testing the positioned elements. In the embodiment of the invention, the mobile terminal is connected with the main server through the cluster server to realize remote control, the remote control of large-scale mobile terminal clusters can be realized, when the control instruction received by the mobile terminal is a depth traversal test instruction, the depth traversal test of the current application program interface of the mobile terminal can be automatically realized, and if the current application program interface has elements which cannot be tested by depth traversal, the element positioning can be further carried out on the current application program interface based on the preset image, so that the complete test of the application program interface is realized, the test automation degree is improved, the test coverage rate and the test efficiency are improved, and the test cost is reduced.
An embodiment of the present application further provides an electronic device, including: one or more processors; a memory communicatively coupled to the one or more processors; one or more application programs; wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method described above.
In a specific example, the electronic device according to the embodiment of the present application may be embodied as a structure as shown in fig. 5, and the electronic device at least includes a processor 51, a storage medium 52, and at least one external communication interface 53; the processor 51, the storage medium 52 and the external communication interface 53 are all connected by a bus 54. The processor 51 may be a microprocessor, a central processing unit, a digital signal processor, a programmable logic array, or other electronic components with processing functions. The storage medium has stored therein computer executable code capable of performing the method of any of the above embodiments. In practical applications, the receiving unit 41, the depth traversal detecting unit 42, and the image recognition detecting unit 43 may be implemented by the processor 51.
Here, it should be noted that: the description of the embodiment of the electronic device is similar to the description of the method, and has the same beneficial effects as the embodiment of the method, and therefore, the description is omitted. For technical details that are not disclosed in the embodiment of the electronic device of the present invention, those skilled in the art should refer to the description of the embodiment of the method of the present invention to understand that, for the sake of brevity, detailed description is not repeated here.
Embodiments of the present application also provide a computer-readable storage medium, which stores a computer program, and when the program is executed by a processor, the computer program implements the method described above.
A computer-readable storage medium can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable read-only memory (CDROM). Additionally, the computer-readable storage medium may even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
The embodiment of the present application further provides a mobile terminal cluster control system, where the system includes: the mobile terminal cluster comprises a main server, a cluster server and a mobile terminal cluster connected with the main server through the cluster server; wherein the content of the first and second substances,
the main server is used for receiving a control instruction input by a user and forwarding the control instruction to the cluster server;
the cluster server is used for receiving the control instruction forwarded by the main server and sending the control instruction to the corresponding mobile terminal cluster;
the mobile terminal cluster comprises at least one mobile terminal and is used for receiving a control instruction which is transmitted by the main server and forwarded by the cluster server; when the control instruction is a depth traversal test instruction, traversing the current application program interface of the mobile terminal to obtain a locatable element for testing; and when the current application program interface also comprises untested elements, carrying out element positioning on the current application program interface based on a preset image, and testing the positioned elements.
Here, it should be noted that: the above description of the embodiments of the mobile terminals in the cluster control system of mobile terminals is similar to the above description of the method, and has the same beneficial effects as the embodiments of the method, and therefore, the detailed description thereof is omitted. For technical details not disclosed in the embodiment of the mobile terminal trunking control system of the present invention, those skilled in the art should refer to the description of the embodiment of the method of the present invention for understanding, and for brevity, will not be described herein again.
The method, the device, the equipment and the storage medium are applied to the mobile terminal in the mobile terminal cluster which is connected with the main server through the cluster server, and the control instruction which is transmitted by the main server and is forwarded by the cluster server is received; when the control instruction is a depth traversal test instruction, traversing the current application program interface of the mobile terminal to obtain a locatable element for testing; and when the current application program interface also comprises untested elements, carrying out element positioning on the current application program interface based on a preset image, and testing the positioned elements. In the embodiment of the invention, the mobile terminal is connected with the main server through the cluster server to realize remote control, the remote control of large-scale mobile terminal clusters can be realized, when the control instruction received by the mobile terminal is a depth traversal test instruction, the depth traversal test of the current application program interface of the mobile terminal can be automatically realized, and if the current application program interface has elements which cannot be tested by depth traversal, the element positioning can be further carried out on the current application program interface based on the preset image, so that the complete test of the application program interface is realized, the test automation degree is improved, the test coverage rate and the test efficiency are improved, and the test cost is reduced.
It should be understood that, as one of ordinary skill in the art would understand, all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, and the program may be stored in a computer readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may also be stored in a computer readable storage medium. The storage medium may be a read-only memory, a magnetic or optical disk, or the like.
The embodiments described above are only a part of the embodiments of the present invention, and not all of them. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

Claims (11)

1. A test method based on a mobile terminal cluster is characterized in that the method is applied to mobile terminals in the mobile terminal cluster which is connected with a main server through a cluster server, and comprises the following steps:
the mobile terminal receives a control instruction transmitted by the main server and forwarded by the cluster server;
when the control instruction is a depth traversal test instruction, traversing the current application program interface of the mobile terminal to obtain a locatable element for testing;
when the current application program interface also comprises untested elements, the mobile terminal carries out element positioning on the current application program interface based on a preset image and tests the positioned elements; the preset image is an interface image corresponding to a prestored element which cannot be subjected to depth traversal test.
2. The method of claim 1, further comprising:
and when the control instruction is a preset user-defined test instruction, executing the preset user-defined test instruction on the mobile terminal.
3. The method of claim 1, further comprising:
and when the control instruction is a picture synchronization instruction, starting screen recording operation, and transmitting the obtained video stream after being coded and compressed to the main server through socket communication.
4. The method according to any one of claims 1 to 3, wherein traversing the current application program interface of the mobile terminal to obtain the locatable element for testing comprises:
traversing the current application program interface of the mobile terminal according to a preset element determination rule, acquiring a locatable element and storing the locatable element according to a tree structure;
and executing corresponding operation on the elements stored in the tree structure according to a preset element operation corresponding relation, wherein the operation comprises one or more of clicking, sliding or long pressing.
5. The method of any one of claims 1 to 3, wherein said element-locating the current application program interface based on the preset image comprises
Sequentially comparing a preset image with the current application program interface to determine the similarity;
determining a preset image with the maximum similarity as an image to be positioned of the current application program interface;
and determining the elements in the image to be positioned as the elements obtained by positioning the current application program interface.
6. The method of claim 5, wherein the testing the located elements comprises:
and executing corresponding operation on the positioned elements according to a preset element operation corresponding relation, wherein the operation comprises one or more of clicking, sliding, inputting or long pressing.
7. The method of any one of claims 1 to 3, further comprising:
and after the test is finished, reporting the test result to the main server.
8. A testing device based on a mobile terminal cluster is characterized in that the device is applied to mobile terminals in the mobile terminal cluster which is connected with a main server through a cluster server, and comprises: the device comprises a receiving unit, a depth traversal testing unit and an image identification testing unit; wherein the content of the first and second substances,
the receiving unit is configured to receive a control instruction sent by the master server and forwarded by the cluster server;
the depth traversal testing unit is used for traversing the current application program interface of the mobile terminal to acquire a locatable element for testing when the control instruction is a depth traversal testing instruction;
the image identification testing unit is used for positioning elements of the current application program interface based on a preset image and testing the positioned elements when the current application program interface also comprises untested elements; the preset image is an interface image corresponding to a prestored element which cannot be subjected to depth traversal test.
9. An electronic device, comprising:
one or more processors;
a memory communicatively coupled to the one or more processors;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of any of claims 1-7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
11. A mobile terminal cluster control system, the system comprising: the mobile terminal cluster comprises a main server, a cluster server and a mobile terminal cluster connected with the main server through the cluster server; wherein the content of the first and second substances,
the main server is used for receiving a control instruction input by a user and forwarding the control instruction to the cluster server;
the cluster server is used for receiving the control instruction forwarded by the main server and sending the control instruction to the corresponding mobile terminal cluster;
the mobile terminal cluster comprises at least one mobile terminal and is used for receiving a control instruction which is transmitted by the main server and forwarded by the cluster server; when the control instruction is a depth traversal test instruction, traversing the current application program interface of the mobile terminal to obtain a locatable element for testing; when the current application program interface also comprises untested elements, carrying out element positioning on the current application program interface based on a preset image, and testing the positioned elements; the preset image is an interface image corresponding to a prestored element which cannot be subjected to depth traversal test.
CN202010634578.8A 2020-07-02 2020-07-02 Test method, device, equipment and storage medium based on mobile terminal cluster Active CN111817916B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010634578.8A CN111817916B (en) 2020-07-02 2020-07-02 Test method, device, equipment and storage medium based on mobile terminal cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010634578.8A CN111817916B (en) 2020-07-02 2020-07-02 Test method, device, equipment and storage medium based on mobile terminal cluster

Publications (2)

Publication Number Publication Date
CN111817916A CN111817916A (en) 2020-10-23
CN111817916B true CN111817916B (en) 2022-06-03

Family

ID=72856789

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010634578.8A Active CN111817916B (en) 2020-07-02 2020-07-02 Test method, device, equipment and storage medium based on mobile terminal cluster

Country Status (1)

Country Link
CN (1) CN111817916B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112612690B (en) * 2020-11-30 2024-05-14 北京达佳互联信息技术有限公司 User interface information processing method and device, electronic equipment and storage medium
CN114116441A (en) * 2020-12-30 2022-03-01 京东数科海益信息科技有限公司 UI (user interface) testing method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461900A (en) * 2014-12-19 2015-03-25 北京奇虎科技有限公司 User interface testing method, center control server, test terminal and system
CN106528179A (en) * 2016-12-08 2017-03-22 中国科学院软件研究所 Static recognition method for Java class dependence relations
CN109491890A (en) * 2018-10-16 2019-03-19 深圳壹账通智能科技有限公司 The interface scans method and terminal device of application program
CN109840205A (en) * 2018-12-20 2019-06-04 平安科技(深圳)有限公司 Applied program testing method, device, readable storage medium storing program for executing and terminal device
CN110389900A (en) * 2019-07-10 2019-10-29 深圳市腾讯计算机系统有限公司 A kind of distributed experiment & measurement system test method, device and storage medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104252410B (en) * 2013-06-27 2017-12-22 阿里巴巴集团控股有限公司 The method and apparatus that a kind of control in the page is tested
CN104035867B (en) * 2014-06-04 2017-06-09 重庆泰凯科技有限公司 Application function traversal method of testing based on Android
US9760475B2 (en) * 2014-06-20 2017-09-12 Vmware, Inc. Automatic updating of graphical user interface element locators based on image comparison
CN106250307B (en) * 2016-07-20 2019-01-22 福建省农村信用社联合社 A kind of bank's mobile phone application automated testing method and system
US10169853B2 (en) * 2016-12-20 2019-01-01 Entit Software Llc Score weights for user interface (UI) elements
CN107357725B (en) * 2017-06-29 2018-09-04 腾讯科技(深圳)有限公司 Application testing method and device
CN109710506A (en) * 2017-10-25 2019-05-03 卓望数码技术(深圳)有限公司 A kind of terminal APP spreadability test method and device based on tree traversal
CN108399124B (en) * 2018-02-07 2021-04-13 深圳壹账通智能科技有限公司 Application testing method and device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461900A (en) * 2014-12-19 2015-03-25 北京奇虎科技有限公司 User interface testing method, center control server, test terminal and system
CN106528179A (en) * 2016-12-08 2017-03-22 中国科学院软件研究所 Static recognition method for Java class dependence relations
CN109491890A (en) * 2018-10-16 2019-03-19 深圳壹账通智能科技有限公司 The interface scans method and terminal device of application program
CN109840205A (en) * 2018-12-20 2019-06-04 平安科技(深圳)有限公司 Applied program testing method, device, readable storage medium storing program for executing and terminal device
CN110389900A (en) * 2019-07-10 2019-10-29 深圳市腾讯计算机系统有限公司 A kind of distributed experiment & measurement system test method, device and storage medium

Also Published As

Publication number Publication date
CN111817916A (en) 2020-10-23

Similar Documents

Publication Publication Date Title
CN108900776B (en) Method and apparatus for determining response time
CN110347587B (en) APP compatibility testing method and device, computer equipment and storage medium
US9161238B2 (en) Mobile device monitoring and testing
CN111817916B (en) Test method, device, equipment and storage medium based on mobile terminal cluster
CN110716853A (en) Test script recording method, application program testing method and related device
CN111949509B (en) Response time testing method, device and equipment of application software and storage medium
CN104539682A (en) Debug method, device, mobile terminal, server and system for mobile webpage
CN110837474A (en) Script recording method, device, terminal and storage medium
CN112416775B (en) Software automatic test method and device based on artificial intelligence and electronic equipment
CN109542754B (en) Access method of mobile equipment, debugging method, device and system of application program
CN104539478A (en) Pressure test device and method for instant communication system
CN111901589B (en) Automatic test system for television mainboard
CN111078533A (en) Automatic testing method and device, computer equipment and storage medium
CN115269375A (en) Multi-terminal interactive automatic testing method and device and electronic equipment
CN110347597B (en) Interface testing method and device of picture server, storage medium and mobile terminal
CN113923443A (en) Network video recorder testing method and device and computer readable storage medium
CN114756448A (en) Automatic testing system and method for reduction degree of user interface
CN110460841B (en) Television detection method and device, electronic equipment and storage medium
CN113641575A (en) Test method, device, equipment and storage medium
CN112948195A (en) Interface testing method and device, electronic equipment and storage medium
CN113568840B (en) Method and system for identifying transition drawing
CN109743436B (en) Communication compensation method, device, equipment and storage medium for voice conversation
CN114401393A (en) Lens resolution testing method and testing device
CN117938724A (en) Router testing method, device and testing equipment
CN117170727A (en) Inspection method and device

Legal Events

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