CN102624576B - A kind of method and system of web page download time of automatic test browser - Google Patents

A kind of method and system of web page download time of automatic test browser Download PDF

Info

Publication number
CN102624576B
CN102624576B CN201110032465.1A CN201110032465A CN102624576B CN 102624576 B CN102624576 B CN 102624576B CN 201110032465 A CN201110032465 A CN 201110032465A CN 102624576 B CN102624576 B CN 102624576B
Authority
CN
China
Prior art keywords
screenshot picture
page download
web page
webpage
screenshotss
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.)
Active
Application number
CN201110032465.1A
Other languages
Chinese (zh)
Other versions
CN102624576A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201110032465.1A priority Critical patent/CN102624576B/en
Publication of CN102624576A publication Critical patent/CN102624576A/en
Application granted granted Critical
Publication of CN102624576B publication Critical patent/CN102624576B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides a kind of method and system of web page download time of automatic test browser.Described method comprises: in terminal, opening described webpage to start to download described webpage according to opening web page instructions, recording the initial time of described page download simultaneously; In described page download process, described terminal obtains at least one screenshot picture, at least one value that record is corresponding with the screenshotss moment of at least one screenshot picture described simultaneously; At least one screenshot picture relatively more described is to determine whether described webpage is downloaded complete successively; And if determine that described page download is complete according to one of at least one screenshot picture described, then determine deadline of described page download according to the value corresponding with determining the screenshotss moment of the screenshot picture that described page download is complete.The present invention accurately can measure web page download time and the flow of different browsers when the source code without the need to obtaining browser.

Description

A kind of method and system of web page download time of automatic test browser
Technical field
The present invention relates to browsing device net page measuring technology, especially relate to the method and system of the web page download time of test browser automatically.
Background technology
The time that current calculating browsing device net page is downloaded and flow, have following three kinds of modes usually:
First kind of way: by initial time and the deadline of hand computation page download, also draws the traffic consumes of page download process simultaneously by inquiry mobile phone connection management.Owing to adopting the mode of pinching stopwatch, accuracy is not high, and application condition is large.In addition, use manual testing, sampled point is fewer, and accuracy is inadequate, and time-consuming and manpower.When testing different browsers, also needing to drop into different manpower and testing.
The second way: by means of initial time and the deadline of stopwatch record page download, and recorded a video by the whole process opened webpage, each frame then by analyzing video recording draws initial time and deadline, thus obtains both differences.But although adopt the method for video recording analysis frame, accuracy improves, owing to needing many pictures, human eye analysis is very hard.Equally, due to needs manual test, compare and waste time and energy, sampled point is few, and accuracy is not high enough.
The third mode: by adding test code in browser source code, the initial time of test code record page download and deadline, thus the difference (i.e. web page download time) drawing both, records traffic consumes simultaneously.Although this mode can accurately calculate the webpage time by code interface, but need the source code obtaining different browsers version to realize, and to obtain source code be almost impossible.
As can be seen here, need a kind of accurately can measure different browsers web page download time and also automatic test technology without the need to the source code that obtains browser.
Summary of the invention
In order to solve the problems of the technologies described above, the present invention proposes a kind of method and system of web page download time of automatic test browser, accurately can measure the web page download time of different browsers when the source code without the need to obtaining browser.
According to an aspect of the present invention, provide a kind of method of web page download time of automatic test browser, comprising: in terminal, opening described webpage to start to download described webpage according to opening web page instructions, recording the initial time of described page download simultaneously; In described page download process, described terminal obtains at least one screenshot picture, at least one value that record is corresponding with the screenshotss moment of at least one screenshot picture described simultaneously; Successively the screenshot picture that at least one screenshot picture described and the expression prestored have been downloaded is compared to determine whether described webpage is downloaded complete; And if determine that described page download is complete according to one of at least one screenshot picture described, then determine deadline of described page download according to the value corresponding with determining the screenshotss moment of the screenshot picture that described page download is complete.
Described method may further include: the difference calculating described deadline and described initial time is as the time of downloading described webpage and spending.
Described method may further include: when opening described webpage, record start flow value; When determining that described page download is complete, record flow value; And the difference completing flow value and described fore flow value described in calculating is as the flow downloaded described webpage and consume.
Described method may further include: if determine that described webpage is not downloaded complete, then send and obtain screenshot picture instruction, the step of wherein said at least one screenshot picture of acquisition comprises: obtain current screenshot picture when receiving described acquisition screenshot picture instruction.
The step of described at least one screenshot picture of acquisition can comprise: periodically obtain current screenshot picture, described method may further include: if determine that described page download is complete, then send and stop obtaining screenshot picture instruction, and stop obtaining current screenshot picture according to this snapshot instruction.
The step of at least one value that described record is corresponding with the screenshotss moment of at least one screenshot picture described can comprise: store at least one screenshot picture described, and the screenshotss order that record is corresponding with the screenshotss moment of at least one screenshot picture described in the title of at least one screenshot picture described respectively; And the described basis value corresponding with determining the screenshotss moment of the screenshot picture that described page download is complete determines that the step of the deadline of described page download can comprise: according to screenshotss cycle, described initial time and determine that the screenshotss order of the screenshot picture that described page download is complete determines the described deadline.
The step of at least one value that described record is corresponding with the screenshotss moment of at least one screenshot picture described can comprise: store at least one screenshot picture described, and the timestamp that record is corresponding with the screenshotss moment of at least one screenshot picture described in the title of at least one screenshot picture described respectively.
Described terminal can be intelligent mobile terminal, described intelligent mobile terminal can by with the communication interface of terminal receive described terminal send described in open web page instructions to open described webpage, and receive screenshotss instruction to obtain at least one screenshot picture described from described terminal; And described in described terminal can perform successively at least one screenshot picture relatively described step and determine the step of described deadline, described method may further include: at least one screenshot picture described, described initial time and at least one value corresponding with the screenshotss moment of at least one screenshot picture described are sent to described terminal by described communication interface by described intelligent mobile terminal.
Described basis is opened the step that web page instructions opens described webpage in terminal and can be comprised: open according to described web page instructions to input described webpage in the address field of described browser network address in the mode of simulating keyboard, and simulation points impact opens the operation of described webpage to open described webpage.
The step of described at least one screenshot picture relatively more described successively can comprise: the mode of the character adopting contrast picture pixels or optical character identification to obtain, the precalculated position of more described webpage at least one screenshot picture of showing and the screenshot picture that this precalculated position is shown when described page download completes prestored successively, and one of at least one screenshot picture described in described basis determines that the complete step of described page download comprises: when one of at least one screenshot picture that the precalculated position of described webpage is shown is identical with the screenshot picture that this precalculated position is shown when described page download completes prestored, determine that described page download is complete, wherein when described page download completes, on described precalculated position, displayed web page has downloaded mark.
According to a further aspect in the invention, provide a kind of system of web page download time of automatic test browser, comprising: browser, for downloading and displayed web page in terminal; Test execution unit, for opening described webpage to start to download described webpage on described browser according to opening web page instructions, records the initial time of described page download simultaneously; And obtain at least one screenshot picture for the described webpage from described browser-presented in described page download process, at least one value that record is corresponding with the screenshotss moment of at least one screenshot picture described simultaneously; And test processes unit, described in sending to described test execution unit, open web page instructions; And for receiving at least one screenshot picture described from described test execution unit, and successively the screenshot picture that at least one screenshot picture described and the expression prestored have been downloaded is compared, to determine whether described webpage is downloaded complete; And if for determining that described page download is complete according to one of at least one screenshot picture described, then determine the deadline of described page download according to the value corresponding with determining the screenshotss moment of the screenshot picture that described page download is complete.
Described system may further include: computing unit, for the difference that calculates described deadline and described initial time as the time of downloading described webpage and spending.
Described test execution unit can be further used for the record start flow value when opening described webpage, and has recorded flow value when determining that described page download is complete; And the difference completing flow value and described fore flow value described in described computing unit is further used for calculating is as the flow downloaded described webpage and consume.
If described test processes unit can be further used for determining that described webpage is not downloaded complete, then send to described test execution unit and obtain screenshot picture instruction, and the described webpage of described test execution unit when receiving described acquisition screenshot picture instruction from described browser-presented obtains current screenshot picture.
Described test execution unit can periodically obtain current screenshot picture, if described test processes unit can be further used for determining that described page download is complete, then send to described test execution unit and stop obtaining screenshot picture instruction, and described test execution unit can be further used for stopping obtaining current screenshot picture according to this snapshot instruction.
Described test execution unit and described browser can be positioned on intelligent mobile terminal, described test processes unit and described computing unit can be positioned on terminal, described test execution unit can be received by the communication interface between described intelligent machine mobile terminal and described terminal described test processes unit send described in open web page instructions, and described test execution unit can be further used at least one screenshot picture described by described communication interface, described initial time and at least one value corresponding with the screenshotss moment of at least one screenshot picture described are sent to described test processes unit.
Described test execution unit can store at least one screenshot picture described, and the timestamp that record is corresponding with the screenshotss moment of at least one screenshot picture described in the title of at least one screenshot picture described respectively.
Described test processes unit can comprise simulating keyboard module, described simulating keyboard module may be used for opening the network address that web page instructions inputs described webpage in the address field of described browser described in basis, and simulation points impact opens the operation of described webpage to open described webpage.
The mode of the character that described test processes unit can adopt contrast picture pixels or optical character identification to obtain, the precalculated position of more described webpage at least one screenshot picture of showing and the screenshot picture that this precalculated position is shown when described page download completes prestored successively, and when one of at least one screenshot picture that the precalculated position of described webpage is shown is identical with the screenshot picture that this precalculated position is shown when described page download completes prestored, determine that described page download is complete, wherein when described page download completes, on described precalculated position, displayed web page has downloaded mark.
From with technique scheme, the method and system of the web page download time of a kind of automatic test browser provided by the invention, adopt the mode of test automatically, by obtaining screenshot picture in the downloading process of browsing device net page, record time during each screenshotss simultaneously, and screenshot picture when completing with this page download prestored the screenshot picture obtained compares, thus automatically can determine web page download time, accurate height, sampling quantity is many, and any a browser that can be applied on smart mobile phone or PC, and without the need to obtaining the source code of browser.
Accompanying drawing explanation
Fig. 1 is the indicative flowchart of the method for the web page download time automatically testing browser according to an embodiment of the invention;
Fig. 2 is the indicative flowchart of the method for the web page download time of automatic test browser according to another embodiment of the present invention;
Fig. 3 is the indicative flowchart of the method for the web page download time of automatic test browser according to still another embodiment of the invention;
Fig. 4 is the indicative flowchart of the method for the web page download time of the automatic test browser of the one exemplary embodiment of embodiment according to Fig. 2 of the present invention;
Fig. 5 is the indicative flowchart of the method for the web page download time of the automatic test browser of the one exemplary embodiment of embodiment according to Fig. 3 of the present invention; And
Fig. 6 is the block diagram of the system of the web page download time automatically testing browser according to an embodiment of the invention.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly, the present invention is described in further detail below in conjunction with the accompanying drawings and the specific embodiments.
Due to when testing the flow of time that the page download of browser spends and consumption, the method that usual employing is manually compared, this method precision is not high, and workload is large.Although and another utilizes the method for browser source code to measure accurately, unlikely obtain the source code of various browser under normal circumstances.The solution of the present invention adopts the mode of test automatically, repeatedly screenshot picture is obtained in page download process, obtain the time of each screenshotss and the flow of terminal simultaneously, then by the screenshot picture that more each screenshot picture has been downloaded with the expression prestored, thus determining to calculate web page download time and consumed flow when both are identical.
Fig. 1 is the indicative flowchart of the method 100 of the web page download time automatically testing browser according to an embodiment of the invention.See Fig. 1, method 100 comprises:
Step 110, opening webpage to start downloading web pages according to opening web page instructions, recording the initial time of page download simultaneously in terminal.Such as, after receiving and opening web page instructions, the network address (URL) of webpage can be inputted in the mode of simulating keyboard in the address field of browser, and simulation points impact opens the operation of webpage to open webpage.In step 110, such as, can stab by allocating time function acquisition time, namely obtain the time of opening webpage, and initial time can be recorded as the form of timestamp.
Step 120, in page download process, terminal obtains at least one screenshot picture, at least one value that record is corresponding with the screenshotss moment of at least one screenshot picture simultaneously.Such as, when each screenshotss, this screenshot picture can be stored, and the timestamp that record is corresponding with the screenshotss moment of this screenshot picture in the title of this screenshot picture, comprise the time in screenshotss moment in this timestamp.Such as, this timestamp can be obtained by allocating time function.In addition, when the interval of each screenshotss is certain, can also only record and the screenshotss moment screenshotss order of tackling mutually.
Step 130, compares at least one screenshot picture successively to determine whether webpage is downloaded complete.Such as, the mode of the character that can adopt contrast pixel or obtained by optical character knowledge (OCR), the precalculated position of comparing webpage successively at least one screenshot picture of showing and the screenshot picture that this precalculated position is shown when page download completes prestored, and when one of at least one screenshot picture that the precalculated position of webpage is shown is identical with the screenshot picture that this precalculated position is shown when this page download completes prestored, determine that this page download is complete.Certainly, also when determining screenshot picture identical (such as, more than 90%) being identical to a certain extent, can determine that page download is complete.Usually, when page download completes, mark can have been downloaded by displayed web page on a predetermined position.Such as, after webpage opened by the browser of different mobile phone, in page download process, there will be progress bar prompting or certain flag (such as right soft key word) represents that webpage is being downloaded medium.If webpage has all been downloaded, then progress bar will disappear or certain flag be just shown as download complete icon (such as, right soft key become close or retreat).
Step 140, if determine that page download is complete according to one of at least one screenshot picture, then determines the deadline of page download according to the value corresponding with determining the screenshotss moment of the screenshot picture that page download is complete.
It should be noted that, according to embodiments of the invention, above-mentioned terminal can be intelligent mobile terminal, such as, and smart mobile phone.What intelligent mobile terminal can be sent by the communication interface receiving computer terminal between terminal opens web page instructions to open webpage, and receives screenshotss instruction to obtain at least one screenshot picture from terminal.Terminal performs and compares at least one screenshot picture step successively and determine the step of deadline.Method according to the present invention may further include: at least one screenshot picture, initial time and at least one value corresponding with the screenshotss moment of at least one screenshot picture are sent to terminal by communication interface by intelligent mobile terminal.According to another embodiment of the present invention, above-mentioned terminal can also be terminal, and step 110 all performs to step 140 on computer terminal, so that the web page download time of the browser in automatic test computer terminal.
Because embodiments of the invention adopt the mode of test automatically, so accurately high, sampling quantity is many.In addition, due to the mode that the present invention adopts picture to compare, therefore, it is possible to be applied to any a browser on smart mobile phone or PC, and without the need to obtaining the source code of browser.
Fig. 2 is the indicative flowchart of the method 200 of the web page download time of automatic test browser according to another embodiment of the present invention.When being described this embodiment, no longer similar to the embodiment described with Fig. 1 step is described in detail.See Fig. 2, method 200 comprises:
Step 210, opening webpage to start downloading web pages according to opening web page instructions, recording the initial time of page download simultaneously in terminal.When the download test carrying out browsing device net page, also may need to test the flow that browser downloads webpage consumes, in this case, can while opening webpage record start flow, such as, the function that can obtain terminal flow can be called.
Step 220, in page download process, terminal obtains at least one screenshot picture, at least one value that record is corresponding with the screenshotss moment of at least one screenshot picture simultaneously.Such as, when each screenshotss, this screenshot picture can be stored, and the timestamp that record is corresponding with the screenshotss moment of this screenshot picture in the title (or filename) of this screenshot picture, the time in screenshotss moment is comprised in this timestamp, such as, this timestamp can be obtained by allocating time function.
Step 230, compares at least one screenshot picture successively to determine whether webpage is downloaded complete, compares at least one screenshot picture successively to determine whether webpage is downloaded complete.If determine that page download is complete, then continue to perform step 250, otherwise perform step 240.Described in the embodiment of Fig. 1, when certain screenshot picture of showing when the precalculated position of webpage is identical with the screenshot picture that this precalculated position is shown when this page download completes prestored, determine that this page download is complete.
Step 240, if determine that webpage is not downloaded complete, then sends screenshotss instruction, and continues to perform step 220.
Step 250, if determine that page download is complete according to one of at least one screenshot picture, then determines the deadline of page download according to the value corresponding with determining the screenshotss moment of the screenshot picture that page download is complete.If need to calculate the flow that consumes of downloading web pages, in step 250, also need to obtain current flow and complete flow as downloading web pages.
Step 260, the time that the difference calculating deadline and initial time spends as downloading web pages.If need the flow that calculating downloading web pages consumes, then the flow that the difference that can also calculate flow and initial flow consumes as downloading web pages simultaneously.
Completely the regular hour is expended possibly, so it is also conceivable to separate with the step of screenshotss carry out determining to download whether complete step owing to determining whether according to screenshot picture to download.In other words, just send screenshotss instruction when no longer waiting until and determine that page download does not have complete, thus improve the precision of test further.
Fig. 3 is the indicative flowchart of the method 300 of the web page download time of automatic test browser according to still another embodiment of the invention.When being described this embodiment, no longer the step similar with the embodiment described by Fig. 1 is described in detail.See Fig. 3, method 300 comprises:
Step 310, opening webpage to start downloading web pages according to opening web page instructions, recording the initial time of page download simultaneously in terminal.
Step 320, in page download process, terminal periodically obtains at least one screenshot picture, at least one value that record is corresponding with the screenshotss moment of at least one screenshot picture simultaneously.Such as, when each screenshotss, this screenshot picture can be stored, and the timestamp that record is corresponding with the screenshotss moment of this screenshot picture in the title of this screenshot picture, comprise the time in screenshotss moment in this timestamp, such as, this timestamp can be obtained by allocating time function.In addition, can also only record and each screenshotss moment screenshotss order of tackling mutually, and the length in screenshotss cycle can be adjusted according to the actual needs.Step 320 when receiving stopping and obtaining screenshot picture instruction, can also stop screenshotss operation.Such as, an end mark can be set, when the value of end mark is true (True), the instruction receiving end step 320 be described.Certainly, embodiments of the invention are not limited to this.
Step 330, compares at least one screenshot picture successively to determine whether webpage is downloaded complete.If determine that page download is complete according to one of at least one screenshot picture, then perform step 340, otherwise proceed to compare.Step 330 can with step 320 concurrence performance, such as can perform on two threads respectively.
Step 340, stops obtaining screenshot picture, and determines the deadline of web page download time according to the value corresponding with determining the screenshotss moment of the screenshot picture that page download is complete.In addition, when in the title in step 320 in screenshot picture record and each screenshotss moment tackle mutually timestamp time, the time comprised in the timestamp corresponding with determining the screenshotss moment of the screenshot picture that page download is complete is the deadline.In addition, when in step 320 record and each screenshotss moment tackle mutually screenshotss order time, according to screenshotss cycle, initial time and can determine that the screenshotss order of the screenshot picture that page download is complete determines the deadline.As mentioned above, if determine that page download is complete, the value of end mark can be become very, thus trigger the instruction stopping step 320.
Step 350, the time that the difference calculating deadline and initial time spends as downloading web pages.
The same with the mode of the calculated flow rate described in Fig. 1, in the embodiment described by Fig. 3, also automatically can test the flow that downloading web pages consumes, just no longer describe in detail here.
Fig. 4 is the indicative flowchart of the method 400 of the web page download time of the automatic test browser of the one exemplary embodiment of embodiment according to Fig. 2 of the present invention.In the exemplary embodiment, for smart mobile phone, the browsing device net page automatically being tested smart mobile phone by terminal downloads the time of cost and the flow of consumption.See Fig. 4, method 400 comprises:
Step 410, starts test.Can test instruction by terminal sends.Such as, can be responsible for being carried out communicate (such as, send and receive the operations such as instruction) with smart mobile phone by communication interfaces such as serial ports, infrared ray, bluetooth or WiFi at terminal coding.In step 410, when smart mobile phone receives the open any browser instruction of terminal transmission, start to test.
Step 420, according to open any browser instruction unpack browser, input URL opens webpage, records off the net year initial time T1 and flow value N1 simultaneously.Such as, can, at the Agent (Agent) of smart mobile phone running background one test, be responsible for receiving instruction performing by above-mentioned communication interface from PC termination.Then, Agent will simulate corresponding button execution input network address and open webpage.When realizing, can install a background program on mobile phone, for simulating keyboard event, it is the same that its effect presses cell phone keyboard with staff, and the application program of current foreground will respond its event.Meanwhile, record input network address opens the initial time T1 of that moment as page download of webpage, can also obtain this moment mobile phone flow value N1 by smart mobile phone, and sends terminal to and carry out record.Some cell phone manufacturers, such as Nokia, provide PC external member, in this case, can also obtain this moment mobile phone flow value N1 by PC external member interface.PC external member refers to the software of the terminal that mobile phone producer provides, and can be used for installing handset program, access mobile phone disk, synchronous associated person information and short message etc., and additionally provides the DLL (dynamic link library) of corresponding function.
Step 430, carries out sectional drawing (comprising local sectional drawing) to mobile phone screen, and is that title stores with timestamp.In page download process, terminal can send instructions again and carry out screenshotss or local screenshotss to current screen, and can be saved in mobile phone disk, picture name can be preserved according to timestamp and also can be preserved according to screenshotss order.In addition, terminal can carry out sectional drawing or local sectional drawing by the application programming interfaces of PC external member (API) to mobile phone screen.
Step 440: screenshot picture is uploaded to terminal, and after terminal obtains picture, just carry out picture contrast (or local contrast) or OCR (local OCR) character contrast, it is complete whether checking has downloaded.Screenshot area can set according to the diverse location of the download progress bar of different browsers or download flag.
Step 450, if judge not download by step 440 complete, then repeats step 430 and 440 and carries out screenshotss and judgement, until page download is complete.If judge that page download is complete, then continue step 460.
Step 460, if page download is complete, then records title and the timestamp T2 and flow value N2 now of last screenshot picture compared.When each sectional drawing is all preserve using the moment of sectional drawing as title, finish time T2 has been exactly the title of that pictures of page download.The title of last screenshot picture that terminal is compared by acquisition i.e. time stamp T 2 are as downloading the deadline (if not taking timestamp as name title, the moment T2 of last sectional drawing is gone out according to sectional drawing order and screenshotss computation of Period), and record Agent passes the flow N2 of the mobile phone current time of coming.
Step 470, calculates web page download time and consumed flow.Draw by calculating deadline T2 and initial time T1 difference the time that page download spends, and the difference having calculated flow N2 and initial flow N1 draws the flow that page download consumes.
Step 480, terminates automatically to test.
Fig. 5 is the indicative flowchart of the method 500 of the web page download time of the automatic test browser of one exemplary embodiment according to Fig. 3 of the present invention.In the exemplary embodiment, for smart mobile phone, the spended time that the browsing device net page automatically testing smart mobile phone by terminal is downloaded and consumed flow.See Fig. 5, the method 500 comprises:
Step 510, starts test.Can send test sign on by PC terminal equally, the description in concrete mode and step 410 is similar.
Step 515, according to open any browser instruction unpack browser, input URL opens webpage, records off the net year time started T1 and flow value N1 simultaneously, and arranges end mark or complete variable End, and such as, arranging page download, to complete variable End be False.Except end mark, the detailed description of step 515 and the description of step 420 similar.
Step 520, after opening webpage, starts thread A, namely starts to perform step 525, postpones to start a thread B in, namely starts to perform step 545.Certainly, the present invention is not limited to delay one second, can need the length adjusting this time of delay according to actual conditions.
Step 525, A thread carries out sectional drawing or local sectional drawing to mobile phone screen, and using current timestamp as the title of screenshot picture.
Step 530, whether judgment variable End is True.If be not True, then perform step 525.If be True, then continue to perform step 535.
Step 535, terminates thread A.Namely no longer screenshotss operation is carried out.
Step 545, thread B is responsible for the sectional drawing of A thread to be sent to PC (each biography one), and carries out picture contrast (or local picture contrast) or OCR (or local OCR) character contrast.
Step 550, whether checking webpage is downloaded complete.If do not download complete, then continue to perform step 545, repeat that sectional drawing is copied PC and contrast, otherwise, continue to perform step 555.
Step 555, if page download is complete, is just set to True by variable End, then terminates thread A.
Step 560, records the title of last picture compared i.e. time stamp T 2 as the deadline simultaneously, and obtains the flow N2 of current time mobile phone as completing flow by the Agent that mobile phone backstage is run.When cell phone manufacturer must supply PC external member, Agent can also obtain this moment mobile phone flow value N2 by PC external member interface.
Step 565, draw the time that downloading web pages spends, and the difference having calculated flow N2 and initial flow N1 draws the flow that downloading web pages consumes by calculating deadline T2 and initial time T1 difference.
Step 570, terminates thread B.
Due to screenshotss are carried out to the webpage in downloading process and operation screenshot picture being transferred to the character that the operation of terminal and the picture of comparing calculation machine terminal or OCR obtain respectively two thread execution, the time loss of the character that the contrast picture that so just can reduce or avoid terminal to perform or OCR obtain is on the impact of measuring accuracy.
It should be noted that, although the one exemplary embodiment described by Fig. 4 with Fig. 5 to be undertaken communicating the web page download time of the browser tested on smart mobile phone and flow by terminal and smart mobile phone, the present invention is not limited to this.One skilled in the art will recognize that the automatic test that can realize separately the above-mentioned web page download time to browser and flow on terminal or smart mobile phone.
Fig. 6 is the block diagram of the system 600 of the web page download time automatically testing browser according to an embodiment of the invention.See Fig. 6, this system 600 comprises: test execution unit 610, test processes unit 620, browser 630.
Test execution unit 610, for opening webpage to start downloading web pages in terminal according to opening web page instructions, records the initial time of page download simultaneously; And the webpage for showing from browser 630 in page download process obtains at least one screenshot picture, at least one value that record is corresponding with the screenshotss moment of at least one screenshot picture simultaneously.Such as, in smart mobile phone, a program (such as Agent program) can be write run on mobile phone backstage and be responsible for terminal communication, and for analogue-key, then the instruction from terminal is received, the operation of corresponding analogue-key is done according to the content (such as start browser, input network address is opened etc.) of instruction; Button operation can operate the tested program (browser program) operating in mobile phone foreground.Mobile phone is communicated by communication interfaces such as serial ports or infrared ray, bluetooth, WiFi with terminal.After web page operation is opened in execution, test execution unit 610 carries out screenshotss to current mobile phone screen in page download process, then the screenshot picture obtained is passed to terminal.
Test processes unit 620, opens web page instructions for sending to test execution unit 610; And for receiving at least one screenshot picture from test execution unit 610, and compare at least one screenshot picture successively to determine whether webpage is downloaded complete, if determine that page download is complete according to one of at least one screenshot picture, then determine the deadline of page download according to the value corresponding with determining the screenshotss moment of the screenshot picture that page download is complete.Such as, character terminal can contrast (or local contrast) or contrast OCR (or local OCR) by picture after verifies whether page download completes, if do not have download to complete, then again carry out screenshotss contrast, until determine that download completes, thus calculate time and the flow of page download.In addition, when terminal obtains the screenshot picture of webpage, the application programming interfaces (API) of the PC external member that terminal can be provided by smart mobile phone manufacturer carry out sectional drawing or local sectional drawing to mobile phone screen, and the above-mentioned Agent program run on smart mobile phone can directly be obtained the mobile phone flow value of current time by mobile phone or be obtained the flow value of current time mobile phone by PC external member interface.
Browser 630, for download webpage according to the address of webpage and show.Such as, browser 630 can be the tested program operating in mobile phone foreground, can respond the event of the analogue-key run in the test execution unit 610 on backstage.
According to another embodiment of the present invention, this system 600 comprises further: computing unit 640, the time that computing unit 640 spends as downloading web pages for the difference calculating deadline and initial time.
According to still another embodiment of the invention, test execution unit 610 is further used for the record start flow value when opening webpage, and has recorded flow value when determining that page download is complete; And the flow that the difference that computing unit 640 is further used for having calculated flow value and fore flow value consumes as downloading web pages.
If test processes unit 620 is further used for determining that webpage is not downloaded complete, then send to test execution unit 610 and obtain screenshot picture instruction, and test execution unit 610 obtains current screenshot picture when receiving and obtaining screenshot picture instruction from browser 630.
Test execution unit 610 periodically obtains current screenshot picture, if test processes unit 620 is further used for determining that page download is complete, then send to test execution unit 610 and stop obtaining screenshot picture instruction, and test execution unit 610 is further used for stopping obtaining current screenshot picture according to this snapshot instruction.
Test execution unit 610 and browser can be positioned on intelligent mobile terminal, test processes unit 620 and computing unit 640 can be positioned on terminal, what by the communication interface between intelligent machine mobile terminal and terminal, test execution unit 610 received that test processes unit 620 sends opens web page instructions, and test execution unit 610 is further used for, by communication interface, at least one screenshot picture, initial time and at least one value corresponding with the screenshotss moment of at least one screenshot picture are sent to test processes unit 620.
Test execution unit 610 can store at least one screenshot picture, and at least one timestamp that record is corresponding with the screenshotss moment of at least one screenshot picture in the title of at least one screenshot picture respectively.
Test processes unit 620 can comprise simulating keyboard module, and simulating keyboard module is used for according to opening the network address that web page instructions inputs webpage in the address field of browser 630, and simulation points impact opens the operation of webpage to open webpage.
The mode of character that test processes unit 620 can adopt compared pixels or be obtained by optical character identification, the precalculated position of comparing webpage successively at least one screenshot picture of showing and the screenshot picture that this precalculated position is shown when page download completes prestored, and when one of at least one screenshot picture that the precalculated position of webpage is shown is identical with the screenshot picture that this precalculated position is shown when page download completes prestored, determine that page download is complete, wherein when page download completes, displayed web page has downloaded mark on a predetermined position.
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 made, equivalent replacement, improvement etc., all should be included within the scope of protection of the invention.

Claims (19)

1. automatically test a method for the web page download time of browser, comprising:
In terminal, opening described webpage to start to download described webpage according to opening web page instructions, recording the initial time of described page download simultaneously;
In described page download process, described terminal obtains at least one screenshot picture, at least one value that record is corresponding with the screenshotss moment of at least one screenshot picture described simultaneously;
Successively the screenshot picture that at least one screenshot picture described and the expression prestored have been downloaded is compared, to determine whether described webpage is downloaded complete; And
If determine that described page download is complete according to one of at least one screenshot picture described, then determine the deadline of described page download according to the value corresponding with determining the screenshotss moment of the screenshot picture that described page download is complete.
2. the method for the web page download time of automatic test browser according to claim 1, comprises further:
The difference calculating described deadline and described initial time is as the time of downloading described webpage and spending.
3. the method for the web page download time of automatic test browser according to claim 2, comprises further:
When opening described webpage, record start flow value;
When determining that described page download is complete, record flow value; And
The difference completing flow value and described fore flow value described in calculating is as the flow downloaded described webpage and consume.
4. the method for the web page download time of automatic test browser according to claim 2, comprises further:
If determine that described webpage is not downloaded complete, then send and obtain screenshot picture instruction, the step of wherein said at least one screenshot picture of acquisition comprises:
Current screenshot picture is obtained when receiving described acquisition screenshot picture instruction.
5. the method for the web page download time of automatic test browser according to claim 2, the step of wherein said at least one screenshot picture of acquisition comprises: periodically obtain current screenshot picture, and described method comprises further:
If determine that described page download is complete, then send and stop obtaining screenshot picture instruction, and stop obtaining current screenshot picture according to this snapshot instruction.
6. the method for the web page download time of automatic test browser according to claim 5, the step of at least one value that wherein said record is corresponding with the screenshotss moment of at least one screenshot picture described comprises:
Store at least one screenshot picture described, and the screenshotss order that record is corresponding with the screenshotss moment of at least one screenshot picture described in the title of at least one screenshot picture described respectively; And
The described basis value corresponding with determining the screenshotss moment of the screenshot picture that described page download is complete determines that the step of the deadline of described page download comprises:
According to screenshotss cycle, described initial time and determine that the screenshotss order of the screenshot picture that described page download is complete determines the described deadline.
7. the method for the web page download time of the automatic test browser according to any one in claim 2 to 5, the step of at least one value that wherein said record is corresponding with the screenshotss moment of at least one screenshot picture described comprises:
Store at least one screenshot picture described, and the timestamp that record is corresponding with the screenshotss moment of at least one screenshot picture described in the title of at least one screenshot picture described respectively.
8. the method for the web page download time of the automatic test browser according to any one in claim 2 to 6, wherein said terminal is intelligent mobile terminal, described intelligent mobile terminal by with the communication interface of terminal receive described terminal send described in open web page instructions to open described webpage, and receive screenshotss instruction to obtain at least one screenshot picture described from described terminal; And described in described terminal performs successively at least one screenshot picture relatively more described step and determine the step of described deadline, described method comprises further:
At least one screenshot picture described, described initial time and at least one value corresponding with the screenshotss moment of at least one screenshot picture described are sent to described terminal by described communication interface by described intelligent mobile terminal.
9. the method for the web page download time of the automatic test browser according to any one in claim 2 to 6, wherein said basis is opened the step that web page instructions opens described webpage in terminal and is comprised:
Open according to described web page instructions to input described webpage in the address field of described browser network address in the mode of simulating keyboard, and simulation points impact opens the operation of described webpage to open described webpage.
10. the method for the web page download time of the automatic test browser according to any one in claim 2 to 6, the step of wherein said at least one screenshot picture relatively more described successively comprises: the mode of the character adopting contrast picture pixels or optical character identification to obtain, the precalculated position of more described webpage at least one screenshot picture of showing and the screenshot picture that this precalculated position is shown when described page download completes prestored successively, and one of at least one screenshot picture described in described basis determines that the complete step of described page download comprises: when one of at least one screenshot picture that the precalculated position of described webpage is shown is identical with the screenshot picture that this precalculated position is shown when described page download completes prestored, determine that described page download is complete, wherein when described page download completes, on described precalculated position, displayed web page has downloaded mark.
The system of the web page download time of 11. 1 kinds of automatic test browsers, comprising:
Browser, for downloading and displayed web page in terminal;
Test execution unit, for opening described webpage to start to download described webpage on described browser according to opening web page instructions, records the initial time of described page download simultaneously; And obtain at least one screenshot picture for the described webpage from described browser-presented in described page download process, at least one value that record is corresponding with the screenshotss moment of at least one screenshot picture described simultaneously; And
Test processes unit, opens web page instructions described in sending to described test execution unit; And for receiving at least one screenshot picture described from described test execution unit, and successively the screenshot picture that at least one screenshot picture described and the expression prestored have been downloaded is compared, to determine whether described webpage is downloaded complete; And if for determining that described page download is complete according to one of at least one screenshot picture described, then determine the deadline of described page download according to the value corresponding with determining the screenshotss moment of the screenshot picture that described page download is complete.
The system of the web page download time of 12. automatic test browsers according to claim 11, comprises further:
Computing unit, for the difference that calculates described deadline and described initial time as the time of downloading described webpage and spending.
The system of the web page download time of 13. automatic test browsers according to claim 12, wherein said test execution unit is further used for the record start flow value when opening described webpage, and has recorded flow value when determining that described page download is complete; And the difference completing flow value and described fore flow value described in described computing unit is further used for calculating is as the flow downloaded described webpage and consume.
The system of the web page download time of 14. automatic test browsers according to claim 12, if wherein said test processes unit is further used for determining that described webpage is not downloaded complete, then send to described test execution unit and obtain screenshot picture instruction, and the described webpage of described test execution unit when receiving described acquisition screenshot picture instruction from described browser-presented obtains current screenshot picture.
The system of the web page download time of 15. automatic test browsers according to claim 12, wherein said test execution unit periodically obtains current screenshot picture, if described test processes unit is further used for determining that described page download is complete, then send to described test execution unit and stop obtaining screenshot picture instruction, and described test execution unit is further used for stopping obtaining current screenshot picture according to this snapshot instruction.
16. according to claim 12 to the system of the web page download time of the automatic test browser described in arbitrary claim in 15, wherein said test execution unit and described browser are positioned on intelligent mobile terminal, described test processes unit and described computing unit are positioned on terminal, described test execution unit by the communication interface between described intelligent machine mobile terminal and described terminal receive described test processes unit send described in open web page instructions, and described test execution unit is further used at least one screenshot picture described by described communication interface, described initial time and at least one value corresponding with the screenshotss moment of at least one screenshot picture described are sent to described test processes unit.
17. according to claim 12 to the system of the web page download time of the automatic test browser described in arbitrary claim in 15, wherein said test execution unit stores at least one screenshot picture described, and the timestamp that record is corresponding with the screenshotss moment of at least one screenshot picture described in the title of at least one screenshot picture described respectively.
18. according to claim 12 to the system of the web page download time of the automatic test browser described in arbitrary claim in 15, wherein said test processes unit comprises simulating keyboard module, described simulating keyboard module is used for opening the network address that web page instructions inputs described webpage in the address field of described browser described in basis, and simulation points impact opens the operation of described webpage to open described webpage.
19. according to claim 12 to the system of the web page download time of the automatic test browser described in arbitrary claim in 15, the mode of the character that wherein said test processes unit adopts contrast picture pixels or optical character identification to obtain, the precalculated position of more described webpage at least one screenshot picture of showing and the screenshot picture that this precalculated position is shown when described page download completes prestored successively, and when one of at least one screenshot picture that the precalculated position of described webpage is shown is identical with the screenshot picture that this precalculated position is shown when described page download completes prestored, determine that described page download is complete, wherein when described page download completes, on described precalculated position, displayed web page has downloaded mark.
CN201110032465.1A 2011-01-27 2011-01-27 A kind of method and system of web page download time of automatic test browser Active CN102624576B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110032465.1A CN102624576B (en) 2011-01-27 2011-01-27 A kind of method and system of web page download time of automatic test browser

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110032465.1A CN102624576B (en) 2011-01-27 2011-01-27 A kind of method and system of web page download time of automatic test browser

Publications (2)

Publication Number Publication Date
CN102624576A CN102624576A (en) 2012-08-01
CN102624576B true CN102624576B (en) 2016-04-20

Family

ID=46564267

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110032465.1A Active CN102624576B (en) 2011-01-27 2011-01-27 A kind of method and system of web page download time of automatic test browser

Country Status (1)

Country Link
CN (1) CN102624576B (en)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103812713A (en) * 2012-11-06 2014-05-21 腾讯科技(深圳)有限公司 Method and apparatus for testing webpage loading time
CN103810086B (en) * 2012-11-08 2017-12-22 腾讯科技(深圳)有限公司 Make processing method, the apparatus and system of the network address of browser collapse
CN102929782A (en) * 2012-11-14 2013-02-13 北京奇虎科技有限公司 Device and method for testing software performances
CN102902625B (en) * 2012-11-14 2015-04-22 北京奇虎科技有限公司 Software performance test system and method
CN104052630B (en) * 2013-03-14 2019-10-11 北京百度网讯科技有限公司 The method and system of verifying is executed to website
EP2882135B1 (en) * 2013-12-05 2017-08-23 Accenture Global Services Limited Network server system, client device, computer program product and computer-implemented method
CN104796929B (en) * 2014-01-22 2019-12-06 腾讯科技(深圳)有限公司 Network debugging method and device
CN105025518B (en) * 2014-04-30 2018-09-25 中国电信股份有限公司 A kind of application operation quality auto-dial testing method, server and system
CN104333601B (en) * 2014-11-14 2018-01-16 广东欧珀移动通信有限公司 Using synchronous method, system and terminal
CN106161133B (en) * 2015-04-21 2020-08-04 腾讯科技(深圳)有限公司 Method and device for testing webpage loading time
CN106612198B (en) * 2015-10-26 2019-08-13 中国移动通信集团公司 A kind of test method and device of measure of the quality of service index
CN106982368B (en) * 2016-01-19 2020-06-23 腾讯科技(深圳)有限公司 Video response speed detection method and system
US9779293B2 (en) * 2016-01-27 2017-10-03 Honeywell International Inc. Method and tool for post-mortem analysis of tripped field devices in process industry using optical character recognition and intelligent character recognition
CN105812564A (en) * 2016-03-11 2016-07-27 合肥联宝信息技术有限公司 Control method, electronic device and personal computer
CN107239397A (en) * 2017-05-17 2017-10-10 北京微影时代科技有限公司 A kind of web automated testing methods and electronic equipment
CN107885645B (en) * 2017-10-31 2020-06-23 阿里巴巴集团控股有限公司 Method and device for calculating rendering duration of first screen of page and electronic equipment
CN108205674B (en) * 2017-12-22 2022-04-15 广州爱美互动网络科技有限公司 Social APP content identification method, electronic device, storage medium and system
CN110209978B (en) * 2019-01-28 2023-05-16 腾讯科技(深圳)有限公司 Data processing method and related device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101072131A (en) * 2006-09-19 2007-11-14 腾讯科技(深圳)有限公司 Network operation monitoring method and system
CN101071438A (en) * 2007-03-26 2007-11-14 腾讯科技(深圳)有限公司 Capture server, distribution server, method and system for generating webpage capture
CN101206657A (en) * 2006-12-21 2008-06-25 英业达股份有限公司 Web page beforehand download method
CN101807180A (en) * 2009-02-16 2010-08-18 宏达国际电子股份有限公司 Mobile electric device and pretreatment and display method of web page thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7162600B2 (en) * 2005-03-29 2007-01-09 Hitachi, Ltd. Data copying method and apparatus in a thin provisioned system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101072131A (en) * 2006-09-19 2007-11-14 腾讯科技(深圳)有限公司 Network operation monitoring method and system
CN101206657A (en) * 2006-12-21 2008-06-25 英业达股份有限公司 Web page beforehand download method
CN101071438A (en) * 2007-03-26 2007-11-14 腾讯科技(深圳)有限公司 Capture server, distribution server, method and system for generating webpage capture
CN101807180A (en) * 2009-02-16 2010-08-18 宏达国际电子股份有限公司 Mobile electric device and pretreatment and display method of web page thereof

Also Published As

Publication number Publication date
CN102624576A (en) 2012-08-01

Similar Documents

Publication Publication Date Title
CN102624576B (en) A kind of method and system of web page download time of automatic test browser
CN109302522B (en) Test method, test device, computer system, and computer medium
CN112270149B (en) Verification platform automatic integration method and system, electronic equipment and storage medium
CN112098924B (en) Interactive function testing method and device based on double-core intelligent electric meter
CN110196795B (en) Method and related device for detecting running state of mobile terminal application
CN107608901B (en) Jmeter-based testing method and device, storage medium and electronic equipment
CN103544100A (en) Method, system and client side for testing APP of portable data processing equipment
CN104866416A (en) Method and device for performance analysis of application program
CN103581987B (en) The test method and device of the page download speed of mobile terminal device
CN106504026A (en) A kind of data capture method and device
CN104052769A (en) Method, apparatus and system for updating resources contained by mobile terminal application
WO2017113877A1 (en) Automatic measurement method for mobile terminal app loading energy consumption based on actual physical measurement
US9378109B1 (en) Testing tools for devices
CN109491883A (en) Performance detects control methods and system simultaneously between applying under a kind of Android platform more
CN111352836A (en) Pressure testing method and related device
US20200293592A1 (en) Methods and systems for browser extension used to generate relative xpath, absolute xpath and/or css selectors
CN110321278B (en) System testing method and device, computer equipment and storage medium
CN111258893A (en) Mobile terminal application automatic testing device for randomly assembling transaction path
US10834169B2 (en) System and method of communicating with and controlling a test device
CN110008105A (en) A kind of BMC time reservation method, device and electronic equipment and storage medium
CN114924963A (en) Distributed execution method, device, equipment and medium for webpage compatibility test
CN103870368A (en) SAS (Serial Attached SCSI (small computer system interface)) expander testing system and method
CN106776330A (en) Application testing method and device and electronic equipment
CN114647521A (en) Drawing pipeline adjusting method and device, computer equipment and storage medium
CN104679618A (en) Test result integration system and method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant