CN106021102B - The generation method and device of automatic test file - Google Patents
The generation method and device of automatic test file Download PDFInfo
- Publication number
- CN106021102B CN106021102B CN201610323689.0A CN201610323689A CN106021102B CN 106021102 B CN106021102 B CN 106021102B CN 201610323689 A CN201610323689 A CN 201610323689A CN 106021102 B CN106021102 B CN 106021102B
- Authority
- CN
- China
- Prior art keywords
- operation object
- type
- action type
- file
- attribute information
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses the generation method and device of a kind of automatic test file, cumbersome and low formation efficiency technical problem when being at least able to solve through traditional approach generation automatic test file.The generation method of the automatic test file includes: the attribute information for obtaining each operation object in user interface, and obtains the corresponding action type of each operation object;Preset test case file is written into the attribute information of each operation object and its corresponding action type by preset interface;Corresponding automatic test file is generated according to the test case file.
Description
Technical field
The present invention relates to network communication technology fields, and in particular to a kind of generation method and dress of automatic test file
It sets.
Background technique
In order to realize the automatic test effect of mobile terminal, pre-generated automatic test file is needed, operation is passed through
The automatic test file realizes the purpose tested automatically.
During generating automatic test file, need to obtain the control information of each control in user interface,
For example, it is desired to which the concrete operations for obtaining the specific location of control and executing for the control, are automatically brought into operation the control to reach
The purpose of part.In conventional manner, developer is needed to obtain the control information of control manually, and by way of being manually entered
The control information that will acquire is filled into the corresponding position of automatic test file.
It can be seen that in above process, needing developer to carry out a large amount of manual operation, especially in control information
It will certainly be taken a substantial amount of time link is manually entered when longer, cause the formation efficiency of automatic test file low.
Summary of the invention
In view of the above problems, it proposes on the present invention overcomes the above problem or at least be partially solved in order to provide one kind
State the generation method and device of the automatic test file of problem.
According to one aspect of the present invention, a kind of generation method of automatic test file is provided, comprising: obtain user
The attribute information of each operation object on interface, and obtain the corresponding action type of each operation object;It is connect by default
Preset test case file is written in the attribute information of each operation object and its corresponding action type by mouth;According to institute
It states test case file and generates corresponding automatic test file.
Optionally, the corresponding action type of each operation object that obtains specifically includes: being connect by action type input
Mouth receives corresponding action type, and obtains the type identification of the action type and execute the operation that the type operates and patrol
Volume;
Wherein, the action type includes one or more in the following contents: it is long by type, drag type, click class
Type double-clicks type and the action type for analog hardware button, wherein the hardware button include one of the following or
It is multiple: return key, Menu key, volume key and power key.
Optionally, the attribute information for obtaining each operation object in user interface specifically includes: obtaining the use
The interface screenshot at family interface obtains the attribute information of each operation object according to the interface screenshot;
Wherein, the attribute information includes one or more in the following contents: type, the operation object of operation object
The operation logic of program class belonging to mark, the text of operation object, operation object and positioning operation object.
Optionally, the operation logic of the positioning operation object includes: the operation object by prestoring in user circle
The operation logic that coordinate ratio on face is positioned;And/or by identifying that the characteristic of the operation object prestored is determined
The operation logic of position.
Optionally, the test case file is JAVA code file.
Another aspect according to the present invention provides a kind of generating means of automatic test file, comprising: first obtains
Module, suitable for obtaining the attribute information of each operation object in user interface;Second obtains module, is suitable for obtaining each operation
The corresponding action type of object;Writing module, suitable for by preset interface by the attribute information of each operation object and its
Preset test case file is written in corresponding action type;Generation module is suitable for according to test case file generation pair
The automatic test file answered.
Optionally, the second acquisition module is specifically used for: receiving corresponding operation class by action type input interface
Type, and obtain the type identification of the action type and execute the operation logic of the type operation;
Wherein, the action type includes one or more in the following contents: it is long by type, drag type, click class
Type double-clicks type and the action type for analog hardware button, wherein the hardware button include one of the following or
It is multiple: return key, Menu key, volume key and power key.
Optionally, the first acquisition module is specifically used for: the interface screenshot of the user interface is obtained, according to the boundary
Face screenshot obtains the attribute information of each operation object;
Wherein, the attribute information includes one or more in the following contents: type, the operation object of operation object
The operation logic of program class belonging to mark, the text of operation object, operation object and positioning operation object.
Optionally, the operation logic of the positioning operation object includes: the operation object by prestoring in user circle
The operation logic that coordinate ratio on face is positioned;And/or by identifying that the characteristic of the operation object prestored is determined
The operation logic of position.
Optionally, the test case file is JAVA code file.
In the generation method of automatic test file provided by the invention and device, it can obtain in user interface automatically
Each operation object attribute information and corresponding action type, and by preset interface by the attribute of each operation object
Information and its corresponding action type automatically write preset test case file.It can be seen that in embodiments of the present invention, one
Aspect can be got automatically by preset interface each operation object attribute information and its corresponding action type;It is another
The information that aspect can automatically will acquire under the premise of pre-defining test case file is filled into test case text
In part, to realize the effect for the formation speed for greatly improving automatic test file, the workload of developer is significantly reduced.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention,
And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can
It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field
Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention
Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows the flow chart of the generation method of automatic test file provided by one embodiment of the present invention;
Fig. 2 shows the flow charts of the generation method of the automatic test file of another embodiment of the present invention offer;
Fig. 3 shows the structure chart of the generating means of the automatic test file of another embodiment of the present invention offer.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
It is fully disclosed to those skilled in the art.
The embodiment of the invention provides the generation methods and device of a kind of automatic test file, are at least able to solve and pass through
Traditional approach generates technical problem cumbersome and low formation efficiency when automatic test file.
Fig. 1 shows the flow chart of the generation method of automatic test file provided by one embodiment of the present invention.Such as Fig. 1
It is shown, method includes the following steps:
Step S110: the attribute information of each operation object in user interface is obtained, and obtains each operation object
Corresponding action type.
Wherein, the attribute information of operation object includes one or more in the following contents: the type of operation object, operation
The mark of object, the text of operation object, program class and positioning operation object belonging to operation object operation logic.It is described
Action type includes one or more in the following contents: it is long by type, drag type, click type, double-click type and use
In the action type of analog hardware button, wherein the hardware button includes one of the following or multiple: return key, menu
Key, volume key and power key.
Step S120: the attribute information of each operation object and its corresponding action type are written in advance by preset interface
If test case file.
Wherein, the effect of preset interface be each operation object that will be got in step S110 attribute information and its
Corresponding action type is filled into test case file automatically.Wherein, test case file can be the text of user-defined format
Part.
Step S130: corresponding automatic test file is generated according to test case file.
Wherein, test case file and automatic test file can be same file, at this point, directly in test case
Certain modification operation is carried out on the basis of file can be obtained automatic test file.Alternatively, test case file and automatic
Change test file and be also possible to two different files, this is not limited by the present invention.Specifically, automatic test file can be with
It is various types of script files such as JAVA, is also possible to other various types of file packets.
It can be seen that in the present embodiment, on the one hand each operation object can be got automatically by preset interface
Attribute information and its corresponding action type;It on the other hand can be automatic under the premise of pre-defining test case file
The information that ground will acquire is filled into test case file, greatly improves the formation speed of automatic test file with realization
Effect significantly reduces the workload of developer.
Fig. 2 shows the processes of the generation method of the automatic test file of another specific embodiment offer of the invention
Figure.The present embodiment can realize based on a variety of automated test frames, for example, can based on Uiautomator and/or
Robotium test frame and Monkey Runner test frame etc., the present invention test environment without limitation to specific.
As shown in Fig. 2, method includes the following steps:
Step S210: the attribute information of each operation object in user interface is obtained.
Wherein, user interface refers to the interface of product to be tested, due to product to be tested generally comprise main interface with
And the multilayer interface linked by main interface, therefore, it is necessary to be directed to each of multiple user interfaces respectively to execute step
Operation in S210.Operation object in user interface mainly includes control, button, input frame etc..
When specific implementation, the interface screenshot of user interface can be obtained by modes such as dump, by clicking interface screenshot
On specific position obtain the attribute information of operation object in this position.For example, can be customized for obtaining user interface
On each operation object attribute information function logics, it is customized for inquiring the ginseng of every attribute information in the function
Number, to realize the automatic acquisition operation of attribute information.Alternatively, it is also possible to utilize the third based on Uiautomator test frame
Square tool UiautomatorViewer obtains the attribute information of above-mentioned each operation object automatically.
Specifically, the attribute information of the operation object got includes one or more in the following contents: operation object
Type, the mark of operation object, the text of operation object, program class and positioning operation object belonging to operation object behaviour
Make logic etc..Wherein, belonging to the type of operation object, the mark of operation object, the text of operation object and/or operation object
Program class can by directly by click control in a manner of obtained.In addition, the operation logic of positioning operation object can pass through
Preset function is realized, for finding corresponding operation object in the user interface and being positioned to the operation object, so as to
Realize the operation to the operation object.In the present embodiment, the behaviour of positioning operation object can be set by the following two kinds mode
Make logic:
In the first implementation, it is positioned by the coordinate ratio of the operation object that prestores on a user interface.
For example, it is assumed that establishing coordinate system by coordinate origin of the lower left corner of user interface, and set the upper right corner of complete user interface
Coordinate be (1,1), correspondingly, each position in user interface can be indicated by corresponding coordinate ratio, example
Such as, coordinate points are that the position of (1/3,2/3) is at the left side position on the upper side of entire user interface.It can benefit by this kind of mode
The position that operation object is determined with operation object coordinate ratio locating in entire user interface passes through merely with traditional
Specific coordinate value is higher compared to accuracy come the mode for determining position, is not influenced by screen resolution variation, and locating speed
Fastly.For example, cause the size of user interface to change even if the screen resolution size of terminal device is changed, but
Be, the relativeness between a certain operation object and entire user interface be it is fixed, therefore, can still be accurately located
The operation object.
In the second implementation, by identifying that the characteristic of the operation object prestored is positioned.Wherein, it prestores
Operation object characteristic for uniquely identifying corresponding operation object, specifically include: the exterior contour of operation object
Data and/or color data etc..For example, for by taking " set " button as an example, corresponding characteristic include the button shape,
Size, color, text and font etc..In short, the characteristic by the operation object prestored can be unique on a user interface
Ground identification and positioning operation object.When specific implementation, it can be realized in conjunction with related algorithms such as image recognitions.It can by this kind of mode
The position of operation object is searched and determined according to the resemblance of operation object, pass through specific coordinate value merely with traditional
The advantage not influenced by screen resolution variation is likewise supplied with to determine that the mode of position is compared.Moreover, working as the cloth of user interface
When office's variation (such as after product renewing), even if the position of operation object is changed, still can accurately it determine by this way
Bit manipulation object.
Step S220: the corresponding action type of each operation object is obtained.
Wherein, there is no strict sequences between step S220 and step S210.Wherein, action type is specifically wrapped
It includes: the type identification of action type and the operation logic for executing the type operation.It can be uniquely determined by type identification
Which kind of type it is specially, and the operation of the type can be realized automatically in the operation logic by executing the type operation, to reach
To the effect of automatic test.Wherein, the operation logic for executing the type operation can be realized by preset function.Except default letter
Number is outer, can also be realized by other kinds of program instruction or chip.
Wherein, action type specifically includes one or more in the following contents: it is long by type, drag type, click class
Type double-clicks type and the action type for analog hardware button etc., wherein hardware button includes one of the following or more
It is a: return key, Menu key, Home key, volume key and power key etc..For a certain operation object, for control, can pass through
Action type input interface inputs corresponding action type.Wherein, action type input interface can pass through combobox, input frame
Etc. being embodied in various ways, for example, when mouse is placed on a certain control, the corresponding combobox of automatic spring arranges in combobox
Go out the various action types that may be executed for the control, it is available accordingly to arrive the corresponding operation class of each operation object
Type.
Step S230: the attribute information of each operation object and its corresponding action type are written in advance by preset interface
If test case file.
Wherein, preset interface can be interface function predetermined etc., which can be all kinds of by linking up with, adjusting back etc.
Mechanism monitors to obtain the event of the attribute information of each operation object and its corresponding action type, and is monitoring such thing
Corresponding attribute information and action type are obtained automatically when part and are filled into preset test case file automatically.
For example, can realize above-mentioned function by following code segment:
Wherein, action type can be determined if receiving " click " parameter value to click, if receiving " drag "
Parameter value can then determine action type for dragging.Specifically, OPERATION_ARRAY is operation object in Uiautomator
The array of attribute-name can be obtained in equal test frames.OperType parameter is incoming action type, passes through the tool of the parameter
Body value can determine action type for click (" click "), dragging (" drag "), sliding or long-pressing etc..OperObjs parameter
The filter attribute or coordinate ratio of operation object can then be uniquely determined, therefore, by the parameter can to operation object into
Row positioning.In short, attribute information and the operation of the operation object that can automatically will acquire by above-mentioned function code section
The information such as type are filled into the corresponding position of test case file, and specifically, the relevant information of each operation object is filled
The specific format definition of test case file is then depended on to the where position of use-case test file.
Wherein, test case file is that the file of user-defined format has pre-defined testing process frame in this document
Frame, and the attribute information of padding object and its interface of corresponding action type have been reserved, it can by reserved interface
Realize the attribute information of operation object and its automatic filling of corresponding action type.In addition, the test case file can lead to
It crosses each speech like sound such as JAVA, VC, VB and realizes that the present embodiment is illustrated by taking JAVA as an example, but the present invention does not limit specifically
Language form.
Step S240: corresponding automatic test file is generated according to above-mentioned test case file.
Wherein, test case file and automatic test file can be same file, it may be assumed that by test case text
Part modifies to obtain automatic test file.Alternatively, test case file and automatic test file are also possible to two phases
Mutual independent file, for example, can be packaged to associated documents such as test case files, to generate jar packet (i.e. executable text
Part packet) form automatic test file, can be realized by the way that the jar packet is transferred to terminal device and terminal device surveyed automatically
The function of examination.It can be realized by various strapping tools (such as ant tool) when specific packing.
It optionally, further comprise following step S250 after step S240.
Step S250: above-mentioned automatic test file is sent to terminal device to be tested, for the terminal device
Test is executed according to the automatic test file.
Wherein, terminal device is usually mobile terminal, for example, it may be possible to be plurality of mobile phones.Under normal conditions, above-mentioned S210
It can be realized to S240 by the end PC, correspondingly, the channel radios such as the wired communication modes such as data line or wifi, bluetooth can be passed through
Automatic test file is sent to mobile terminal to be tested by letter mode, alternatively, can also be entered on port transmission by ADB order
The automatic test file stated, this is not limited by the present invention.
It, can be complete according to above-mentioned automatic test file after mobile terminal receives above-mentioned automatic test file
At test function.It specifically, in embodiments of the present invention, can include complete testing process in automatic test file,
Including each testing procedure and its corresponding implementation.In this way, when automatic test file is transferred to movement eventually
Behind end, the connection with server side can be disconnected, the automatic test file that need to only run mobile terminal side can be realized entirely
Testing process, this kind of mode is not necessarily to during the test and Server-side communities, can effectively avoid due to communication link shakiness
Reasons brings such as fixed (such as wireless signal are unstable) tests disruption.
Alternatively, it is also possible to which the behaviour of various types operation is only identified and executed comprising action type in automatic test file
Make logic, and/or, multiple operated object marks and the operation logic for positioning each operation object.On this basis, according to subsequent
Each operation logic is completed in the test instruction received, to realize complete test process.That is, automatic test file
In only define basic action type and operation object, but be not defined specific operating procedure.For example, automating
Comprising the operation logic that " double-click " operation is corresponding in test file, double-click behaviour can be realized automatically when operation logic operation
Make, still, which can't execute " double click operation " automatically, only receive double click operation to be executed
When test instruction, just double click procedure can be realized according to corresponding operation logic.Correspondingly, include tool in each test instruction
The action type (as double-clicked) of body and/or specific operation object (such as control title).In this way, by operation logic and
Specific operating procedure separation, therefore, when a certain step when the error occurs, it is not necessary to modify automatic test files, need to only connect again
The corresponding test instruction of the step is received and executed, can accomplish the effect of single step error single-step debug, tune can be greatly simplified
Examination process.
Fig. 3 show another embodiment of the present invention provides a kind of automatic test file generating means structural representation
Figure, as shown in figure 3, the device includes: that the first acquisition module 31, second obtains module 32, writing module 33 and generation module 34.
Wherein, first the attribute information that module 31 is suitable for obtaining each operation object in user interface is obtained.Specifically,
First acquisition module obtains the interface screenshot of the user interface, and the attribute of each operation object is obtained according to the interface screenshot
Information.Wherein, the attribute information includes one or more in the following contents: the mark of the type of operation object, operation object
The operation logic of program class belonging to knowledge, the text of operation object, operation object and positioning operation object.
Wherein, the operation logic of positioning operation object include: by the operation object that prestores on a user interface
The operation logic that coordinate ratio is positioned;And/or the behaviour positioned by identifying the characteristic of the operation object prestored
Make logic.
Second, which obtains module 32, is suitable for obtaining the corresponding action type of each operation object.Specifically, it described second obtains
Module 32 is specifically used for: receiving corresponding action type by action type input interface, and obtains the class of the action type
Type mark and the operation logic for executing the type operation.Wherein, the action type includes one or more in the following contents
: it is long by type, drag type, click type, double-click type and the action type for analog hardware button, wherein institute
It includes one of the following or multiple for stating hardware button: return key, Menu key, volume key and power key.
Writing module 33 is suitable for passing through preset interface for the attribute information of each operation object and its corresponding operation
Preset test case file is written in type.
Generation module 34 is suitable for generating corresponding automatic test file according to the test case file.
Wherein, above-mentioned test case file can be JAVA code file, be also possible to other kinds of code file.
Above-mentioned automatic test file can be jar packet, be also possible to other kinds of test bag.
It can refer to the description of corresponding portion in embodiment of the method about the specific structure and working principle of above-mentioned modules,
Details are not described herein again.
In the generation method of automatic test file provided by the invention and device, it can obtain in user interface automatically
Each operation object attribute information and corresponding action type, and by preset interface by the attribute of each operation object
Information and its corresponding action type automatically write preset test case file.It can be seen that in embodiments of the present invention, one
Aspect can be got automatically by preset interface each operation object attribute information and its corresponding action type;It is another
The information that aspect can automatically will acquire under the premise of pre-defining test case file is filled into test case text
In part, to realize the effect for the formation speed for greatly improving automatic test file, the workload of developer is significantly reduced.
Algorithm and display are not inherently related to any particular computer, virtual system, or other device provided herein.
Various general-purpose systems can also be used together with teachings based herein.As described above, it constructs required by this kind of system
Structure be obvious.In addition, the present invention is also not directed to any particular programming language.It should be understood that can use various
Programming language realizes summary of the invention described herein, and the description done above to language-specific is to disclose this hair
Bright preferred forms.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that implementation of the invention
Example can be practiced without these specific details.In some instances, well known method, structure is not been shown in detail
And technology, so as not to obscure the understanding of this specification.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of the various inventive aspects,
Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes
In example, figure or descriptions thereof.However, the disclosed method should not be interpreted as reflecting the following intention: i.e. required to protect
Shield the present invention claims features more more than feature expressly recited in each claim.More precisely, as following
Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore,
Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, wherein each claim itself
All as a separate embodiment of the present invention.
Those skilled in the art will understand that can be carried out adaptively to the module in the equipment in embodiment
Change and they are arranged in one or more devices different from this embodiment.It can be the module or list in embodiment
Member or component are combined into a module or unit or component, and furthermore they can be divided into multiple submodule or subelement or
Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it can use any
Combination is to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so disclosed
All process or units of what method or apparatus are combined.Unless expressly stated otherwise, this specification is (including adjoint power
Benefit require, abstract and attached drawing) disclosed in each feature can carry out generation with an alternative feature that provides the same, equivalent, or similar purpose
It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments in this include institute in other embodiments
Including certain features rather than other feature, but the combination of the feature of different embodiment means in the scope of the present invention
Within and form different embodiments.For example, in the following claims, embodiment claimed it is any it
One can in any combination mode come using.
Various component embodiments of the invention can be implemented in hardware, or to run on one or more processors
Software module realize, or be implemented in a combination thereof.It will be understood by those of skill in the art that can be used in practice
Microprocessor or digital signal processor (DSP) realize some or all portions in device according to an embodiment of the present invention
The some or all functions of part.The present invention is also implemented as a part or complete for executing method as described herein
The device or device program (for example, computer program and computer program product) in portion.It is such to realize program of the invention
It can store on a computer-readable medium, or may be in the form of one or more signals.Such signal can be with
It downloads from internet website, is perhaps provided on the carrier signal or is provided in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and ability
Field technique personnel can be designed alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference symbol between parentheses should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not
Element or step listed in the claims.Word "a" or "an" located in front of the element does not exclude the presence of multiple such
Element.The present invention can be by means of including the hardware of several different elements and being come by means of properly programmed computer real
It is existing.In the unit claims listing several devices, several in these devices can be through the same hardware branch
To embody.The use of word first, second, and third does not indicate any sequence.These words can be explained and be run after fame
Claim.
Claims (10)
1. a kind of generation method of automatic test file, comprising:
Obtain the attribute information of each operation object in user interface;Wherein, the interface screenshot of the user interface, root are obtained
The attribute information of each operation object is obtained according to the interface screenshot, and the attribute information includes the operation of positioning operation object
Logic;The operation logic of the positioning operation object includes the characteristic of the operation object prestored by image recognition algorithm identification
Characteristic according to the operation logic positioned, and the operation object prestored includes the exterior contour data of operation object
And color data;And obtain the corresponding action type of each operation object;
Preset test is written into the attribute information of each operation object and its corresponding action type by preset interface
Use-case file;
Corresponding automatic test file is generated according to the test case file;Wherein, it is wrapped in the automatic test file
The operation logic and multiple operated object marks and position each operation pair that various types operate are identified and executed containing action type
The operation logic of elephant, to complete each operation logic according to the test instruction received, to realize test process;Wherein, institute
Stating preset interface is interface function, for obtaining the attribute information of each operation object by hook and/or callback mechanism monitoring
And its event of corresponding action type, and obtain corresponding attribute information and action type when monitoring the event and fill
Into the preset test case file;Wherein, the test case file is used to pre-define testing process frame, and pre-
Stay the attribute information of padding object and its interface of corresponding action type.
2. according to the method described in claim 1, wherein, the corresponding action type of each operation object that obtains specifically is wrapped
It includes: corresponding action type being received by action type input interface, and obtains the type identification of the action type and holds
The operation logic of row the type operation;
Wherein, the action type includes one or more in the following contents: it is long by type, drag type, click type, is double
Hit type and the action type for analog hardware button, wherein the hardware button includes one of the following or multiple:
Return key, Menu key, volume key and power key.
3. according to the method described in claim 1, wherein, the attribute information includes one or more in the following contents: behaviour
Make the type of object, the mark of operation object, program class belonging to the text of operation object and operation object.
4. according to the method described in claim 3, wherein, the operation logic of the positioning operation object includes: by prestoring
The operation logic that the coordinate ratio of the operation object on a user interface is positioned.
5. according to the method described in claim 1, wherein, the test case file is JAVA code file.
6. a kind of generating means of automatic test file, comprising:
First obtains module, suitable for obtaining the attribute information of each operation object in user interface;Wherein, the user is obtained
The interface screenshot at interface obtains the attribute information of each operation object according to the interface screenshot, and the attribute information includes
The operation logic of positioning operation object;The operation logic of the positioning operation object includes being prestored by image recognition algorithm identification
Operation object the operation logic that is positioned of characteristic, and the characteristic of the operation object prestored includes operation
The exterior contour data and color data of object;
Second obtains module, is suitable for obtaining the corresponding action type of each operation object;
Writing module, suitable for being write the attribute information of each operation object and its corresponding action type by preset interface
Enter preset test case file;
Generation module is suitable for generating corresponding automatic test file according to the test case file;Wherein, the automation
It include the operation logic and multiple operated object marks and determine that action type identified and executed that various types operate in test file
The operation logic of each operation object in position, to complete each operation logic according to the test instruction received, to realize test
Process;
Wherein, the preset interface is interface function, for obtaining each operation object by hook and/or callback mechanism monitoring
Attribute information and its corresponding action type event, and corresponding attribute information and operation are obtained when monitoring the event
Type is simultaneously filled into the preset test case file;Wherein, the test case file is for pre-defined test stream
Journey frame, and the interface of the attribute information of reserved padding object and its corresponding action type.
7. device according to claim 6, wherein the second acquisition module is specifically used for: being inputted by action type
The corresponding action type of interface, and obtain the type identification of the action type and execute the operation that the type operates and patrol
Volume;
Wherein, the action type includes one or more in the following contents: it is long by type, drag type, click type, is double
Hit type and the action type for analog hardware button, wherein the hardware button includes one of the following or multiple:
Return key, Menu key, volume key and power key.
8. device according to claim 6, wherein the attribute information includes one or more in the following contents: behaviour
Make the type of object, the mark of operation object, program class belonging to the text of operation object and operation object.
9. device according to claim 8, wherein the operation logic of the positioning operation object includes: by prestoring
The operation logic that the coordinate ratio of the operation object on a user interface is positioned.
10. device according to claim 6, wherein the test case file is JAVA code file.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610323689.0A CN106021102B (en) | 2016-05-16 | 2016-05-16 | The generation method and device of automatic test file |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610323689.0A CN106021102B (en) | 2016-05-16 | 2016-05-16 | The generation method and device of automatic test file |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106021102A CN106021102A (en) | 2016-10-12 |
CN106021102B true CN106021102B (en) | 2019-05-28 |
Family
ID=57097515
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610323689.0A Active CN106021102B (en) | 2016-05-16 | 2016-05-16 | The generation method and device of automatic test file |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106021102B (en) |
Families Citing this family (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106649103B (en) * | 2016-11-25 | 2019-04-16 | 深圳大学 | A kind of method and system of Android application program Automated Black Box Testing |
CN106874190B (en) * | 2016-12-30 | 2018-03-16 | 上海壹账通金融科技有限公司 | The method of testing and server of user interface |
CN107423209B (en) * | 2017-03-08 | 2020-06-19 | 北京数码大方科技股份有限公司 | Software testing method and device |
CN107343040A (en) * | 2017-06-30 | 2017-11-10 | 百度在线网络技术(北京)有限公司 | Analogy method, device, terminal and the computer-readable recording medium of physical operation device |
CN107391383B (en) * | 2017-08-11 | 2021-01-12 | 上海巍擎信息技术有限责任公司 | Test method and test system for application program interface |
CN107577607B (en) * | 2017-09-07 | 2020-07-21 | 携程旅游信息技术(上海)有限公司 | User interface automatic testing method and device, electronic equipment and storage medium |
CN107908559B (en) * | 2017-11-15 | 2021-05-07 | 中国农业银行股份有限公司 | Test case design method and device |
CN110287111A (en) * | 2019-06-21 | 2019-09-27 | 深圳前海微众银行股份有限公司 | A kind of method for generating test case and device of user interface |
CN112416744A (en) * | 2020-01-21 | 2021-02-26 | 上海哔哩哔哩科技有限公司 | Test control system, method and equipment |
CN111552634A (en) * | 2020-03-30 | 2020-08-18 | 深圳壹账通智能科技有限公司 | Method and device for testing front-end system and storage medium |
CN111736564B (en) * | 2020-08-20 | 2020-12-11 | 杭州百子尖科技股份有限公司 | Halcon-based chemical OTS simulation DCS flow chart manufacturing method |
CN112256595B (en) * | 2020-12-22 | 2021-03-12 | 成都新希望金融信息有限公司 | Heterogeneous system testing method and device and electronic equipment |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101237662A (en) * | 2008-02-29 | 2008-08-06 | 深圳华为通信技术有限公司 | Method and device for generating automatic test cases of mobile phone |
CN102135936A (en) * | 2010-12-31 | 2011-07-27 | 华为技术有限公司 | Method and system for generating test case |
CN104239044A (en) * | 2014-09-05 | 2014-12-24 | 北京航天自动控制研究所 | Dynamic generation method for graphical user interface |
CN104484269A (en) * | 2014-11-27 | 2015-04-01 | 北京广利核系统工程有限公司 | Method for automatically generating testing script |
CN104699608A (en) * | 2015-03-10 | 2015-06-10 | 于秀山 | Automatic test method and device for graphic user interface software |
CN105095088A (en) * | 2015-09-02 | 2015-11-25 | 厦门美图移动科技有限公司 | Calculator automatic test method and test system based on uiautomator test framework |
CN105487966A (en) * | 2014-09-17 | 2016-04-13 | 腾讯科技(深圳)有限公司 | Program testing method, device and system |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102831052B (en) * | 2011-06-16 | 2016-03-09 | 中国银联股份有限公司 | Test exemple automation generating apparatus and method |
CN103365643B (en) * | 2012-03-30 | 2017-07-21 | Ge医疗系统环球技术有限公司 | A kind of method and device for the test script for automatically generating graphic user interface |
CN104536889A (en) * | 2014-12-26 | 2015-04-22 | 北京奇虎科技有限公司 | Method and system for testing user interface, use case management platform and operating terminal |
CN104980552B (en) * | 2015-06-18 | 2019-01-04 | 惠州Tcl移动通信有限公司 | Realize the method and system of Android mobile terminal automatic test |
CN105354138A (en) * | 2015-10-12 | 2016-02-24 | 上海斐讯数据通信技术有限公司 | Method for determining specific control attribute of mobile phone page |
-
2016
- 2016-05-16 CN CN201610323689.0A patent/CN106021102B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101237662A (en) * | 2008-02-29 | 2008-08-06 | 深圳华为通信技术有限公司 | Method and device for generating automatic test cases of mobile phone |
CN102135936A (en) * | 2010-12-31 | 2011-07-27 | 华为技术有限公司 | Method and system for generating test case |
CN104239044A (en) * | 2014-09-05 | 2014-12-24 | 北京航天自动控制研究所 | Dynamic generation method for graphical user interface |
CN105487966A (en) * | 2014-09-17 | 2016-04-13 | 腾讯科技(深圳)有限公司 | Program testing method, device and system |
CN104484269A (en) * | 2014-11-27 | 2015-04-01 | 北京广利核系统工程有限公司 | Method for automatically generating testing script |
CN104699608A (en) * | 2015-03-10 | 2015-06-10 | 于秀山 | Automatic test method and device for graphic user interface software |
CN105095088A (en) * | 2015-09-02 | 2015-11-25 | 厦门美图移动科技有限公司 | Calculator automatic test method and test system based on uiautomator test framework |
Also Published As
Publication number | Publication date |
---|---|
CN106021102A (en) | 2016-10-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106021102B (en) | The generation method and device of automatic test file | |
CN107451663B (en) | Algorithm componentization, modeling method and device based on algorithm components and electronic equipment | |
CN102402481B (en) | The fuzz testing of asynchronous routine code | |
CN112270149B (en) | Verification platform automatic integration method and system, electronic equipment and storage medium | |
US7266809B2 (en) | Software debugger and software development support system for microcomputer operable to execute conditional execution instruction | |
CN104267947B (en) | A kind of editor's method of pop-up picture and pop-up picture editor's device | |
CN106021101B (en) | The method and device that mobile terminal is tested | |
CN105094783B (en) | method and device for testing stability of android application | |
US9189377B1 (en) | Automation testing using descriptive maps | |
US8407661B2 (en) | Method and system for creating HMI applications for an automation process | |
CN107203473A (en) | The automatization test system and method for automatic expansion interface test case | |
US7881440B2 (en) | Method for automatic graphical profiling of a system | |
CN105260315A (en) | Method for debugging log in embedded system process | |
KR101637371B1 (en) | System for testing an application use for a smart device and method therefor | |
CN110941467A (en) | Data processing method, device and system | |
CN103744787A (en) | Cellphone automated testing method | |
CN108228288A (en) | A kind of component system and its call method and device | |
CN103970659A (en) | Android application software automation testing method based on pile pitching technology | |
CN110399299A (en) | The execution method of automated test frame and test case | |
US20150339127A1 (en) | Configuration Change Tracking for Measurement Devices | |
CN109902251A (en) | Scheme Choice method, apparatus, terminal and readable storage medium storing program for executing based on decision tree | |
CN108475267A (en) | System and method for executable content and executable content stream distribution | |
US10102110B1 (en) | Simulation process for interface behavior | |
CN111580789B (en) | Function block frame generation | |
CN115686621B (en) | Rule engine rule script generation method and device |
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 | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220715 Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015 Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd. Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park) Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd. Patentee before: Qizhi software (Beijing) Co.,Ltd. |