The content of the invention
The present invention is to provide a kind of method for recording test exception, intelligent terminal and the device with store function, canEffectively obtain program test and the reproduction path of problem during exception occur.
In order to solve the above technical problems, one aspect of the present invention is:A kind of record is provided and tests exceptionMethod, it the described method comprises the following steps:
Start Application testing function to test tested program, while open oracle listener, record screen program and letterCease gripping tool;
The oracle listener is monitored the test process of the tested program, and the record screen program is to described by rangingThe test process of sequence is recorded, and generates video file, and described information gripping tool captures the tested program test processRunning state information;
The oracle listener judges whether the tested program test process exception occurs;
If there is exception, by the video file and the information captured preserves and/or upload server.
In order to solve the above technical problems, another technical solution used in the present invention is:A kind of intelligent terminal is provided, it is describedIntelligent terminal includes processor, and the processor is in configuration processor data to realize following steps:
Start Application testing function to test tested program, while open oracle listener, record screen program and letterCease gripping tool;
The oracle listener is monitored the test process of the tested program, and the record screen program is to described by rangingThe test process of sequence is recorded, and generates video file, and described information gripping tool captures the tested program test processRunning state information;
The oracle listener judges whether the tested program test process exception occurs;
If there is exception, by the video file and the information captured preserves and/or upload server.
In order to solve the above technical problems, another technical scheme that the present invention uses is:There is provided one kind has store functionDevice, described device has program stored therein data, and described program data realize following steps when being executed by processor:
Start Application testing function to test tested program, while open oracle listener, record screen program and letterCease gripping tool;
The oracle listener is monitored the test process of the tested program, and the record screen program is to described by rangingThe test process of sequence is recorded, and generates video file, and described information gripping tool captures the tested program test processRunning state information;
The oracle listener judges whether the tested program test process exception occurs;
If there is exception, by the video file and the information captured preserves and/or upload server.
The beneficial effects of the invention are as follows:The situation of prior art is different from, the present invention provides a kind of record and tests exceptionMethod, tested program is tested especially by Application testing function is started, while open oracle listener, record screen programWith information scratching instrument;Then oracle listener is monitored the test process of tested program, and record screen program is to tested programTest process is recorded, and generates video file, and the running status of information scratching instrument crawl tested program test processInformation;In addition, oracle listener judges whether tested program test process exception occurs, will record screen program institute if there is exceptionThe information that the video file and information scratching instrument of recording are captured preserves and/or upload server.In above method, startingWhile Application testing function is tested tested program, oracle listener, record screen program and information scratching instrument are opened,The test process of tested program is monitored, recorded and grabbed respectively using oracle listener, record screen program and information scratching instrumentTake running state information, and when oracle listener is monitored and determines tested program test process and occur abnormal, will record screen program recordThe information of video file and information scratching the instrument crawl of system preserves and/or upload server, so as to be tested when tested programDuring Cheng Fasheng exceptions, user can effectively obtain the reproduction path of problem, be easy to position problem and analyzed, to solve to askTopic, reduce research and development, the workload of test job personnel;And the test anomalous video file recorded and the information that is captured are justPreserve and check in user.
Embodiment
The present invention is described in detail with embodiment below in conjunction with the accompanying drawings.
Referring to Fig. 1, Fig. 1 is the schematic flow sheet of the abnormal embodiment of method one of present invention record test.Such as Fig. 1 institutesShow, the abnormal method of present embodiment record test comprises the following steps:
101:Start Application testing function to test tested program, while open oracle listener, record screen programWith information scratching instrument.
Wherein, tested program can be the application programs such as games, voice procedure or video program, and it, which can run on, appointsIn one intelligent terminal of meaning, intelligent terminal includes but is not limited to mobile phone terminal, the network terminal, mobile communication terminal etc..InformationGripping tool can be log instruments, or other information scratching instruments.
102:Oracle listener is monitored the test process of tested program, test process of the record screen program to tested programRecorded, and generate video file, information scratching instrument captures the running state information of tested program test process.
Specifically, oracle listener is monitored the whole test process of tested program, monitors the operation feelings of tested programCondition.
Record screen program can be recorded continuously to the whole test process of tested program, but open record screen program for a long time and enterRow is uninterrupted to be recorded, and obtains a larger video file, can take the internal memory of intelligent terminal too much, thus, in order to reduceThe EMS memory occupation of intelligent terminal, user as the case may be, can preset each record screen duration of record screen program and maximum regardsFrequency file number, program is shielded in then record to carry out segmentation record to the test process of tested program according to the default screen duration of record every timeSystem, when record screen program recording time reaches the default screen duration of record every time, then record screen program is closed, obtains a video textPart, record screen program is then then turned on, the test process of tested program is carried out successively according to the default screen duration of record every time againRecord, obtain multiple video files;When the video file number of gained is more than default maximum video file number, intelligent terminal is certainlyIt is dynamic to delete the video file generated at first, retain newly-generated video file, and keep current video number of files to be equal to and preset mostBig video file number.If test process tested program early stage normal operation, relative to the video file of record screen later stage acquisition, record screenWhat the video file more first obtained early stage retained has little significance, therefore as above deletes the video file obtained by early stage, only retains testThe video file of process later stage record screen gained, the stored memory of intelligent terminal can be saved.Wherein, presetting maximum video file number canTo be artificially to preset the maximum video file number that need to retain;It can also use according to artificial record screen total duration set in advanceShield duration with each record, total duration divided by the default maximum video file number recorded screen duration every time and tried to achieve are shielded by default record, fromAnd can according to the demand of user, retain record screen program record screen terminate before preset record screen total duration (or according to it is default every time recordScreen duration and preset the record screen total duration tried to achieve of maximum video file number) in treat ranging sequence test process and recorded and regardedFrequency file, the video file of record screen gained before this is deleted, reduce the EMS memory occupation of intelligent terminal.
In addition, if continually program is shielded in open and close record, larger consumption can be caused to the system resource of intelligent terminal, therefore beThis kind of situation is avoided, in another embodiment, user can preset record screen total duration, maximum video as the case may beNumber of files and each record screen duration;Intelligent terminal can shield total duration according to default record and preset maximum video file number, by pre-If record screen total duration divided by default maximum video file number, record screen duration every time is tried to achieve in calculating;Then judgement is tried to achieve eachRecord screen duration whether be less than it is default every time record screen duration, if it is less, using it is default every time record screen duration as reality it is everySecondary record screen duration, if fruit is not less than, each record screen duration that can be tried to achieve is as the actual screen duration of record every time;Then record screenProgram carries out segmentation recording according to actual screen duration of recording every time to the test process of tested program, is preset when record screen total duration is more thanDuring record screen total duration, intelligent terminal is automatically deleted the video file generated at first, retains newly-generated video file, and keeps working asPreceding record screen total duration is equal to default record and shields total duration, so as to avoid every time record screen duration too small, the test to tested programWhen Cheng Jinhang is recorded, the problem of program causes larger consumption to the system resource of intelligent terminal is shielded in frequent open and close record;AndUnnecessary video file is deleted, only retains the video file preset before test stops in total duration, so as to save intelligent terminalStored memory.
103:Oracle listener judges whether tested program test process exception occurs.
Specifically, while oracle listener monitors running situation of the tested program in test process, tested program is judgedWhether operation there is exception.Wherein, run the exception being likely to occur moved back by force including application program, application crash (Force&Close), application program without response (ANR, Application No Responding), (such as certificate is permitted for application program licenseCan, network license) any of which such as mistake.
104:If there is exception, by video file and the information captured preserves and/or upload server.
Specifically, if oracle listener, which is monitored, judges that exception occurs in the operation of test process tested program, program is shielded into recordThe information that the video file and information scratching instrument recorded are captured is stored in local device and/or upload server, so as toIt can be easy to preserve and check.Wherein, if record screen program is continuously recorded to the whole test process of tested program, test processWhen tested program operation occurs abnormal, then whole video file is preserved and/or upload server;If record screen program is to by rangingThe segmentation that the test process of sequence carries out as above is recorded, when the operation of test process tested program occurs abnormal, then by the video of reservationFile preserves and/or upload server.And if the operation of test process tested program does not occur exception, record screen program can be recordedVideo file and information scratching instrument crawl erasing of information.
In addition, gained and the multiple video files retained are recorded for segmentation, before preservation and/or upload server,Video file splicing first can be integrated into a complete video file.And for the information that information scratching instrument is captured, canIntercept and the information for recording crawl in screen total duration is preset before tested program test stops, including abnormal information during abnormal generation is (such asProgram to be measured occurs abnormal type and abnormal time point etc. occurs), then the information of interception is preserved in the lump with video fileAnd/or upload server, occur presetting information in record screen total duration before abnormal, test stops so as to only retaining program operation to be measuredThe information that gripping tool is captured, further save the stored memory of intelligent terminal.
Above before by video file and the information captured preservation and/or upload server, intelligent terminal can be to itBe compressed or some other conventional treatment, do not limit herein.And by video file and the information that is captured preserve and/Or after upload server, intelligent terminal can also generate prompting, prompt user to detect exception, and record and shield successfully;Wherein, promptThe one or more in the prompting modes such as auditory tone cues, text prompt or flashing indicating can be used, the present invention is not also done to thisLimit.
In other embodiments, go back active bank and be likely to occur abnormal situation and phase for program test to be measuredThe processing mode answered customizes detailed information, and database associates with information scratching instrument, can direct chain when test occurs abnormalDatabase is connected to, and scans for matching with the test abnormal conditions stored in database according to current abnormal conditions, is found outRelated abnormal conditions and corresponding processing countermeasure;In some cases, intelligent terminal even can also pass through internal operationComparative analysis, and then conclusion is provided, such as abnormal possible cause, it is contemplated that the processing mode taken;And then it is easy to research and develop peopleMember is according to the video recorded, the information captured and the relevant abnormalities situation searched in database, intelligent terminalAnalysis result etc., orientation problem;And the processing mode of the relevant abnormalities situation searched in database is may be incorporated in, analysis is askedTopic, and then make corresponding solution.In addition, the exception and the processing mode of use that each test occurs can also be recordedEnter in database, the reference as positioning analysis problem when exception occurs in test backward.The setting of above linked database, can be justProblem is positioned, analyzes and solved more quickly when exception occurs in program test to be measured in user.
The abnormal method of present embodiment record test, by starting Application testing function to tested program progressWhile test, oracle listener, record screen program and information scratching instrument are opened, is grabbed using oracle listener, record screen program and informationTake instrument to be monitored, recorded and captured running state information to the test process of tested program respectively, and supervised in oracle listenerListen determine tested program test process occur it is abnormal when, by record screen program record video file and information scratching instrument captureInformation preserve and/or upload server, so as to when tested program test process occur it is abnormal when, user can be by analyzing informationThe information of gripping tool crawl, abnormal information of the program to be measured in test process is obtained, including exception occurs for program to be measuredType and the time point that exception occurs, and the reproduction path occurred extremely can be obtained by video file, consequently facilitating to problemFast positioning and analysis are carried out, to solve problem, reduces research and development and the workload of test job personnel;And the test recordedAnomalous video file and the information of crawl are easy to user to preserve and check.
The above method is applied to intelligent terminal, and its logical process can be represented by computer program, and can pass through intelligenceTerminal is realized.
For the hardware configuration of intelligent terminal, referring to Fig. 2, Fig. 2 is the structure of the embodiment of intelligent terminal one of the present inventionSchematic diagram.As shown in Fig. 2 present embodiment intelligent terminal 201 includes processor 202, and processor 202 is in configuration processor dataWhen to realize above record test abnormal method embodiment the step of.
Present embodiment, the configuration processor data of processor 202 of intelligent terminal 201, starting Application testing functionWhile test tested program, oracle listener, record screen program and information scratching instrument are opened, utilizes oracle listener, recordRunning state information is monitored, recorded and captured to screen program and information scratching instrument to the test process of tested program respectively,And oracle listener monitor determine tested program test process occur it is abnormal when, by record screen program record video file and letterInformation preservation and/or the upload server of gripping tool crawl are ceased, so that when tested program test process occurs abnormal, userThe reproduction path of problem can be effectively obtained, is easy to position problem and analyzed, to solve problem, reduces research and development and test workMake the workload of personnel;And the test anomalous video file recorded and the information captured are easy to user to preserve and check.
For computer program, realize in a software form and as independent production marketing or in use, be storable in oneIn individual electronic device-readable storage medium, i.e. the present invention also provides a kind of device with store function, referring to Fig. 3, Fig. 3It is the structural representation for the embodiment of device one that the present invention has store function, should has on the device 301 of store function and depositRoutine data 302 is contained, the routine data 302 can be executed by processor to realize that the method that record test is abnormal above is implementedThe step of mode.Wherein, processor can be processor possessed by this has the device 301 of store function itself, can alsoIt is the processor of other-end device.And it with the device 301 of store function should may include that procedure above data 302 can be carriedAny device, such as include USB flash disk, CD and terminal, at least one of server, do not limit herein.
Present embodiment has the device 301 of store function, when the routine data 302 stored thereon is executed by processor,It can be achieved:Start Application testing function to test tested program, while open oracle listener, record screen program and informationGripping tool, the test process of tested program is monitored respectively using oracle listener, record screen program and information scratching instrument,Running state information is recorded and captured, and is monitored by oracle listener and judges whether tested program test process exception occurs, ifThere is exception, then will record video file and the information preservation of information scratching instrument crawl and/or upload service that screen program is recordedDevice, so as to which when tested program test process occurs abnormal, user can effectively obtain the reproduction path of problem, be easy to enter problemRow positioning and analysis, to solve problem, reduce research and development and the workload of test job personnel;And the test recorded regards extremelyFrequency file and the information captured are easy to user to preserve and check.
Embodiments of the present invention are the foregoing is only, are not intended to limit the scope of the invention, it is every to utilize thisThe equivalent structure or equivalent flow conversion that description of the invention and accompanying drawing content are made, or directly or indirectly it is used in other correlationsTechnical field, it is included within the scope of the present invention.