Movatterモバイル変換


[0]ホーム

URL:


CN110543416A - Method, device, equipment and storage medium for automatically testing terminal program - Google Patents

Method, device, equipment and storage medium for automatically testing terminal program
Download PDF

Info

Publication number
CN110543416A
CN110543416ACN201910712379.1ACN201910712379ACN110543416ACN 110543416 ACN110543416 ACN 110543416ACN 201910712379 ACN201910712379 ACN 201910712379ACN 110543416 ACN110543416 ACN 110543416A
Authority
CN
China
Prior art keywords
terminal
target
information
testing
automatically testing
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.)
Pending
Application number
CN201910712379.1A
Other languages
Chinese (zh)
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.)
Guangzhou Trace Technology Co Ltd
Original Assignee
Guangzhou Trace 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 Guangzhou Trace Technology Co LtdfiledCriticalGuangzhou Trace Technology Co Ltd
Priority to CN201910712379.1ApriorityCriticalpatent/CN110543416A/en
Publication of CN110543416ApublicationCriticalpatent/CN110543416A/en
Pendinglegal-statusCriticalCurrent

Links

Classifications

Landscapes

Abstract

the invention discloses a method for automatically testing terminal programs, which comprises the steps of obtaining equipment information of a terminal, communicating with the terminal according to the equipment information, obtaining parameter information of a target APP of the terminal, extracting a target package name and a target inlet of the target APP from the parameter information, connecting with the terminal, starting the target APP according to the target package name and the target inlet to obtain UI (user interface) level information of the target APP, displaying the UI level information in an XML (extensible markup language) mode, reading node information of element nodes to be tested according to testing requirements, and testing the node information by adapting corresponding testing tools.

Description

Method, device, equipment and storage medium for automatically testing terminal program
Technical Field
The invention relates to the technical field of software testing, in particular to a method and a device for automatically testing a terminal program.
Background
The mode of operating APP at present mostly depends on manual operation, for example test APP, reuse certain APP function etc. all need the APP on the manual operation cell-phone in order to reach the purpose of testing APP, and under the trend based on the high-speed development of present electronic information technique, the version of APP also is the renewal that keeps on the ground, and then is more and more frequent to the test demand of APP, if continue to rely on manual operation, will cause the waste of a large amount of manpower and materials, so at present stage urgent need a can automatic test APP method.
disclosure of Invention
The embodiment of the invention aims to provide a method for automatically testing a terminal program, which can realize unattended automatic operation of a mobile phone APP to meet the testing requirement, is effective for the APP of most mobile phones in the market and reduces the labor cost for enterprises.
in order to achieve the above object, an embodiment of the present invention provides a method for automatically testing a terminal program, including the following steps:
Acquiring equipment information of a terminal, and communicating with the terminal according to the equipment information;
acquiring parameter information of a target APP of the terminal, and extracting a target package name and a target entrance of the target APP from the parameter information;
Connecting with the terminal, starting the target APP according to the target package name and the target entry to acquire UI hierarchical information of the target APP, and displaying the UI hierarchical information in an XML mode;
and reading node information of the element nodes to be tested according to the test requirements, and testing the node information by adapting to a corresponding test tool.
Further, the testing tool comprises XCTest and UI Automator.
Further, the terminal comprises an Android terminal and an iOS terminal.
Further, when the terminal is an Android terminal, the node information is subjected to custom test by adopting an API (application program interface) provided by a UI (user interface) Automator;
and when the terminal is an iOS terminal, performing custom test on the target APP node information by adopting XCtest.
The embodiment of the invention also provides a device for automatically testing the terminal program, which comprises: the system comprises a communication module, a target data acquisition module, a display module and an automatic test module;
The communication module is used for acquiring equipment information of a terminal and communicating with the terminal according to the equipment information;
The target data acquisition module is used for acquiring parameter information of a target APP of the terminal and extracting a target package name and a target entrance of the target APP from the parameter information;
the display module is used for connecting with the terminal, starting the target APP according to the target package name and the target entry to acquire UI hierarchical information of the target APP, and displaying the UI hierarchical information in an XML mode;
The automatic test module is used for reading node information of the element nodes to be tested according to test requirements and testing the node information by adapting to corresponding test tools.
Further, the testing tool comprises XCTest and UI Automator.
Further, the terminal comprises an Android terminal and an iOS terminal.
further, when the terminal is an Android terminal, the node information is subjected to custom test by adopting an API (application program interface) provided by a UI (user interface) Automator;
And when the terminal is an iOS terminal, performing custom test on the target APP node information by adopting XCtest.
The present invention further provides, as a preferred embodiment of the present invention, an apparatus for automatically testing a terminal program, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, where the processor implements the method for automatically testing a terminal program according to the above embodiment of the present invention when executing the computer program.
another embodiment of the present invention provides a storage medium, where the computer-readable storage medium includes a stored computer program, where when the computer program runs, a device in which the computer-readable storage medium is located is controlled to execute the method for automatically testing a terminal program according to the above-described embodiment of the present invention.
compared with the prior art, the method has the following beneficial effects:
According to the method for automatically testing the terminal program, the terminal equipment information is obtained, communication is carried out with the terminal according to the terminal equipment information, the parameter information of the target APP of the terminal is obtained, the target package name and the target inlet of the target APP are extracted from the parameter information, then connection is carried out with the terminal, the target APP is started according to the target package name and the target inlet, the UI level information of the target APP is obtained, meanwhile, XML display is carried out on the UI level information, finally, the node information of the element node to be tested is read according to the testing requirement, and the node information is tested by adapting to the corresponding testing tool.
Drawings
FIG. 1 is a flow diagram illustrating one embodiment of a method for automatically testing a terminal program provided by the present invention;
FIG. 2 is a flow chart illustrating the operation of one embodiment of a method for automatically testing a terminal program provided by the present invention;
Fig. 3 is a schematic structural diagram of an embodiment of an apparatus for automatically testing a terminal program according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. 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.
Referring to fig. 1, fig. 1 is a schematic flow chart of an embodiment of a method for automatically testing a terminal program according to the present invention; the embodiment of the invention provides a method for automatically testing a terminal program, which comprises the steps of S1-S4;
and S1, acquiring the equipment information of the terminal, and communicating with the terminal according to the equipment information.
in this embodiment, the terminal includes an Android terminal and an iOS terminal, and both the Android terminal and the iOS terminal include, but are not limited to, a smart terminal that is a mobile phone, a tablet, or the like and can use an application.
s2, acquiring parameter information of the target APP of the terminal, and extracting the target package name and the target entry of the target APP from the parameter information.
And S3, connecting with the terminal, starting the target APP according to the target package name and the target entry to acquire the UI hierarchical information of the target APP, and displaying the UI hierarchical information in an XML mode.
and S4, reading the node information of the element node to be tested according to the test requirement, and testing the node information by adapting a corresponding test tool.
It should be noted that the test tools include XCTest and uiautomation.
As a preferred embodiment of the present invention, when the terminal is an Android terminal, the node information is subjected to a custom test by using an API provided by the uiautomation;
Specifically, an example of testing the QQ is described, and the exit function of the QQ is tested as follows:
In this embodiment, the API provided by the uiautomation is used for performing the custom test on the QQ, so that the corresponding test process can be automatically completed without manual operation, and a large amount of human resources are saved.
And when the terminal is an iOS terminal, performing custom test on the target APP node information by adopting XCtest.
Specifically, as an example of the network request class, the success or failure of get request of MWURLRequestManager is tested, and the following test procedure is as follows:
referring to fig. 2, in order to better illustrate the principle of the method for automatically testing a terminal program according to the embodiment of the present invention, the following steps are specifically performed to implement the present invention: firstly, target equipment information is obtained, the target equipment information is communicated with host equipment, then target APP information is obtained, package names and entries are recorded, the mobile equipment and the host are connected, the APP is started, target APP UI level information is obtained, XML display is carried out, finally element nodes to be operated are found through XML, node information is read, the actions such as clicking and pull-down are executed by utilizing an API provided by XCtest or UI Automator, and the control over the APP is realized and the test over the target APP is completed.
according to the method for automatically testing the terminal program, the terminal equipment information is obtained, communication is carried out with the terminal according to the terminal equipment information, the parameter information of the target APP of the terminal is obtained, the target package name and the target inlet of the target APP are extracted from the parameter information, then connection is carried out with the terminal, the target APP is started according to the target package name and the target inlet, the UI level information of the target APP is obtained, meanwhile, XML display is carried out on the UI level information, finally, the node information of the element node to be tested is read according to the testing requirement, and the node information is tested by adapting to the corresponding testing tool.
The embodiment provided by the invention has the following beneficial effects:
(1) The unattended operation is realized without manual intervention;
(2) the large-scale operation is realized, the flexibility is strong, and the expansion is easy;
(3) The automatic operation greatly reduces redundant operation and greatly reduces the operation error rate;
(4) Compared with manual single-person single-machine operation, the invention can be operated by multiple virtual machines in one physical machine, thereby greatly reducing the cost of enterprise equipment.
referring to fig. 3 as a preferred embodiment provided by the present invention, fig. 3 is a schematic structural diagram of an embodiment of an apparatus for automatically testing a terminal program provided by the present invention, including: the system comprises a communication module, a target data acquisition module, a display module and an automatic test module;
The communication module is used for acquiring equipment information of a terminal and communicating with the terminal according to the equipment information; the target data acquisition module is used for acquiring parameter information of a target APP of the terminal and extracting a target package name and a target entrance of the target APP from the parameter information; the display module is used for connecting with the terminal, starting the target APP according to the target package name and the target entry to acquire UI hierarchical information of the target APP, and displaying the UI hierarchical information in an XML mode; the automatic test module is used for reading node information of the element nodes to be tested according to test requirements and testing the node information by adapting to corresponding test tools.
In the embodiment of the invention, the test tool comprises XCTest and UI Automator.
preferably, the terminal includes an Android terminal and an iOS terminal.
It should be noted that, when the terminal is an Android terminal, the node information is subjected to a custom test by using an API provided by a UI automation;
And when the terminal is an iOS terminal, performing custom test on the target APP node information by adopting XCtest.
as can be seen from the above, the apparatus for automatically testing a terminal program according to an embodiment of the present invention obtains device information of a terminal through a communication module, communicates with the terminal according to the device information, obtains parameter information of a target APP of the terminal through a target data obtaining module, extracts a target package name and a target entry of the target APP from the parameter information, connects with the terminal through a display module, starts the target APP according to the target package name and the target entry to obtain UI level information of the target APP, displays the UI level information in an XML manner, reads node information of an element node to be tested according to a test requirement through an automatic test module, and tests the node information by adapting to a corresponding test tool, and according to an embodiment provided by the present invention, an unattended automatic operation of a mobile phone APP can be realized to solve the test requirement, and the APP of most mobile phones in the market is effective, and the labor cost is reduced for enterprises.
The embodiment of the invention also provides equipment for automatically testing the terminal program. The apparatus comprises: a processor, a memory, and a computer program stored in the memory and executable on the processor. The processor, when executing the computer program, implements the steps in the above-described method embodiments of the automated test terminal program, such as steps S1-S4 shown in fig. 1.
the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, the processor being the control center of the automated test terminal program device, the various parts of the entire automated test terminal program device being connected by various interfaces and lines.
the memory may be used to store the computer programs and/or modules, and the processor may implement the various functions of the device of the automatic test terminal program by running or executing the computer programs and/or modules stored in the memory and calling the data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
wherein the device-integrated module/unit of the automatic test terminal program may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like.
it should be noted that the above-described device embodiments are merely illustrative, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. In addition, in the drawings of the embodiment of the apparatus provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, and may be specifically implemented as one or more communication buses or signal lines. One of ordinary skill in the art can understand and implement it without inventive effort.
while the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

Claims (10)

CN201910712379.1A2019-08-022019-08-02Method, device, equipment and storage medium for automatically testing terminal programPendingCN110543416A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201910712379.1ACN110543416A (en)2019-08-022019-08-02Method, device, equipment and storage medium for automatically testing terminal program

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201910712379.1ACN110543416A (en)2019-08-022019-08-02Method, device, equipment and storage medium for automatically testing terminal program

Publications (1)

Publication NumberPublication Date
CN110543416Atrue CN110543416A (en)2019-12-06

Family

ID=68710432

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201910712379.1APendingCN110543416A (en)2019-08-022019-08-02Method, device, equipment and storage medium for automatically testing terminal program

Country Status (1)

CountryLink
CN (1)CN110543416A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111949189A (en)*2020-09-022020-11-17平安国际智慧城市科技股份有限公司Automatic test method and device for sliding scene of APP screen and computer equipment
CN112135195A (en)*2020-09-222020-12-25湖南快乐阳光互动娱乐传媒有限公司Multimedia file playing test method, system and equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US8788885B1 (en)*2011-09-232014-07-22Amazon Technologies, Inc.Intermediary for testing content and applications
CN106095666A (en)*2016-06-022016-11-09腾讯科技(深圳)有限公司Game automated testing method and relevant apparatus
CN107168841A (en)*2017-05-252017-09-15北京云测信息技术有限公司The remote test method and device of a kind of mobile device
CN108572913A (en)*2018-02-262018-09-25挖财网络技术有限公司Method, apparatus and the application of App homepages are positioned in Android client UI automation processes

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US8788885B1 (en)*2011-09-232014-07-22Amazon Technologies, Inc.Intermediary for testing content and applications
CN106095666A (en)*2016-06-022016-11-09腾讯科技(深圳)有限公司Game automated testing method and relevant apparatus
CN107168841A (en)*2017-05-252017-09-15北京云测信息技术有限公司The remote test method and device of a kind of mobile device
CN108572913A (en)*2018-02-262018-09-25挖财网络技术有限公司Method, apparatus and the application of App homepages are positioned in Android client UI automation processes

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
TMQ: "手把手教你搭建安卓自动化框架之UIAutomator", 《HTTPS://CLOUD.TENCENT.COM/DEVELOPER/ARTICLE/1036947》*

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111949189A (en)*2020-09-022020-11-17平安国际智慧城市科技股份有限公司Automatic test method and device for sliding scene of APP screen and computer equipment
CN112135195A (en)*2020-09-222020-12-25湖南快乐阳光互动娱乐传媒有限公司Multimedia file playing test method, system and equipment

Similar Documents

PublicationPublication DateTitle
CN112463634B (en)Software testing method and device under micro-service architecture
WO2019218458A1 (en)Application program test method and device, mobile terminal and medium
CN107193733A (en)Simulate the methods, devices and systems of Monkey tests
CN111488088B (en)Equipment state identification method and device and intelligent terminal
CN104063305A (en)Pressure testing method, device and system for intelligent terminal software
CN113127099B (en)Server configuration method, device, equipment and storage medium
CN104317618A (en)Firmware partitioning method and device
CN111324378B (en)Configuration method, device and equipment for video monitoring application software
CN111158987B (en)Health check method and device for micro-service architecture
CN109002282B (en)Method and device for realizing animation effect in web page development
WO2019218464A1 (en)Application program testing method and apparatus, and mobile terminal and medium
CN112996020A (en)Bluetooth-based automatic testing method and device and Bluetooth testing terminal
CN111506579A (en)Method, program and equipment for generating intelligent contract code
CN106569854B (en)Method and system for setting equipment firmware and realizing factory test
CN113051105A (en)Data processing method, device, equipment and storage medium
CN110543416A (en)Method, device, equipment and storage medium for automatically testing terminal program
CN104572443A (en)Mobile terminal testing method and device
WO2016165461A1 (en)Automated testing method and apparatus for network management system software of telecommunications network
CN109840201B (en)UI test method, device, electronic equipment and computer readable storage medium
CN107733866A (en)RPC requests, RPC request processing methods, device and equipment
CN108037914B (en)Method and device for developing android native system by combining js
CN112631920A (en)Test method, test device, electronic equipment and readable storage medium
CN114647548A (en) A log generation method and device
CN112115060A (en)Audio test method and system based on terminal
CN110851313B (en)Sensor debugging method, intelligent terminal, storage medium and electronic equipment

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication

Application publication date:20191206

RJ01Rejection of invention patent application after publication

[8]ページ先頭

©2009-2025 Movatter.jp