CN104866413A - Multi-process testing method and device - Google Patents

Multi-process testing method and device Download PDF

Info

Publication number
CN104866413A
CN104866413A CN201410062756.9A CN201410062756A CN104866413A CN 104866413 A CN104866413 A CN 104866413A CN 201410062756 A CN201410062756 A CN 201410062756A CN 104866413 A CN104866413 A CN 104866413A
Authority
CN
China
Prior art keywords
control
test
interface
coordinate
tree
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
CN201410062756.9A
Other languages
Chinese (zh)
Other versions
CN104866413B (en
Inventor
邓曦
万宇
陈翌
郑辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201410062756.9A priority Critical patent/CN104866413B/en
Publication of CN104866413A publication Critical patent/CN104866413A/en
Application granted granted Critical
Publication of CN104866413B publication Critical patent/CN104866413B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a multi-process testing method and device capable of simplifying the multi-process testing complexity, and relates to the field of terminal application testing. The method comprises steps as follows: a first control is acquired from a first interface according to a first control identity, and the first interface is an interface of a first process; first testing operation is performed on the first control and used for taking a second process; a second control is acquired from a second interface of the second process according to a second control identity; second testing operation is performed on the second control and used for generating a target interface; whether the testing succeeds or not is determined according to a verification point in the target interface. The multi-process testing method and device are mainly applied to the terminal application testing process.

Description

The method of multi-process test and device
Technical field
The present invention relates to terminal applies field tests, particularly relate to method and the device of a kind of multi-process test.
Background technology
Along with the development of mobile terminal application technology, mobile terminal can run multiple process simultaneously, process division, for performing an application, when application comprises multiple module, is that thread carries out Resourse Distribute by one of them process.In order to the function of abundant application, by transferring other application by control in the application, user operation can be simplified while enriching application function.In prior art, provide a kind of method of testing of the control laid respectively in different process being tested by control coordinate.
State in realization in the process of multi-process test, inventor finds that in prior art, at least there are the following problems: but the same control of same operation interface is being different without the coordinate in the terminal of screen size.During the control of tester in the terminal of testing different screen size, need to change the difference according to screen size, calculate the new coordinate of control, cause test operation very complicated.
Summary of the invention
A kind of method that embodiments of the invention provide multi-process to test and device, can simplify the complexity of multi-process test.
On the one hand, the invention provides the method for a kind of multi-process test, described method comprises:
Be identified in the first interface according to the first control and obtain the first control, described first interface is the interface of the first process;
Carry out the first test operation to described first control, described first test operation is used for transferring the second process;
Be identified at according to the second control in the second contact surface of described second process and obtain the second control;
Carry out the second test operation to described second control, described second test operation is for generating target interface;
Determine that whether test is successful according to the check post in target interface.
On the other hand, present invention also offers the device of a kind of multi-process test, described device comprises:
Acquiring unit, obtains the first control for being identified in the first interface according to the first control, and described first interface is the interface of the first process;
Test cell, carry out the first test operation for described first control obtained described acquiring unit, described first test operation is used for transferring the second process;
Described acquiring unit also for, be identified at according to the second control in the second contact surface of described second process that described test cell is transferred and obtain the second control;
Described test cell also for, carry out the second test operation to described second control that described acquiring unit obtains, described second test operation is for generating target interface;
Authentication unit, determines test whether success for the check post in the described target interface that generates according to described test cell.
The method of multi-process test provided by the invention and device, can according to the first control mark acquisition first control, after the first test operation is carried out to the first control, from the second contact surface transferred, the second control is obtained according to the second control mark, after the second test operation is carried out to the second control, validation test successful.Prior art needs tester to remember the coordinate of control voluntarily, when testing in different terminals, needs the new coordinate of the screen size conversion control according to terminal, complex operation.In the present invention, by selecting control in the first control mark (or the second control mark) in interface, and then saving the step of manual conversion hole man control coordinate, simplifying test, improving testing efficiency.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the process flow diagram of the method for a multi-process test in the embodiment of the present invention;
Fig. 2 is the process flow diagram of the method for another multi-process test in the embodiment of the present invention;
Fig. 3 is the process flow diagram in the method for a multi-process test in the embodiment of the present invention;
Fig. 4 is the structural representation of the device of a multi-process test in the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Embodiments provide the method for a kind of multi-process test, as shown in Figure 1, described method comprises:
Step 101, to be identified in the first interface to obtain the first control according to the first control, the first interface is the interface of the first process.
Described first control is designated the index of class name or described first control belonging to the title of described first control or described first control.Automatically test in (uiautomator) instrument in the user interface of Android (Android) system and obtain described first control.User interface automatic testing instrument can provide the control tree at the first interface.First interface is the interface of the first moment terminal top set display, and described first moment is the moment that tester obtains the first control.
Step 102, carry out the first test operation to the first control, the first test operation is used for transferring the second process.
In Android system, a process is for performing an application, and each application is divided into again different activities, and an activity shows in an interface.Second process is the process different from the first process.By carrying out the first test operation in the first interface of the first process, transfer the second process.Second process is have the process successively performing relation with the first process.Such as: the second process is input method process, the first process is instant messaging process, when in the text event detection dialog box in the first process during input characters, transfers the second process.
Step 103, be identified at the second process according to the second control second contact surface in obtain the second control.
The acquisition methods of the second control is identical with the method obtaining the first control in step 101.Described second control is designated the index of class name or described second control belonging to the title of described second control or described second control.
Step 104, carry out the second test operation to the second control, the second test operation is for generating target interface.
Second test operation and the operation that test operation can perform for the first time include but not limited to: clicking operation or text event detection operation.Judge the second test operation or first time test operation be clicking operation or text event detection operation and the concrete mode of clicking operation and the content of text event detection, the test target that the application performed by the second process and needs carry out is determined.
3rd interface of the 3rd process that target interface can make the second test operation transfer also can be other interfaces of the second process.
Step 105, determine test whether success according to the check post in target interface.
Check post is used for whether having target detection effect in test-target interface.Check point include but not limited to following any one or multiple: target interface comprises in the predetermined control in the target widget of predetermined quantity, target interface and whether shows predetermined content, whether generates target interface.
The method of the multi-process test that the embodiment of the present invention provides, can according to the first control mark acquisition first control, after the first test operation is carried out to the first control, from the second contact surface transferred, the second control is obtained according to the second control mark, after the second test operation is carried out to the second control, validation test successful.Prior art needs tester to remember the coordinate of control voluntarily, when testing in different terminals, needs the new coordinate of the screen size conversion control according to terminal, complex operation.In the present invention, by selecting control in the first control mark (or the second control mark) in interface, and then saving the step of manual conversion hole man control coordinate, simplifying test, improving testing efficiency.
It should be noted that, the second test operation can transfer the 3rd process, carries out the 3rd test and handles, can transfer the 4th process to the 3rd control in the 3rd interface of the 3rd process.By that analogy, can have and carry out repeatedly test operation.Last test operation is for generating target interface.Target interface
The embodiment of the present invention additionally provides the method for a kind of multi-process test, as illustrating method shown in Fig. 1, as shown in Figure 2, step 101, to be identified in the first interface to obtain the first control according to the first control, comprising:
Step 201, obtain first control tree at the first interface.
Step 202, search the first control set first control set and comprise according to the first control mark of user's input whole first controls identifying with the first control and conform to from the first control tree, the first control comprises the coordinate of the first control.
Step 203, from the first control set, determine the first control according to the selection instruction of user.
Concrete, 1) show the first control set.Optionally, the similarity that the first control inputted according to control title and user identifies sorts, and is shown by ranking results.
2) according to the selection instruction of user, in the first spatial aggregation, the control corresponding with described selection instruction is defined as the first control.
The method of the multi-process test that the embodiment of the present invention provides, the whole controls in the first interface can be obtained by the first control tree, after user inputs the first control mark needing to obtain, from the first control tree, search the first control identifying happiness with this first control, and then obtain the first control.First control tree provides and identifies according to the first control the technical basis searched the first control, and then simplifies the complexity of searching the first control, improves testing efficiency.
The embodiment of the present invention additionally provides the method for a kind of multi-process test, and as illustrating method shown in Fig. 1, step 102, carry out the first test operation to the first control, the first test operation is used for transferring the second process, comprising:
1) if described first control is text editing (EditText) control, then input test character in described first control.
Concrete, from described first control tree, obtain the coordinate of described first control, by the first test statement input test character in the coordinate of described first control
Test character comprises: Chinese character, English, letter or symbol etc.
2) if described first control is button (Button) control, then (click) operation is clicked to described first control.
Concrete, from described first control tree, obtain the coordinate of described first control, in the coordinate of described first control, carry out clicking operation by the second test statement.
The method of the multi-process test that the embodiment of the present invention provides, can perform different test operations for different controls, and then improve the diversity of test.Further, by coordinate, test operation is carried out to control, namely by the coordinate by control in programmed statements, control is tested, make test more comprehensive.
It should be noted that, above-mentioned two kind of first test operation can be tested the second control as the second test operation.
Below by a use scenes, foregoing is specifically described, as shown in Figure 3,
Step 301, start N application (starting condition is N=1).
Step 302, obtain the control tree N at N interface.
Step 303, in control tree N, search N control to be tested, and from control tree N, obtain the screen coordinate of N control.
Step 304, perform N test operation according to the screen coordinate of N control to N control, N test operation is for starting other interfaces of N+1 application or N application.
Step 305, judge whether to need to start other application.If needed, then N is added 1, do not need if perform step 301., then perform step 306.
The control tree N ' at other interfaces that step 306, the N+1 application obtaining the startup of N test operation or N apply.
Step 307, judge whether there is check post in control tree N '.If existed, then test successfully.If there is no, then test crash.
The embodiment of the present invention additionally provides the device of a kind of multi-process test, and as shown in Figure 4, described device 41 comprises:
Acquiring unit 411, obtains the first control for being identified in the first interface according to the first control, and described first interface is the interface of the first process;
Test cell 412, carry out the first test operation for described first control obtained described acquiring unit 411, described first test operation is used for transferring the second process;
Described acquiring unit 411 also for, be identified at according to the second control in the second contact surface of described second process that described test cell 412 is transferred and obtain the second control;
Described test cell 412 also for, carry out the second test operation to described second control that described acquiring unit 411 obtains, described second test operation is for generating target interface;
According to the check post in the described target interface of described test cell 412 generation, authentication unit 413, for determining that whether test is successful.
Further, described acquiring unit 411 also for:
Obtain first control tree at the first interface;
From described first control tree, search the first control set described in the first control set according to the first control mark of user's input and comprise whole first controls identifying with described first control and conform to, described first control comprises the coordinate of the first control;
Selection instruction according to user determines the first control from described first control set.
Further, described test cell 412 also for:
If described first control is text editing control, then input test character in described first control;
If described first control is button control, then clicking operation is carried out to described first control.
Further, described test cell 412 also for:
The coordinate of described first control is obtained, by the first test statement input test character in the coordinate of described first control from described first control tree;
From described first control tree, obtain the coordinate of described first control, in the coordinate of described first control, carry out clicking operation by the second test statement.
Further, described first control is designated the index of class name or described first control belonging to the title of described first control or described first control;
Described second control is designated the index of class name or described second control belonging to the title of described second control or described second control.
Those skilled in the art can be well understood to, for convenience and simplicity of description, only be illustrated with the division of above-mentioned each functional module, in practical application, can distribute as required and by above-mentioned functions and be completed by different functional modules, inner structure by device is divided into different functional modules, to complete all or part of function described above.The system of foregoing description, the specific works process of device and unit, with reference to the corresponding process in preceding method embodiment, can not repeat them here.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; change can be expected easily or replace, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should described be as the criterion with the protection domain of claim.

Claims (10)

1. a method for multi-process test, it is characterized in that, described method comprises:
Be identified in the first interface according to the first control and obtain the first control, described first interface is the interface of the first process;
Carry out the first test operation to described first control, described first test operation is used for transferring the second process;
Be identified at according to the second control in the second contact surface of described second process and obtain the second control;
Carry out the second test operation to described second control, described second test operation is for generating target interface;
Determine that whether test is successful according to the check post in target interface.
2. the method for multi-process according to claim 1 test, is characterized in that, is describedly identified at the step obtaining the first control in the first interface according to the first control, comprising:
Obtain first control tree at the first interface;
From described first control tree, search the first control set described in the first control set according to the first control mark of user's input and comprise whole first controls identifying with described first control and conform to, described first control comprises the coordinate of the first control;
Selection instruction according to user determines the first control from described first control set.
3. the method for multi-process test according to claim 2, it is characterized in that, described step of described first control being carried out to the first test operation, comprising:
If described first control is text editing control, then input test character in described first control;
If described first control is button control, then clicking operation is carried out to described first control.
4. the method for multi-process test according to claim 3, it is characterized in that, the step of described input test character in described first control, comprising:
The coordinate of described first control is obtained, by the first test statement input test character in the coordinate of described first control from described first control tree;
Described step of described first control being carried out to clicking operation, comprising:
From described first control tree, obtain the coordinate of described first control, in the coordinate of described first control, carry out clicking operation by the second test statement.
5. the method for multi-process according to any one of claim 1 to 4 test, is characterized in that, described first control is designated the index of class name or described first control belonging to the title of described first control or described first control;
Described second control is designated the index of class name or described second control belonging to the title of described second control or described second control.
6. a device for multi-process test, it is characterized in that, described device comprises:
Acquiring unit, obtains the first control for being identified in the first interface according to the first control, and described first interface is the interface of the first process;
Test cell, carry out the first test operation for described first control obtained described acquiring unit, described first test operation is used for transferring the second process;
Described acquiring unit also for, be identified at according to the second control in the second contact surface of described second process that described test cell is transferred and obtain the second control;
Described test cell also for, carry out the second test operation to described second control that described acquiring unit obtains, described second test operation is for generating target interface;
Authentication unit, determines test whether success for the check post in the described target interface that generates according to described test cell.
7. the device of multi-process according to claim 6 test, is characterized in that, described acquiring unit also for:
Obtain first control tree at the first interface;
From described first control tree, search the first control set described in the first control set according to the first control mark of user's input and comprise whole first controls identifying with described first control and conform to, described first control comprises the coordinate of the first control;
Selection instruction according to user determines the first control from described first control set.
8. the device of multi-process according to claim 7 test, is characterized in that, described test cell also for:
If described first control is text editing control, then input test character in described first control;
If described first control is button control, then clicking operation is carried out to described first control.
9. the device of multi-process according to claim 8 test, is characterized in that, described test cell also for:
The coordinate of described first control is obtained, by the first test statement input test character in the coordinate of described first control from described first control tree;
From described first control tree, obtain the coordinate of described first control, in the coordinate of described first control, carry out clicking operation by the second test statement.
10. the device of the multi-process test according to any one of claim 6 to 9, it is characterized in that, described first control is designated the index of class name or described first control belonging to the title of described first control or described first control;
Described second control is designated the index of class name or described second control belonging to the title of described second control or described second control.
CN201410062756.9A 2014-02-24 2014-02-24 The method and device of multi-process test Active CN104866413B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410062756.9A CN104866413B (en) 2014-02-24 2014-02-24 The method and device of multi-process test

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410062756.9A CN104866413B (en) 2014-02-24 2014-02-24 The method and device of multi-process test

Publications (2)

Publication Number Publication Date
CN104866413A true CN104866413A (en) 2015-08-26
CN104866413B CN104866413B (en) 2018-09-28

Family

ID=53912259

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410062756.9A Active CN104866413B (en) 2014-02-24 2014-02-24 The method and device of multi-process test

Country Status (1)

Country Link
CN (1) CN104866413B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105159992A (en) * 2015-09-01 2015-12-16 北京瑞汛世纪科技有限公司 Method and device for detecting page contents and network behaviors of application program
CN106294152A (en) * 2016-08-09 2017-01-04 努比亚技术有限公司 The traversal test device and method of application user interface

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1994011818A1 (en) * 1992-11-19 1994-05-26 Segue Software, Inc. Automated gui interface testing
CN102053911A (en) * 2010-12-30 2011-05-11 东莞宇龙通信科技有限公司 Automated testing method and system based on Android and mobile terminal
CN103019923A (en) * 2011-09-22 2013-04-03 腾讯科技(深圳)有限公司 Method and system of simulated click test
CN103064782A (en) * 2011-10-21 2013-04-24 腾讯科技(深圳)有限公司 Method and device for obtaining control
CN103164300A (en) * 2011-12-13 2013-06-19 腾讯科技(深圳)有限公司 Mobile terminal touch screen automatic testing method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1994011818A1 (en) * 1992-11-19 1994-05-26 Segue Software, Inc. Automated gui interface testing
CN102053911A (en) * 2010-12-30 2011-05-11 东莞宇龙通信科技有限公司 Automated testing method and system based on Android and mobile terminal
CN103019923A (en) * 2011-09-22 2013-04-03 腾讯科技(深圳)有限公司 Method and system of simulated click test
CN103064782A (en) * 2011-10-21 2013-04-24 腾讯科技(深圳)有限公司 Method and device for obtaining control
CN103164300A (en) * 2011-12-13 2013-06-19 腾讯科技(深圳)有限公司 Mobile terminal touch screen automatic testing method and device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105159992A (en) * 2015-09-01 2015-12-16 北京瑞汛世纪科技有限公司 Method and device for detecting page contents and network behaviors of application program
CN106294152A (en) * 2016-08-09 2017-01-04 努比亚技术有限公司 The traversal test device and method of application user interface
CN106294152B (en) * 2016-08-09 2019-03-12 努比亚技术有限公司 Using the traversal test device and method of user interface

Also Published As

Publication number Publication date
CN104866413B (en) 2018-09-28

Similar Documents

Publication Publication Date Title
CN103312850B (en) A kind of mobile phone automatized test macro and method of work
CN104035867A (en) Android-based application function traverse test method
CN104636322B (en) The method and device that a kind of text replicates
CN108351828A (en) Technology for device-independent automatic application test
CN103164300A (en) Mobile terminal touch screen automatic testing method and device
CN102110053A (en) Random testing method based on Android
CN109614325B (en) Method and device for determining control attribute, electronic equipment and storage medium
CN103970662A (en) Method and system for obtaining boundary value input through GUI software
CN107102949A (en) Application program off-line test method and instrument
CN104536874A (en) Client collapse locating method and device
CN104899140B (en) A kind of method of testing of mobile terminal component
CN104915228B (en) Application program language setting method and device
Patil et al. Enhanced UI Automator Viewer with improved Android accessibility evaluation features
CN102736830A (en) Handwriting input method and terminal equipment
CN112597066B (en) Page testing method and device
CN104866413A (en) Multi-process testing method and device
CN112149828B (en) Operator precision detection method and device based on deep learning framework
CN104536880B (en) Gui program test case amplification method based on semiology analysis
CN107783867B (en) Gesture testing method and device, computer equipment and storage medium
CN112685311A (en) Test script automatic generation method and device, computer equipment and storage medium
CN107577685A (en) A kind of knowledge point indication method and device
CN106814935A (en) The application icon display methods and terminal of a kind of terminal
CN106598843A (en) Method for automatic identification of software log behaviors based on program analysis
CN102521124B (en) Method and system for outputting failure reasons
CN104735072A (en) Method and device for logging in user account

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