CN109902030A - A kind of method of application program of mobile phone automatic test step record and playback - Google Patents

A kind of method of application program of mobile phone automatic test step record and playback Download PDF

Info

Publication number
CN109902030A
CN109902030A CN201910340454.6A CN201910340454A CN109902030A CN 109902030 A CN109902030 A CN 109902030A CN 201910340454 A CN201910340454 A CN 201910340454A CN 109902030 A CN109902030 A CN 109902030A
Authority
CN
China
Prior art keywords
record
test
mobile phone
app
application program
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
CN201910340454.6A
Other languages
Chinese (zh)
Other versions
CN109902030B (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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN201910340454.6A priority Critical patent/CN109902030B/en
Publication of CN109902030A publication Critical patent/CN109902030A/en
Application granted granted Critical
Publication of CN109902030B publication Critical patent/CN109902030B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the invention discloses the methods of a kind of application program of mobile phone automatic test step record and playback, the recording method of the automatic test step are as follows: install test record APP in mobile phone, it opens test record APP and selects the application program that will be tested, after opening service, that clicks test record APP starts recording button, carry out Application testing, during the test, the location information of test record APP record mobile phone operation interface, test terminates, it clicks test APP and records conclusion button, operation note in all test process is stored in test record APP.The present invention solves the problems, such as existing to automate recording application program testing procedure on non-root mobile phone.

Description

A kind of method of application program of mobile phone automatic test step record and playback
Technical field
The present embodiments relate to software testing technology fields, and in particular to a kind of application program of mobile phone automatic test step The rapid method recorded with playback.
Background technique
When existing application program of mobile phone is updated, application developer needs to test application program, detection Application program whether there is loophole and unreasonable place, and more new spectra will be passed in face of widely applying program to need to test every time Generally application program is tested using point-to-point mode in system testing scheme, the program needs to consume the plenty of time, leads It causes testing efficiency extremely low, or using the scheme of batch testing, needs to carry out root to mobile phone, so that more permissions are obtained, but It is the cell phone system that user can be destroyed after mobile phone root, it can not really analog subscriber operating environment, and existing cell phone manufacturer Do not allow to carry out root to mobile phone, prevents from damaging cell phone system.
Summary of the invention
For this purpose, the embodiment of the present invention provides the method for a kind of application program of mobile phone automatic test step record and playback, Recording application program testing procedure cannot be automated to solve the problems, such as existing on non-root mobile phone.
To achieve the goals above, the embodiment of the present invention provides the following technical solutions:
According to a first aspect of the embodiments of the present invention, a kind of application program of mobile phone automatic test step record is disclosed Method, the recording method of the automatic test step are as follows: test record APP is installed in mobile phone, opens test record APP selection The application program that will be tested, that clicks test record APP starts to record button, and progress Application testing is being tested In the process, test record APP records the location information of mobile phone operation interface, and test terminates, and clicking test APP and recording terminates to press Button, the operation note in all test process are stored in test record APP.
Further, the location information of the mobile phone operation interface includes: event type, event time, event package name, thing Part class name, event text, case index and event description.
Further, the test record APP defines an AccessibilityService and inherits the class derived from, definition Class is serviced, the test record APP rewrites the onAccessibilityEvent of base class before starting recording operation, A Boolean type member variable isRecord is defined in AccessibilityService service, if isRecord is false It does not do any data collection operations then, monitors and record the AccessibilityEvent_ of user if isRecord is ture TYPE_VIEW_CLICKED and AccessibilityEvent_TYPE_VIEW_TEXT_SELECTION_CHANGED event.
Further, the test record APP defines the categorical variable of List<AccessibilityNodeInfo>and is RecordNodeInfos, definition List<RecordEven>categorical variable is recordEvents, real according to isRecord state Shi Jilu AccessibilityNodeInfo and AccessibilityEvents data.
Further, the test record APP click starts to record button, and the state of isRecord is changed to ture, simultaneously In the state of mobile phone notification bar display recording, the title for recording APP, APP icon and whether terminate to record button.
Further, the test record APP is in recording process, due to the AccessibilityEvent class listened to Type data cannot serialize, and influence data transmitting, need to be packaged into the RecordEvent class of serializability, to what is listened to AccessibilityEvent carries out data collection and filtering, and the clicking operation of each user is one recordEvent pairs corresponding As, all recordEvent objects are stored in the member variable RecordEvents of List<recordEvent>type, By calling AccessibilityEvent.getSources () method to obtain the change of AccessibilityNodeInfo type Measure NodeInfo, NodeInfo is stored in recordNodeInfos, the length of recordEvents and The equal length of recordNodeInfos, and event corresponds, and has complementary effect on multiple attributes.
Further, the test record APP, which is clicked, terminates to record, the RecordEvents that is collected in recording process and NodeInfos data are transferred to ModifyRecordInfosActivity, record before being obtained by Intent RecordEvents and recordNodeInfos, reminds user's present, and starting handleRecords thread process is whole The data collected are closed, integration is packaged into the class of entitled RecordRunningInfos, defines List < RecordRunningInfos > variable.
Further, test record APP by the number of steps of collection according to judging, the event type of continuous two data, If previous is TYPE_VIEW_TEXT_SELECTION_CHANGED event, and the latter is not the type, then current TYPE_ The data of VIEW_TEXT_SELECTION_CHANGED event are just the last required data obtained in the step, while will be received The Events and NodeInfos of collection are handled, and form recordEvents and recordNodeInfos in air explosion loading Complementation obtains stablizing data.
Further, it after the completion of the test record APP is to Events and the NodeInfos processing of collection, will record RecordRunningInfos monitor event traversal be shown in the ModifyRecordInfosActivity page, user It can check, pull in the ModifyRecordInfosActivity page, modifying the operating procedure number being currently collected into According to starting handleRecordEvents2FileBean thread believes the event for the playback for integrating out in mRunInfoList Breath is packaged into Json and is saved in local file.
According to a second aspect of the embodiments of the present invention, a kind of playback of application program of mobile phone automatic test step is disclosed Method, the back method are as follows: mobile phone is connect by USB data line with computer, play-back command is transmitted to mobile phone by computer, The test operation that mobile phone automatic running is recorded, is automatically performed test process.
The embodiment of the present invention has the advantages that
The embodiment of the invention discloses the methods of a kind of application program of mobile phone automatic test step record and playback, do not have to Root is carried out to mobile phone, by installing test record APP for the interface operation information and typing in the test process of application program Information is recorded, and is carried out precise positioning to operation element in recording process and irised out rectangle frame, and each operation step is specified Suddenly, user can modify and delete the operating procedure of recording, can connect plurality of mobile phones simultaneously and carry out automatic test, promotion is answered With the testing efficiency of program.
Detailed description of the invention
It, below will be to embodiment party in order to illustrate more clearly of embodiments of the present invention or technical solution in the prior art Formula or attached drawing needed to be used in the description of the prior art are briefly described.It should be evident that the accompanying drawings in the following description is only It is merely exemplary, it for those of ordinary skill in the art, without creative efforts, can also basis The attached drawing of offer, which is extended, obtains other implementation attached drawings.
Structure depicted in this specification, ratio, size etc., only to cooperate the revealed content of specification, for Those skilled in the art understands and reads, and is not intended to limit the invention enforceable qualifications, therefore does not have technical Essential meaning, the modification of any structure, the change of proportionate relationship or the adjustment of size are not influencing the function of the invention that can be generated Under effect and the purpose that can reach, should all still it fall in the range of disclosed technology contents obtain and can cover.
Fig. 1 is a kind of application program of mobile phone automatic test step record flow chart provided in an embodiment of the present invention;
Specific embodiment
Embodiments of the present invention are illustrated by particular specific embodiment below, those skilled in the art can be by this explanation Content disclosed by book is understood other advantages and efficacy of the present invention easily, it is clear that described embodiment is the present invention one Section Example, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not doing Every other embodiment obtained under the premise of creative work out, shall fall within the protection scope of the present invention.
Embodiment
It is described automatic present embodiment discloses the method for a kind of application program of mobile phone automatic test step record and playback Change the recording method of testing procedure are as follows: test record APP is installed in mobile phone, opening test record APP selection will be tested Application program, click test record APP starts record button, carry out Application testing, during the test, test note The location information of APP record mobile phone operation interface is recorded, test terminates, and clicks test APP and records conclusion button, all test process In operation note be stored in test record APP.
For the test record APP before starting recording operation, test record APP defines one AccessibilityService inherits the class derived from, and definition service class rewrites the onAccessibilityEvent of base class, A Boolean type member variable isRecord is defined in AccessibilityService service, if isRecord is false It does not do any data collection operations then, monitors and record the AccessibilityEvent_ of user if isRecord is ture TYPE_VIEW_CLICKED and AccessibilityEvent_TYPE_VIEW_TEXT_SELECTION_CHANGED event, The categorical variable that test record APP defines List<AccessibilityNodeInfo>is recordNodeInfos, definition List<RecordEvent>categorical variable is recordEvents, is recorded in real time according to isRecord state AccessibilityNodeInfo and AccessibilityEvents data.
Test record APP click starts to record button, and the state of isRecord is changed to ture, while aobvious in mobile phone notification bar Show the state of recording, the title for recording APP, APP icon and whether terminates to record button, during the test, test record APP Record mobile phone operation interface location information, the location information of the mobile phone operation interface include: event type, event time, Event package name, event class name, event text, case index, event number and event description;
During the test, every single stepping can be selected by positioning circle, orients clicking operation each time and information Typing manipulation, is convenient for observing, confirms the authenticity of every single stepping.
Test record APP is in recording process, since the AccessibilityEvent the type data listened to cannot Serializing, and data transmitting is influenced, need to be packaged into the RecordEvent class of serializability, to what is listened to AccessibilityEvent carries out data collection and filtering, and the clicking operation of each user is one recordEvent pairs corresponding As, all recordEvent objects are stored in the member variable RecordEvents of List<recordEvent>type, By calling AccessibilityEvent.getSources () method to obtain the change of AccessibilityNodeInfo type Measure NodeInfo, NodeInfo is stored in recordNodeInfos, the length of recordEvents and The equal length of recordNodeInfos, and event corresponds, and has complementary effect on multiple attributes.
Test record APP, which is clicked, to be terminated to record, RecordEvents the and NodeInfos data collected in recording process pass It is defeated to arrive ModifyRecordInfosActivity, before being obtained by Intent the recordEvents that records and RecordNodeInfos, reminds user's present, and the data that starting handleRecords thread process integration is collected are whole The class for being packaged into entitled RecordRunningInfos is closed, List<RecordRunningInfos>variable is defined.
Test record APP by the number of steps of collection according to judging, the event type of continuous two data, if previous be TYPE_VIEW_TEXT_SELECTION_CHANGED event, and the latter is not the type, then current TYPE_VIEW_TEXT_ The data of SELECTION_CHANGED event be just it is last in the step needed for the data that obtain, user's one character of every input, The event will be triggered, as inputted A for the first time, then the value in event is A, and second of input B, then the value in event becomes AB, So user inputs in the case where completing, the total data of last time need to be only obtained here, therefore needs to filter out last time Event;Simultaneously the Events of collection and NodeInfos are handled, make recordEvents and RecordNodeInfos forms complementation in air explosion loading, obtains stablizing data.
After the completion of the test record APP is to Events and the NodeInfos processing of collection, by record RecordRunningInfos monitors event traversal and is shown in the ModifyRecordInfosActivity page, user It can check, pull in the ModifyRecordInfosActivity page, modifying the operating procedure number being currently collected into According to starting handleRecordEvents2FileBean thread believes the event for the playback for integrating out in mRunInfoList Breath is packaged into Json and is saved in local file, uses convenient for playback operation.
When carrying out playback operation, mobile phone is connect by USB data line with computer, is referred to by computer to mobile phone transmission playback It enables, play-back command is adb shell am instrument-w-r-e debug false-e classasuper.com.sre cordandroid.UiAutoTest_1asuper.com.srecordan droid.test/android.support.test .runner.AndroidJUnitRunner.The instruction is called in asuper.com.srecordandroid packet path by making It is automatic to read the Json data saved with the code word UiAutoTest of UiAutoMator framework encapsulation, what automatic running was recorded Test operation is automatically performed test process, promotes Application testing efficiency.
Although above having used general explanation and specific embodiment, the present invention is described in detail, at this On the basis of invention, it can be made some modifications or improvements, this will be apparent to those skilled in the art.Therefore, These modifications or improvements without departing from theon the basis of the spirit of the present invention are fallen within the scope of the claimed invention.

Claims (10)

1. a kind of method of application program of mobile phone automatic test step record, which is characterized in that the automatic test step Recording method are as follows: test record APP is installed in mobile phone, opens test record APP and selects the application program that will be tested, That clicks test record APP starts to record button, and progress Application testing, during the test, test record APP records hand The location information of machine operation interface, test terminate, and click test APP and record conclusion button, the operation note in all test process Address book stored is in test record APP.
2. a kind of method of application program of mobile phone automatic test step record as described in claim 1, which is characterized in that institute The location information for stating mobile phone operation interface includes: event type, event time, event package name, event class name, event text, thing Part index and event description.
3. a kind of method of application program of mobile phone automatic test step record as described in claim 1, which is characterized in that institute It states test record APP and defines the class that an AccessibilityService inherits derivation, definition service class, the test record APP rewrites the onAccessibilityEvent of base class before starting recording operation, services in AccessibilityService One Boolean type member variable isRecord of middle definition does not do any data collection operations if isRecord is false, if IsRecord be ture then monitor and record user AccessibilityEvent_TYPE_VIEW_CLICKED and AccessibilityEvent_TYPE_VIEW_TEXT_SELECTION_CHANGED event.
4. a kind of method of application program of mobile phone automatic test step record as claimed in claim 3, which is characterized in that institute Stating test record APP and defining the categorical variable of List<AccessibilityNodeInfo>is recordNodeInfos, definition List<RecordEven>categorical variable is recordEvents, is recorded in real time according to isRecord state AccessibilityNodeInfo and AccessibilityEvents data.
5. a kind of method of application program of mobile phone automatic test step record as described in claim 1, which is characterized in that institute It states test record APP click to start to record button, the state of isRecord is changed to ture, while showing and recording in mobile phone notification bar State, record the title of APP, APP icon and whether terminate to record button.
6. a kind of method of application program of mobile phone automatic test step record as described in claim 1, which is characterized in that institute Test record APP is stated in recording process, since the AccessibilityEvent categorical data listened to cannot serialize, and Influence data transmitting, need to be packaged into the RecordEvent class of serializability, to the AccessibilityEvent listened into Row data collection and filtering, the corresponding recordEvent object of the clicking operation of each user, all recordEvent Object is stored in the member variable RecordEvents of List<recordEvent>type, passes through calling AccessibilityEvent.getSources () method obtains the variable of AccessibilityNodeInfo type NodeInfo is stored in recordNodeInfos by NodeInfo, the length of recordEvents and The equal length of recordNodeInfos, and event corresponds, and has complementary effect on multiple attributes.
7. a kind of method of application program of mobile phone automatic test step record as claimed in claim 6, which is characterized in that institute Stating test record APP and clicking terminates to record, RecordEvents the and NodeInfos data collected in recording process are transferred to ModifyRecordInfosActivity, before being obtained by Intent the recordEvents that records and RecordNodeInfos, reminds user's present, and the data that starting handleRecords thread process integration is collected are whole The class for being packaged into entitled RecordRunningInfos is closed, List<RecordRunningInfos>variable is defined.
8. a kind of method of application program of mobile phone automatic test step record as claimed in claim 7, which is characterized in that institute State test record APP by the number of steps of collection according to judging, the event type of continuous two data, if previous is TYPE_ VIEW_TEXT_SELECTION_CHANGED event, and the latter is not the type, then current TYPE_VIEW_TEXT_ The data of SELECTION_CHANGED event be just it is last in the step needed for the data that obtain, while by the Events of collection And NodeInfos is handled, and so that recordEvents and recordNodeInfos is formed complementation in air explosion loading, is obtained Stablize data.
9. a kind of method of application program of mobile phone automatic test step record as claimed in claim 8, which is characterized in that institute After the completion of test record APP is stated to Events and the NodeInfos processing of collection, by the RecordRunningInfos of record Monitoring event traversal is shown in the ModifyRecordInfosActivity page, user It can check, pull in the ModifyRecordInfosActivity page, modifying the operating procedure number being currently collected into According to starting handleRecordEvents2FileBean thread believes the event for the playback for integrating out in mRunInfoList Breath is packaged into Json and is saved in local file.
10. a kind of method of application program of mobile phone automatic test step playback, which is characterized in that the back method are as follows: will Mobile phone is connect by USB data line with computer, transmits play-back command, the test that mobile phone automatic running is recorded to mobile phone by computer Operation, is automatically performed test process.
CN201910340454.6A 2019-04-25 2019-04-25 Method for recording and replaying automatic test steps of mobile phone application program Active CN109902030B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910340454.6A CN109902030B (en) 2019-04-25 2019-04-25 Method for recording and replaying automatic test steps of mobile phone application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910340454.6A CN109902030B (en) 2019-04-25 2019-04-25 Method for recording and replaying automatic test steps of mobile phone application program

Publications (2)

Publication Number Publication Date
CN109902030A true CN109902030A (en) 2019-06-18
CN109902030B CN109902030B (en) 2022-05-24

Family

ID=66956313

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910340454.6A Active CN109902030B (en) 2019-04-25 2019-04-25 Method for recording and replaying automatic test steps of mobile phone application program

Country Status (1)

Country Link
CN (1) CN109902030B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110502437A (en) * 2019-07-31 2019-11-26 惠州市德赛西威汽车电子股份有限公司 A kind of test macro and its method of on-vehicle Bluetooth application program
CN111464381A (en) * 2020-03-26 2020-07-28 深圳市万事富科技有限公司 Test method of mobile phone software function app
CN112597050A (en) * 2020-12-28 2021-04-02 上海品顺信息科技有限公司 Method, system, equipment and storage medium for testing associated source code and test case

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103853658A (en) * 2012-12-04 2014-06-11 腾讯科技(深圳)有限公司 Automated testing method for production and playback in Android equipment and Android equipment
CN103970649A (en) * 2013-01-31 2014-08-06 腾讯科技(深圳)有限公司 Test method and device for Android terminal application programs
CN106034174A (en) * 2015-03-13 2016-10-19 展讯通信(上海)有限公司 Operation playback system, operation playback method and mobile terminal
CN107025165A (en) * 2017-03-07 2017-08-08 腾讯科技(深圳)有限公司 Game automated testing method and relevant apparatus
CN107357724A (en) * 2017-06-27 2017-11-17 深圳市泰衡诺科技有限公司上海分公司 Automatic software test method and device in Android system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103853658A (en) * 2012-12-04 2014-06-11 腾讯科技(深圳)有限公司 Automated testing method for production and playback in Android equipment and Android equipment
CN103970649A (en) * 2013-01-31 2014-08-06 腾讯科技(深圳)有限公司 Test method and device for Android terminal application programs
CN106034174A (en) * 2015-03-13 2016-10-19 展讯通信(上海)有限公司 Operation playback system, operation playback method and mobile terminal
CN107025165A (en) * 2017-03-07 2017-08-08 腾讯科技(深圳)有限公司 Game automated testing method and relevant apparatus
CN107357724A (en) * 2017-06-27 2017-11-17 深圳市泰衡诺科技有限公司上海分公司 Automatic software test method and device in Android system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
万木林: "面向Android手机应用的功能测试软件的设计与实现", 《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》 *
张灿等: "一种基于Android平台GUI录制回放工具的设计与实现", 《计算机应用与软件》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110502437A (en) * 2019-07-31 2019-11-26 惠州市德赛西威汽车电子股份有限公司 A kind of test macro and its method of on-vehicle Bluetooth application program
CN111464381A (en) * 2020-03-26 2020-07-28 深圳市万事富科技有限公司 Test method of mobile phone software function app
CN112597050A (en) * 2020-12-28 2021-04-02 上海品顺信息科技有限公司 Method, system, equipment and storage medium for testing associated source code and test case

Also Published As

Publication number Publication date
CN109902030B (en) 2022-05-24

Similar Documents

Publication Publication Date Title
US11886464B1 (en) Triage model in service monitoring system
USRE48681E1 (en) System and method for tracking web interactions with real time analytics
US10942960B2 (en) Automatic triage model execution in machine data driven monitoring automation apparatus with visualization
US11258693B2 (en) Collaborative incident management for networked computing systems
US10932106B2 (en) System, a method and a computer program product for automated remote control
US9639412B1 (en) Application performance management tools with a service monitor for collecting network breadcrumb data
CN104899016B (en) Allocating stack Relation acquisition method and device
US20170286038A1 (en) Technology Add-On Control Console
CN109902030A (en) A kind of method of application program of mobile phone automatic test step record and playback
EP3499360B1 (en) Systems and methods for client-side data analysis
CN106844136A (en) The collection method and system of a kind of program crashing information
CN110069464A (en) Log analysis processing method, device, equipment and readable storage medium storing program for executing
US9723075B2 (en) Systems and methods for data synchronization management between call centers and CRM systems
CN105243007B (en) The ageing testing method and device of memory in mobile terminal
WO2021129335A1 (en) Operation monitoring method and apparatus, operation analysis method and apparatus
CN112667426A (en) Log analysis method and device
CN110610376A (en) Behavior data response method and device, computer equipment and storage medium
CN106997313A (en) A kind of signal processing method of application program, system and terminal device
CN109684156A (en) Monitoring method, device, terminal and storage medium based on mixed mode applications
CN105094810B (en) Data processing method and device based on CGI(Common gateway interface) plug-in unit
CN109144841B (en) Method and device for identifying advertisement application, computer equipment and storage medium
CN104636372B (en) The method and device of big data quantity processing is realized based on table
CN111338960A (en) Buried point data acquisition method and device
CN115344471A (en) User interface test method, system, cluster, medium and program product
CN110597810A (en) Data processing method, device, terminal and storage medium

Legal Events

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