Summary of the invention
To this end, the present invention provides a kind of visual automated testing method of script, device and mobile terminal, to try hard to solve
Determine or at least alleviate at least one problem existed above.
According to an aspect of the invention, it is provided a kind of visual automated testing method of script, be suitable to be measured
Performing in mobile terminal, be provided with the suspended frame that can show Word message in the interface of described mobile terminal, the method includes: will
Each Action Events in test script is packaged;Generate the literal order of described each Action Events, and be written into
Buffer area;Resolve test script and perform each Action Events in this script successively;By monitoring described buffer area
State obtains the Action Events of up-to-date operation;The literary composition corresponding to Action Events of described up-to-date operation is shown in described suspended frame
Word instruction;And after described test script end of run, generate test report.
Alternatively, according in the automated testing method of the present invention, suspended frame is arranged to click on.
Alternatively, according in the automated testing method of the present invention, also include: the script recording in response to tester please
Ask, create test script;Receive the Action Events that tester is inputted on the touch screen of mobile terminal to be measured.
Alternatively, according in the automated testing method of the present invention, the step of the literal order of each Action Events is generated
Suddenly include: in test script, generate the literal order corresponding to this Action Events according to the described Action Events received, and
Shown in described suspended frame.
Alternatively, according in the automated testing method of the present invention, test report includes: the title of test script, interior
Appearance, beginning and ending time, number of run, the title of each Action Events and the time of execution, and final testing result.
Alternatively, according in the automated testing method of the present invention, Action Events is included in the point of mobile terminal to be measured
Hit operation, long by operation, slide, opening operation and etc. to be operated at least one.
According to a further aspect in the invention, it is provided that a kind of visual automatic test device of script, be suitable to reside in
In mobile terminal to be measured, being provided with the suspended frame that can show Word message in the interface of described mobile terminal, this device includes: thing
Part package module, is suitable to be packaged each Action Events in test script;Directive generation module, be suitable to generate described often
The literal order of individual Action Events, and it is written into buffer area;Script execution module, is suitable to resolve test script successively
Perform each Action Events in this script;Event acquisition module, is suitable to the state by monitoring described buffer area and obtains
The new Action Events run;Order display module, is suitable to show the Action Events institute of described up-to-date operation in described suspended frame
Corresponding literal order;And report generation module, be suitable to generate test report after described test script end of run.
Alternatively, according in the automatic test device of the present invention, suspended frame is arranged to click on.
Alternatively, according in the automatic test device of the present invention, also include: module recorded by script, is adapted for
The script recording request of tester, creates test script;Event receiver module, is suitable to receive tester at mobile terminal to be measured
The Action Events inputted on touch screen.
Alternatively, according in the automatic test device of the present invention, directive generation module is suitable to according to following methods raw
Become the literal order of each Action Events: in test script, generate this Action Events institute according to the described Action Events received
Corresponding literal order, and shown in described suspended frame.
Alternatively, according in the automatic test device of the present invention, test report includes: the title of test script, interior
Appearance, beginning and ending time, number of run, the title of each Action Events and the time of execution, and final testing result.
Alternatively, according in the automatic test device of the present invention, Action Events is included in the point of mobile terminal to be measured
Hit operation, long by operation, slide, opening operation and etc. to be operated at least one.
According to a further aspect in the invention, it is provided that a kind of mobile terminal, there is automatic test device as above.
Script visual automatic test scheme according to the present invention, by adding current survey at the interface of mobile terminal
The text instruction that try is rapid, thus by the operational feedback corresponding to the code of backstage to mobile phone screen, it is achieved that script operation
Visualization, adds the readability in script running, the convenient correctness judging script, thus reduces the rate of false alarm of bug.
It addition, this programme both can use traditional pattern being driven mobile terminal to carry out automatic test by PC, it is also possible to fully profit
By mobile terminal independence and the feature of portability, directly carried out script recording by mobile terminal and perform test.And, moving
In the script recording process of dynamic terminal, it is also possible to add and test captions, thus the operation judges during facilitating subsequent playback.
Detailed description of the invention
It is more fully described the exemplary embodiment of the disclosure below with reference to accompanying drawings.Although accompanying drawing shows the disclosure
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure and should be by embodiments set forth here
Limited.On the contrary, it is provided that these embodiments are able to be best understood from the disclosure, and can be by the scope of the present disclosure
Complete conveys to those skilled in the art.
Fig. 1 is mobile terminal 100 organigram according to an embodiment of the invention.With reference to Fig. 1, mobile terminal
100 include: memory interface 102, one or more data processor, image processor and/or CPU 104, with
And peripheral interface 106.Memory interface 102, one or more processor 104 and/or peripheral interface 106 both can be discrete units
Part, it is also possible to be integrated in one or more integrated circuit.In the mobile terminal 100, various elements can be by one or many
Bar communication bus or holding wire couple.Sensor, equipment and subsystem are alternatively coupled to peripheral interface 106, in order to help real
Existing several functions.Such as, motion sensor 110, optical sensor 112 and range sensor 114 are alternatively coupled to peripheral interface
106, facilitating orientation, illuminate and the function such as range finding.Other sensors 116 are equally connected with peripheral interface 106, the most fixed
Position system (such as GPS), temperature sensor, biometric sensor or other sensor devices, thus can help reality
Execute relevant function.
Camera sub-system 120 and optical pickocff 122 may be used for the camera of convenient such as recording photograph and video clipping
The realization of function, wherein said camera sub-system and optical pickocff can be such as charge-coupled image sensor (CCD) or complementary gold
Belong to oxide semiconductor (CMOS) optical pickocff.Can help to realize by one or more radio communication subsystem 124
Communication function, wherein radio communication subsystem can include radio-frequency transmitter and transmitter and/or light (the most infrared) receiver
And transmitter.The particular design of radio communication subsystem 124 and embodiment can depend on that mobile terminal 100 is supported
Individual or multiple communication networks.Such as, mobile terminal 100 can include being designed to support GSM network, GPRS network, EDGE net
The communication subsystem 124 of network, Wi-Fi or WiMax network and BlueboothTM network.Audio subsystem 126 can with raise one's voice
Device 128 and mike 130 are coupled, in order to help the function implementing to enable voice, such as speech recognition, speech reproduction, number
Word record and telephony feature.
I/O subsystem 140 can include touch screen controller 142 and/or other input controllers 144 one or more.
Touch screen controller 142 is alternatively coupled to touch screen 146.For example, this touch screen 146 and touch screen controller 142 are permissible
Use any one of multiple touch-sensing technology to detect the contact and movement or time-out carried out therewith, wherein sense skill
Art is including, but not limited to capacitive character, resistive, infrared and surface acoustic wave technique.Other input controllers 144 one or more
Be alternatively coupled to other input/control devicess 148, the most one or more buttons, rocker switch, thumb wheel, infrared port,
The pointer device of USB port and/or instruction pen etc.The one or more button (not shown) can include for controlling
Speaker 128 and/or the up/down button of mike 130 volume.
Memory interface 102 can be coupled with memorizer 150.This memorizer 150 can include that high random access is deposited
Reservoir and/or nonvolatile memory, the most one or more disk storage equipment, one or more optical storage apparatus, and/
Or flash memories (such as NAND, NOR).Memorizer 150 can store operating system 152, such as Android, IOS or
The operating system of Windows Phone etc.This operating system 152 can include for processing basic system services and execution
Depend on the instruction of the task of hardware.Memorizer 150 can also store application 154.These apply when operation, can be from memorizer
150 are loaded on processor 104, and run on the operating system run by processor 104, and utilize operating system
And the interface that bottom hardware provides realizes the desired function of various user, such as instant messaging, web page browsing, pictures management etc..
Application can be independently of what operating system provided, it is also possible to is that operating system carries.It addition, application 154 is installed to move
Time in dynamic terminal 100, it is also possible to add to operating system and drive module.
In above-mentioned various application 154, the visual automatization of script that a kind of application therein is related to the present invention
Test device 300.In certain embodiments, the script that mobile terminal 100 is configured to perform according to the present invention is visual certainly
Dynamicization method of testing 200.
Additionally, in the interface of mobile terminal can the most self-defined suspended frame that can show Word message, this function
Being realized by the application programming interfaces of mobile terminal, wherein conventional in test API includes but not limited to: input,
sleep、waitForConnection、drag、installPackage、press、removePackage、
startActivity、touch、type、sameAs、takeSnapshot.Additionally, this suspended frame only can show Word message, and
And suspended frame is set can not click on, the most just do not interfere with the operation of script.
Fig. 2 shows the flow chart of the visual automated testing method of script 200 according to an embodiment of the invention.
As in figure 2 it is shown, the method starts from step S210.In step S210, by each Action Events in test script
It is packaged.Specifically, it is simply that each Action Events is encapsulated in middleware, this middleware that is executable jar literary composition
Part, generally, this jar file is placed in the assets file in mobile terminal 100 application, as a kind of resource
Document form processes.When needs are opened automatic test, resolved test text, in response to test command (such as, test
Personnel can press switch to open automatic test by clicking on the response in mobile terminal 100), this middleware can be derived to specifying
Catalogue, such as, it is stipulated that the path of assigned catalogue is /sdcard/autotest/Script, certainly, this path can be self-defined,
According to one embodiment of present invention, middleware is derived to the catalogue of an entitled Script, can be certainly under this catalogue
Oneself organizes text external member by Path form.Such as, 50 automatic test literary compositions are write for the contact person in mobile terminal 100
This script, can be placed on/sdcard/autotest/Script/contacts/ path under, wherein contacts is user oneself
The folder path arranged.Can select to perform all of text script under contacts performing when, thus reach pipe
The purpose of reason text script.
Action Events as above be included in mobile terminal to be measured click, long by, slide, open, screenshotss, wait,
The operational motions such as input.Wherein " click on " operation can be divided into again: click on screen coordinate, click on physical button (comprise HOME,
MENU, BACK, CAMERA, POWER (go out screen/bright screen), seven buttons such as VOLUME_UP, VOLUME_DOWN), click on text pair
As." length is pressed " operation can be divided into again: long by screen coordinate and long by text object.Operation of " sliding " is divided into: left and right directions is sliding
Move and slip screen coordinate." open " operation to be divided into: open application program and open mode hurdle." screenshotss " operation can be divided into:
Screenshotss mode and the screenshotss mode of interpolation remarks without remarks." wait " that operation includes the time waited;" input " operation to include
Text to be inputted and position;" circulate " operation and include number of times to be circulated.
Subsequently, in step S220, generate the literal order of each Action Events, and be written into buffer area, i.e.
Before the operation packaged by performing, first write a literal order to buffer area describe the information of this operation.
Clicking on as a example by control by word, normal script ways of writing is:
With in upper type, add the process that word describes that builds, and word description is write buffer area, for rear
Phase shows.In like manner, other slide operates with dragging etc. is also similar packaged type.Survey after typically requiring encapsulation
Training originally saves as test text, and according to an embodiment of the invention, test text can be that txt, doc, excel etc. appoint
Meaning form.
Subsequently, in step S230, resolve test script and perform each Action Events in this script successively.Specifically
Ground, in this step, starts automatic test, and resolves test text by middleware, obtain test script.Mobile terminal
100, by performing shell-command, call this middleware, identify the operational motion in test text, and will be known by middleware
Other operational motion resolves to script, obtains test script.Finally, resolve test script sentence by sentence, obtain and test script
Corresponding driving layer order, and transmit the command to drive layer to perform.
Subsequently, in step S240, obtained the Action Events of up-to-date operation by the state monitoring described buffer area, and
In step s 250, suspended frame shows the literal order corresponding to this Action Events.Here it is possible to open a thread not
Monitor buffer area disconnectedly, when having new content to write when, obtain the literal order of Action Events contained in this content, and
Refresh the Word message of suspended frame.
Fig. 4 A and Fig. 4 B shows and shows that the word of script refers at interface of mobile terminal according to an embodiment of the invention
The schematic diagram of order.Wherein show in suspended frame is current " clicking on BACK key " and the operation of " click text: fine work " respectively.
So, tester, after carrying out script test, can describe and currently practical by observing the word on interface of mobile terminal
UI operation, judge that the operation of script is the most correct easily.
Subsequently, in step S260, generating test report after test script end of run, wherein test report includes:
The title of test script, content, beginning and ending time, number of run, the title of each Action Events and the time of execution, and final test
Result.Specifically, namely after driving layer to perform driving layer order, corresponding test result is exported.Mobile terminal 100 meeting
Resolve the execution logic of test script, and perform test assignment automatically by performing logic, record test result simultaneously.Test
Being reported as log file, log file is won, is arranged by staff, in order to objective appraisal operating system performance.
It should be noted that, the present invention can finish writing test text on PC then text is imported to mobile terminal, by
Mobile terminal completes follow-up parsing and drives test assignment;Test script can also be write in the terminal and preserve, so
Rear unlatching is tested.Writing work do not limit for completing test text on which kind of equipment, this is given birth to by PC with traditional
Becoming command adapted thereto to go the test mode difference driving mobile terminal to carry out various operation, in this programme, mobile terminal can be independent
Complete automatic test, on the one hand reduce the input of testing cost, on the other hand it also avoid PC and mobile terminal number
According to some unstable factors during transmission, such as test process connects and disconnects.
The process writing test script at mobile terminal can use recording and playback technology.Specifically, in response to tester
Script recording request, create test script;Receive the operation thing that tester is inputted on the touch screen of mobile terminal to be measured
Part, and in test script, generate the literal order corresponding to this Action Events according to the described Action Events received, and will
Its display is in described suspended frame.I.e. while being operated at the interface of mobile terminal by script recording technology, pass through
Resolve this operation content and generate the instruction corresponding to this operation, and this instruction is added in test script;Simultaneously at interface
Suspended frame shows this given content.So, the foot currently carried out just can be easily judged when carrying out script playback
This operation is the most correct, thus improves testing efficiency.
Fig. 3 shows the schematic diagram of the visual automatic test device of script 300 according to an embodiment of the invention.
This device is arranged on mobile terminal 100, as it is shown on figure 3, this device 300 includes: Event Package module 310, instruction generate mould
Block 320, script execution module 330, event acquisition module 340, order display module 350 and report generation module 360.
Event Package module 310 is suitable to be packaged each Action Events in test script.Wherein, Action Events bag
Include mobile terminal to be measured clicking operation, long by operation, slide, opening operation and etc. to be operated at least one.
Directive generation module 320 is suitable to generate the literal order of described each Action Events, and is written into buffer area.
Script execution module 330 is suitable to each Action Events resolving test script and performing in this script successively.Specifically
Ground, script execution module 330 resolves test text by middleware, obtains test script.Mobile terminal 100 is by performing
Shell-command, calls this middleware, identifies the operational motion in test text, and the operation identified is moved by middleware
Resolve to script, obtain test script.Finally, resolve test script sentence by sentence, obtain the driving corresponding with test script
Layer order, and transmit the command to drive layer to perform.
Event acquisition module 340 is suitable to the state by monitoring described buffer area and obtains the Action Events of up-to-date operation.
Order display module 350 is suitable to show the literal order corresponding to Action Events of described up-to-date operation in suspended frame.
Report generation module 360 is suitable to generate test report after described test script end of run.Wherein test report
Including the title of test script, content, beginning and ending time, number of run, the title of each Action Events and the time of execution, and finally
Test result.Specifically, after driving layer order to be finished, by the test result output of record, and by staff to survey
Examination report carries out winning, arranging, in order to objective appraisal operating system performance.
It addition, according to the embodiment of the present invention, test script can be saved as the forms such as txt, doc, excel, and
And can be done directly on mobile terminal 100, it is also possible to import to move by the test text finished writing on the equipment such as PC in advance
In dynamic terminal 100.If completed on mobile terminals, then according to the visual automatic test device of script 300 of the present invention
Can also include that script records module and event receiver module.The former is adapted for the script recording request of tester, creates
Test script;The latter is suitable to receive the Action Events that tester is inputted on the touch screen of mobile terminal to be measured.
According to technical scheme, the word increasing this operation before each operation of scripted code describes, and
This word is described and presents on the screen of the mobile terminal;I.e. by by the Chinese WD of script operation and literal order
Suspended window shows and combines, and facilitates whether tester judges script operation after having performed testing procedure fast and effectively
Correctly, thus drastically increase the efficiency of automatic test, and reduce the rate of false alarm of bug.
B10, device as described in B9, wherein said directive generation module is suitable to generate each operation thing according to following methods
The literal order of part:
In test script, the literal order corresponding to this Action Events is generated according to the described Action Events received, and
Shown in described suspended frame.
B11, device as described in B7, wherein said test report includes:
The title of test script, content, beginning and ending time, number of run, the title of each Action Events and the time of execution, and
Final testing result.
B12, device as described in B7, wherein said Action Events be included in mobile terminal to be measured clicking operation, long by
Operation, slide, opening operation and etc. to be operated at least one.
Should be appreciated that one or more, the most right in order to simplify that the disclosure helping understands in each inventive aspect
In the description of the exemplary embodiment of the present invention, each feature of the present invention be sometimes grouped together into single embodiment, figure or
In person's descriptions thereof.But, should not be construed to the method for the disclosure reflect an intention that the most required for protection is sent out
The bright feature more features requiring ratio to be expressly recited in each claim.More precisely, as the following claims
As book is reflected, inventive aspect is all features less than single embodiment disclosed above.Therefore, it then follows specifically real
The claims executing mode are thus expressly incorporated in this detailed description of the invention, and the most each claim itself is as this
Bright independent embodiment.
Those skilled in the art are to be understood that the module of the equipment in example disclosed herein or unit or group
Part can be arranged in equipment as depicted in this embodiment, or alternatively can be positioned at and the equipment in this example
In different one or more equipment.Module in aforementioned exemplary can be combined as a module or be segmented into multiple in addition
Submodule.
Those skilled in the art are appreciated that and can carry out the module in the equipment in embodiment adaptively
Change and they are arranged in one or more equipment different from this embodiment.Can be the module in embodiment or list
Unit or assembly are combined into a module or unit or assembly, and can put them in addition multiple submodule or subelement or
Sub-component.In addition at least some in such feature and/or process or unit excludes each other, can use any
Combine all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so disclosed appoint
Where method or all processes of equipment or unit are combined.Unless expressly stated otherwise, this specification (includes adjoint power
Profit requires, summary and accompanying drawing) disclosed in each feature can be carried out generation by providing identical, equivalent or the alternative features of similar purpose
Replace.
Although additionally, it will be appreciated by those of skill in the art that embodiments more described herein include other embodiments
Some feature included by rather than further feature, but the combination of the feature of different embodiment means to be in the present invention's
Within the scope of and form different embodiments.Such as, in the following claims, embodiment required for protection appoint
One of meaning can mode use in any combination.
Additionally, some in described embodiment be described as at this can be by the processor of computer system or by performing
The method of other device enforcement of described function or the combination of method element.Therefore, have for implementing described method or method
The processor of the necessary instruction of element is formed for implementing the method or the device of method element.Additionally, device embodiment
This described element is the example of following device: this device is for implementing by performed by the element of the purpose in order to implement this invention
Function.
As used in this, unless specifically stated so, ordinal number " first ", " second ", " the 3rd " etc. is used
Describe plain objects and be merely representative of the different instances relating to similar object, and be not intended to imply that the object being so described must
Must have the time upper, spatially, sequence aspect or in any other manner to definite sequence.
Although the embodiment according to limited quantity describes the present invention, but benefits from above description, the art
In it is clear for the skilled person that in the scope of the present invention thus described, it can be envisaged that other embodiments.Additionally, it should be noted that
The language that uses in this specification primarily to the readable and purpose of teaching and select rather than in order to explain or limit
Determine subject of the present invention and select.Therefore, in the case of without departing from the scope of the appended claims and spirit, for this
For the those of ordinary skill of technical field, many modifications and changes will be apparent from.For the scope of the present invention, to this
The disclosure that invention is done is illustrative and not restrictive, and it is intended that the scope of the present invention be defined by the claims appended hereto.