CN103164336B - The automated testing method of application program and device on a kind of mobile terminal - Google Patents
The automated testing method of application program and device on a kind of mobile terminal Download PDFInfo
- Publication number
- CN103164336B CN103164336B CN201310057556.XA CN201310057556A CN103164336B CN 103164336 B CN103164336 B CN 103164336B CN 201310057556 A CN201310057556 A CN 201310057556A CN 103164336 B CN103164336 B CN 103164336B
- Authority
- CN
- China
- Prior art keywords
- tested
- list
- automatic test
- objects
- test
- 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.)
- Expired - Fee Related
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 122
- 238000000034 method Methods 0.000 claims abstract description 36
- 230000008569 process Effects 0.000 claims abstract description 23
- 230000000694 effects Effects 0.000 claims description 9
- 238000011990 functional testing Methods 0.000 abstract description 4
- 230000008859 change Effects 0.000 description 6
- 230000006870 function Effects 0.000 description 4
- 239000000203 mixture Substances 0.000 description 3
- 238000004088 simulation Methods 0.000 description 3
- 230000000712 assembly Effects 0.000 description 2
- 238000000429 assembly Methods 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000012141 concentrate Substances 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000004615 ingredient Substances 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000009897 systematic effect Effects 0.000 description 1
- 238000010998 test method Methods 0.000 description 1
Abstract
The invention discloses automated testing method and the device of application program on a kind of mobile terminal.According to the inventive method, first read the configuration file of the title recording all objects to be tested, and the title of all objects to be tested is stored to object chained list;List the list of the title of all objects to be tested, select its test in object to be tested can cause the object that system is closed or test process stops according to the input of user, and from list object, delete selected object;Start automatic test course;Load the object to be tested in list object;Object to be tested in list object is carried out automatic test.Use the inventive method and device, can be prevented effectively from because the system causing the functional test of some moving objects is closed or test process stops, improving the efficiency of automatic test.
Description
Technical field
The present invention relates to mobile terminal test field, particularly relate to the automated testing method of a kind of application program
And device.
Background technology
At present, mobile Internet is flourish.Because the fast development of mobile Internet, on mobile terminal
Application development also has huge market.Only for Android (Android) systematic difference program, its
Day dispensed amount has breached 20,000,000.The user of mobile terminal the most freely can download at mobile interchange,
Installing varied, the application program of Various Functions, this is that the user of mobile terminal brings abundant user
Experience.But, after these application emerged in an endless stream have been developed, must be through surveying before putting on market
Their effectiveness, safety etc. are verified in examination.Only by the one-tenth manually testing these application programs
This is too high, the most just creates the automated test tool of application program.
Movable (Activity) is to liking a highly important class in Android (Android) application development
Object.Moving object is to provide a class application component at the manipulable interface of user.In Android
(Android), in software environment, application program is made up of one group of moving object, and each moving object
The most still ingredient of application, and opening to the outside world, can in same system any one
External application provides service.Because the importance that moving object is in Android application program, much apply
Automatic programming testing tool is using moving object as the object of automatic test.
There are so some moving objects, have invoked during it realizes and can cause mobile terminal shutdown or weight
The function opened.Owing to these call, to the process of the automatic test of these moving objects probably due to its institute
The shutdown that causes or restart and interrupt.As a result of which it is, the test man of application program must manually be restarted automatically
Change test process, and manually skip the automatic test to these moving objects.So, the most very convenient,
Automatic test course becomes cumbersome efficiently.
Summary of the invention
It is an object of the invention to propose automated testing method and the dress of application program on a kind of mobile terminal
Put, to avoid shutdown unnecessary in automatic test course and to restart.
For reaching this purpose, the present invention by the following technical solutions:
The automated testing method of application program on a kind of mobile terminal, described method includes:
Read the configuration file of the title recording all objects to be tested, and by the title of all objects to be tested
Store to object chained list;
List the list of the title of all objects to be tested, input its survey in selection object to be tested according to user
Examination can cause the object that system is closed or test process stops, and delete from list object selected right
As;
Start automatic test course;
Load the object to be tested in list object;
Object to be tested in list object is carried out automatic test.
Further, the operating system of described mobile terminal is Android (Android) operating system.
Further, the configuration file of the described title recording all objects to be tested is Android inventory
(Android Manifest) file.
Further, described to be tested to liking movable (Activity) object.
Corresponding, present invention also offers the automatic test device of application program on a kind of mobile terminal, institute
State device to include:
Configuration file read module, for reading the configuration file of the title recording all objects to be tested, and
The title of all objects to be tested is stored to object chained list;
Test object choice module, for listing the list of the title of all objects to be tested for user, by with
Family rule of thumb select its test in object to be tested can cause system close or test process stop right
As, after user completes to select, from list object, delete selected object;
Test program starts module, is used for starting automatic test course;
Object load-on module to be tested, for loading the object to be tested in list object;
Automatic test module, for carrying out automatic test to the object to be tested in list object.
Further, the operating system of described mobile terminal is Android (Android) operating system.
Further, the configuration file of the described title recording all objects to be tested is Android inventory
(Android Manifest) file.
Further, described to be tested to liking movable (Activity) object.
Having the beneficial effects that of the inventive method and device, uses the method and device of the present invention effectively to keep away
What the system closedown of generation when exempting from that some moving objects are carried out automatic test or test process stopped asking
Topic, improves testing efficiency;Test program operates in PC, and by the data with mobile terminal even
Connect the test controlled mobile terminal, beneficially user and be test for object by testing requirement change.
Accompanying drawing explanation
Fig. 1 is the automated testing method of application program on the mobile terminal that the first embodiment of the present invention provides
Flow chart.
Fig. 2 is the automatic test device of application program on the mobile terminal that the second embodiment of the present invention provides
Structural representation.
Detailed description of the invention
Further illustrate technical scheme below in conjunction with the accompanying drawings and by detailed description of the invention.
Fig. 1 shows the first embodiment of the present invention.
Fig. 1 is the automated testing method of application program on the mobile terminal that the first embodiment of the present invention provides
Flow chart.
In step S101, read the configuration file of the title recording all objects to be tested, and will be needed
The title of test object stores to object chained list.
Under Android (Android) operating system, each application program to start in systems and to run, all
The use that must have an entitled Android inventory (Android Manifest) under its root is expansible
The configuration file that markup language (XML) is write.Described Android inventory configuration file define application program and
The structure of assembly and metadata.Concrete, described Android inventory configuration file contains composition application program
The node of each assembly, and use intention filter (Intent Filter) and authority (Authority)
Determine between these assemblies and these assemblies are the most mutual with other application programs.
When automatic test course starts, reading from described Android inventory configuration file should described in all compositions
By the title of the moving object of program, and the title of described moving object is stored in object chained list, with standard
The standby automatic test to described moving object.
When reading moving object title, it should first find described work in described Android inventory configuration file
Dynamic (Activity) node, then reads each that described application program includes from described active node
The title of movable (Activity) object, and the title of the moving object of reading is stored in a chained list.
Described chained list is used for storing the title of all of moving object in application program to be tested, for follow-up from
Dynamicization test provides the target of test.
In step s 102, list the list of the title of all objects to be tested for user, input according to user
Select its test in object to be tested can cause the object that system is closed or test process stops, and from object
List is deleted selected object.
In the application program of Android system, there is the operation of the moving object of some application programs can cause system
Close or the stopping of automatic test course.Such as, with the operation of application program of timing shutdown function
The system that this may result in is closed.During these application programs are carried out automatic test, described application
Program is run unavoidably to the program segment that can cause described problem, causes the operating system of mobile terminal to close, or
The stopping of automatic test course described in person.
This happens, and tester can only manually stop the process of automatic test, restarts movement
Terminal and described automatic test course, and the meeting of skipping manual after described automatic test course is restarted
Cause the test of the moving object of problem.
Obviously, such operation is cumbersome.Therefore, we are obtaining all moving objects of application program
After, the form of all of moving object list is listed, system in allowing user therefrom select, can be caused to close
And the application program of the stopping of automatic test course.The selection course Main Basis user of user is to application journey
The priori of sequence and the conventional experience that moving object was tested.
After user completes above-mentioned selection step, the selection completing oneself confirms.After having confirmed, institute
State the application program that user selects by automatic test course to delete from list object.
In step s 103, automatic test course is started.
After completing the preparation of moving object to be tested, start automatic test course.Described automatization
Test program is write according to MonkeyRunner framework, belongs to functional test program.Described MoneyRunner
Framework is the automatic test program development tools that Android SDK (Android SDK) carries,
Utilize MonkeyRunner can develop quick, easy-to-use mobile terminal function test program.
Described automatic test program operates in PC, by the data between described mobile terminal
Connect and control described mobile terminal, described mobile terminal is tested.Described automatic test program can
To be driven by the test script write in advance, it is also possible to input a command at Cmd Shell window by user
Real Time Drive.
In step S104, load the object to be tested in list object.
After described automatic test course starts, just need to load moving object to be tested.Through step S101
In reading and selection in step S102, obtained the object column that store moving object to be tested
Table.Therefore, after described automatic test course starts, the list object being already prepared to described in loading.
For described automatic test course, the process loading described list object reads in list object exactly
Process.In the first embodiment of the present invention, in order to improve the efficiency of described automatic test course, right
The read-in process of described list object takes the method disposably reading in whole list object, and does not use row
The method that moving object in table reads one by one.
In step S105, the object to be tested in list object is carried out automatic test.
After the list of the moving object as test object being read in, just start the automatization to object to be tested
Test.The inventive method is the functionality test method to the application program on mobile terminal, main by right
The various objects for interface alternation defined in moving object carry out random operation and realize.Such as, treating
A button object defined in the moving object of test, click institute that described automatic test program can be random
State button object.The most such as, at text box objects defined in moving object to be tested, described from
Dynamicization test program can be random to described text box objects input text.
When automatic test starts, first described automatic test program reads institute in moving object to be tested
There is the title of the object for interface alternation, then the described object for interface alternation is entered row stochastic behaviour
Make.The object acceptable for interface alternation that described random operation is operated.Such as, described from
Dynamicization test program will not input text to button object.
Described random operation is by described automatic test program stochastic generation, it is not intended that user is at ordinary times
Input habit.This point is mainly due to the consideration of vigorousness of tested application program so that by described
The application program of automatic test program test copes with the multiple abnormal input data from user.
The magnanimity of described random operation and frequently.Why abandon manual testing and use automatic test,
High efficiency just because of automatic test.Described automatic test program can generate in relatively short period of time section
Substantial amounts of random operation, the correctness testing moving object to be tested with this and vigorousness.
Described automatic test program includes logger.While described automatic test program is run,
The daily record that described logger record automatic test runs.Described daily record records automatic test program
The committed step run, the exception (Exception) occurred in automatic test course, automatic test journey
The key messages such as various warnings (Warning) that sequence is quoted and mistake (Error).
The present embodiment is by, before automatic test program starts, being first shown to the list of object to be tested
User, user the method therefrom cancelling the object to be tested hindering the smooth and easy operation of automatic test program, real
Show the smooth and easy operation of automatic test program, it is to avoid some objects to be tested are being carried out automatic test
During occur system close or automatic test course stop situation.
Fig. 2 shows the second embodiment of the present invention.
Fig. 2 is the automatic test device of application program on the mobile terminal that the second embodiment of the present invention provides
Structural representation.
On described mobile terminal, the automatic test device of application program includes configuration file read module 201, surveys
Examination object choice module 202, test program start module 203, object load-on module 204 to be tested and automatically
Change test module 205.
Described configuration file read module 201 is for reading the configuration literary composition of the title recording all objects to be tested
Part, and the title of all objects to be tested is stored to object chained list.
Described configuration file is Android inventory (Android Manifest) configuration file.Described Android inventory
Configuration file defines application program and the structure of assembly thereof and metadata.Moving object is the one of application program
Kind of significant components, therefore to be recorded in described Android clear for the title of each moving object and association attributes thereof
In single (Android Manifest) configuration file.
Described configuration file read module 201 is each to be measured for reading from described Android inventory configuration file
The title of moving object of examination, and by read the title of moving object is stored in object chained list.Institute
The reading process stated is first to find activity (activity) node from Android inventory configuration file, then from
Described active node reads the title of each moving object, and by the name of all moving objects read
Claim to be stored in object chained list.
Described test object choice module 202 is used for listing the list of the title of all objects to be tested, according to
User inputs its test in selection object to be tested and system can be caused to close or automatic test course stopping
Object, and from list object, delete selected object.
First described test object choice module 202 is listed by described configuration file for user on program interface
The title of the moving object to be tested that read module 201 reads.User is listing moving object to be tested
List in selection can cause system close and automatic test course stop moving object.Selected work
Dynamic object is deleted in the list from moving object to be tested.
Described test program starts module 203 and is used for starting automatic test course.
Described automatic test course is carried out the inventive method, and the application program on mobile terminal is carried out merit
The process that can test.More specifically, described automatic test course is the moving object to described application program
Carry out the process of functional test.Owing to selecting through described configuration file read module 201 and described test object
Select the process of module 202, have been obtained for constituting tested application program, and its test does not results in
The chained list of moving object that system is closed or automatic test course stops, it is possible to starting described automatically
Change test process.
Described object load-on module to be tested 204 is for loading the object to be tested in list object.
The process loading the object to be tested in described list object is exactly the process of reading object list.In order to
Improve the efficiency of described automatic test program, take disposably to read in the read-in process of described list object
The method of whole list object, and do not use the method that the moving object in list is read one by one.
Described automatic test module 205 is for carrying out automatic test to the object to be tested in list object.
The various input operations of described automatic test module simulation user, enter the moving object of application program
Row functional test.Such as, to the button object defined in moving object, described automatic test module simulation
The clicking operation of user;To the text box objects defined in moving object, described automatic test module simulation
The text entry operation of user.
Described automatic test module includes a logger.In described automatic test module to described
When active module is tested, the daily record that automatic test program described in described logger record is run.
Recording the committed step that automatic test program is run in described daily record, occur in automatic test course is different
Often (Exception), automatic test program is quoted various warnings (Warning) and mistake (Error)
Deng key message.
The present embodiment is by adding test object choice module so that user can be before automatic test runs
The moving object needing test is selected, it is to avoid because the functional test to some moving objects causes
System close or test process stop, effectively raising the efficiency of automatic test.
Obviously, it will be understood by those skilled in the art that each module or each step of the above-mentioned present invention can be used
General calculating device realizes, and they can concentrate on single calculating device, or is distributed in multiple meter
Calculating on the network that device is formed, alternatively, they can come with the executable program code of computer installation
Realize, performed by calculating device such that it is able to be stored in storing in device, or by them respectively
It is fabricated to each integrated circuit modules, or the multiple modules in them or step are fabricated to single integrated electricity
Road module realizes.So, the present invention is not restricted to the combination of any specific hardware and software.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for this area skill
For art personnel, the present invention can have various change and change.All institutes within spirit and principles of the present invention
Any modification, equivalent substitution and improvement etc. made, should be included within the scope of the present invention.
Claims (4)
1. the automated testing method of application program on a mobile terminal, it is characterised in that described method bag
Include:
Read the configuration file of the title recording all objects to be tested, and by the title of all objects to be tested
Store to object chained list;
List the list of the title of all objects to be tested, select in object to be tested it according to the input of user
Operation can cause the object that system is closed or test process stops, and deletes selected from list object
Object;
Start automatic test course;
Load the object to be tested in list object;
Object to be tested in list object is carried out automatic test;
The operating system of described mobile terminal is Android (Android) operating system;
Described to be tested to liking movable (Activity) object;
Described automatic test course is write according to MonkeyRunner framework.
The automated testing method of application program on mobile terminal the most according to claim 1, its feature
Being, the configuration file of the described title recording all objects to be tested is Android inventory (Android
Manifest) file.
3. the automatic test device of application program on a mobile terminal, it is characterised in that described device bag
Include:
Configuration file read module, for reading the configuration file of the title recording all objects to be tested, and
The title of all objects to be tested is stored to object chained list;
Test object choice module, for listing the list of the title of all objects to be tested, defeated according to user
Enter to select its operation in object to be tested can cause the object that system is closed or test process stops, and from right
As list is deleted selected object;
Test program starts module, is used for starting automatic test course;
Object load-on module to be tested, for loading the object to be tested in list object;
Automatic test module, for carrying out automatic test to the object to be tested in list object;
The operating system of described mobile terminal is Android (Android) operating system;
Described to be tested to liking movable (Activity) object;
Described automatic test course is write according to MonkeyRunner framework.
The automatic test device of application program on mobile terminal the most according to claim 3, its feature
Being, the configuration file of the described title recording all objects to be tested is Android inventory (Android
Manifest) file.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310057556.XA CN103164336B (en) | 2013-02-22 | The automated testing method of application program and device on a kind of mobile terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310057556.XA CN103164336B (en) | 2013-02-22 | The automated testing method of application program and device on a kind of mobile terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103164336A CN103164336A (en) | 2013-06-19 |
CN103164336B true CN103164336B (en) | 2016-11-30 |
Family
ID=
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1519721A (en) * | 2003-01-23 | 2004-08-11 | 英业达股份有限公司 | Dynamic extendable computer testing system as well as method |
CN101131660A (en) * | 2006-08-25 | 2008-02-27 | 佛山市顺德区顺达电脑厂有限公司 | Method for integrating module testing work |
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1519721A (en) * | 2003-01-23 | 2004-08-11 | 英业达股份有限公司 | Dynamic extendable computer testing system as well as method |
CN101131660A (en) * | 2006-08-25 | 2008-02-27 | 佛山市顺德区顺达电脑厂有限公司 | Method for integrating module testing work |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107870933B (en) | Method, device and system for counting android application page browsing behaviors | |
CN105094783B (en) | method and device for testing stability of android application | |
KR101637371B1 (en) | System for testing an application use for a smart device and method therefor | |
Ridene et al. | A model-driven approach for automating mobile applications testing | |
US20150248343A1 (en) | Method and apparatus for implementing instrumentation code | |
CN104021077A (en) | Mobile terminal software test system and method | |
CN110502415B (en) | Buried point setting method, device and equipment | |
CN105359143A (en) | Database diagnostics interface system | |
Sokolova et al. | Android passive MVC: a novel architecture model for the android application development | |
CN102541561B (en) | Method for developing configuration type software and device | |
JP2014191830A (en) | Method of automatic feature-driven testing and quality checking of applications, system, and product | |
Helfen et al. | Testing SAP solutions | |
CN106294172A (en) | App self-testing method based on terminal unit and device | |
CN103164336B (en) | The automated testing method of application program and device on a kind of mobile terminal | |
EP4261692A1 (en) | Self-learning application test automation | |
Mirza et al. | ContextDrive: Towards a functional scenario-based testing framework for context-aware applications | |
CN109933506A (en) | Server big data method of evaluating performance, system and electronic equipment and storage medium | |
Narayani et al. | Web Scraping & Automation Bot Using Python: Using Python to automate all the tasks | |
Leal et al. | The SAMBA approach for Self-Adaptive Model-BAsed online testing of services orchestrations | |
CN103164336A (en) | Automation test method and device of application programs of mobile terminals | |
CN103902907A (en) | Dynamic analysis optimization method and system based on behavior analysis templates | |
Dulz | A Versatile Tool Environment to Perform Model-based Testing of Web Applications and Multilingual Websites. | |
Spallino | Native versus hybrid mobile application development for professional membership services | |
Giang | Building a Web Application to Elevating Home User Experience and Efficiency: Home Assistant | |
Patra | Study and Development of Cross-Platform Cloogy Mobile Application for VPS–Virtual Power Solutions. |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
CP01 | Change in the name or title of a patent holder |
Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. |
|
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20161130 |