CN103744787A - Cellphone automated testing method - Google Patents

Cellphone automated testing method Download PDF

Info

Publication number
CN103744787A
CN103744787A CN201410028620.6A CN201410028620A CN103744787A CN 103744787 A CN103744787 A CN 103744787A CN 201410028620 A CN201410028620 A CN 201410028620A CN 103744787 A CN103744787 A CN 103744787A
Authority
CN
China
Prior art keywords
mobile phone
test
script
linux
computing machine
Prior art date
Application number
CN201410028620.6A
Other languages
Chinese (zh)
Inventor
韩继梁
Original Assignee
上海斐讯数据通信技术有限公司
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 上海斐讯数据通信技术有限公司 filed Critical 上海斐讯数据通信技术有限公司
Priority to CN201410028620.6A priority Critical patent/CN103744787A/en
Publication of CN103744787A publication Critical patent/CN103744787A/en

Links

Abstract

The invention discloses a cellphone automated testing method. The cellphone automated testing method is characterized by including: compiling cellphone testing scripts in a Linux system computer according to cases to be tested; transmitting the testing scripts to a cellphone for storage; allowing the computer to send out a command and the cellphone to execute the testing scripts for testing. The Linux system controls the cellphone to perform automated testing instead of manual testing, operation is facilitated, maintenance is fast, the problem of input in manual execution of the test cases is solved, more reliable results are output, the method is high self-applicable and controllable, and the needs of various test cases can be met.

Description

A kind of mobile phone automatized test method

Technical field

The present invention relates to mobile phone test field, be specifically related to a kind of automated testing method that is applicable to Android mobile phone.

Background technology

About the method for Android (android) automatic test, there is the automatic test that adopts Monkey testing tool at present, and Monkey automatic test is a kind of method that android carries, it is a kind of random testing method, cannot meet the performed test of various use-cases in mobile phone production run, and implementation of test cases need to drop into a large amount of manpowers and time, and test result directly depends on tester's level height.

Its shortcoming is, the shortcoming of the mobile phone automatized Monkey of existing android is to produce random test use-case, cannot meet use-case testing requirement targetedly, the situation of uncontrollable test result and the actual android mobile phone of assessment.

Summary of the invention

The invention provides a kind of mobile phone automatized test method, control mobile phone and carry out automatic test, substitute manual test, easy and simple to handle, safeguard fast, the input that solves manpower implementation of test cases also has more reliable result output.

For achieving the above object, the invention provides a kind of mobile phone automatized test method, be characterized in, the method comprises:

The use-case of testing is as required write mobile phone test script in the computing machine of linux system;

Test script imports in mobile phone to be preserved, and computing machine sends instruction and carries out test script to test by mobile phone.

Writing before test script, filter out the Android mobile phone test use-case that is applicable to linux system compile script.

The Android mobile phone test use-case of above-mentioned applicable linux system compile script comprises pressure class testing-case.

Before mobile phone is tested, be connected with the linux system computing machine that obtains this mobile phone root authority.

Mobile phone comprises with the linux system computing machine method of attachment that obtains this mobile phone root authority:

Mobile phone is opened root authority, is selected USB debugging and choose pointer mode;

Mobile phone connects the computing machine of linux system by data line, mobile phone driver is installed on computing machine, obtains the root authority of mobile phone.

After completing test script and writing, test script is debugged, and in test script, added sectional drawing and daily record crawl step;

Complete mobile phone test, after test script is finished, by sectional drawing and daily record output test case.

In operation automatic test course, time point and the daily record of cooperation sectional drawing time of control point, sectional drawing are set.

In operation automatic test course, timing sectional drawing, and while exporting sectional drawing simultaneously the daily record of corresponding executable operations, be stored in mobile phone.

Complete after test, empty the daily record of preserving in mobile phone, and re-establish new daily record.

Above-mentioned test script can be modified and move in the computing machine of linux system or Windows system.

The handset testing method of a kind of Android mobile phone automatized test method of the present invention and prior art is compared, its advantage is, the present invention is write and is moved the test script of Android mobile phone by linux system, by computer control mobile phone, carry out automatic test, the sectional drawing that tester only need browse in test process can be understood test result, use simply, script function is powerful, is substantially applicable to any type of android mobile phone or equipment; Writing and revise agility, can carry out a series of various operations, is a kind of efficient simple script method of testing; Compare with current Monkey test, there is very strong personal property and controlled, can meet the demand of each class testing-case.

Accompanying drawing explanation

Fig. 1 is the method flow diagram of a kind of mobile phone automatized test method of the present invention.

Embodiment

Below in conjunction with accompanying drawing, further illustrate specific embodiments of the invention.

As shown in Figure 1, the present invention discloses a kind of Android system mobile phone automatized test method based on linux system shell user interface, and the method includes the steps of:

Step 1, filter out and be applicable to linux system and write the Android mobile phone test use-case of mobile phone test script.

For the screening of test case, there is following principle, some relate to hardware classes use-case, as bluetooth, T card, the vehicle-mounted equipment that waits cannot change into use-case, and what also have that some relate to the interactive classes such as speech quality is also not suitable for changing into script use-case.And pressure class testing-case is applicable to linux system and changes into this type of test script and operate.

Step 2, arrange mobile phone option enter exploitation penetrate selection, choose pointer position and start USB debugging mode.Open the root authority of Android mobile phone.

Step 3, mobile phone connect the computing machine of linux system by data line, mobile phone driver is installed on computing machine, obtain the root authority of mobile phone, are specifically implemented as follows:

The Android mobile phone with root authority is connected to the computing machine of linux system by USB normal data line, a newly-built some sh(" ~ .sh ") text of suffix.

Mobile phone is installed in linux system and is driven, open Linux terminal, input su and password, obtain after the root authority of linux system, after shell interface input adb shell, if return to No. #, illustrates that the root authority that starts mobile phone obtains.

Step 4, the use-case tested is write mobile phone test script in the computing machine of linux system as required.

In linux system, writing the concrete enforcement of test script can be as follows:

A newly-built text, the ending of sh suffix, file can be named according to the content of test case.

Further start compile script, first new document, can double-click the document of opening newly-built suffix sh, also can be by terminal, and the document of the newly-built sh suffix of shell interface input touch, opens sh suffix document with vi.

Newly-built document stem input #! The interpreter of/bin/bash definition script.

Can, with reference to test case, start compile script, first input symbol No. #, the general idea of this use-case is write out, facilitate subsequent modification reference.

Input command echo " starts to test XXX ", points out user test to start in interface.

Can write concrete execution use-case, in test during certain module, know this control module title, such as needs are tested browser module, " com.android.browser/.BrowserActivity ".Then in script, write " am start-n com.android.browser/.BrowserActivity ", just can carry out the order of calling browser.

In test case, need to use the operation " input tap x y " by point, x, y are respectively by the horizontal and vertical coordinate of point.

The operation " input swipe x y x y " that needs to use slip in test case, Section 1 x, y and Section 2 x, y represent respectively first horizontal and vertical coordinate that slides into second point.

In script input process, also need calling of some fixing controls, such as back, home, and menu, key up and down, respectively: input keyevent 3; Input keyevent 4; Input keyevent 82; Input keyevent 19; Input keyevent 20; Input keyevent 21; Input keyevent 22.

In script input process, in each program process, need to add and postpone operation " sleep A ", the time that A representative postpones, unit is second, for example sleep 2, postpones 2 seconds.

When writing pressure script, certain test case need to be carried out 100 times, or 200 times, can add loop statement:

for?i?in?$(?busybox?seq?1?100?);

do

done

Wherein i represents preliminary examination value, and " busybox seq " represents span, and 1 100 representatives add 1 until 100 at every turn.Specifically need the order of carrying out to be added in the middle of do and done.

Basic script edit step is described above, can after every order, add remarks, with # beginning, plays annotation effect.

In shirtsleeve operation process, need to use flexibly combination and the collocation of these orders, substantially can meet execution and the covering of use-case.Wherein click, can click the arbitrfary point on mobile phone screen, slip can slide into any terminal from any starting point.

The embodiment that a test case is changed into script is below described.

The test case that this script transforms is:

" enter browser

Click input frame, input network address

Then screen laterally slides

Then exit browser

Repeat above operation 100 times.”

Above-mentioned is a complete android automatized script, has used click coordinate, slip coordinate, control operation, cycling.This series of orders is altered and linked up, a series of use-case steps of one-tenth capable of being combined.

It is characterized in that using shell language in conjunction with android test command, to build the method for script, and after every order, add No. # symbol and annotate.

In above-mentioned script, x, y are respectively the transverse and longitudinal coordinates of mobile phone screen point, according to the physical size of android mobile phone, determine, determine that mobile phone transverse and longitudinal coordinate is according to the result of choosing pointer position.

In above-mentioned script, also comprise the control that enters of operation android mobile phone, click coordinate, slip screen, the operation of special key, and prompting user statement, the use of loop statement.

In above-mentioned script, after echo, in quotation marks, be the prompting to tester.Wherein $ i can point out to tester, and testing time at present, so that grasp progress.

Step 5, debugging test script, and add sectional drawing and daily record crawl step, realize in operation automatic test course, time point and the daily record of cooperation sectional drawing time of control point, sectional drawing are set, so that tester understands test status in time.The preservation address of the sectional drawing capturing and daily record can adopt mobile phone or storage card.

The script of sectional drawing and daily record crawl step is as follows:

As shown in above formula, in android mobile phone ,/system/bin/screencap-p is the operation of a crawl figure sectional drawing, and then output redirection is saved in mobile phone EMS memory in log catalogue, and called after screenhot01.png.Export the daily record of executable operations just now simultaneously, be also kept in mobile phone EMS memory in log catalogue called after log01.The corresponding log01 of png picture format 01 like this, can, according to png picture, find corresponding log, mutually corresponding.After end operation, logcat-c empties mobile phone journalizing, and overline is set up new daily record.

The number of capturing pictures and daily record depends on the size of mobile phone EMS memory or mobile phone T card internal memory, and catalogue can be set up or be selected by user.

Step 6, test script is imported in the data/ catalogue of Android mobile phone and preserve, computing machine sends instruction by shell to mobile phone, by mobile phone, automatically performs test script, to move mobile phone test.

Test script need be write in linux system, but can in the computing machine of linux system or Windows system, modify and move.

After step 7, test script are finished, by sectional drawing and daily record, outputed test result; For example, tester only need to finally browse sectional drawing can complete testing procedure, as pinpointed the problems in sectional drawing, can check the daily record that sectional drawing is corresponding, and the reason of particular exam generation problem.

Automatic test script disclosed by the invention is not only applicable to android mobile phone, and is applicable to the equipment of android panel computer and similar Android system, has larger extendability and applicability.

Although content of the present invention has been done detailed introduction by above preferred embodiment, will be appreciated that above-mentioned description should not be considered to limitation of the present invention.Those skilled in the art, read after foregoing, for multiple modification of the present invention and substitute will be all apparent.Therefore, protection scope of the present invention should be limited to the appended claims.

Claims (10)

1. a mobile phone automatized test method, is characterized in that, the method comprises:
The use-case of testing is as required write mobile phone test script in the computing machine of linux system;
Test script imports in mobile phone to be preserved, and computing machine sends instruction and carries out test script to test by mobile phone.
2. mobile phone automatized test method as claimed in claim 1, is characterized in that, writing before test script, filters out the Android mobile phone test use-case that is applicable to linux system compile script.
3. mobile phone automatized test method as claimed in claim 2, is characterized in that, the Android mobile phone test use-case of described applicable linux system compile script comprises pressure class testing-case.
4. mobile phone automatized test method as claimed in claim 1, is characterized in that, before mobile phone is tested, is connected with the linux system computing machine that obtains this mobile phone root authority.
5. mobile phone automatized test method as claimed in claim 4, is characterized in that, mobile phone comprises with the linux system computing machine method of attachment that obtains this mobile phone root authority:
Mobile phone is opened root authority, is selected USB debugging and choose pointer mode;
Mobile phone connects the computing machine of linux system by data line, mobile phone driver is installed on computing machine, obtains the root authority of mobile phone.
6. mobile phone automatized test method as claimed in claim 1, is characterized in that, after completing test script and writing, test script is debugged, and in test script, added sectional drawing and daily record crawl step;
Complete mobile phone test, after test script is finished, by sectional drawing and daily record output test case.
7. mobile phone automatized test method as claimed in claim 6, is characterized in that, in operation automatic test course, time point and the daily record of cooperation sectional drawing time of control point, sectional drawing is set.
8. mobile phone automatized test method as claimed in claim 7, is characterized in that, in operation automatic test course, timing sectional drawing, and while exporting sectional drawing simultaneously the daily record of corresponding executable operations, be stored in mobile phone.
9. the mobile phone automatized test method as described in claim 1 or 7 or 8, is characterized in that, completes after test, empties the daily record of preserving in mobile phone, and re-establishes new daily record.
10. mobile phone automatized test method as claimed in claim 1, is characterized in that, described test script can be modified and move in the computing machine of linux system or Windows system.
CN201410028620.6A 2014-01-21 2014-01-21 Cellphone automated testing method CN103744787A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410028620.6A CN103744787A (en) 2014-01-21 2014-01-21 Cellphone automated testing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410028620.6A CN103744787A (en) 2014-01-21 2014-01-21 Cellphone automated testing method

Publications (1)

Publication Number Publication Date
CN103744787A true CN103744787A (en) 2014-04-23

Family

ID=50501806

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410028620.6A CN103744787A (en) 2014-01-21 2014-01-21 Cellphone automated testing method

Country Status (1)

Country Link
CN (1) CN103744787A (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104331363A (en) * 2014-10-17 2015-02-04 上海斐讯数据通信技术有限公司 Automatic testing method for Android device
CN104866420A (en) * 2015-04-27 2015-08-26 深圳市祈锦通信技术有限公司 Precisely recorded mobile phone software testing method
CN104899122A (en) * 2015-06-12 2015-09-09 上海斐讯数据通信技术有限公司 Mobile terminal testing system and method
CN104915297A (en) * 2015-07-08 2015-09-16 上海斐讯数据通信技术有限公司 APP electricity consumption automatic test method for android device
CN104980552A (en) * 2015-06-18 2015-10-14 惠州Tcl移动通信有限公司 Method and system for realizing automatic test of Android mobile terminal
CN105204849A (en) * 2015-08-27 2015-12-30 努比亚技术有限公司 Pressure test system and implementation method thereof
CN105589808A (en) * 2016-02-23 2016-05-18 惠州Tcl移动通信有限公司 Test method and test system for mobile phone and vehicle-mounted Bluetooth
CN105718363A (en) * 2016-01-15 2016-06-29 青岛海信移动通信技术股份有限公司 Acquisition method and device of mobile phone response startup time point
CN106161134A (en) * 2015-04-21 2016-11-23 腾讯科技(深圳)有限公司 Mobile terminal automation testing method, device and mobile terminal
CN106776320A (en) * 2016-12-16 2017-05-31 四川长虹电器股份有限公司 Android intelligent terminal automatization test system and method
CN107179992A (en) * 2017-05-18 2017-09-19 王东红 A kind of mobile terminal unused time length detecting method
CN107343082A (en) * 2017-05-24 2017-11-10 上海与德科技有限公司 The method and device of location code leak
CN108170607A (en) * 2018-01-03 2018-06-15 上海传英信息技术有限公司 The control device and control method of OTP switches
TWI665606B (en) * 2018-01-19 2019-07-11 慧榮科技股份有限公司 A system and a method for testing a data storage device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1719925A (en) * 2004-07-08 2006-01-11 中兴通讯股份有限公司 Method and apparatus for automatically testing CDMA cell phone software
US20070220494A1 (en) * 2003-11-06 2007-09-20 Intuwave Limited A Method of Rapid Software Application Development for a Wireless Mobile Device
CN101137170A (en) * 2007-09-04 2008-03-05 深圳市中兴移动通信有限公司 Software automatic testing instrument and method of embedded equipment
CN102799511A (en) * 2012-06-30 2012-11-28 成都西可科技有限公司 Android-based automatic test method and system
CN102855188A (en) * 2012-08-03 2013-01-02 福州瑞芯微电子有限公司 Android based system pressure testing method
CN103064781A (en) * 2011-10-18 2013-04-24 飞图科技(北京)有限公司 Mobile software automated testing method
CN103309664A (en) * 2013-05-31 2013-09-18 北京小米科技有限责任公司 Screenshot method, device and equipment
CN103336742A (en) * 2013-07-18 2013-10-02 北京航空航天大学 Automation software black box testing system and method based on Android
CN103338290A (en) * 2013-06-04 2013-10-02 宁波大学 A method for automatically testing performance of an Android handset

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070220494A1 (en) * 2003-11-06 2007-09-20 Intuwave Limited A Method of Rapid Software Application Development for a Wireless Mobile Device
CN1719925A (en) * 2004-07-08 2006-01-11 中兴通讯股份有限公司 Method and apparatus for automatically testing CDMA cell phone software
CN101137170A (en) * 2007-09-04 2008-03-05 深圳市中兴移动通信有限公司 Software automatic testing instrument and method of embedded equipment
CN103064781A (en) * 2011-10-18 2013-04-24 飞图科技(北京)有限公司 Mobile software automated testing method
CN102799511A (en) * 2012-06-30 2012-11-28 成都西可科技有限公司 Android-based automatic test method and system
CN102855188A (en) * 2012-08-03 2013-01-02 福州瑞芯微电子有限公司 Android based system pressure testing method
CN103309664A (en) * 2013-05-31 2013-09-18 北京小米科技有限责任公司 Screenshot method, device and equipment
CN103338290A (en) * 2013-06-04 2013-10-02 宁波大学 A method for automatically testing performance of an Android handset
CN103336742A (en) * 2013-07-18 2013-10-02 北京航空航天大学 Automation software black box testing system and method based on Android

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104331363A (en) * 2014-10-17 2015-02-04 上海斐讯数据通信技术有限公司 Automatic testing method for Android device
CN106161134A (en) * 2015-04-21 2016-11-23 腾讯科技(深圳)有限公司 Mobile terminal automation testing method, device and mobile terminal
CN104866420A (en) * 2015-04-27 2015-08-26 深圳市祈锦通信技术有限公司 Precisely recorded mobile phone software testing method
CN104866420B (en) * 2015-04-27 2018-11-02 深圳市祈锦通信技术有限公司 A kind of cell phone software test method accurately recorded
CN104899122A (en) * 2015-06-12 2015-09-09 上海斐讯数据通信技术有限公司 Mobile terminal testing system and method
CN104980552A (en) * 2015-06-18 2015-10-14 惠州Tcl移动通信有限公司 Method and system for realizing automatic test of Android mobile terminal
CN104980552B (en) * 2015-06-18 2019-01-04 惠州Tcl移动通信有限公司 Realize the method and system of Android mobile terminal automatic test
CN104915297A (en) * 2015-07-08 2015-09-16 上海斐讯数据通信技术有限公司 APP electricity consumption automatic test method for android device
CN104915297B (en) * 2015-07-08 2018-01-16 上海斐讯数据通信技术有限公司 A kind of automated testing method of the APP power consumption of android equipment
CN105204849A (en) * 2015-08-27 2015-12-30 努比亚技术有限公司 Pressure test system and implementation method thereof
CN105718363A (en) * 2016-01-15 2016-06-29 青岛海信移动通信技术股份有限公司 Acquisition method and device of mobile phone response startup time point
CN105718363B (en) * 2016-01-15 2019-05-03 青岛海信移动通信技术股份有限公司 Mobile phone response starting time point acquisition methods and device
CN105589808A (en) * 2016-02-23 2016-05-18 惠州Tcl移动通信有限公司 Test method and test system for mobile phone and vehicle-mounted Bluetooth
CN105589808B (en) * 2016-02-23 2018-09-18 惠州Tcl移动通信有限公司 The test method and test system of mobile phone and on-vehicle Bluetooth
CN106776320A (en) * 2016-12-16 2017-05-31 四川长虹电器股份有限公司 Android intelligent terminal automatization test system and method
CN107179992A (en) * 2017-05-18 2017-09-19 王东红 A kind of mobile terminal unused time length detecting method
CN107343082A (en) * 2017-05-24 2017-11-10 上海与德科技有限公司 The method and device of location code leak
CN108170607A (en) * 2018-01-03 2018-06-15 上海传英信息技术有限公司 The control device and control method of OTP switches
TWI665606B (en) * 2018-01-19 2019-07-11 慧榮科技股份有限公司 A system and a method for testing a data storage device
US10691569B2 (en) 2018-01-19 2020-06-23 Silicon Motion, Inc. System and method for testing a data storage device

Similar Documents

Publication Publication Date Title
US9459994B2 (en) Mobile application testing systems and methods
CN106201170B (en) A kind of the footmark processing method and terminal of application icon
CN104679658B (en) The test method and system of WEB page
US9342237B2 (en) Automated testing of gesture-based applications
CN104991763B (en) A kind of general interface Behavior- Based control system
CN104794050B (en) The test method of application program, apparatus and system
US7856619B2 (en) Method and system for automated testing of a graphic-based programming tool
CN104765617B (en) Based on the HTML5 stream application functional interface distribution method realized and system
CN105094783B (en) method and device for testing stability of android application
US20130117855A1 (en) Apparatus for automatically inspecting security of applications and method thereof
CN104834595A (en) Visual automatic test method and system
CN104461894B (en) The operation record device and method of Android software
US20060271322A1 (en) Systems and Methods Providing A Normalized Graphical User Interface For Testing Disparate Devices
CN103544100B (en) Method of testing, system and the client of portable data processing equipment application program
US8015239B2 (en) Method and system to reduce false positives within an automated software-testing environment
US20130263090A1 (en) System and method for automated testing
US20150339175A1 (en) Method and device for starting external application program in browser
CN104407980B (en) Mobile solution automatic test device and method
CN105117233B (en) API Calls method and device
CN103365779A (en) Software test method and system
CN103995715B (en) Restorative procedure, device and the server of application program
US8001468B2 (en) Method and system for accelerating test automation of software applications
CN103365770A (en) Mobile terminal software testing system and software testing method
CN104123219A (en) Method and device for testing software
CN104809056B (en) A kind of generation method and device of interface testing code

Legal Events

Date Code Title Description
PB01 Publication
C06 Publication
SE01 Entry into force of request for substantive examination
C10 Entry into substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20140423

RJ01 Rejection of invention patent application after publication