Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.
It is appreciated that term " first " used in this application, " second " etc. can be used to describe various elements herein,
But these elements should not be limited by these terms.These terms are only used for distinguishing first element and another element.Citing comes
Say, in the case where not departing from scope of the present application, first gesture test script can be referred to as to second gesture test script, and
Similarly, second gesture test script can be referred to as to second gesture test script.
Fig. 1 is the implementation environment figure of the gesture method of testing provided in one embodiment, as shown in figure 1, in the implementation ring
In border, including computer equipment 110 and terminal 120.
Computer equipment 110 is that computer equipment, the computer such as test equipment, the computer that for example, tester uses are set
Automated test tool is installed on standby 110, such as can be Appium.Progress gesture test in need is installed in terminal 120
Tested application, when need test when, tester can send gesture test request in computer equipment 110, the gesture survey
Gesture mark is carried in examination request, computer equipment 110 receives the gesture test request, is identified according to gesture and obtains computer
Gesture test script corresponding with gesture mark in equipment 110.Then gesture test pin is performed using automated test tool
This, tests the tested application in terminal 120, and obtain gesture test result corresponding to gesture test script.
It should be noted that terminal 120 and computer equipment 110 can be smart mobile phone, tablet personal computer, notebook electricity
Brain, desktop computer etc., but be not limited thereto.Computer equipment 110 and terminal 120 can pass through bluetooth, USB
(Universal Serial Bus, USB) or other communication connected modes are attached, and the present invention is herein not
It is limited.
Fig. 2 is the internal structure schematic diagram of one embodiment Computer equipment.As shown in Fig. 2 the computer equipment bag
Include processor, non-volatile memory medium, memory and the network interface connected by system bus.Wherein, the computer is set
Standby non-volatile memory medium is stored with operating system, database and computer-readable instruction, and control can be stored with database
Part information sequence, when the computer-readable instruction is executed by processor, it may be such that processor realizes a kind of gesture method of testing.Should
The processor of computer equipment is used to provide calculating and control ability, supports the operation of whole computer equipment.The computer is set
Computer-readable instruction can be stored with standby memory, when the computer-readable instruction is executed by processor, may be such that processing
Device performs a kind of gesture method of testing.The network interface of the computer equipment is used for and terminal connection communication.People in the art
Member is appreciated that the block diagram of the structure, the only part-structure related to application scheme that are shown in Fig. 2, composition pair
The restriction for the computer equipment that application scheme is applied thereon, specific computer equipment can include than shown in figure more
More or less parts, either combine some parts or arranged with different parts.
As shown in figure 3, in one embodiment it is proposed that a kind of gesture method of testing, the gesture method of testing can answer
For in above-mentioned computer equipment 110, specifically may comprise steps of:
Step 302, gesture test request is received, gesture test request carries gesture mark;
In the present embodiment, gesture is identified for identifying gesture, can be made up of characters such as word, numerals, can also
It is the mark that other can identify gesture.
In certain embodiments, gesture mark can be one or be multiple.When gesture is identified as it is multiple when, obtaining
While gesture identifies, the execution sequence of gesture test script corresponding to gesture mark can also be obtained.For example, tester exists
When inputting first gesture mark and second gesture mark, the execution sequence of gesture test scripts corresponding to them can be inputted.
The execution that computer equipment 110 obtains first gesture mark, second gesture mark and gesture test script corresponding to them is suitable
Sequence.
Step 304, identified according to gesture and obtain gesture test script, gesture test script is the control according to input gesture
Information sequence and gesture test script generate template generation;
In embodiments of the present invention, gesture test script corresponding to input gesture can be generated in advance and is stored, and work as acquisition
When being identified to gesture, the gesture test script according to corresponding to directly obtaining gesture mark.Can also get gesture mark when,
The control information sequence according to corresponding to obtaining gesture mark, template is generated further according to control information sequence and gesture test script
Generate gesture test script.
Gesture test script generation template is that the testing procedure performed when being tested according to gesture is write in advance, by gesture
Path decomposing is multiple controls (initial control, N number of intermediate control (N=0,1,2 ...) terminate control) for being sequentially connected and adjacent
Line between control.Therefore gesture test can be analyzed to following testing procedure:First clicked on for initial control
Testing procedure, and since the initial control, enter one or more tests of line slip between each adjacent control successively
Step.Therefore in gesture test, performed action and order are fixed in testing procedure, and the control that simply gesture is passed through is not
Together.Therefore, gesture test script generation template can be generated according to the gesture testing procedure of decomposition.When the control for getting gesture
During information sequence, it is input in gesture test script generation template, can be to generate gesture test script.
The mark for the control that control information is passed through for mark gesture, corresponding control can be found according to control information,
Control information for example can be the Xpath paths of control.Control information sequence is generated according to input gesture, and user can gather around
There is the gesture for being inputted in the equipment of touch-screen and wanting test, computer equipment 110 obtains by obtaining the control that input gesture is passed through
The order of the control of control information and process is taken, generates control information sequence.For example, all control informations that gesture will be inputted
Form an array.
In certain embodiments, gesture test script generation template can utilize the compiled code of script
Template, sets the variable of filling in need in the Code Template, and variable is the control information of gesture.Certainly, gesture test pin
This generation template can also be the format module of other prefabricated forms, such as tabular template, in the tabular template-setup
First testing procedure is clicks on, and to slide, tabular template is additionally provided with each step and corresponds to control second testing procedure
The filling position of information.When getting the control information sequence of input gesture, gesture test script generation template is input to
In, it is possible to script generation gesture test script is utilized according to the compiling code preset.Wherein, an exemplary table
The user interface for template of formatting can be as shown in table 1, and control information row therein are the filling position of control information, work as acquisition
During to control information sequence, control information is filled in order.
Table 1:
Step |
Control type |
Lookup mode |
Control information |
Type of action |
1 |
Native |
Xpath |
|
Click |
2 |
Native |
Xpath |
|
Move |
3 |
Native |
Xpath |
|
Move |
4 |
Native |
Xpath |
|
Move |
In certain embodiments, when gesture is identified as it is multiple when, with gesture mark include first gesture identify and second
Exemplified by gesture mark, then the step of obtaining gesture test script is identified according to gesture and specifically included:Obtained according to first gesture mark
First gesture test script is taken, and, identified according to second gesture and obtain second gesture test script;
For example, can be while acquisition first gesture test script be identified according to first gesture, according to second gesture mark
Know and obtain second gesture test script.Second gesture test script can certainly first be obtained and obtain first gesture test pin again
This.Acquisition order of the embodiment of the present invention to second gesture test script and first gesture test script is not limited.
Step 306, gesture test is carried out to tested application according to gesture test script;
After gesture test script is got, according to the action command sequence analysis of gesture test script into action command,
Action command is sent in tested application, carries out gesture test, so that tested application performs corresponding behaviour according to action command
Make, simulate the track of the input gesture.
Gesture test script includes action command sequence, when performing the gesture test script, can be answered tested
With the motion track of simulation input gesture, the starting control that action command sequence includes to gesture successively calls click event letter
The tests instruction that number is operated, and the survey for calling between the adjacent control of gesture slip event function to be operated successively
Examination instruction.In test instructs, it can be identified with control and represent control, control mark can be control information, naturally it is also possible to be
For identifying other marks of control information, as long as control information can be got according to control mark.
For example, the starting control of gesture is A, intermediate control is followed successively by B, C, terminal control is D, then control location information sequence
It is classified as control A, B, C and D control information and is ranked up the sequence of composition by the order of these controls according to gesture
Row.Test instruction and its execution sequence are followed successively by call for starting control A and click on event functions and operated, from control A
Call slip event function to be operated to control B, call slip event function to be operated, from control from control B to control C
C to control D calls slip event function to be operated.
Step 308, gesture test result corresponding to gesture test script is obtained.
After the completion of gesture test, gesture test result corresponding to the gesture test script is obtained, with to tested application
Test result is analyzed or assessed.
Fig. 4 is shown in one embodiment, when gesture test script includes first gesture test script and second-hand
Gesture test script, when first gesture test script and second gesture test script are performed in a test assignment, step
S306 is implementation process figure the step of carrying out gesture test to tested application according to gesture test script, can specifically include with
Lower step:
S402, first gesture test script is called to carry out gesture test to tested application;
The first gesture test script of calling can be one randomly selected in multiple gesture test scripts.In some realities
Apply in example, when user have input the execution sequence of gesture test script, call the gesture test script that execution sequence is first
As first gesture test script.
S404, after the completion of the test of first gesture test script, initialization directive is sent to tested application, so that tested should
With being initialized;
Initialization directive, which refers to, can revert to tested application the instruction that can re-start gesture test mode.For example,
When unblock gesture password to wechat is tested, initialization command is sent, wechat is re-started startup, unlocked into input
The state of gesture password.
S406, when reaching the wait initialization time of tested application, second gesture test script is called to tested application
Carry out gesture test.
Wait a period of time that initialization time refers to start at from transmission initialization directive.For default a period of time.When
When tested application is different, the wait initialization time for being tested application can be different, when specifically can be according to the startup of tested application
Between set.
If it is appreciated that when also including the 3rd gesture test script in gesture test assignment, when second gesture test script
After the completion of test, initialization directive can be sent to tested application again, and when waiting initialization time to reach, call the 3rd hand
Gesture test script is tested.If also including the 4th gesture test script, the 5th gesture test script, can continue to repeat to work as
After the completion of preceding test script test, initialization directive is sent, next gesture test script is called when waiting initialization time to reach
The step of carrying out gesture test.
Fig. 5 shows in one embodiment that step S308 is to obtain gesture test result corresponding to gesture test script
The implementation process figure of step, specifically may comprise steps of:
S502, detect in tested application default homepage keyword whether occur, if so, determining that gesture test result is hand
Gesture unlocks successfully, if it is not, determining that gesture test result is gesture unblock failure;
It can inquire about in tested application and the homepage keyword relevant with homepage, such as " homepage " one word whether occur.Certainly,
Other homepage keywords can also be pre-set according to the characteristics of tested application homepage.Detection time can be set according to being actually needed
It is fixed.When testing result for when there is homepage keyword, then it represents that tested application enters the startup page, and current gesture tests pin
Gesture corresponding to this is consistent with default gesture unlocking pin, and implementing result is that gesture unlocks successfully;Otherwise, implementing result is hand
Gesture unblock failure.
In certain embodiments, can be detected in a manner of poll.Preferably, can be after gesture test starts
Poll is proceeded by after preset time again, to reduce the number of poll.The preset time can be according to actual set.
S504, obtain gesture test result corresponding to gesture test script.
When it is determined that after gesture test result, computer equipment obtains the gesture test result, to enter to gesture test result
Row analysis or evaluation.
Fig. 6 shows the implementation process figure of gesture method of testing in one embodiment, specifically may comprise steps of:
S602, obtain the control information of input gesture;
In embodiments of the present invention, user can input the input hand for wanting test on the touch terminal with touch-screen
Gesture.The touch terminal can be computer equipment 110, or other touch terminals.Preferably, gesture is in tested application
Upper input.When being inputted in other touch terminals, computer is communicatively coupled with touch terminal, obtains input gesture
Control information.The mark for the control that control information is passed through for mark gesture, control according to corresponding to control information can find it
Part, such as can be the Xpath paths of control.
S604, control information sequence is sequentially generated by control according to control information and input gesture;
In embodiments of the present invention, get input gesture by each control control information after, according to input hand
Gesture is sequentially generated control information sequence by control.
By taking Fig. 7 as an example, gesture of the user on mobile phone slides into You little Jiao control for the control from the upper left corner, by seven
Individual control, it is assumed that this seven control informations be followed successively by Xpath1, Xpath2, Xpath3, Xpath4, Xpath5, Xpath6,
Xpath7, then this seven control informations can be formed an arrays, be sequentially followed successively by Xpath1, Xpath2, Xpath3,
Xpath4、Xpath5、Xpath6、Xpath7。
S606, template generation gesture test script is generated according to control information sequence and gesture test script.
In embodiments of the present invention, control information sequence inputting to default gesture test script is generated in template, it is raw
Into gesture test script.Gesture test script includes action command sequence, with when performing the gesture test script, Ke Yi
The motion track of the upper simulation input gesture of tested application.The starting control that action command sequence is included to gesture successively, which calls, to be clicked on
The test instruction that event functions are operated, and call slip event function to be grasped successively between the adjacent control of gesture
The test instruction of work.In test instructs, the Xpath path representation controls of control can be used, naturally it is also possible to be for identifying
Other control informations of control, as long as the control according to corresponding to being got the control information.
Gesture test script generation template is that the testing procedure performed when being tested according to gesture is write in advance, by gesture point
Solve to be sequentially connected multiple controls (initial control, N number of intermediate control (N=0,1,2 ...), terminate control) and adjacent control it
Between line.Therefore gesture can be tested and is decomposed into following testing procedure:First survey clicked on for initial control
Try is rapid, and since the initial control, enters one or more test steps of line slip successively between each adjacent control
Suddenly.Therefore in gesture test, performed action and order in testing procedure are fixed, and the control that simply gesture is passed through is not
Together.Therefore, gesture test script generation template can be generated according to the gesture testing procedure of decomposition.When the control for getting gesture
During information sequence, it is input in gesture test script generation template, can be to generate gesture test script.
In certain embodiments, gesture test script generation template can utilize the compiled code of script
Template, sets the variable of filling in need in the Code Template, and variable is the control information of gesture.Certainly, gesture is tested
Script generates the format module that template can also be other prefabricated forms, such as tabular template, in the tabular template-setup
To click on, second testing procedure is additionally provided with each step and corresponds to filling out for control information first testing procedure to slide
Fill position.When getting the control information sequence of input gesture, it is input in gesture test script generation template, it is possible to
Script generation gesture test script is utilized according to the compiling code preset.
For example, again exemplified by inputting gesture as Fig. 7 gesture, the action command sequence in test script includes being directed to successively
The control in the upper left corner calls click event functions to be operated, the control in the upper left corner slides thing to calling between second control
Part function is operated, calls slip event function to be operated, at the 3rd between the 3rd control in second control
Control is operated to calling slip event function between the 4th control, called in the 4th control between the 5th control
Slip event function operated, the 5th control to call slip event function to be operated between the 6th control,
6th control calls slip event function to be operated between the 7th control (i.e. the control in the lower right corner).
Step 608, gesture test request is received, gesture test request carries the gesture mark of input gesture;
In the present embodiment, gesture is identified for identifying gesture, can be made up of characters such as word, numerals, can also
It is the mark that other can identify gesture.
Step 610, the gesture test script for obtaining input gesture is identified according to gesture;
Step 612, gesture test is carried out to tested application according to gesture test script;
After gesture test script is got, the testing procedure in gesture test script is parsed, the testing procedure is sent
Gesture test is carried out into tested application.
In certain embodiments, control is that control information is identified in test script, and is in tested application
It is identified with coordinate points, therefore when testing procedure is sent into tested application tested, it is also necessary to by control information
Resolve to the coordinate points in tested application.For example, Xpath paths are resolved into specific coordinate points.
Step 614, gesture test result corresponding to gesture test script is obtained.
After the completion of gesture test, gesture test result corresponding to the gesture test script is obtained, with to tested application
Test result is analyzed or assessed.
As shown in figure 8, in one embodiment, there is provided a kind of gesture test device, the gesture test device can collect
Into in above-mentioned computer equipment 110, it can specifically include test request receiving unit 802, script acquiring unit 804, hand
Gesture test cell 806 and test result acquiring unit 808.
Test request receiving unit 802, for receiving gesture test request, the gesture test request carries gesture mark
Know;
Script acquiring unit 804, gesture test script is obtained for being identified according to gesture;
Gesture test cell 806, for carrying out gesture test to tested application according to gesture test script;
Test result acquiring unit 808, for obtaining gesture test result corresponding to gesture test script.
In one embodiment, gesture mark includes first gesture mark and second gesture mark, script acquiring unit
804 are specifically used for identifying acquisition first gesture test script according to first gesture, and, obtain second according to second gesture mark
Gesture test script;
As shown in figure 9, in one embodiment, when gesture test script includes first gesture test script and second-hand
Gesture test script, gesture test cell 806 include the first script calling module 806A, initialization directive sending module 806B and
Second script calling module 806C.
First script calling module 806A, for calling first gesture test script to carry out gesture test to tested application;
Initialization directive sending module 806B, after the completion of the test of first gesture test script, sent just to tested application
Beginningization instructs, so that tested application is initialized;
Second script calling module 806C, when reaching the wait initialization time of tested application, second gesture is called to survey
Training this gesture test is carried out to tested application.
As shown in Figure 10, in one embodiment, test result acquiring unit 808 include keyword detection module 808A with
And test result acquisition module 808B.
Keyword detection module 808A, for detecting in tested application default homepage keyword whether occur, if so, really
Determine gesture test result to unlock successfully for gesture, if it is not, determining that gesture test result is gesture unblock failure;
It can inquire about in tested application and the homepage keyword relevant with homepage, such as " homepage " one word whether occur.Certainly,
Other homepage keywords can also be pre-set according to the characteristics of tested application homepage.Detection time can be set according to being actually needed
It is fixed.When testing result for when there is homepage keyword, then it represents that tested application enters the startup page, and current gesture tests pin
Gesture corresponding to this is consistent with default gesture unlocking pin, and implementing result is that gesture unlocks successfully;Otherwise, implementing result is hand
Gesture unblock failure.
In certain embodiments, can be detected in a manner of poll.Preferably, can be after gesture test starts
Poll is proceeded by after preset time again, to reduce the number of poll.The preset time can be set according to being actually needed.
Test result acquisition module 808B, for obtaining gesture test result corresponding to gesture test script.
When it is determined that after gesture test result, computer equipment obtains the gesture test result, to enter to gesture test result
Row analysis or evaluation.
As shown in figure 11, gesture test device can also include control information acquiring unit 1102, control information sequence is given birth to
Into unit 1104 and test script generation unit 1106.
Control information acquiring unit 1102, for obtaining the control information of input gesture;
Control information sequence generating unit 1104, for the control information according to input gesture and input gesture by control
Part is sequentially generated control information sequence;
Test script generation unit 1106, for generating template generation according to control information sequence and gesture test script
Gesture test script.
In one embodiment it is proposed that a kind of computer equipment, computer equipment include memory, processor and storage
On a memory and the computer program that can run on a processor, following steps are realized during computing device computer program:
Gesture test request is received, gesture test request carries gesture mark;Identified according to gesture and obtain gesture test script, its
In, gesture test script generates template generation according to the control information sequence and gesture test script of input gesture;According to hand
Gesture test script carries out gesture test to tested application, and gesture test script includes the action command sequence for simulation input gesture
Row, action command sequence include instructing the test that the starting control for inputting gesture calls click event functions to be operated successively
And the test instruction for calling slip event function to be operated successively between the adjacent control of input gesture;Gesture is obtained to survey
Gesture test result corresponding to training sheet.
In one embodiment, following steps are also performed during computing device computer-readable instruction:Obtain input gesture
Control information;Control information sequence is sequentially generated by control according to the control information of input gesture and input gesture;
According to control information sequence and gesture test script generation template generation gesture test script.
In one embodiment, gesture mark includes first gesture mark and second gesture identifies, performed by processor
According to gesture identify obtain gesture test script the step of include:Identified according to first gesture and obtain first gesture test pin
This, and, identified according to second gesture and obtain second gesture test script;Performed by processor according to gesture test script pair
The step of tested application carries out gesture test includes:First gesture test script is called to carry out gesture test to tested application;When
After the completion of the test of first gesture test script, initialization directive is sent to tested application, so that tested application is initialized;When
When the wait initialization time of tested application reaches, second gesture test script is called to carry out gesture test to tested application.
In one embodiment, corresponding to the acquisition gesture test script performed by processor the step of gesture test result
Including:Whether there is default homepage keyword in the tested application of detection, if so, determine gesture test result be gesture unlock into
Work(, if it is not, determining that gesture test result is gesture unblock failure;Obtain gesture test result corresponding to gesture test script.
In one embodiment it is proposed that a kind of storage medium for being stored with computer-readable instruction, this is computer-readable
When instruction is executed by one or more processors so that one or more processors perform following steps:Receiving gesture test please
Ask, gesture test request carries gesture mark;Identified according to gesture and obtain gesture test script, wherein, gesture test script
According to the control information sequence of input gesture and gesture test script generation template generation;According to gesture test script to tested
Using gesture test is carried out, gesture test script includes the action command sequence for simulation input gesture, action command sequence
Include instructing the test that the starting control for inputting gesture calls click event functions to be operated and in input gesture successively
Adjacent control between call the test instruction that slip event function operated successively;Obtain hand corresponding to gesture test script
Gesture test result.
In one embodiment, following steps are also performed during computing device computer-readable instruction:Obtain input gesture
Control information;Control information sequence is sequentially generated by control according to the control information of input gesture and input gesture;
According to control information sequence and gesture test script generation template generation gesture test script.
In one embodiment, gesture mark includes first gesture mark and second gesture identifies, performed by processor
According to gesture identify obtain gesture test script the step of include:Identified according to first gesture and obtain first gesture test pin
This, and, identified according to second gesture and obtain second gesture test script;Performed by processor according to gesture test script pair
The step of tested application carries out gesture test includes:First gesture test script is called to carry out gesture test to tested application;When
After the completion of the test of first gesture test script, initialization directive is sent to tested application, so that tested application is initialized;When
When the wait initialization time of tested application reaches, second gesture test script is called to carry out gesture test to tested application.
In one embodiment, corresponding to the acquisition gesture test script performed by processor the step of gesture test result
Including:Whether there is default homepage keyword in the tested application of detection, if so, determine gesture test result be gesture unlock into
Work(, if it is not, determining that gesture test result is gesture unblock failure;Obtain gesture test result corresponding to gesture test script.
One of ordinary skill in the art will appreciate that realize all or part of flow in above-described embodiment method, being can be with
The hardware of correlation is instructed to complete by computer program, the computer program can be stored in a computer-readable storage and be situated between
In matter, the program is upon execution, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, foregoing storage medium can be
The non-volatile memory mediums such as magnetic disc, CD, read-only memory (Read-Only Memory, ROM), or random storage note
Recall body (Random Access Memory, RAM) etc..
Each technical characteristic of embodiment described above can be combined arbitrarily, to make description succinct, not to above-mentioned reality
Apply all possible combination of each technical characteristic in example to be all described, as long as however, the combination of these technical characteristics is not deposited
In contradiction, the scope that this specification is recorded all is considered to be.
Embodiment described above only expresses the several embodiments of the present invention, and its description is more specific and detailed, but simultaneously
Therefore the limitation to the scope of the claims of the present invention can not be interpreted as.It should be pointed out that for one of ordinary skill in the art
For, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to the guarantor of the present invention
Protect scope.Therefore, the protection domain of patent of the present invention should be determined by the appended claims.