CN103713991B - A kind of method and apparatus of the test application program in Android device - Google Patents

A kind of method and apparatus of the test application program in Android device Download PDF

Info

Publication number
CN103713991B
CN103713991B CN201210376104.3A CN201210376104A CN103713991B CN 103713991 B CN103713991 B CN 103713991B CN 201210376104 A CN201210376104 A CN 201210376104A CN 103713991 B CN103713991 B CN 103713991B
Authority
CN
China
Prior art keywords
test
android
android device
server
wireless network
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
CN201210376104.3A
Other languages
Chinese (zh)
Other versions
CN103713991A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201210376104.3A priority Critical patent/CN103713991B/en
Publication of CN103713991A publication Critical patent/CN103713991A/en
Application granted granted Critical
Publication of CN103713991B publication Critical patent/CN103713991B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

This application discloses a kind of method and apparatus of the test application program in Android device.This method includes:The Android device for needing to test is connected on server, server obtains the device identification ID of each Android device of connection, the device id of acquisition is added in executable list, device id in the executable list of server traversal, for each device id traversed, test thread is activated individually, Application testing is carried out to the corresponding Android device of the device id using current test case, and generate test result.Testing efficiency can be improved using the present invention.

Description

A kind of method and apparatus of the test application program in Android device
Technical field
The application is related to technical field of measurement and test, more particularly to a kind of test application program in Android device method and dress Put.
Background technology
At present, Android on the market(android)Device type is various, and the application program run in Android device is just , it is necessary to be tested in various types of Android devices, to cause various types of Android devices simultaneous before formula issue Hold the application program.
At present, Application testing is carried out in Android device often through the mode of Consumer's Experience.
Specifically, when the quantity for experiencing user is more, the Android device compared with polymorphic type can be usually covered, therefore, will Application program and test case to be tested are distributed to substantial amounts of experience user, by experiencing user using the test case to be measured Examination application program is tested, and returns to test result.
It can be seen that, the method for carrying out Application testing in Android device by way of Consumer's Experience, except needing dimension Beyond the huge experience customer group of shield, the behavioral test due to test result dependent on experience user, and numerous experience users It is difficult to all complete behavioral test in a short time, therefore often testing efficiency is relatively low.
The content of the invention
This application provides a kind of method and apparatus of the test application program in Android device, it is possible to increase test effect Rate.
A kind of method of the test application program in Android device, this method includes:
By need test Android device be connected to or server on,
Server obtains the device identification ID of each Android device of connection, and the device id of acquisition is added into executable row In table,
Device id in the executable list of server traversal, for each device id traversed, is activated individually p-wire Journey, carries out Application testing, and generate test result using current test case to the corresponding Android device of the device id.
A kind of device of the test application program in Android device, the device is held including link block, acquisition module, test Row module and result-generation module;
The link block, for connecting the Android device for needing to test;
The acquisition module, the device identification ID of each Android device for obtaining connection, the device id of acquisition is added Enter into executable list;
The testing execution module, for traveling through the device id in executable list, for each device id traversed, Test thread is activated individually, Application testing is carried out to the corresponding Android device of the device id using current test case;
The result-generation module, the test result for generating the testing execution module.
From such scheme, the present invention is by the way that the Android device for needing to test is all connected on server, server The device id of each Android device of connection is obtained, the device id of acquisition is added in executable list, the executable row of traversal Device id in table, for each device id traversed, is activated individually test thread, this is set using current test case Application testing is carried out for the corresponding Android devices of ID, and generates test result, it is possible to achieve the Android device to batch is several Same set of test case is performed simultaneously, so as to complete batch Android device in the almost run time of a test case Test job, greatly increases testing efficiency.
Brief description of the drawings
Fig. 1 is the method flow diagram of test application program in Android device that the present invention is provided.
Fig. 2 is the structure drawing of device of test application program in Android device that the present invention is provided.
Embodiment
Fig. 1 is the method flow diagram of test application program in Android device that the present invention is provided.
As shown in figure 1, this method includes:
Step 101, it would be desirable to which the Android device of test is connected on server.
Wherein, described server, can be PC(PC)Machine or other kinds of server.
In this step, the Android device for needing to test can be connected on server by serial communication USB interface, or Person is connected on server by wireless network, wherein, each Android on same server is connected to by wireless network Be provided with equipment proxy module and by wireless network be connected on same server the IP address of each Android device with The IP address of the server belongs to same LAN.
Step 102, server obtains the device identification ID of each Android device of connection, and the device id of acquisition is added to In executable list.
In this step, the order in SDK SDK of the server by calling Android platform, which is obtained, passes through USB The attribute information of the Android device of interface connection, the attribute information includes the device id of the Android device, can also include peace The information such as manufacturer, model, the system version of tall and erect equipment, for example, the adb devices orders carried by Android SDK Obtain the device id of tested Android device.Mould is acted on behalf of in each Android device that server by utilizing is connected by wireless network Block, obtains the IP address of each Android device connected by wireless network, each Android connected by wireless network is set Standby IP address is used as the corresponding Android device device id of itself.
Proxy module therein, for the order in the reception server, the information of Android device is obtained simultaneously according to the order Server is returned to, or the order is issued to the modules such as test case in Android device, to cause the moulds such as the test case Block can start the work such as test according to the order.
Step 103, the device id in the executable list of server traversal, for each device id traversed, is individually opened Dynamic test thread, carries out Application testing, and generate using current test case to the corresponding Android device of the device id Test result.
Wherein, each test thread carries out applying journey using current test case to the corresponding Android device of the device id The step of sequence is tested can specifically include:
Application program to be tested and test case in step 1, the corresponding Android devices of test thread unloading equipment ID.
In this step, application program to be tested and test case can be unloaded with call instruction adb uninstall.
Current application program to be tested and current test case are installed to the device id pair by step 2, test thread In the Android device answered.
In this step, application program to be tested and test case can be installed with call instruction adb install.
Step 3, test thread dispatching are tested test case current in Android device to current application program to be tested Tested.
In this step, by call instruction adb shell am instrument-w Instrument can be called to survey Try framework and start test, and it is possible to periodically call instruction adb shell dumpsys meminfo and adb shell Monitored results are write survey by dumpsys cpuinfo to realize the monitoring of CPU and/or internal memory to being tested Android device In test result storage file or journal file.Wherein, Instrument test frames are a series of Android system to be controlled The set of the method for system.Each of control android applications independent outside normal life cycle can be applied in android Component.
Wherein, when generating test result, for each test thread, the Android currently tested according to the test thread is set Standby attribute information generation filename, the test result of the test thread is stored in the test result named with file name and deposited Store up in file, so as to realize the classification to test result, and lookup is easy to not according to the filename of test result storage file The test result of same type Android device.
In addition, when generating test result, can also further monitor the Android device that each test thread is currently tested CPU and/or memory source use information, and the corresponding test result of each test thread of monitored results write-in is stored into text In part, consequently facilitating according to the CPU of all kinds Android device and/or memory source use information and application journey to be tested The test result of sequence, treats running situation of the test application program in all kinds Android device and is comprehensively analyzed.
The test result of each test thread generation can be uploaded on the server specified, consequently facilitating to test result Unified management, and conveniently draw and be adapted to effect between Android device type and tested application program.
According to the above method of the present invention, present invention also offers a kind of dress of the test application program in Android device Put, specifically refer to Fig. 2.
Fig. 2 is the structure drawing of device of test application program in Android device that the present invention is provided.
As shown in Fig. 2 the device includes link block 201, acquisition module 202, testing execution module 203 and result generation Module 204.
Link block 201, for connecting the Android device for needing to test.
Acquisition module 202, the device identification ID of each Android device for obtaining connection, the device id of acquisition is added Into executable list.
Testing execution module 203, for traveling through the device id in executable list, for each device id traversed, Test thread is activated individually, Application testing is carried out to the corresponding Android device of the device id using current test case.
Result-generation module 204, the test result for generating the testing execution module 203.
Wherein, link block 201, specifically can be used for connecting Android device by serial communication USB interface, or pass through Wireless network connects Android device, wherein being provided with proxy module in each Android device connected by wireless network and logical The IP address of each Android device for crossing wireless network connection belongs to same LAN with the IP address of the link block.
Acquisition module 202, the order that specifically can be used for calling in the SDK SDK of Android platform obtains logical The attribute information of the Android device of USB interface connection is crossed, the attribute information includes the device id of the Android device, using passing through Proxy module in each Android device of wireless network connection, obtains the IP of each Android device connected by wireless network Address, regard the IP address of each Android device connected by wireless network as the corresponding Android device device id of itself.
Testing execution module 203, is used for unloading the application program to be tested in the corresponding equipment of the device id and test Example, current application program to be tested and current test case are installed in the corresponding equipment of the device id, are called current Test case current application program to be tested is tested.
Result-generation module 204, specifically can be used for, for each test thread, currently being tested according to the test thread The attribute information generation filename of Android device, the test result of the test thread is stored in the test named with file name As a result in storage file.
Result-generation module 204, can be also used for monitoring the Android device that each test thread is currently tested CPU and/ Or the use information of memory source, and by the corresponding test result storage file of each test thread of monitored results write-in.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all essences in the present invention God is with principle, and any modification, equivalent substitution and improvements done etc. should be included within the scope of protection of the invention.

Claims (8)

1. a kind of method of the test application program in Android device, it is characterised in that this method includes:
The Android device for needing to test is connected on server,
Server obtains the device identification ID of each Android device of connection, and the device id of acquisition is added into executable list In,
Device id in the executable list of server traversal, for each device id traversed, is activated individually test thread, profit Application testing is carried out to the corresponding Android device of the device id with current test case, and generates test result;
The Android device for needing to test, which is connected on server, to be included:
The Android device for needing to test is connected on server by serial communication USB interface, or connected by wireless network Be connected on server, wherein, be provided with each Android device being connected to by wireless network on server proxy module and The IP address of each Android device and the IP address of the server on server are connected to by wireless network and belong to same LAN;
The device identification ID that server obtains each Android device of connection includes:
Order in SDK SDK of the server by calling Android platform obtains the peace connected by USB interface The attribute information of tall and erect equipment, the attribute information includes the device id of the Android device, and server by utilizing is connected by wireless network Proxy module in each Android device connect, obtain described in the IP address of each Android device that is connected by wireless network, It regard the IP address of each Android device connected by wireless network as the corresponding Android device device id of itself.
2. according to the method described in claim 1, it is characterised in that described corresponding to the device id using current test case Equipment carry out Application testing include:
Unload the application program to be tested and test case in the corresponding equipment of the device id;
Current application program to be tested and current test case are installed in the corresponding equipment of the device id;
Current test case is called to test current application program to be tested.
3. method according to claim 1 or 2, it is characterised in that the generation test result includes:
For each test thread, the attribute information generation filename for the Android device currently tested according to the test thread will The test result of the test thread is stored in the test result storage file named with file name.
4. method according to claim 3, it is characterised in that the generation test result also includes:
The CPU and/or the use information of memory source for the Android device that each test thread of monitoring is currently tested, and monitoring is tied Fruit is write in the corresponding test result storage file of each test thread.
5. a kind of device of the test application program in Android device, it is characterised in that the device includes link block, obtains mould Block, testing execution module and result-generation module;
The link block, for connecting the Android device for needing to test;
The acquisition module, the device identification ID of each Android device for obtaining connection, the device id of acquisition is added to In executable list;
The testing execution module, for traveling through the device id in executable list, for each device id traversed, individually Start test thread, Application testing is carried out to the corresponding Android device of the device id using current test case;
The result-generation module, the test result for generating the testing execution module;
The link block, for connecting Android device by serial communication USB interface, or connects Android by wireless network Equipment, wherein proxy module is installed in each Android device connected by wireless network and connected by wireless network The IP address of each Android device belongs to same LAN with the IP address of the link block;
Order in the acquisition module, the SDK SDK for calling Android platform is obtained to be connected by USB interface The attribute information of the Android device connect, the attribute information includes the device id of the Android device, connects using by wireless network Proxy module in each Android device connect, obtains the IP address of each Android device connected by wireless network, will be logical The IP address of each Android device of wireless network connection is crossed as the corresponding Android device device id of itself.
6. device according to claim 5, it is characterised in that
The testing execution module, for unloading application program to be tested and test case in the corresponding equipment of the device id, Current application program to be tested and current test case are installed in the corresponding equipment of the device id, current survey is called Example on probation is tested current application program to be tested.
7. the device according to claim 5 or 6, it is characterised in that
The result-generation module, for for each test thread, the Android device currently tested according to the test thread Attribute information generates filename, and the test result of the test thread is stored in the test result named with file name and stores text In part.
8. device according to claim 7, it is characterised in that
The result-generation module, is additionally operable to monitor the CPU and/or internal memory money for the Android device that each test thread is currently tested The use information in source, and by the corresponding test result storage file of each test thread of monitored results write-in.
CN201210376104.3A 2012-10-08 2012-10-08 A kind of method and apparatus of the test application program in Android device Active CN103713991B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210376104.3A CN103713991B (en) 2012-10-08 2012-10-08 A kind of method and apparatus of the test application program in Android device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210376104.3A CN103713991B (en) 2012-10-08 2012-10-08 A kind of method and apparatus of the test application program in Android device

Publications (2)

Publication Number Publication Date
CN103713991A CN103713991A (en) 2014-04-09
CN103713991B true CN103713991B (en) 2017-08-04

Family

ID=50406991

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210376104.3A Active CN103713991B (en) 2012-10-08 2012-10-08 A kind of method and apparatus of the test application program in Android device

Country Status (1)

Country Link
CN (1) CN103713991B (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105426298B (en) * 2014-08-25 2019-05-10 腾讯科技(深圳)有限公司 A kind of method for testing software and system based on ADB
CN105446873B (en) * 2014-09-01 2018-05-22 中国科学院深圳先进技术研究院 APK Software Automatic Testing Methods and system based on Android platform
CN104394131A (en) * 2014-11-12 2015-03-04 国云科技股份有限公司 Method for debugging multiple Android devices via wifi
CN104679654A (en) * 2015-02-26 2015-06-03 百度在线网络技术(北京)有限公司 Method, equipment and system for testing application program
CN106155848B (en) * 2015-03-24 2019-09-03 阿里巴巴集团控股有限公司 A kind of test method and equipment
CN105320598B (en) * 2015-11-24 2018-06-15 广州华多网络科技有限公司 Method for testing software and device
CN105512029B (en) * 2015-11-27 2018-12-25 北京奇虎科技有限公司 A kind of method, server and system for testing intelligent terminal
CN106201798A (en) * 2016-07-14 2016-12-07 努比亚技术有限公司 Product ID processing means and method
CN106649107B (en) * 2016-12-09 2020-06-12 武汉斗鱼网络科技有限公司 Automatic testing method and device for stability of android system
CN109992494A (en) * 2017-12-29 2019-07-09 北京京东尚科信息技术有限公司 A kind of automatic test execution method and apparatus
CN110389891A (en) * 2018-04-23 2019-10-29 北京京东尚科信息技术有限公司 The method and apparatus of test application program
CN110196798A (en) * 2019-06-06 2019-09-03 百度在线网络技术(北京)有限公司 Performance data determines method, apparatus, equipment and readable storage medium storing program for executing
CN110502428A (en) * 2019-07-08 2019-11-26 平安科技(深圳)有限公司 Code test method, device, computer equipment and storage medium
CN111737136A (en) * 2020-06-24 2020-10-02 海尔优家智能科技(北京)有限公司 Object testing method and device based on Internet of things platform
CN112256560A (en) * 2020-09-22 2021-01-22 北京达佳互联信息技术有限公司 Application program testing method and device and electronic equipment
CN112765028B (en) * 2021-01-22 2023-08-04 济南大学 Android application program testing method and system based on group control mechanism
CN112799958A (en) * 2021-02-23 2021-05-14 长鑫存储技术有限公司 Equipment batch test method and device, computer equipment and medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102685323A (en) * 2012-04-21 2012-09-19 北京迈凯互动网络科技有限公司 Mobile device testing method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120102462A1 (en) * 2010-10-26 2012-04-26 Microsoft Corporation Parallel test execution

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102685323A (en) * 2012-04-21 2012-09-19 北京迈凯互动网络科技有限公司 Mobile device testing method and system

Also Published As

Publication number Publication date
CN103713991A (en) 2014-04-09

Similar Documents

Publication Publication Date Title
CN103713991B (en) A kind of method and apparatus of the test application program in Android device
CN103927255B (en) Method for testing software, cloud test macro and its client based on cloud test macro
CN102567203B (en) A kind of method and system of test distributed file system performance
CN103425574B (en) A kind of method and device of test application program
CN107256195A (en) Webpage front-end method of testing and device
CN110532169A (en) Interface testing case generation method, device, computer equipment and storage medium
CN106302008A (en) Data-updating method and device
CN104268079B (en) A kind of method and system of POS Application testings
CN103631705B (en) A kind of regression testing method and device for search engine
CN108920376A (en) Test method, device and the medium of application program
CN110532185A (en) Test method, device, electronic equipment and computer readable storage medium
CN109523752A (en) A kind of equipment fault early-warning method, apparatus, electronic equipment and medium
CN108459850B (en) Method, device and system for generating test script
CN103903312B (en) The execution method and apparatus of automatic detecting
CN108563579A (en) White-box testing method, apparatus, system and storage medium
CN103186463B (en) Determine the method and system of the test specification of software
CN109240865A (en) A kind of AC test method, device, terminal and the storage medium of AEP memory
CN108089566A (en) A kind of BMC stability parallel test method and system
CN106059853A (en) Network connectivity test method and device
CN102375103B (en) Electronic product test device and method
CN103455313A (en) Method and device for associating input information with output information of detected system
CN104021070B (en) A kind of intelligent terminal software bag method of testing, device and system
CN104636250B (en) Cloud automatic test system and method
US9064038B2 (en) Method and system for combining multiple benchmarks
CN107122307B (en) Internet of things execution system

Legal Events

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