CN104199770A - Automated mobile phone music APK testing method - Google Patents

Automated mobile phone music APK testing method Download PDF

Info

Publication number
CN104199770A
CN104199770A CN201410441233.5A CN201410441233A CN104199770A CN 104199770 A CN104199770 A CN 104199770A CN 201410441233 A CN201410441233 A CN 201410441233A CN 104199770 A CN104199770 A CN 104199770A
Authority
CN
China
Prior art keywords
test
mobile phone
file
apk
computer
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.)
Granted
Application number
CN201410441233.5A
Other languages
Chinese (zh)
Other versions
CN104199770B (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.)
HUZHOU FENGYUAN AGRICULTURAL EQUIPMENT MANUFACTURE Co.,Ltd.
Original Assignee
Shanghai Feixun Data Communication 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 Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201410441233.5A priority Critical patent/CN104199770B/en
Publication of CN104199770A publication Critical patent/CN104199770A/en
Application granted granted Critical
Publication of CN104199770B publication Critical patent/CN104199770B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides an automated mobile phone music APK testing method. The automated mobile phone music APK testing method comprises the steps of using a robotium script to compile a testing script for mobile phone music APK through a computer; compiling a test execution file through the computer; setting testing content and parameters and compiling the testing content and parameters to form a test file; connecting a mobile phone needing mobile phone music APK testing to the computer; running the test execution file on the computer, using the testing script to test the mobile phone music APK of the mobile phone according to the test file, editing a test result into a test result file and storing the test result file on the computer. The automated mobile phone music APK testing method is developed based on the robotium script, testing can be automatically executed, the result can be automatically fed back, screenshots can be automatically provided, the testing time is saved, the testing efficiency and repeated utilization rate of the script are improved, and the maintenance cost is reduced.

Description

The automated testing method of a kind of mobile phone music APK
Technical field
The present invention relates to mobile phone application testing field, particularly relate to the automatic test of a kind of mobile phone music APK (Android Package).
Background technology
Along with the extensive listing of smart mobile phone, also more prevalent as the android mobile phone of main flow.Method of testing about mobile phone application is many, and the test that is still exclusively used in mobile phone music APK is fewer, and how quick, efficient test automatically has become day by day urgent problem.
At present, the test of mobile phone music APK is had following several:
1. manual testing: complete test job by tester's manual operations;
2. white-box testing: write test case and test by understanding the source code of mobile phone application;
3. Black-box Testing: application monkeyrunner writes test script and tests.
There is following defect in said method:
Manual testing's method of the first need to expend a large amount of manpowers, and efficiency is lower, is not suitable for large-scale test and uses.
The white-box testing of the second needs to understand the source code of concrete mobile phone music module, the mobile phone music module that need are tested is by certain restriction, can only test tester is the mobile phone music module of increasing income, and, the mode of white-box testing is had relatively high expectations to tester, the rudimentary knowledge that need to possess certain android, is not suitable for common test personnel.Meanwhile, due to needs, to understand source code more consuming time, so efficiency is not high yet.
The Black-box Testing that the third adopts monkeyrunner to write test script, although higher than the testing efficiency of first two method, its impact of receiving mobile phone hardware is larger, for example, the resolution of mobile phone, the screen size of mobile phone all have impact to it; And the change of the UI of mobile phone (User Interface, user interface) also can impact it.Therefore, generally all adopt and write some shell scripts more and distinguished.But, distinguished like this and will certainly be limited the scope of application of test script.
Summary of the invention
The shortcoming of prior art in view of the above, the object of the present invention is to provide the automated testing method of a kind of mobile phone music APK, for solve the automatic test efficiency of prior art mobile phone music APK lower, be subject to mobile phone hardware to affect large and the narrower problem of the scope of application.
For achieving the above object and other relevant objects, the invention provides the automated testing method of a kind of mobile phone music APK, comprising: by computer, use robotium script edit to be directed to the test script of described mobile phone music APK; By described computer, write test execution file; Content measurement and parameter are set, and are written as test file by described computer; The mobile phone that need is carried out to described mobile phone music APK test is connected with described computer; Move on computers described test execution file, described mobile phone, according to described test file, uses described test script to test described mobile phone music APK, test result is compiled to test result file, and be saved in described computer.
Alternatively, described content measurement comprises automatic broadcasting, interpolation automatically, deletion automatically, automatic search and automatic pause.
Alternatively, in described mobile phone, prestore a plurality of audio files.
Alternatively, describedly move on computers described test execution file, described mobile phone is according to described test file, use described test script to test described mobile phone music APK, test result is compiled to test result file, and the step being saved in described computer specifically comprises: read described test file, and the content reading is corresponded in test list one by one; According to described test list, use one by one described test script to carry out test to the described audio file prestoring in described mobile phone: step 1, judge whether to carry out test, if do not carry out test, NT information is write in described test result file; If carry out test, jump to step 2; Step 2, carries out the solo operation of described test script, and judges whether to enter required interface: if entered, jump to step 3; If do not entered, fail information is write in described test result file; Step 3, continues described solo operation, until described solo has operated, the interface after intercept operation completes, judges whether to meet expected results: if met, pass information is write in described test result file; If do not meet, fail information write in described test result file; After having tested one by one according to described test list, described test result file is saved in described computer.
Alternatively, JAVA and Android SDK more than V1.6 version is installed on described computer.
Alternatively, described content measurement file and described test result file are XML file.
Alternatively, described computer is used WINDOWS system, and described test execution file is autoexec.
Alternatively, described computer adopts LINUX system, and described test execution file is shell instruction.
Alternatively, described mobile phone is crossed USB mouth with described computer expert and is connected.
As mentioned above, the automated testing method of a kind of mobile phone music APK of the present invention, based on the exploitation of robotium script, has following beneficial effect:
1. than the better transplantability of MonkeyRunner script, the methods that judge that whether Case is correct more;
2. more intelligent than manual test, almost no longer need manual operation: can automatically perform and automatic feedback result;
3. than simple robotium script, can be controlled and be carried out number by test file, the test that obtains being easily understood by test result file be fed back, and test result can be fed back to tester intuitively by sectional drawing; The recycling rate of waterused that has improved test script, has reduced maintenance cost;
4. can directly carry out batch file and start test, no longer need Eclipse program;
5. save the time of test, improved the efficiency of test and the recycling rate of waterused of test script, reduced the cost of safeguarding.
Accompanying drawing explanation
Fig. 1 is shown as the schematic flow sheet of the automated testing method of the disclosed a kind of mobile phone music APK of embodiments of the invention.
Fig. 2 be shown as the disclosed a kind of mobile phone music APK of embodiments of the invention automated testing method pass through the schematic flow sheet that robotium script carries out mobile phone music APK test.
Element numbers explanation
S10~S50 step
S51~S53 step
S521~S523 step
Embodiment
Below, by specific instantiation explanation embodiments of the present invention, those skilled in the art can understand other advantages of the present invention and effect easily by the disclosed content of this instructions.The present invention can also be implemented or be applied by other different embodiment, and the every details in this instructions also can be based on different viewpoints and application, carries out various modifications or change not deviating under spirit of the present invention.It should be noted that, in the situation that not conflicting, the feature in following examples and embodiment can combine mutually.
Refer to Fig. 1 and Fig. 2.It should be noted that, the diagram providing in following examples only illustrates basic conception of the present invention in a schematic way, satisfy and only show with assembly relevant in the present invention in graphic but not component count, shape and size drafting while implementing according to reality, during its actual enforcement, kenel, quantity and the ratio of each assembly can be a kind of random change, and its assembly layout kenel also may be more complicated.
The present embodiment provides the automated testing method of a kind of mobile phone music APK, the primary music APK that is applicable to android4.0, it is based on robotium script, after basic test frame is optimized, when carrying out, only need to the above JAVA of V1.6 version or Android SDK be installed in computer end, the 5-10 song that prestores on mobile phone can complete the automatic test of mobile phone music APK.Concrete automated testing method as shown in Figure 1, comprising:
Step S10, is used the test script of robotium script edit mobile phone music APK: in the present embodiment, the bag of test script is by name: TestPackageName on computers.
Step S20, writes test execution file by computer:
The system of computer is different, and its test execution file is also different.When computer adopts WINDOWS system, test execution file adopts autoexec; When computer adopts LINUX system, test execution file completes by shell instruction.In the present embodiment, computer adopts WINDOWS system, and corresponding test execution file is autoexec, is specially:
@echo?off
The PackageName of set TestPackageName=com.example.ad.test::TestPackageName test script
The Package Name of the tested APK of set TestedPackageName=com.android.music::TestedPackageName
adb?shell?am?instrument–w%TestPackageName%/com.needbedankt.android.test.Instrum?entationTestRunner
Echo completes
adb?pull/data/data/%TestedPackageName%/files/TEST-all.xml?d:/TestResult
adb?pull/mnt/sdcard/CaseRes.xml?d:/TestResult
Echo completes
pause
Wherein, com.example.ad.test is the bag name of test script; Com.android.music is the bag name (mobile phone music APK) of tested script; D:/TestResult represents the outgoing position of test result file.
Step S30, arranges content measurement and parameter, and is written as test file:
Owing to the present invention be directed to the automated testing method of mobile phone music APK, so its content measurement comprises: broadcasting automatically, interpolation automatically, deletion automatically, automatic search and automatic pause etc.Test file is edited content measurement one by one, and mobile phone music APK tests according to the content measurement in test file.And, in test file, also comprising test parameter, test parameter is for a certain concrete content measurement: to a certain content measurement, in test file, by test parameter is set, determine whether this content measurement is carried out.
In the present embodiment, the name of test file is called setting.xml, specifically:
Wherein, in test file setting.xml, content measurement is divided into 4, respectively: U_1, U_2, U_3, U_4 and U_5; And the name of the content measurement of " U_1 " representative is called " playing First song in list of songs "; The name of the content measurement of " U_2 " representative is called " adding the 5th head in list of songs to playlist "; The name of the content measurement of " U_3 " representative is called " deleting specific music "; The name of the content measurement of " U_4 " representative is called " retrieval particular songs "; " U_5 " representative content measurement name be called " Play Control: suspends upper one head next "." Execute " is test parameter, when it is 1, is expressed as and carries out this content measurement; When it is 0, is expressed as and does not carry out this content measurement; If do not write this test parameter exactly, be defaulted as and carry out this content measurement.
Step S40, the mobile phone that need is carried out to mobile phone music APK test is connected with computer:
Mobile phone links together by USB mouth and the computer that test file, test script and test execution file are housed.
Step S50, moves test execution file on computers, and mobile phone is according to test file, and use test script is tested mobile phone music APK, and test result is compiled to test result file, and is saved in computer, specifically as shown in Figure 2:
Step 51, after operation test execution file, read test file, and the content measurement in test file is corresponded to test list one by one.In the present embodiment, the content measurement in test file setting.xml " U_1, U_2, U_3, U_4 and U_5 " is corresponded in test list CaseInfo;
Step 52, according to test list CaseInfo, use test script is tested a plurality of audio files that prestore in mobile phone one by one.Each Case in test list CaseInfo is tested in accordance with the following steps:
Step S521, judges that whether this Case carries out test, judges the test parameter that this Case is corresponding: if do not carry out test, NT information is write in test result file, in the present embodiment, test result file is CaseRes.xml; If carry out test, enter into step S522;
Step S522, carries out the solo operation of the test script of this Case, and judges whether to enter as expected required interface: if entered, jump to step S523; If do not enter required interface, illustrate in test and make mistakes, so fail information is write in test result file CaseRes.xml;
Step S523, continues the solo operation of test script, until solo has operated, intercept last interface, and judge whether to meet expected results: if met, illustrate that test result is correct, pass information is write in test result file CaseRes.xml; If do not met, test has occurred so fail information being write mistake in test result file CaseRes.xml;
Step S53, when executing one by one all case according to test list CaseInfo, is saved to test result file CaseRes.xml in computer.In the present embodiment, according to test execution file, test result file CaseRes.xml is stored in to d:/TestResult.
The test script based on robotium of the present embodiment, its code is specific as follows:
The structure of the test result file CaseRes.xml of the present embodiment is:
According to test file setting.xml, need to carry out U_1, U_2, U_3, U_4 and U_5 to mobile phone music APK, that is: the test of " play First song ", " adding the 5th head in list of songs to playlist ", " deleting specific music ", " retrieval particular songs " and " Play Control: suspend a upper head next " in list of songs.Corresponding, in test result file CaseRes.xml, also comprised the result about above-mentioned five tests.
In sum, the invention provides the automated testing method of a kind of mobile phone music APK, be applicable to the primary music APK of android4.0, and, automated testing method of the present invention is based on robotium script, through basic test frame optimization, when carrying out, in computer end, the above JAVA of V1.6 version or Android SDK are installed, the 5-10 song that prestores on mobile phone can complete the automatic test of mobile phone music APK.The automated testing method of mobile phone music APK of the present invention is developed based on robotium script, can automatically perform test, automatic feedback result and sectional drawing is provided, greatly saved Test Engineer's time, improved the efficiency of test, the recycling rate of waterused that has improved script, has reduced maintenance cost; And there is better transplantability.So the present invention has effectively overcome various shortcoming of the prior art and tool high industrial utilization.
Above-described embodiment is illustrative principle of the present invention and effect thereof only, but not for limiting the present invention.Any person skilled in the art scholar all can, under spirit of the present invention and category, modify or change above-described embodiment.Therefore, such as in affiliated technical field, have and conventionally know that the knowledgeable, not departing from all equivalence modifications that complete under disclosed spirit and technological thought or changing, must be contained by claim of the present invention.

Claims (9)

1. an automated testing method of mobile phone music APK, is characterized in that, comprising:
By computer, use robotium script edit to be directed to the test script of described mobile phone music APK;
By described computer, write test execution file;
Content measurement and parameter are set, and are written as test file by described computer;
The mobile phone that need is carried out to described mobile phone music APK test is connected with described computer;
Move on computers described test execution file, described mobile phone, according to described test file, uses described test script to test described mobile phone music APK, test result is compiled to test result file, and be saved in described computer.
2. the automated testing method of mobile phone music APK according to claim 1, is characterized in that, described content measurement comprises automatic broadcasting, interpolation automatically, deletion automatically, automatic search and automatic pause.
3. the automated testing method of mobile phone music APK according to claim 2, is characterized in that, prestores a plurality of audio files in described mobile phone.
4. the automated testing method of mobile phone music APK according to claim 1, it is characterized in that, describedly move on computers described test execution file, described mobile phone is according to described test file, use described test script to test described mobile phone music APK, test result is compiled to test result file, and the step being saved in described computer specifically comprises:
Read described test file, and the content reading is corresponded in test list one by one;
According to described test list, use one by one described test script to carry out test to the described audio file prestoring in described mobile phone:
Step 1, judges whether to carry out test, if do not carry out test, NT information is write in described test result file; If carry out test, jump to step 2;
Step 2, carries out the solo operation of described test script, and judges whether to enter required interface: if entered, jump to step 3; If do not entered, fail information is write in described test result file;
Step 3, continues described solo operation, until described solo has operated, the interface after intercept operation completes, judges whether to meet expected results: if met, pass information is write in described test result file; If do not meet, fail information write in described test result file;
After having tested one by one according to described test list, described test result file is saved in described computer.
5. the automated testing method of mobile phone music APK according to claim 1, is characterized in that, more than V1.6 version JAVA and Android SDK are installed on described computer.
6. the automated testing method of mobile phone music APK according to claim 1, is characterized in that, described test file and described test result file are XML file.
7. the automated testing method of mobile phone music APK according to claim 1, is characterized in that, described computer is used WINDOWS system, and described test execution file is autoexec.
8. the automated testing method of mobile phone music APK according to claim 1, is characterized in that, described computer adopts LINUX system, and described test execution file is shell instruction.
9. the automated testing method of mobile phone music APK according to claim 1, is characterized in that, described mobile phone is crossed USB mouth with described computer expert and is connected.
CN201410441233.5A 2014-09-01 2014-09-01 A kind of automated testing method of mobile phone music APK Active CN104199770B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410441233.5A CN104199770B (en) 2014-09-01 2014-09-01 A kind of automated testing method of mobile phone music APK

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410441233.5A CN104199770B (en) 2014-09-01 2014-09-01 A kind of automated testing method of mobile phone music APK

Publications (2)

Publication Number Publication Date
CN104199770A true CN104199770A (en) 2014-12-10
CN104199770B CN104199770B (en) 2018-05-01

Family

ID=52085066

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410441233.5A Active CN104199770B (en) 2014-09-01 2014-09-01 A kind of automated testing method of mobile phone music APK

Country Status (1)

Country Link
CN (1) CN104199770B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461898A (en) * 2014-12-19 2015-03-25 北京奇虎科技有限公司 Application testing method, center control server, test terminal and system
CN106161134A (en) * 2015-04-21 2016-11-23 腾讯科技(深圳)有限公司 Mobile terminal automation testing method, device and mobile terminal
CN107341216A (en) * 2017-06-27 2017-11-10 大唐陈村水力发电厂 A kind of method of timed play of music
CN107948640A (en) * 2017-12-19 2018-04-20 百度在线网络技术(北京)有限公司 Video playing test method, device, electronic equipment and storage medium
CN109471798A (en) * 2018-10-25 2019-03-15 杭州任你说智能科技有限公司 A kind of automatization test system and its test method of musical technique module

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060259629A1 (en) * 2005-04-21 2006-11-16 Qualcomm Incorporated Methods and apparatus for determining aspects of multimedia performance of a wireless device
CN101072374A (en) * 2007-06-20 2007-11-14 中兴通讯股份有限公司 Automatic testing method for multimedia system
CN101754246A (en) * 2009-12-11 2010-06-23 中兴通讯股份有限公司 Method and system for testing mobile multimedia broadcasting function of mobile terminal device
CN102156672A (en) * 2011-04-19 2011-08-17 广东欧珀移动通信有限公司 Method for realizing automated test on mobile phone calculator
CN103744784A (en) * 2014-01-06 2014-04-23 中国移动(深圳)有限公司 Method and system for automatically testing mobile phone applications

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060259629A1 (en) * 2005-04-21 2006-11-16 Qualcomm Incorporated Methods and apparatus for determining aspects of multimedia performance of a wireless device
CN101072374A (en) * 2007-06-20 2007-11-14 中兴通讯股份有限公司 Automatic testing method for multimedia system
CN101754246A (en) * 2009-12-11 2010-06-23 中兴通讯股份有限公司 Method and system for testing mobile multimedia broadcasting function of mobile terminal device
CN102156672A (en) * 2011-04-19 2011-08-17 广东欧珀移动通信有限公司 Method for realizing automated test on mobile phone calculator
CN103744784A (en) * 2014-01-06 2014-04-23 中国移动(深圳)有限公司 Method and system for automatically testing mobile phone applications

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
吴辉: "Android应用软件自动化测试工具的研究与设计", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461898A (en) * 2014-12-19 2015-03-25 北京奇虎科技有限公司 Application testing method, center control server, test terminal and system
CN106161134A (en) * 2015-04-21 2016-11-23 腾讯科技(深圳)有限公司 Mobile terminal automation testing method, device and mobile terminal
CN107341216A (en) * 2017-06-27 2017-11-10 大唐陈村水力发电厂 A kind of method of timed play of music
CN107948640A (en) * 2017-12-19 2018-04-20 百度在线网络技术(北京)有限公司 Video playing test method, device, electronic equipment and storage medium
CN107948640B (en) * 2017-12-19 2020-09-25 百度在线网络技术(北京)有限公司 Video playing test method and device, electronic equipment and storage medium
CN109471798A (en) * 2018-10-25 2019-03-15 杭州任你说智能科技有限公司 A kind of automatization test system and its test method of musical technique module

Also Published As

Publication number Publication date
CN104199770B (en) 2018-05-01

Similar Documents

Publication Publication Date Title
CN108351764B (en) Data processing method and system
CN106021103B (en) A kind of mobile application test script automatic maintenance method based on code change
CN104407973A (en) Automatic unit test realizing method and device
CN104199770A (en) Automated mobile phone music APK testing method
CN103164300A (en) Mobile terminal touch screen automatic testing method and device
CN103064781A (en) Mobile software automated testing method
CN104778124A (en) Automatic testing method for software application
CN102819492A (en) Keyword driven automatic testing frame on basis of Android
CN101046767A (en) Method and system for automated testing of a graphic-based programming tool
CN107832059B (en) Code static analysis method and device based on Makefile
CN103970659A (en) Android application software automation testing method based on pile pitching technology
US9117020B2 (en) Determining control flow divergence due to variable value difference
CN101976187A (en) Stack tracing method and device in decompilation process and decompiler
CN106021101B (en) The method and device that mobile terminal is tested
CN102999419B (en) A kind of Android test incident record back method and device
CN101639805A (en) Method and equipment for tracing variable in program debugging
CN103399814A (en) Automated testing method and automated testing device
US10496379B2 (en) Facilitated production of code for software testing
Lelli et al. On model-based testing advanced GUIs
KR101352383B1 (en) Method of program development using Visual Programming Language and computer readable medium thereof
US8683494B1 (en) Constructing event sequences in event-driven programs
CN103744331A (en) Education robot, controller thereof and programming method of controller
KR101368044B1 (en) Plug­in module based on eclipse platform
CN102446134A (en) Automatic positioning method and device of compiler error
CN102081520A (en) Method and system for establishing graphical user interface of embedded digital video recorder

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20201211

Address after: 313028 Industrial Park, balidian Town, Huzhou City, Zhejiang Province

Patentee after: HUZHOU FENGYUAN AGRICULTURAL EQUIPMENT MANUFACTURE Co.,Ltd.

Address before: 201616 No. 3666 Sixian Road, Songjiang District, Shanghai

Patentee before: Phicomm (Shanghai) Co.,Ltd.

PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: An automatic test method of mobile phone music apk

Effective date of registration: 20210630

Granted publication date: 20180501

Pledgee: Zhejiang Tailong Commercial Bank Co.,Ltd. Huzhou Branch

Pledgor: HUZHOU FENGYUAN AGRICULTURAL EQUIPMENT MANUFACTURE Co.,Ltd.

Registration number: Y2021330000755

PC01 Cancellation of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20230811

Granted publication date: 20180501

Pledgee: Zhejiang Tailong Commercial Bank Co.,Ltd. Huzhou Branch

Pledgor: HUZHOU FENGYUAN AGRICULTURAL EQUIPMENT MANUFACTURE Co.,Ltd.

Registration number: Y2021330000755