Embodiment
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
Embodiment one
Refer to Fig. 1, the page that it illustrates the embodiment of the present invention one provides loads the method flow diagram of duration method of testing, and the method may be used for testing page loading velocity in the terminal.The method can comprise:
Step 102, obtains record screen video, and this record screen video is the video recording at least one page loading procedure in the terminal;
Step 104, obtains in this record screen video, the relative point in time of this page start-up loading;
Step 106, obtains the relative point in time that the predetermined content in this record screen screen, in this page has loaded;
Step 108, the difference between the relative point in time loaded the predetermined content in the relative point in time of this page start-up loading and this page is as the loading duration of the predetermined content in this page.
In sum, the page that the embodiment of the present invention provides loads duration method of testing, by the relative point in time that the relative point in time of this page start-up loading of video acquisition of record page loading procedure has in the terminal loaded with the predetermined content in this page, and difference between the relative point in time predetermined content in the relative point in time of this page start-up loading and this page loaded is as the loading duration of the predetermined content in this page, in the program source code of application, adding correlative code in solution prior art needs source code very familiar, cause the test period page of application being loaded to duration longer, and then the development process of impact application, and manual testing can consume a large amount of human resources, low and the problem that accuracy is not high of testing efficiency, reach in saving human resources, shorten test period, while improving testing efficiency, ensure the object of test accuracy.
Embodiment two
In order to the method provided above-described embodiment one is further described, refer to Fig. 2, the page that it illustrates the embodiment of the present invention two provides loads the method flow diagram of duration method of testing, the method may be used for the page in terminal, and the loading velocity in the such as mobile terminal such as smart mobile phone, panel computer is tested.The method can comprise:
Step 202, proving installation receives the SOT state of termination parameter of input, is configured this terminal according to this SOT state of termination parameter.
Wherein, this SOT state of termination parameter comprises network type and/or whether empties buffer memory.
When testing, need the page loading velocity of test terminal under different networks and buffer status respectively.Proving installation is before control terminal carries out record screen to the process of load page, first can receive the configuration parameter such as network type, buffer status (whether emptying buffer memory) of test subscriber's input, and according to the configuration parameter received, test terminal is configured.
Concrete, network type can comprise 2G(2nd-Generation, Generation Mobile Telecommunication System technology), 3G(3rd-Generation, G mobile communication), 4G(4th-Generation, forth generation mobile communication technology) and Wi-Fi(Wireless-Fidelity, Wireless Fidelity) etc., the current network of terminal can be configured to 2G/3G/4G/Wi-Fi according to network type by proving installation.
In addition, for a certain application program, having buffer memory and without under buffer status, its page loads required duration and usually can make a big difference.Test more targetedly to load duration to the page, proving installation is according in configuration parameter being the buffer memory that buffer status determines whether to empty terminal.
Step 204, proving installation obtains the record screen video of record page loading procedure in the terminal;
Proving installation can complete the start-up loading process of the pages at different levels of a certain application and carries out record screen to said process by control terminal, obtains record screen video.
Concrete, proving installation can control this terminal and start record screen; And control this terminal and start at least one page successively, wherein, this terminal is adjacent starts the first scheduled wait duration of being separated by between the page for twice; Proving installation controls this terminal at last page started in this at least one page and terminates record screen after waiting for the second scheduled wait duration; Finally, proving installation receives the record screen video that this terminal exports.
Proving installation can send instruction to terminal and carry out analog subscriber manual operation in the terminal.To test three kinds of different pages in a certain application, first proving installation sends to terminal the operation that instruction simulation user starts record screen software in the terminal, starts record screen, then, proving installation sends to terminal the operation that instruction simulation user starts application in the terminal, after waiting for the first scheduled duration, proving installation sends to terminal the operation that instruction simulation user clicks a certain original list opened in application homepage in the terminal, after again waiting for the first scheduled duration, proving installation sends to terminal the operation that instruction simulation user clicks a certain details page opened in this original list in the terminal, and after wait second scheduled duration, the operation that instruction simulation user closes record screen software is in the terminal sent to terminal, and the record screen video that the record screen software in receiving terminal exports.Wherein, above-mentioned first scheduled duration and the second scheduled duration can be arranged voluntarily by test subscriber, and the duration of being separated by between the adjacent twice transmission instruction of proving installation can be identical, also can be different, and to this, the embodiment of the present invention is not specifically limited.
It should be noted that, guide page can be shown when the first time be much applied in after installing or upgrading uses, therefore, when proving installation in step 201 according in configuration parameter be buffer status determine the buffer memory emptying terminal time, after proving installation starts the operation of application in the terminal to terminal transmission instruction simulation user, also need to send to terminal the operation that instruction simulation user closes guide page in the terminal.
In addition, when proving installation sends instruction simulation user clicking operation in the terminal to terminal, need the coordinate of simulating clicking operation, and in different terminals, due to the difference of resolution, the coordinate for same application simulation clicking operation is often different.To this, test subscriber can in advance by under different terminals resolution, the manual input test device of the simulation click coordinate corresponding to this application, and when testing, proving installation can search corresponding simulation click coordinate according to terminal type and embody rule.But when the device application that is more or test of test is more, said method needs test subscriber to search and manually each application of input is corresponding to the simulation click coordinate under each resolution, and waste plenty of time and manpower, testing efficiency is low.
To this, in order to the terminal type that adaptation is different, proving installation can calculate the coordinate of simulating clicking operation in current test terminal based on reference to resolution and reference coordinate.Concrete, test terminal obtains the resolution of the screen of this terminal, calculates start coordinate according to the resolution of the screen of reference resolution, reference coordinate and this terminal preset; Wherein, this reference coordinate is the position coordinates of startup button under this reference resolution of at least one page in this application, and this startup coordinate is the position coordinates of startup button under the resolution of the screen of this terminal of at least one page in this application; Test terminal starts at least one page in this application successively according to this this terminal of startup coordinate control.
Concrete, the reference resolution preset is (400*854), and the reference coordinate of startup button under this reference resolution of a certain page is (x0, y0), it is (320*480) that proving installation obtains current resolution, then proving installation can calculate the coordinate (x, y) of startup button under the resolution of this terminal of this page, wherein, and x=(320/400) * x0; Y=(480/854) * y0.
By the above-mentioned utilization method with reference to resolution and reference coordinate calculating simulation click coordinate, tester only needs to obtain and inputs and is eachly applied in reference to the corresponding click coordinate under resolution, cost of labor and test duration can be reduced, improve testing efficiency.
Step 206, proving installation obtains in this record screen video, the relative point in time of this page start-up loading;
Concrete, proving installation when control terminal carries out record screen in step 204, can obtain the time point t starting and record this record and shield video0, and obtain the time point t starting a certain page in this record of recording screen video process1; Proving installation can according to t0and t1calculate in this record screen video, the relative point in time t of this page start-up loading, wherein, t=t1-t0-T, T are the delay duration estimated.
Concrete, still with in above-mentioned steps to kind of the page (homepage of three in a certain application, original list and details page) to carry out test be example, test terminal record sends to terminal the running time point a that instruction simulation user starts record screen software in the terminal, the running time point b that instruction simulation user starts application is in the terminal sent to terminal, click the running time of opening original list in the terminal to terminal transmission instruction simulation user put c and click the running time point d opening details page to terminal transmission instruction simulation user in the terminal, consider proving installation to terminal send instructions to terminal receive instruction make a response between there is expected latency T, therefore, test terminal can calculate in this record screen video, the relative point in time of homepage page start-up loading is b-a-T, the relative point in time of original list start-up loading is c-a-T, the relative point in time of details page start-up loading is d-a-T.
Step 208, proving installation obtains the relative point in time that the predetermined content in this record screen screen, in this page has loaded;
Proving installation can carry out framing to this record screen video, obtains the relative point in time at least two frame pictures and this record of each leisure of this at least two frames picture screen video; Proving installation determines Target Photo from this at least two frames picture, and this Target Photo has been load predetermined content in this page and relative point in time picture the earliest; The relative point in time of this Target Photo is defined as the relative point in time that the predetermined content in this page has loaded by proving installation.This predetermined content can comprise the complete page of the framework of this page, the first word of this page and/or this page.
Wherein, when proving installation determines Target Photo from this at least two frames picture, that prestore, when having loaded corresponding to the predetermined content of this page reference picture can be obtained, and calculate the similarity of this at least two frames picture and this reference picture; Similarity is greater than predetermined threshold value, and relative point in time picture is the earliest defined as this Target Photo.
Step 210, the difference between the relative point in time that the predetermined content in the relative point in time of this page start-up loading and this page has loaded by proving installation is as the loading duration of the predetermined content in this page.
Wherein, this predetermined content can comprise the complete page of the framework of this page, the first word of this page and/or this page, and the loading duration of this predetermined content comprises the loading duration of the framework of this page, the loading duration of first word of this page and/or the loading duration of the complete page of this page.
Preferably, above-mentioned proving installation can be divided into two parts, i.e. video record part and loading duration detecting portion.When needs carry out the test of loading duration to multiple intimate application, video record part is carried out video record to the plurality of application and is preserved the video exported, load the video that duration detecting portion can extract one or more application from the video preserved, detect targetedly.
Concrete, during recorded video, the video record part in proving installation receives the resolution of the mark of one or more application of test subscriber's input, the screen of cycle index, configuration parameter (network type and buffer status) and the terminal to each application recorded video.It should be noted that, when the application identities of test subscriber's input is multiple, the record screen environment applied to make each is as far as possible close, poll record screen can be carried out to the plurality of application, such as, test subscriber inputs application A, B and C these 3 application mark and circulation 3 times, then video record part is according to the order can applying A->B->C->A->B->C->A->B->C, according to the method shown in above-mentioned steps 204 to these 3 application poll recorded video, finally obtain and preserve terminal export video.
When carrying out the test of loading duration, load the mark of application and the mark of video that duration detecting portion can receive test subscriber's input, according to the mark of the application received and the corresponding video of the marker extraction of video, and calculate the page loading duration of corresponding application according to the method shown in step 206 ~ 210.
In sum, the page that the embodiment of the present invention provides loads duration method of testing, by the relative point in time that the relative point in time of this page start-up loading of video acquisition of record page loading procedure has in the terminal loaded with the predetermined content in this page, and difference between the relative point in time predetermined content in the relative point in time of this page start-up loading and this page loaded is as the loading duration of the predetermined content in this page, solve in prior art and add correlative code and need source code very familiar in the program source code of application, cause the test period page of application being loaded to duration longer, and then the development process of impact application, and manual testing can consume a large amount of human resources, low and the problem that accuracy is not high of testing efficiency, reach in saving human resources, shorten test period, while improving testing efficiency, ensure the object of test accuracy.
Embodiment three
Refer to Fig. 3, the page that it illustrates the embodiment of the present invention three provides loads the structure drawing of device of duration proving installation, and this device can comprise:
Video acquiring module 301, for obtaining record screen video, described record screen video is the video recording at least one page loading procedure in the terminal;
Very first time point acquisition module 302, for obtaining, described record is shielded in video, the relative point in time of described page start-up loading;
Second time point acquisition module 303, the relative point in time that the predetermined content for obtaining in described record screen screen, in the described page has loaded;
Load duration acquisition module 304, for the loading duration of the difference between the relative point in time that the predetermined content in the relative point in time of described page start-up loading and the described page loaded as the predetermined content in the described page.
In sum, the page that the embodiment of the present invention provides loads duration proving installation, by the relative point in time that the relative point in time of this page start-up loading of video acquisition of record page loading procedure has in the terminal loaded with the predetermined content in this page, and difference between the relative point in time predetermined content in the relative point in time of this page start-up loading and this page loaded is as the loading duration of the predetermined content in this page, in the program source code of application, adding correlative code in solution prior art needs source code very familiar, cause the test period page of application being loaded to duration longer, and then the development process of impact application, and manual testing can consume a large amount of human resources, low and the problem that accuracy is not high of testing efficiency, reach in saving human resources, shorten test period, while improving testing efficiency, ensure the object of test accuracy.
Embodiment four
In order to the device provided above-described embodiment three is described further, refer to Fig. 4, the page that it illustrates the embodiment of the present invention four provides loads the structure drawing of device of duration proving installation, this device may be used for control terminal and records page loading video, and obtains the loading duration of the page according to the video recorded.This device can comprise:
Video acquiring module 401, for obtaining record screen video, described record screen video is the video recording at least one page loading procedure in the terminal;
Very first time point acquisition module 402, for obtaining, described record is shielded in video, the relative point in time of described page start-up loading;
Second time point acquisition module 403, the relative point in time that the predetermined content for obtaining in described record screen screen, in the described page has loaded;
Load duration acquisition module 404, for the loading duration of the difference between the relative point in time that the predetermined content in the relative point in time of described page start-up loading and the described page loaded as the predetermined content in the described page.
Described very first time point acquisition module 402, comprising:
First acquiring unit 4021, for obtaining the time point t starting and record described record screen video0;
Second acquisition unit 4022, is recording for obtaining the time point t starting the described page in described record screen video process1;
Time point computing unit 4023, for calculating, described record is shielded in video, the relative point in time t of described page start-up loading, wherein, t=t1-t0-T, T are the delay duration estimated.
Described second time point acquisition module 403, comprising:
Dividing frame unit 4031, for carrying out framing to described record screen video, obtaining the relative point in time at least two frame pictures and each leisure of described at least two frame picture described record screen video;
Picture determining unit 4032, for determining Target Photo from described at least two frame pictures, described Target Photo has been load predetermined content in the described page and relative point in time picture the earliest;
Time point determining unit 4033, for being defined as the relative point in time that the predetermined content in the described page has loaded by the relative point in time of described Target Photo.
Described picture determining unit 4032, comprising:
Picture obtains subelement 4032a, for obtain prestore, loaded corresponding to the predetermined content of the described page time reference picture;
Similarity Measure subelement 4032b, for the similarity of at least two frame pictures described in calculating and described reference picture;
Picture determination subelement 4032c, for similarity is greater than predetermined threshold value, and relative point in time picture is the earliest defined as described Target Photo.
Described video acquiring module 401, comprising:
Record screen start unit 4011, starts record screen for controlling described terminal;
Page start unit 4012, starts at least one page described successively for controlling described terminal, wherein, and the first scheduled wait duration of being separated by between the adjacent twice startup page of described terminal;
Record screen end unit 4013, terminates record screen for controlling described terminal at last page started at least one page described after waiting for the second scheduled wait duration;
Video reception unit 4014, for receiving the described record screen video that described terminal exports.
Described video acquiring module 401 also comprises:
Resolution acquiring unit 4015, before described terminal starts at least one page described successively, obtains the resolution of the screen of described terminal for controlling at described page start unit 4012;
Coordinate calculating unit 4016, the resolution for the screen according to reference resolution, reference coordinate and the described terminal preset calculates and starts coordinate; Wherein, described reference coordinate is the position coordinates of startup button under described reference resolution of at least one page described, and described startup coordinate is the position coordinates of startup button under the resolution of the screen of described terminal of at least one page described;
Described page start unit 4012, starts at least one page described successively for terminal according to described startup coordinate control.
Described device also comprises:
Parameter receiver module 405, for obtain record screen video in described video acquiring module 401 before, receive the SOT state of termination parameter of input, described SOT state of termination parameter comprises network type and/or whether empties buffer memory;
Configuration module 406, for being configured described terminal according to described SOT state of termination parameter.
In sum, the page that the embodiment of the present invention provides loads duration proving installation, by the relative point in time that the relative point in time of this page start-up loading of video acquisition of record page loading procedure has in the terminal loaded with the predetermined content in this page, and difference between the relative point in time predetermined content in the relative point in time of this page start-up loading and this page loaded is as the loading duration of the predetermined content in this page, solve in prior art and add correlative code and need source code very familiar in the program source code of application, cause the test period page of application being loaded to duration longer, and then the development process of impact application, and manual testing can consume a large amount of human resources, low and the problem that accuracy is not high of testing efficiency, reach in saving human resources, shorten test period, while improving testing efficiency, ensure the object of test accuracy.
It should be noted that: the page that above-described embodiment provides loads duration proving installation when test page loads duration, only be illustrated with the division of above-mentioned each functional module, in practical application, can distribute as required and by above-mentioned functions and be completed by different functional modules, inner structure by device is divided into different functional modules, to complete all or part of function described above.In addition, the page that above-described embodiment provides loads duration proving installation and the page and loads the embodiment of the method that duration tests and belong to same design, and its specific implementation process refers to embodiment of the method, repeats no more here.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that all or part of step realizing above-described embodiment can have been come by hardware, the hardware that also can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium mentioned can be ROM (read-only memory), disk or CD etc.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.