CN105824755A - Automation test method, automation test device and mobile terminal - Google Patents

Automation test method, automation test device and mobile terminal Download PDF

Info

Publication number
CN105824755A
CN105824755A CN201610152909.8A CN201610152909A CN105824755A CN 105824755 A CN105824755 A CN 105824755A CN 201610152909 A CN201610152909 A CN 201610152909A CN 105824755 A CN105824755 A CN 105824755A
Authority
CN
China
Prior art keywords
script
test
run
request
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201610152909.8A
Other languages
Chinese (zh)
Other versions
CN105824755B (en
Inventor
黄志坤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Heigu Network Technology Co.,Ltd.
Original Assignee
Xiamen Meitu Mobile Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Meitu Mobile Technology Co Ltd filed Critical Xiamen Meitu Mobile Technology Co Ltd
Priority to CN201610152909.8A priority Critical patent/CN105824755B/en
Publication of CN105824755A publication Critical patent/CN105824755A/en
Application granted granted Critical
Publication of CN105824755B publication Critical patent/CN105824755B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

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)
  • Telephone Function (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses an automation test method, which is suitable to be executed in a mobile terminal with a touch screen. The method comprises the following steps of receiving a script manufacturing starting request of a user; responding to the request and creating a test script; receiving one operation event input by the user on the touch screen through the mobile terminal; generating one test command in the test script according to the received operation event; repeating the receiving and generating steps on the operation event subsequently input by the user on the touch screen until the script manufacturing ending request of the user is received; receiving a test request of the user, wherein the test request includes the script running parameters and an assigned running test script; responding to the request; reading the assigned running test script; running the test script according to the running script parameters; generating a test request after the running is completed. The invention discloses an automation test device and the mobile terminal.

Description

A kind of automated testing method, device and mobile terminal
Technical field
The present invention relates to the applied technical field of mobile terminal, especially a kind of automated testing method, Apparatus and system.
Background technology
Along with the development of mobile terminal device manufacturing technology, the mobile terminal devices such as the intelligence degree of various mobile terminal devices, portability etc. have had unprecedented raising, such as smart mobile phone have obtained large-scale universal.Mobile terminal device of today, can run relative complex operating system, and meanwhile, increasing developer puts in the exploitation of mobile terminal device application software, develops the software application of substantial amounts for various equipment platforms.Software test is important step indispensable during software application development, is also such for the exploitation of software application in mobile terminal.Passing through software test, it will be appreciated that whether software application exists mistake, whether its running or operation result meet the expected requirements, pressure that software application can bear etc..According to the difference of test target, the software application test of mobile terminal can include following basic sides: UI test, functional module test, crossing event test, stress test, security test, compatibility test, ease for use/Consumer's Experience test etc..The test job of the software application of mobile terminal, provides guarantee for developing the mobile terminal software application of relative ideal.
But, along with the size of code of mobile terminal software application is increasing, complexity is more and more higher, traditional manual testing's method has been difficult to obtain satisfied and comprehensive test result, and due to mobile terminal device huge number, the operating system and the multiple hardwares specification of equipment that carry differ, and especially carry the mobile terminal device of Android operation system, have even more serious operating system and type fragmentation problem.If test event needs to cover as far as possible many system versions or type, then needing to pay substantial amounts of testing time and manpower and materials cost, the testing time is long also can increase the R&D cycle, is unfavorable for the timely issue of software product or renewal.
Make script and then run the very effective solution of one being to be used in field tests.Run automatically by the operation that tester is specified, it is achieved the purpose that the operation repeated is performed automatically.The most conventional has above-mentioned functions automated test tool such as MonkeyRunner, firstly the need of building PC environment (download Android-SDK, installation Python, set), then starting corresponding script production process at PC end, the interface of mobile terminal using mouse-keyboard operation to be synchronized to PC end completes script and makes operation.It is clear that tester needs to build development environment at PC end, MonkeyRunner can be used.And its script makes functional lability, card reports an error the appearance frequently such as pop-up, and fluency is the best, and these factors influence the use of tester.
It is thus desirable to the easiest a kind of easy-to-use automatic test scheme.
Summary of the invention
To this end, the present invention provides a kind of automated testing method, device and mobile terminal, to try hard to solve or at least alleviate at least one problem existed above.
According to an aspect of the invention, it is provided a kind of automated testing method, being suitable to perform in the mobile terminal have touch screen, the method includes: the script receiving user makes startup request;In response to this request, create test script;The Action Events that user inputs on the touchscreen is received via mobile terminal;A test command in test script is generated according to the Action Events received;The Action Events inputted subsequent user on the touchscreen repeats the step of above-mentioned reception, generation, until the script receiving user makes ending request;Receiving the test request of user, test request includes the parameter of Run Script, and specifies the test script of operation;In response to this request, read and specify the test script run;Parameter according to Run Script runs this test script;And after end of run, generate test result.
Alternatively, according in the automated testing method of the present invention, wherein generating the step of a test command in test script according to the Action Events received to include: obtain the operation data produced after mobile terminal receives Action Events, operation data include type and the parameter of this Action Events;In test script, write includes the type of Action Events and a test command of parameter.
Alternatively, according in the automated testing method of the present invention, wherein the parameter of Run Script includes running total degree, includes according to the step of the parameter testing results script of Run Script: rerun test script, until the number of times running this test script reaches to run total degree.
Alternatively, according in the automated testing method of the present invention, wherein the parameter of Run Script also includes running total duration, the step of the parameter testing results script according to Run Script includes: rerun test script, until the number of times running this test script reaches to run total degree or runs time of this test script and reach to run total duration.
Alternatively, according in the automated testing method of the present invention, wherein the step of testing results script includes: a test command initial in read test script;Perform this test command;Test command follow-up in test script is repeated the step of above-mentioned reading and execution.
Alternatively, according in the automated testing method of the present invention, the step wherein performing a test command also includes: intercept the screen picture after performing a test command.
Alternatively, according in the automated testing method of the present invention, the step of the Action Events wherein inputted on the touchscreen via mobile terminal reception user also includes: intercept the screen picture after user inputs an Action Events on the touchscreen.
Alternatively, according in the automated testing method of the present invention, wherein the parameter of Run Script also includes labelling and the image comparison similarity threshold indicating whether to carry out image comparison, when labelling instruction carries out image comparison, the step performing a test command also includes: after intercepting the screen picture after performing a test command, calculate the similarity of the screen picture of corresponding intercepting when this screen picture makes with test script;Record image comparison result, wherein, if the similarity calculated reaches image comparison similarity threshold, then image comparison result is for passing through, otherwise for not pass through.
Alternatively, according in the automated testing method of the present invention, the step wherein generating test result includes: according to record at least one image comparison result, determine test result be by or do not pass through.
Alternatively, according in the automated testing method of the present invention, also include: after end of run, generating run report, run the execution time of each test command, content and image comparison result in script name, the starting and ending time of script operation and the script operation that report includes running.
Alternatively, according in the automated testing method of the present invention, the step wherein generating test report also includes: according to running report generation test report, test report includes duration, the number of times of picture contrast and the test result that the script name run and content for script, the number of times of script operation, script run, and wherein the number of times of picture contrast includes the number of times that the number of times that contrast is passed through does not passes through with contrast.
Alternatively, according in the automated testing method of the present invention, the type of Action Events at least include click coordinate event, click keys event, long by event, slip event, open application affairs and wait event.
Alternatively, according in the automated testing method of the present invention, wherein the test command in test script is expressed as the text language with set form.
According to a further aspect in the invention, it is provided that a kind of automatic test device, residing in the mobile terminal with touch screen, this device includes: request receiver module, is suitable to receive the script making startup request of user and script makes stopping and asking;Being further adapted for receiving the test request of user, test request includes the parameter of Run Script, and specifies the test script of operation;Script makes module, is adapted for script and makes startup request, creates test script;It is further adapted for receiving, via mobile terminal, the Action Events that user inputs on the touchscreen;It is further adapted for generating a test command in test script according to the Action Events received;The Action Events being further adapted for inputting subsequent user on the touchscreen repeats the step of above-mentioned reception, generation, until the script that request receiver module receives user makes ending request;Script runs module, is adapted for test request, reads and specifies the test script run;It is further adapted for the parameter testing results script according to Run Script;And report generation module, after being suitable to end of run, generate test result.
Alternatively, according in the automatic test device of the present invention, wherein script makes the operation data produced after module is further adapted for obtaining mobile terminal reception Action Events, and operation data include type and the parameter of this Action Events;It is further adapted in test script write and includes the type of Action Events and a test command of parameter.
Alternatively, according in the automatic test device of the present invention, wherein the parameter of Run Script includes running total degree, and script runs module and is further adapted for the test script that reruns, until the number of times running this test script reaches to run total degree.
Alternatively, according in the automatic test device of the present invention, wherein the parameter of Run Script also includes running total duration, script runs module and is further adapted for the test script that reruns, until the number of times running this test script reaches to run total degree or runs time of this test script and reach to run total duration.
Alternatively, according in the automatic test device of the present invention, wherein script runs module and is further adapted in read test script an initial test command;It is further adapted for performing this test command;It is further adapted for test command follow-up in test script is repeated the step of above-mentioned reading and execution.
Alternatively, according in the automatic test device of the present invention, wherein script runs module and is further adapted for the screen picture after intercepting one test command of execution.
Alternatively, according in the automatic test device of the present invention, wherein script makes module and is further adapted for the screen picture after intercepting user inputs an Action Events on the touchscreen.
Alternatively, according in the automatic test device of the present invention, wherein the parameter of Run Script also includes labelling and the image comparison similarity threshold indicating whether to carry out image comparison, script runs module and also includes image comparison module, image comparison module is suitable to when labelling instruction carries out image comparison, be suitable to, after intercepting the screen picture after performing a test command, calculate the similarity of the screen picture of corresponding intercepting when this screen picture makes with test script;Being further adapted for recording image comparison result, wherein, if the similarity calculated reaches image comparison similarity threshold, then image comparison result is for passing through, otherwise for not pass through.
Alternatively, according in the automatic test device of the present invention, wherein report generation module is further adapted at least one image comparison result according to record, determine test result be by or do not pass through.
Alternatively, according in the automatic test device of the present invention, after report generation module is further adapted for end of run, generating run report, runs the execution time of each test command, content and image comparison result in script name, the starting and ending time of script operation and the script operation that report includes running.
Alternatively, according in the automatic test device of the present invention, report generation module is further adapted for according to running report generation test report, test report includes duration, the number of times of picture contrast and the test result that the script name run and content for script, the number of times of script operation, script run, and wherein the number of times of picture contrast includes the number of times that the number of times that contrast is passed through does not passes through with contrast.
Alternatively, according in the automatic test device of the present invention, the type of Action Events at least include click coordinate event, click keys event, long by event, slip event, open application affairs and wait event.
Alternatively, according in the automatic test device of the present invention, wherein the test command in test script is expressed as the text language with set form.
An also aspect according to the present invention, it is provided that a kind of mobile terminal, has the automatic test device according to the present invention.
Automatic test scheme according to the present invention, carries out automatic test by the way of making, Run Script on mobile terminals, completely disengages from PC end, release PC end resource, it also avoid the problems such as card when PC end makes script pauses.Meanwhile, more convenient to operate simply save the time cost of test, improve testing efficiency and Consumer's Experience.
Accompanying drawing explanation
In order to realize above-mentioned and relevant purpose; herein in conjunction with explained below and accompanying drawing, some illustrative aspect is described; these aspects indicate can to put into practice the various modes of principles disclosed herein, and all aspects and equivalence aspect be intended to fall under in the range of theme required for protection.By reading in conjunction with the accompanying detailed description below, above-mentioned and other purpose, feature and the advantage of the disclosure will be apparent from.Throughout the disclosure, identical reference generally refers to identical parts or element.
Fig. 1 shows the structured flowchart of the mobile terminal 100 according to one exemplary embodiment of the present invention;
Fig. 2 shows the structured flowchart of the automatic test device 200 according to one exemplary embodiment of the present invention;
Fig. 3 shows the sectional drawing of the graphic user interface of the request that inputs for user according to one exemplary embodiment of the present invention;
Fig. 4 shows the sectional drawing of the graphic user interface for user's input test script name according to one exemplary embodiment of the present invention;
Fig. 5 shows the operation schematic diagram data that the user according to one exemplary embodiment of the present invention receives after inputting click coordinate event;
It is long by the operation schematic diagram data received after event that Fig. 6 shows that the user according to one exemplary embodiment of the present invention inputs;
Fig. 7 shows the sectional drawing selecting the test script specifying operation and the graphic user interface of the parameter arranging Run Script for user according to one exemplary embodiment of the present invention;
Fig. 8 shows the sectional drawing of the graphic user interface for presenting test result according to one exemplary embodiment of the present invention;
Fig. 9 shows the schematic diagram running report according to one exemplary embodiment of the present invention;
Figure 10 shows the schematic diagram of the test report according to one exemplary embodiment of the present invention;And
Figure 11 shows the flow chart of the automated testing method 300 according to one exemplary embodiment of the present invention.
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 showing the exemplary embodiment of the disclosure, it being understood, however, that may be realized in various forms the disclosure and should not limited by embodiments set forth here.On the contrary, it is provided that these embodiments are able to be best understood from the disclosure, and complete for the scope of the present disclosure can be conveyed 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 includes: memory interface 102, one or more data processor, image processor and/or CPU 104, and peripheral interface 106.Memory interface 102, one or more processor 104 and/or peripheral interface 106 both can be discrete components, it is also possible to be integrated in one or more integrated circuit.In the mobile terminal 100, various elements can be coupled by one or more communication bus or holding wire.Sensor, equipment and subsystem are alternatively coupled to peripheral interface 106, in order to help to realize 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, such as alignment system (such as GPS), temperature sensor, biometric sensor or other sensor devices, thus can help to implement relevant function.
Camera sub-system 120 and optical pickocff 122 may be used for the realization of the camera function of convenient such as recording photograph and video clipping, and wherein said camera sub-system and optical pickocff can be such as charge-coupled image sensor (CCD) or complementary metal oxide semiconductors (CMOS) (CMOS) optical pickocff.Can help to realize communication function by one or more radio communication subsystem 124, 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 one or more communication networks that mobile terminal 100 is supported.Such as, mobile terminal 100 can include being designed to support GSM network, GPRS network, EDGE network, Wi-Fi or the communication subsystem 124 of WiMax network and BlueboothTM network.Audio subsystem 126 can be coupled with speaker 128 and mike 130, in order to helps the function implementing to enable voice, such as speech recognition, speech reproduction, digital 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, any one of the multiple touch-sensing technology that can use this touch screen 146 and touch screen controller 142 detects the contact and movement or time-out carried out therewith, and wherein detection technology is including, but not limited to capacitive character, resistive, infrared and surface acoustic wave technique.Other input controllers 144 one or more are alternatively coupled to other input/control devicess 148, the pointer device of the most one or more buttons, rocker switch, thumb wheel, infrared port, 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 high-speed random access memory 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 the operating system of operating system 152, such as Android, IOS or WindowsPhone etc.This operating system 152 can include for processing basic system services and execution depends on the instruction of task of hardware.Memorizer 150 can also store application 154.These apply when operation, can be loaded into processor 104 from memorizer 150, and run on the operating system run by processor 104, and the interface utilizing operating system and bottom hardware to provide 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.
In above-mentioned application 154, a kind of application therein is the automatic test device 200 according to the present invention.Fig. 2 shows the structured flowchart of automatic test device 200 according to an embodiment of the invention.This automatic test device 200 can include asking receiver module 210, script to make module 220, script runs module 230 and report generation module 240.
Request receiver module 210 is suitable to receive the request of user, and the script of such as user makes startup request, script makes ending request, test request etc., and the graphic user interface that this request can present to user at automatic test device 200 inputs.Specifically, when automatic test device 200 is conducted interviews, user generally can be presented graphic user interface as shown in Figure 3, its beginning and the stop button that can include making script, the beginning of Run Script and stop button, user can select the start button making script to start script making with request, selects the conclusion button making script to terminate script making with request, and selects the start button of Run Script to start test etc. with request.Additionally, make the beginning of script, conclusion button and the beginning of Run Script, conclusion button may be also configured to corresponding physics shortcut, such as, be arranged in volume key and the closing key etc. of mobile terminal side.
Wherein, request receiver module 210 receives the script of user and makes startup request, the script being connected with request receiver module 210 makes module 220 in response to this request, create test script, receive, via mobile terminal, the Action Events that user inputs on the touchscreen simultaneously, generate a test command in test script according to the Action Events received.
The Action Events that subsequent user is inputted by script making module 220 on the touchscreen repeats to receive, generate test command, until the script that request receiver module 220 receives user makes ending request.
Now, according to an embodiment of the invention, request receiver module 210 can receive the test script title of user's input, and the graphic user interface as shown in Figure 4 that this title can present to user at automatic test device 200 inputs.Then, script makes the entitled filename of test script that the test script made can be inputted by module 220 with user, stores to mobile terminal under the installation directory of automatic test device 200.Wherein, the test script of storage can be txt formatted file.
Principle that test script make below be will be described in greater detail.
After user inputs an Action Events on mobile terminal touch screen, mobile terminal can correspondingly produce the operation data that can embody this Action Events, and the operation data of generation include type and the parameter of Action Events.Then, script makes module 220 can obtain the operation data produced after mobile terminal receives Action Events, and in the test script created, write includes the test command of Action Events type and parameter.
Assume that the mobile terminal being populated with automatic test device 200 is Android operation system, based on Android operation system characteristic, the operation data after user's input operation event all can be recorded in system bottom such as/dev/input/event0~X in.Having different hardware devices according to different mobile terminals, X can be different numeral, usually 6.Such as, the operation of mobile terminal touch screen and button can be embodied in event0 and event3.
After user starts script making, script makes module 220 can call the getevent order in the instruction of Android operation system shell, to obtain corresponding event.Especially, getevent-lt/dev/input/event0& can be called for the Action Events of mobile terminal touch screen and button;Getevent-lt/dev/input/event3& order, to obtain event0 and event3.
It should be noted that, the type of Action Events that user inputs on the touchscreen include but not limited to click event, long by event, slip event, open application affairs and wait event.
The object wherein clicking on event can be divided into click screen coordinate, click on physical button, click text object.Such as, when the click event object of user's input is for clicking on screen coordinate, script makes the operation data received after module 220 calls getevent order as it is shown in figure 5, wherein ABS_MT_POSITION_X and ABS_MT_POSITION_Y indicates respectively screen X-axis and Y-axis coordinate.Script makes module 220 can therefrom extract the parameter of this Action Events: the X of coordinate points that user clicks on, Y value, and the test command " click on | coordinate | X-coordinate value | Y-coordinate value " being mapped as in test script.When the click event object of user's input is for clicking on physical button, definition physical button comprises HOME, MENU, BACK, CAMERA, POWER (go out screen/bright screen), seven buttons such as VOLUME_UP, VOLUME_DOWN, and the test command such as clicking on HOME key correspondence mappings is " clicking on | button | HOME ".
Length can be divided into by the object of event: long by screen coordinate and long by text object.Specifically, such as, when the length of user's input presses event object for growing by screen coordinate, script makes the operation data received after module 220 calls getevent order as shown in Figure 6, script makes module 220 can therefrom extract the parameter of this Action Events: the X of coordinate points, Y value and the long time pressed pressed with the head of a household, and the test command " click on | X-coordinate value | Y-coordinate value | long temporally " being mapped as in test script.
When the event of user's input is slip event, script makes module 220 can be from the parameter of operation this Action Events of extracting data obtained: starting point coordinate (x0,y0), click on starting point time time t0, terminal point coordinate (x1,y1), decontrol terminal point coordinate time time t1, and calculate time difference t (t=t1-t0), now slip event can be mapped as test command " slide | x0|y0|x1|y1|t”。
When the event of user's input is for opening application affairs, the parameter of this Action Events can be obtained: the Apply Names opened, be then mapped as test command and " open | application | Apply Names ".
In addition, when user inputs (generally 1000 milliseconds) when the time interval between two Action Events exceedes predetermined time value, it has been generally acknowledged that the event that user inputs is wait event, record the parameter of this Action Events: input the waiting time between two Action Events, be then mapped as test command " wait | waiting time ".
After assuming that script makes startup, the operation that user is carried out successively is " returning to main interface ", " entrance dialing interface ", " click on input 10086 ", " breathe out and wait 10 seconds ", " hanging up ", " exiting dialing ", " returning to main interface ", the test script that automatic test device 200 makes according to aforesaid operations can be such that
" click on | button | HOME
Open | application | dialing
Click on | coordinate | 200 | 1090
Click on | coordinate | 550 | 1580
Click on | coordinate | 550 | 1580
Click on | coordinate | 540 | 1407
Click on | coordinate | 877 | 1226
Click on | coordinate | 550 | 1800
Wait | 10000
Click on | coordinate | 550 | 1800
Click on | button | BACK
Click on | button | HOME ", wherein, the test command of generation arranges according to the input order of the Action Events of its correspondence.
It should be noted that, user can also be on the graphic user interface including amendment script buttons as shown in Figure 3, select the test script to making to modify, so can improve the efficiency of script edit fully by quick and artificial precisely the combining of instrument.Simultaneously, it is thus evident that the test command in test script is expressed as the text language with set form, thus greatly reduces user and understand and the difficulty of amendment test script, brings great advantage to the user.
Script makes after terminating, and request receiver module 210 can receive the test request of user, and test request includes the parameter of Run Script, and specifies the test script of operation.Test request equally inputs at the such as graphic user interface shown in Fig. 3, wherein, after user selects the start button of Run Script, can be presented graphic user interface as shown in Figure 7, prompting user selects specify the test script run and arrange the parameter of Run Script.
Then, the script being connected with request receiver module 210 runs module 230 and specifies the test script run in response to test request, reading, and run this test script according to the parameter of Run Script.
The parameter of Run Script can include running total degree, and script runs module 230 and is suitable to rerun test script, until number of run reaches to run total degree.The parameter of Run Script can also include running total duration, and script runs module 230 and is suitable to rerun test script, until number of run reaches to run total degree or the operation time reaches to run total duration.
Specifically, during testing results script, script runs module 230 and is suitable to a test command initial in read test script one by one, performs this test command.nullWherein,After script runs module 230 read test order,Perform after this test command is converted into corresponding code commands,Such as: test command " clicks on | button | POWER " can be converted into code commands " Uidevice.getInstance () .pressPower () ",Test command " click on | coordinate | x | y " code commands " Uidevice.getInstance () .click (x can be converted into,y)”,Test command " length presses | x | y | t " code commands " Uidevice.getInstance () .swipe (x can be converted into,y,x,y,t)”,Test command " slide | x0 | y0 | x1 | y1 | t " code commands " Uidevice.getInstance () .swipe (x0 can be converted into,y0,x1,y1,t)”.
After test script end of run, the report generation module 240 being connected with script operation module 230 can generate test result, checks for user, as shown in Figure 8.
Specifically, according to an embodiment of the invention, script runs module 230 and also includes image comparison module 231, and the parameter of Run Script also includes labelling and the image comparison similarity threshold indicating whether to carry out image comparison.
Wherein, when making script, script makes module 220 and often receives an Action Events, then intercept the screen picture after user inputs an Action Events on the touchscreen;When Run Script, script runs module 230 and often performs a test command, then intercept the screen picture after performing a test command.When the labelling instruction in the parameter of Run Script carries out image comparison, image comparison module 231 can calculate the similarity of the screen picture of corresponding intercepting, then record image comparison result when the screen picture intercepted after performing test command makes with test script.If the similarity calculated reaches image comparison similarity threshold, then image comparison result is for passing through, otherwise for not pass through.
Report generation module 240 can according to image comparison module 231 record at least one image comparison result, determine test result be by or do not pass through.Such as, when all image comparison results be by time, determine that test result is for passing through.
For the ease of the whole test process of user's accurate perception, according to an embodiment of the invention, report generation module 240 can be after end of run, generating run is reported, this operation report includes the execution time of each test command, content and image comparison result in script name, the starting and ending time of script operation and the script operation run, as shown in Figure 9.Then report generation module 240 can also be according to this operation report generation test report, test report includes number of times, the duration of script operation, the number of times of picture contrast and the above-mentioned test result that the script name run and content for script, script run, the number of times of wherein said picture contrast includes the number of times that the number of times that contrast is passed through does not passes through with contrast, as shown in Figure 10.
In sum, according to the automatic test device 200 of the present invention without the auxiliary of PC end, directly just can easily realize, at mobile terminal, the test that script makes, runs, be greatly saved PC device resource.Script makes, runs simple to operate understandable simultaneously, and user is without spending bigger learning cost, without programming basis.Further, this device 200 also records the relevant information performing each test command, and uses image comparison to carry out validation test result, and reappearing problem for subsequent software developer provides effective information.
Figure 11 shows the flow chart of the automated testing method 300 according to one exemplary embodiment of the present invention, and the method is suitable to perform in the mobile terminal have touch screen.
The method 300 starts from step S310, and in step S310, the script receiving user makes startup request.
In step s 320, in response to this request, create test script, and in step S330, receive, via mobile terminal, the Action Events that user inputs on the touchscreen.The type of Action Events at least can include click coordinate event, click keys event, long by event, slip event, open application affairs and wait event.
Then in step S340, a test command in test script is generated according to the Action Events received, specifically, first obtain the operation data produced after mobile terminal receives this Action Events, operation data include type and the parameter of this Action Events, and then in test script, write includes the type of this Action Events and a test command of parameter.
The Action Events inputted subsequent user on the touchscreen repeats step S330 and S340, until judging that in step S350 the script receiving user makes ending request.Test command in the test script wherein generated arranges according to the input order of the Action Events of its correspondence, and is expressed as the text language with set form.
Script makes after terminating, and in step S360, receives the test request of user, and this test request includes the parameter of Run Script, and specifies the test script of operation.
Then in step S370, in response to this test request, read and specify the test script run, and then parameter testing results script according to Run Script in step S380.
Wherein the parameter of Run Script can include running total degree, and step S380 may include that the test script that reruns, until the number of times running this test script reaches to run total degree;The parameter of Run Script can also include running total duration, and step S380 may include that the test script that reruns, until the number of times running this test script reaches to run total degree or runs time of this test script and reach to run total duration.
Specifically, the step of testing results script may include that a test command initial in read test script, performs a test command, test command follow-up in test script then repeats the step of above-mentioned reading and execution.
According to an embodiment of the invention, the step performing a test command also includes: intercept the screen picture after performing a test command, and the step receiving the Action Events that user inputs on the touchscreen via mobile terminal also includes: intercept the screen picture after user inputs an Action Events on the touchscreen.Simultaneously, the parameter of Run Script can also include labelling and the image comparison similarity threshold indicating whether to carry out image comparison, when the instruction of this labelling carries out image comparison, the step performing a test command can also include: after intercepting the screen picture after performing a test command, calculates the similarity of the screen picture of corresponding intercepting when this screen picture makes with test script;Record image comparison result, wherein, if the similarity calculated reaches image comparison similarity threshold, then image comparison result is for passing through, otherwise for not pass through.
After last end of run, in step S390, generate test result.Specifically, generate test result step include: according to record at least one image comparison result, determine test result be by or do not pass through.
According to another implementation of the invention, method 300 can also include step: after end of run, generating run report, runs the execution time of each test command, content and image comparison result in script name, the starting and ending time of script operation and the script operation that report includes running.Step S390 may include that according to running report generation test report, this test report includes duration, the number of times of picture contrast and the test result that the script name run and content for script, the number of times of script operation, script run, and wherein the number of times of picture contrast includes the number of times that the number of times that contrast is passed through does not passes through with contrast.
Above in the specific descriptions combining Fig. 1~Fig. 9 and describing automatic test device 200 to method in the respective handling of each step be described in detail, the most no longer duplicate contents is repeated.
It is to be understood that, one or more in order to simplify that the disclosure helping understands in each inventive aspect, above in the description of the exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or descriptions thereof sometimes.But, the method for the disclosure should not being construed to reflect an intention that, i.e. the present invention for required protection requires than the feature more features being expressly recited in each claim.More precisely, as the following claims reflect, inventive aspect is all features less than single embodiment disclosed above.Therefore, it then follows claims of detailed description of the invention are thus expressly incorporated in this detailed description of the invention, the most each claim itself is as the independent embodiment of the present invention.
Those skilled in the art are to be understood that the module of the equipment in example disclosed herein or unit or assembly can be arranged in equipment as depicted in this embodiment, or alternatively can be positioned in one or more equipment different from the equipment in this example.Module in aforementioned exemplary can be combined as a module or be segmented into multiple submodule in addition.
Those skilled in the art are appreciated that and can adaptively change the module in the equipment in embodiment and they are arranged in one or more equipment different from this embodiment.Module in embodiment or unit or assembly can be combined into a module or unit or assembly, and multiple submodule or subelement or sub-component can be put them in addition.In addition at least some in such feature and/or process or unit excludes each other, can use any combination that all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so disclosed any method or all processes of equipment or unit are combined.Unless expressly stated otherwise, each feature disclosed in this specification (including adjoint claim, summary and accompanying drawing) can be replaced by the alternative features providing identical, equivalent or similar purpose.
Present invention additionally comprises: A6, method as described in A5, the step of wherein said one test command of execution also includes: intercept the screen picture after performing a test command.A7, method as according to any one of A1-6, the wherein said step receiving the Action Events that user inputs on the touchscreen via mobile terminal also includes: intercept the screen picture after user inputs an Action Events on the touchscreen.A8, method as described in A7, the parameter of wherein said Run Script also includes labelling and the image comparison similarity threshold indicating whether to carry out image comparison, when the instruction of described labelling carries out image comparison, the step of described one test command of execution also includes: after intercepting the screen picture after performing a test command, calculate the similarity of the screen picture of corresponding intercepting when this screen picture makes with test script;Record image comparison result, wherein, if the similarity calculated reaches described image comparison similarity threshold, then image comparison result is for passing through, otherwise for not pass through.A9, method as described in A8, the step of wherein said generation test result includes: according at least one image comparison result of record, determine described test result for by or do not pass through.A10, method as described in A9, also include: after end of run, generating run report, described operation reports the execution time of each test command, content and image comparison result in script name, the starting and ending time of script operation and the script operation including running.A11, method as described in A10, the step of wherein said generation test report also includes: according to described operation report generation test report, described test report includes duration, the number of times of picture contrast and the described test result that the script name run and content for script, the number of times of script operation, script run, and the number of times of wherein said picture contrast includes the number of times that the number of times that contrast is passed through does not passes through with contrast.A12, method as according to any one of A1-11, the type of described Action Events at least include click coordinate event, click keys event, long by event, slip event, open application affairs and wait event.A13, method as according to any one of A1-12, the test command in wherein said test script is expressed as the text language with set form.
Also including: B18, device as described in B15 or 16, wherein said script runs module and is further adapted for reading a test command initial in described test script;It is further adapted for performing one test command;It is further adapted for test command follow-up in described test script is repeated the step of above-mentioned reading and execution.B19, device as described in B18, wherein said script runs module and is further adapted for intercepting the screen picture after performing a test command.B20, device as according to any one of B14-19, wherein said script makes module and is further adapted for intercepting the screen picture after user inputs an Action Events on the touchscreen.B21, device as described in B20, the parameter of wherein said Run Script also includes labelling and the image comparison similarity threshold indicating whether to carry out image comparison, described script runs module and also includes image comparison module, described image comparison module is suitable to when the instruction of described labelling carries out image comparison, be suitable to, after intercepting the screen picture after performing a test command, calculate the similarity of the screen picture of corresponding intercepting when this screen picture makes with test script;Being further adapted for recording image comparison result, wherein, if the similarity calculated reaches described image comparison similarity threshold, then image comparison result is for passing through, otherwise for not pass through.B22, device as described in B21, wherein said report generation module is further adapted at least one image comparison result according to record, determine described test result for by or do not pass through.B23, device as described in B22, after described report generation module is further adapted for end of run, generating run report, described operation reports the execution time of each test command, content and image comparison result in script name, the starting and ending time of script operation and the script operation including running.B24, device as described in B23, described report generation module is further adapted for according to described operation report generation test report, described test report includes duration, the number of times of picture contrast and the described test result that the script name run and content for script, the number of times of script operation, script run, and the number of times of wherein said picture contrast includes the number of times that the number of times that contrast is passed through does not passes through with contrast.B25, device as according to any one of B14-24, the type of described Action Events at least include click coordinate event, click keys event, long by event, slip event, open application affairs and wait event.B26, device as according to any one of B14-25, the test command in wherein said test script is expressed as the text language with set form.
In addition, those skilled in the art it will be appreciated that, although embodiments more described herein include some feature included in other embodiments rather than further feature, but the combination of the feature of different embodiment means to be within the scope of the present invention and formed different embodiments.Such as, in the following claims, one of arbitrarily can mode the using in any combination of embodiment required for protection.
Additionally, some in described embodiment be described as at this can by the processor of computer system or by perform described function other device implement method or the combination of method element.Therefore, the processor with the necessary instruction for implementing described method or method element is formed for implementing the method or the device of method element.Additionally, the element described herein of device embodiment is the example of following device: this device is for implementing by the function performed by the element of the purpose in order to implement this invention.
As used in this, unless specifically stated so, use ordinal number " first ", " second ", " the 3rd " etc. to describe plain objects and be merely representative of the different instances relating to similar object, and be not intended to imply the object being so described 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, those skilled in the art will appreciate 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 used in this specification primarily to the readable and purpose of teaching and select rather than select to explain or limit subject of the present invention.Therefore, in the case of without departing from the scope of the appended claims and spirit, many modifications and changes will be apparent from for those skilled in the art.For the scope of the present invention, the disclosure being the present invention is illustrative and not restrictive, and it is intended that the scope of the present invention be defined by the claims appended hereto.

Claims (10)

1. an automated testing method, is suitable to perform in the mobile terminal have touch screen, and the method includes:
The script receiving user makes startup request;
In response to this request, create test script;
The Action Events that user inputs on the touchscreen is received via mobile terminal;
A test command in test script is generated according to the Action Events received;
The Action Events inputted subsequent user on the touchscreen repeats the step of above-mentioned reception, generation, until the script receiving user makes ending request;
Receiving the test request of user, described test request includes the parameter of Run Script, and specifies the test script of operation;
In response to this request, read and specify the test script run;
Parameter according to described Run Script runs described test script;And
After end of run, generate test result.
2. the method for claim 1, the wherein said Action Events according to reception generates the step of a test command in test script and includes:
Obtaining the operation data produced after mobile terminal receives described Action Events, described operation data include type and the parameter of this Action Events;
In described test script, write includes the type of described Action Events and a test command of parameter.
3. method as claimed in claim 2, the parameter of wherein said Run Script includes running total degree, and the described step according to the parameter testing results script of Run Script includes:
Rerun described test script, until the number of times running this test script reaches described operation total degree.
4. method as claimed in claim 3, the parameter of wherein said Run Script also includes running total duration, and the described step according to the parameter testing results script of Run Script includes:
Rerun described test script, until the number of times running this test script reaches described operation total degree or runs time of this test script and reach the total duration of described operation.
5. the method as described in claim 3 or 4, the step of wherein said testing results script includes:
Read a test command initial in described test script;
Perform one test command;
Test command follow-up in described test script is repeated the step of above-mentioned reading and execution.
6. an automatic test device, resides in the mobile terminal with touch screen, and this device includes:
Request receiver module, is suitable to receive the script making startup request of user and script makes stopping and asking;Being further adapted for receiving the test request of user, described test request includes the parameter of Run Script, and specifies the test script of operation;
Script makes module, is adapted for script and makes startup request, creates test script;It is further adapted for receiving, via mobile terminal, the Action Events that user inputs on the touchscreen;It is further adapted for generating a test command in test script according to the Action Events received;The Action Events being further adapted for inputting subsequent user on the touchscreen repeats the step of above-mentioned reception, generation, until the script that described request receiver module receives user makes ending request;
Script runs module, is adapted for test request, reads and specifies the test script run;It is further adapted for the parameter according to described Run Script and runs described test script;And
Report generation module, after being suitable to end of run, generates test result.
7. device as claimed in claim 6, wherein said script makes module and is further adapted for obtaining the operation data produced after mobile terminal receives described Action Events, and described operation data include type and the parameter of this Action Events;It is further adapted in described test script write and includes the type of described Action Events and a test command of parameter.
8. device as claimed in claim 7, the parameter of wherein said Run Script includes running total degree, and described script runs module and is further adapted for the described test script that reruns, until the number of times running this test script reaches described operation total degree.
9. device as claimed in claim 8, the parameter of wherein said Run Script also includes running total duration, described script runs module and is further adapted for the described test script that reruns, until the number of times running this test script reaches described operation total degree or runs time of this test script and reach the total duration of described operation.
10. a mobile terminal, including the automatic test device as according to any one of claim 6-9.
CN201610152909.8A 2016-03-17 2016-03-17 A kind of automated testing method, device and mobile terminal Active CN105824755B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610152909.8A CN105824755B (en) 2016-03-17 2016-03-17 A kind of automated testing method, device and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610152909.8A CN105824755B (en) 2016-03-17 2016-03-17 A kind of automated testing method, device and mobile terminal

Publications (2)

Publication Number Publication Date
CN105824755A true CN105824755A (en) 2016-08-03
CN105824755B CN105824755B (en) 2019-03-15

Family

ID=56523938

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610152909.8A Active CN105824755B (en) 2016-03-17 2016-03-17 A kind of automated testing method, device and mobile terminal

Country Status (1)

Country Link
CN (1) CN105824755B (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106484614A (en) * 2016-09-29 2017-03-08 厦门美图之家科技有限公司 A kind of method of verification picture processing effect, device and mobile terminal
CN107066381A (en) * 2017-02-27 2017-08-18 网易(杭州)网络有限公司 Generate method, device and the equipment of the test analysis report based on image recognition
CN107729195A (en) * 2017-09-28 2018-02-23 努比亚技术有限公司 Test method, equipment and the readable storage medium storing program for executing of terminal
CN107783867A (en) * 2017-07-25 2018-03-09 上海壹账通金融科技有限公司 Gesture method of testing, device, computer equipment and storage medium
CN107908551A (en) * 2017-10-27 2018-04-13 中国平安人寿保险股份有限公司 Terminal software test method, device, terminal and computer-readable storage medium
CN108170593A (en) * 2017-12-22 2018-06-15 北京奇虎科技有限公司 The method and device of application program operation
CN109324967A (en) * 2018-09-26 2019-02-12 深圳壹账通智能科技有限公司 The method, apparatus and terminal device of application program pop-up components testing
CN109359258A (en) * 2018-09-14 2019-02-19 四川长虹电器股份有限公司 A kind of system and method for automatic trigger browser movement
CN110502414A (en) * 2019-08-20 2019-11-26 Oppo广东移动通信有限公司 Terminal device performance test methods, device, terminal device and storage medium
CN110908848A (en) * 2019-11-25 2020-03-24 展讯通信(上海)有限公司 Automatic testing method and device and storage medium
CN112183261A (en) * 2020-09-17 2021-01-05 广州朗国电子科技有限公司 Writing effect checking method and device, storage medium and display terminal
CN113312096A (en) * 2021-05-18 2021-08-27 宁波萨瑞通讯有限公司 Mobile terminal double-click awakening automatic test method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102419732A (en) * 2011-12-27 2012-04-18 Tcl集团股份有限公司 Android-platform-based automated testing method and testing tool
CN104077211A (en) * 2013-03-25 2014-10-01 腾讯科技(深圳)有限公司 Test method and test system for mobile terminal software
CN104424089A (en) * 2013-08-21 2015-03-18 中兴通讯股份有限公司 Terminal testing method and device
US20150135169A1 (en) * 2013-11-12 2015-05-14 Institute For Information Industry Testing device and testing method thereof
CN105320595A (en) * 2014-07-31 2016-02-10 腾讯科技(深圳)有限公司 Application test method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102419732A (en) * 2011-12-27 2012-04-18 Tcl集团股份有限公司 Android-platform-based automated testing method and testing tool
CN104077211A (en) * 2013-03-25 2014-10-01 腾讯科技(深圳)有限公司 Test method and test system for mobile terminal software
CN104424089A (en) * 2013-08-21 2015-03-18 中兴通讯股份有限公司 Terminal testing method and device
US20150135169A1 (en) * 2013-11-12 2015-05-14 Institute For Information Industry Testing device and testing method thereof
CN105320595A (en) * 2014-07-31 2016-02-10 腾讯科技(深圳)有限公司 Application test method and device

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106484614B (en) * 2016-09-29 2019-01-22 厦门美图之家科技有限公司 A kind of method, device and mobile terminal for checking picture treatment effect
CN106484614A (en) * 2016-09-29 2017-03-08 厦门美图之家科技有限公司 A kind of method of verification picture processing effect, device and mobile terminal
CN107066381A (en) * 2017-02-27 2017-08-18 网易(杭州)网络有限公司 Generate method, device and the equipment of the test analysis report based on image recognition
CN107783867B (en) * 2017-07-25 2020-02-14 深圳壹账通智能科技有限公司 Gesture testing method and device, computer equipment and storage medium
CN107783867A (en) * 2017-07-25 2018-03-09 上海壹账通金融科技有限公司 Gesture method of testing, device, computer equipment and storage medium
CN107729195A (en) * 2017-09-28 2018-02-23 努比亚技术有限公司 Test method, equipment and the readable storage medium storing program for executing of terminal
CN107729195B (en) * 2017-09-28 2021-07-23 努比亚技术有限公司 Method and device for testing terminal and readable storage medium
CN107908551A (en) * 2017-10-27 2018-04-13 中国平安人寿保险股份有限公司 Terminal software test method, device, terminal and computer-readable storage medium
CN108170593A (en) * 2017-12-22 2018-06-15 北京奇虎科技有限公司 The method and device of application program operation
CN109359258A (en) * 2018-09-14 2019-02-19 四川长虹电器股份有限公司 A kind of system and method for automatic trigger browser movement
CN109324967A (en) * 2018-09-26 2019-02-12 深圳壹账通智能科技有限公司 The method, apparatus and terminal device of application program pop-up components testing
CN110502414A (en) * 2019-08-20 2019-11-26 Oppo广东移动通信有限公司 Terminal device performance test methods, device, terminal device and storage medium
CN110502414B (en) * 2019-08-20 2023-08-29 Oppo广东移动通信有限公司 Terminal equipment performance test method and device, terminal equipment and storage medium
CN110908848A (en) * 2019-11-25 2020-03-24 展讯通信(上海)有限公司 Automatic testing method and device and storage medium
CN112183261A (en) * 2020-09-17 2021-01-05 广州朗国电子科技有限公司 Writing effect checking method and device, storage medium and display terminal
CN113312096A (en) * 2021-05-18 2021-08-27 宁波萨瑞通讯有限公司 Mobile terminal double-click awakening automatic test method

Also Published As

Publication number Publication date
CN105824755B (en) 2019-03-15

Similar Documents

Publication Publication Date Title
CN105824755A (en) Automation test method, automation test device and mobile terminal
CN106126424B (en) A kind of visual automated testing method of script, device and mobile terminal
CN109542399B (en) Software development method and device, terminal equipment and computer readable storage medium
US9990209B2 (en) Digital assistance device for facilitating multi-stage setup
TWI510913B (en) Testing device and testing method thereof
JP6338829B2 (en) Multiple input processing method and apparatus
CN108959068B (en) Software interface testing method, device and storage medium
CN107025019B (en) Virtual key interaction method and terminal equipment
CN103064620B (en) Touch screen operation method and touch screen terminal
CN105512033B (en) A kind of automated testing method of mobile terminal, device and mobile terminal
US9369823B2 (en) System and method for transferring software applications and data between two mobile devices with different operating systems
CN105975391B (en) One kind restarting test method, equipment and mobile terminal
CN113138925A (en) Function test method and device of application program, computer equipment and storage medium
CN108509343A (en) Automated testing method based on image recognition technology and system
WO2018121582A1 (en) Script generation method and device
CN108605220A (en) A kind of application processing method and device of universal embedded integrated circuit card
CN104991847A (en) Memory leakage automatic testing method and apparatus and mobile terminal
TWI476587B (en) Testing method and testing apparatus for testing function of electronic apparatus
CN107656866A (en) A kind of method, mobile terminal and computing device tested using fluency
CN105100875A (en) Method and device for controlling multimedia information recording
CN104991857B (en) Trace debug method and device
CN104407774A (en) Screen switching equipment and method as well as mobile terminal
CN109550232A (en) Touch control device and its response method, device
CN113938733A (en) Shortcut key control method and device for remote control equipment, storage medium and device
CN105824534A (en) Information processing method and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210922

Address after: 361000 1104, No. 22, dunling Erli, Huli District, Xiamen City, Fujian Province

Patentee after: Xiamen youoxygen Network Technology Co.,Ltd.

Address before: 361009 112a, Pioneer Building, Pioneer Park, torch hi tech Zone, Xiamen City, Fujian Province

Patentee before: Xiamen Meitu Mobile Technology Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20211027

Address after: 361000 room 2601, floor 26, No. 535, Gaolin Middle Road, Huli District, Xiamen City, Fujian Province

Patentee after: Xiamen Heigu Network Technology Co.,Ltd.

Address before: 361000 1104, No. 22, dunling Erli, Huli District, Xiamen City, Fujian Province

Patentee before: Xiamen youoxygen Network Technology Co.,Ltd.