CN104866413B - The method and device of multi-process test - Google Patents

The method and device of multi-process test Download PDF

Info

Publication number
CN104866413B
CN104866413B CN201410062756.9A CN201410062756A CN104866413B CN 104866413 B CN104866413 B CN 104866413B CN 201410062756 A CN201410062756 A CN 201410062756A CN 104866413 B CN104866413 B CN 104866413B
Authority
CN
China
Prior art keywords
control
test
interface
coordinate
mark
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.)
Active
Application number
CN201410062756.9A
Other languages
Chinese (zh)
Other versions
CN104866413A (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

Landscapes

  • User Interface Of Digital Computer (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a kind of method and devices of multi-process test, are related to terminal applies testing field, can simplify the complexity of multi-process test.The method includes:The first control is obtained in the first interface according to the first control mark, first interface is the interface of the first process;First test operation is carried out to first control, first test operation is for transferring the second process;According to the second control mark the second control is obtained in the second contact surface of second process;Second test operation is carried out to second control, second test operation is for generating target interface;It is determined according to the check post in target interface and tests whether success.During being tested present invention is mainly applied to terminal applies.

Description

The method and device of multi-process test
Technical field
The present invention relates to the method and devices that terminal applies testing field more particularly to a kind of multi-process are tested.
Background technology
With the development of mobile terminal application technology, multiple processes can be run on mobile terminal simultaneously, one of them into Journey is for executing an application, when application includes multiple modules, divides a process into thread and carries out resource allocation.In order to abundant The function of application can simplify user by transferring other application by control in the application while abundant application function Operation.In the prior art, a kind of test that the control being located in different processes by control coordinate pair is tested is provided Method.
During stating multi-process test in realization, inventor has found that at least there are the following problems in the prior art:So And coordinate of the same control of the same operation interface in the terminal without screen size is different.Tester exists When testing the control in the terminal of different screen size, the difference according to screen size is needed replacing, the new coordinate of control is calculated, Lead to test operation very complicated.
Invention content
The embodiment of the present invention provides a kind of method and device of multi-process test, can simplify the complexity of multi-process test Degree.
On the one hand, the present invention provides a kind of multi-process test method, the method includes:
The first control is obtained in the first interface according to the first control mark, first interface is the boundary of the first process Face;
First test operation is carried out to first control, first test operation is for transferring the second process;
According to the second control mark the second control is obtained in the second contact surface of second process;
Second test operation is carried out to second control, second test operation is for generating target interface;
It is determined according to the check post in target interface and tests whether success.
On the other hand, the present invention also provides a kind of device of multi-process test, described device includes:
Acquiring unit, for obtaining the first control in the first interface according to the first control mark, first interface is The interface of first process;
Test cell, first control the first test operation of progress for obtaining to the acquiring unit, described the One test operation is for transferring the second process;
The acquiring unit is additionally operable to, second process transferred in the test cell according to the second control mark The second control is obtained in second contact surface;
The test cell is additionally operable to, and the second test operation is carried out to second control that the acquiring unit obtains, Second test operation is for generating target interface;
Authentication unit, the check post in the target interface for being generated according to the test cell, which determines, to be tested whether Success.
The method and device of multi-process test provided by the invention, can identify according to the first control and obtain the first control, After carrying out the first test operation to the first control, the second control is obtained from the second contact surface transferred according to the second control mark Part, after carrying out the second test operation to the second control, validation test successful.The prior art needs tester voluntarily to remember The coordinate of control when being tested in different terminals, needs the new coordinate according to the screen size of terminal conversion control, operation It is cumbersome.In the present invention, by being identified in the first control(Or second control mark)Control is selected in interface, and then is saved artificial The step of conversion hole family's control coordinate, simplifies test, improve testing efficiency.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with Obtain other attached drawings according to these attached drawings.
Fig. 1 is the flow chart for the method that a multi-process is tested in the embodiment of the present invention;
Fig. 2 is the flow chart for the method that another multi-process is tested in the embodiment of the present invention;
Fig. 3 is the flow chart of the method in multi-process test in the embodiment of the present invention;
Fig. 4 is the structural schematic diagram for the device that a multi-process is tested in the embodiment of the present invention.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, those of ordinary skill in the art are obtained every other without creative efforts Embodiment shall fall within the protection scope of the present invention.
An embodiment of the present invention provides a kind of methods of multi-process test, as shown in Figure 1, the method includes:
Step 101 obtains the first control according to the first control mark in the first interface, and the first interface is the first process Interface.
First control is identified as the title or the affiliated class name of first control or described first of first control The index of control.In Android(Android)The user interface of system is tested automatically(uiautomator)Described is obtained in tool One control.User interface automatic testing instrument is capable of providing the control tree at the first interface.First interface is that the first moment terminal is set The interface of display is pushed up, at the time of first moment is that tester obtains the first control.
Step 102 carries out the first control the first test operation, and the first test operation is for transferring the second process.
In Android system, a process is divided into for executing an application, each application as different activities, an activity It is shown in an interface.Second process is the process different from the first process.By at the first interface of the first process The first test operation of middle progress, transfers the second process.Second process is to have the process for successively executing relationship with the first process.Example Such as:Second process is input method process, and the first process is instant messaging process, when in the word input dialogue frame in the first process When inputting word, the second process is transferred.
Step 103 obtains the second control according to the second control mark in the second contact surface of the second process.
The acquisition methods of second control are identical as the method for obtaining the first control in step 101.The second control mark For the title of second control or the index of the affiliated class name of second control or second control.
Step 104 carries out the second control the second test operation, and the second test operation is for generating target interface.
The operation that second test operation and first time test operation are able to carry out includes but not limited to:Clicking operation or word Input operation.Judge that the second test operation or first time test operation are clicking operation or word input operation and specific The content of mode and the word input of clicking operation, by performed by the second process application and the test target that carries out of needs It is determined.
Target interface can make the third interface for the third process that the second test operation transfers, and can also be the second process Other interfaces.
Step 105 tests whether success according to the check post determination in target interface.
Check post is used in test-target interface whether have target detection effect.Check point includes but not limited to following appoints It anticipates one or more:Whether target interface includes being shown in the predetermined control in the target widget of predetermined quantity, target interface Whether predetermined content generates target interface.
The method of multi-process test provided in an embodiment of the present invention, can identify according to the first control and obtain the first control, After carrying out the first test operation to the first control, the second control is obtained from the second contact surface transferred according to the second control mark Part, after carrying out the second test operation to the second control, validation test successful.The prior art needs tester voluntarily to remember The coordinate of control when being tested in different terminals, needs the new coordinate according to the screen size of terminal conversion control, operation It is cumbersome.In the present invention, by being identified in the first control(Or second control mark)Control is selected in interface, and then is saved artificial The step of conversion hole family's control coordinate, simplifies test, improve testing efficiency.
It should be noted that the second test operation can transfer third process, to the third in the third interface of third process Control carries out third test and manipulates, and can transfer the 4th process.And so on, can have and carry out multiple test operation.Last time is surveyed Examination operation is for generating target interface.Target interface
The embodiment of the present invention additionally provides a kind of method of multi-process test, is illustrated as to method shown in Fig. 1, As shown in Fig. 2, step 101, according to the first control mark the first control is obtained in the first interface, including:
Step 201, the first control tree for obtaining the first interface.
Step 202 searches the first control set first according to the first control input by user mark from the first control tree Control set includes all the first controls being consistent with the first control mark, and the first control includes the coordinate of the first control.
Step 203 instructs determining first control from the first control set according to the user's choice.
Specifically, 1)Show the first control set.Optionally, it is identified according to control title and the first control input by user Similarity be ranked up, ranking results are shown.
2)It instructs, is determined as control corresponding with the selection instruction according to the user's choice in the first spatial aggregation First control.
The method of multi-process test provided in an embodiment of the present invention, can be obtained by the first control tree in the first interface Whole controls are searched and the first control mark after user inputs the first control mark for needing to obtain from the first control tree Know the first control of happiness, and then obtains the first control.First control tree, which is provided, to be identified according to the first control to the first control The technical basis searched, and then simplify the complexity for searching the first control, improve testing efficiency.
The embodiment of the present invention additionally provides a kind of method of multi-process test, is illustrated as to method shown in Fig. 1, Step 102 carries out the first control the first test operation, and the first test operation is used to transfer the second process, including:
1)If first control is text editing(EditText)Control, the then input test in first control Character.
Specifically, the coordinate of first control is obtained from first control tree, by the first test statement in institute State input test character in the coordinate of the first control
Testing character includes:Chinese character, English, letter or symbol etc..
2)If first control is button(Button)Control then clicks first control(click) Operation.
Specifically, the coordinate of first control is obtained from first control tree, by the second test statement in institute It states and carries out clicking operation in the coordinate of the first control.
The method of multi-process test provided in an embodiment of the present invention can be directed to different controls and execute different test behaviour Make, and then improves the diversity of test.Further, test operation is carried out by coordinate pair control, i.e., by programmed statements In tested by the coordinate pair control of control so that test more fully.
It should be noted that the first test operation of above two can be surveyed as second the second control of test operation pair Examination.
The above is specifically described below by a usage scenario, as shown in figure 3,
Step 301 starts N applications(Primary condition is N=1).
Step 302, the control tree N for obtaining the interfaces N.
Step 303 searches N controls to be tested in control tree N, and the screen of N controls is obtained from control tree N Coordinate.
Step 304 executes N test operations according to the screen coordinate pair N controls of N controls, and N test operations are used for Start other interfaces of N+1 applications or N applications.
Step 305 judges whether to need to start other application.If it is required, then N is added 1, if executing step 301. not It needs, thens follow the steps 306.
Step 306, the control tree N ' for obtaining the N+1 applications that N test operations start or other interfaces that N is applied.
Step 307 judges to whether there is check post in control tree N '.If it is present being successfully tested.If it does not, Then test crash.
The embodiment of the present invention additionally provides a kind of device of multi-process test, as shown in figure 4, described device 41 includes:
Acquiring unit 411, for obtaining the first control, first interface in the first interface according to the first control mark For the interface of the first process;
Test cell 412, first control for being obtained to the acquiring unit 411 carry out the first test operation, First test operation is for transferring the second process;
The acquiring unit 411 is additionally operable to, described second transferred in the test cell 412 according to the second control mark The second control is obtained in the second contact surface of process;
The test cell 412 is additionally operable to, and the second test is carried out to second control that the acquiring unit 411 obtains Operation, second test operation is for generating target interface;
Authentication unit 413, the check post in the target interface for being generated according to the test cell 412, which determines, to be surveyed Whether examination succeeds.
Further, the acquiring unit 411 is additionally operable to:
Obtain first control tree at the first interface;
It is searched first described in the first control set from first control tree according to the first control input by user mark Control set includes all the first controls being consistent with first control mark, and first control includes the seat of the first control Mark;
It instructs according to the user's choice and determines the first control from the first control set.
Further, the test cell 412 is additionally operable to:
If first control is text editing control, the input test character in first control;
If first control is button control, clicking operation is carried out to first control.
Further, the test cell 412 is additionally operable to:
The coordinate that first control is obtained from first control tree, by the first test statement in first control Input test character in the coordinate of part;
The coordinate that first control is obtained from first control tree, by the second test statement in first control Clicking operation is carried out in the coordinate of part.
Further, first control be identified as first control title or the affiliated class name of first control or The index of first control;
Second control is identified as the title or the affiliated class name of second control or described second of second control The index of control.
It is apparent to those skilled in the art that for convenience and simplicity of description, only with above-mentioned each function The division progress of module, can be as needed and by above-mentioned function distribution by different function moulds for example, in practical application Block is completed, i.e., the internal structure of device is divided into different function modules, to complete all or part of work(described above Energy.The specific work process of the system, apparatus, and unit of foregoing description can refer to corresponding in preceding method embodiment Journey, details are not described herein.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain Lid is within protection scope of the present invention.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. a kind of method of multi-process test, which is characterized in that the method includes:
The first control is obtained in the first interface according to the first control mark, first interface is the interface of the first process;
First test operation is carried out to first control, first test operation is for transferring the second process;
According to the second control mark the second control is obtained in the second contact surface of second process;
Second test operation is carried out to second control, second test operation is for generating target interface;
It is determined according to the check post in target interface and tests whether success,
Wherein, described the step of first control is obtained in the first interface according to the first control mark, including:
Obtain first control tree at the first interface;
The first control described in the first control set is searched from first control tree according to the first control input by user mark Set includes all the first controls being consistent with first control mark, and first control includes the coordinate of the first control;
It instructs according to the user's choice and determines the first control from the first control set.
2. the method for multi-process according to claim 1 test, which is characterized in that described to carry out the to first control The step of one test operation, including:
If first control is text editing control, the input test character in first control;
If first control is button control, clicking operation is carried out to first control.
3. the method for multi-process test according to claim 2, which is characterized in that described to be inputted in first control The step of testing character, including:
The coordinate that first control is obtained from first control tree, by the first test statement in first control Input test character in coordinate;
Described the step of clicking operation is carried out to first control, including:
The coordinate that first control is obtained from first control tree, by the second test statement in first control Clicking operation is carried out in coordinate.
4. the method for multi-process test according to any one of claim 1 to 3, which is characterized in that first control It is identified as the title of first control or the index of the affiliated class name of first control or first control;
Second control is identified as the title or the affiliated class name of second control or second control of second control Index.
5. a kind of device of multi-process test, which is characterized in that described device includes:
Acquiring unit, for obtaining the first control in the first interface according to the first control mark, first interface is first The interface of process;
Test cell, first control for being obtained to the acquiring unit carry out the first test operation, and described first surveys Examination operation is for transferring the second process;
The acquiring unit is additionally operable to, according to the second of second process that the second control mark is transferred in the test cell The second control is obtained in interface;
The test cell is additionally operable to, and the second test operation is carried out to second control that the acquiring unit obtains, described Second test operation is for generating target interface;
Authentication unit, the check post in the target interface for being generated according to the test cell, which determines, to be tested whether into Work(,
Wherein, the acquiring unit is additionally operable to:
Obtain first control tree at the first interface;
The first control described in the first control set is searched from first control tree according to the first control input by user mark Set includes all the first controls being consistent with first control mark, and first control includes the coordinate of the first control;
It instructs according to the user's choice and determines the first control from the first control set.
6. the device of multi-process test according to claim 5, which is characterized in that the test cell is additionally operable to:
If first control is text editing control, the input test character in first control;
If first control is button control, clicking operation is carried out to first control.
7. the device of multi-process test according to claim 6, which is characterized in that the test cell is additionally operable to:
The coordinate that first control is obtained from first control tree, by the first test statement in first control Input test character in coordinate;
The coordinate that first control is obtained from first control tree, by the second test statement in first control Clicking operation is carried out in coordinate.
8. the device of multi-process test according to any one of claims 5 to 7, which is characterized in that first control It is identified as the title of first control or the index of the affiliated class name of first control or first control;
Second control is identified as the title or the affiliated class name of second control or second control of second control Index.
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 CN104866413A (en) 2015-08-26
CN104866413B true 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)

Families Citing this family (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
CN106294152B (en) * 2016-08-09 2019-03-12 努比亚技术有限公司 Using the traversal test device and method of 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

Also Published As

Publication number Publication date
CN104866413A (en) 2015-08-26

Similar Documents

Publication Publication Date Title
CN104484273B (en) The method of testing of application program, equipment and system
CN106294152B (en) Using the traversal test device and method of user interface
US9720799B1 (en) Validating applications using object level hierarchy analysis
CN102110053B (en) Random testing method based on Android
CN104331373A (en) Monkey test system and method
CN105183630B (en) Applied program testing method and device
CN103312850A (en) Mobile phone automation testing system and work method
CN106649125A (en) Method and frame system for establishing multi-platform-supporting automatic testing script
CN108595343A (en) The test method and device of application program
CN107102949A (en) Application program off-line test method and instrument
CN104915228B (en) Application program language setting method and device
CN103970662A (en) Method and system for obtaining boundary value input through GUI software
CN104866413B (en) The method and device of multi-process test
CN107967207A (en) The test method and device of user interface interaction function
CN104123397A (en) Automatic test device and method for Web page
CN112149828B (en) Operator precision detection method and device based on deep learning framework
CN112985867B (en) Steering engine testing method, device, equipment and storage medium
CN107783867B (en) Gesture testing method and device, computer equipment and storage medium
CN104536880B (en) Gui program test case amplification method based on semiology analysis
CN107844427A (en) A kind of Test Case Prioritization method perceived based on test resource
CN107943635A (en) A kind of test method of storage device, device and medium
CN102541284B (en) A kind of method and system of carrying out combination through target quantity in character input
CN107577685A (en) A kind of knowledge point indication method and device
CN113190154B (en) Model training and entry classification methods, apparatuses, devices, storage medium and program
CN112883523B (en) Automobile bus topological graph display method, device and equipment

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