CN107577589A - The method and device of fixed time test advertisement putting interface - Google Patents

The method and device of fixed time test advertisement putting interface Download PDF

Info

Publication number
CN107577589A
CN107577589A CN201610518091.7A CN201610518091A CN107577589A CN 107577589 A CN107577589 A CN 107577589A CN 201610518091 A CN201610518091 A CN 201610518091A CN 107577589 A CN107577589 A CN 107577589A
Authority
CN
China
Prior art keywords
test request
advertisement putting
configuration information
test
result
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.)
Pending
Application number
CN201610518091.7A
Other languages
Chinese (zh)
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.)
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing 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 Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201610518091.7A priority Critical patent/CN107577589A/en
Publication of CN107577589A publication Critical patent/CN107577589A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a kind of method of fixed time test advertisement putting interface, it includes:The configuration information of advertisement putting interface testing request is obtained, the configuration information of test request is stored in database;According to the configuration information of test request, the test request of construction advertisement putting interface;Test request is sent according to the time interval timing in the configuration information of test request;It is whether correct to detect advertisement putting interface implementing result by the result that test request obtains compared with the expected results in the configuration information of test request.By simply setting configuration information, it is not required to read advertisement putting interface code, user can conveniently realize that timing calls advertisement putting interface to be tested.The result that test request is obtained reduces the time that user is manually detected to the result that test request obtains directly compared with expected results, reduces the probability of artificial detection error.

Description

The method and device of fixed time test advertisement putting interface
Technical field
The present invention relates to computer software fields, and in particular to a kind of method and dress of fixed time test advertisement putting interface Put.
Background technology
As what the development of internet and web were applied becomes increasingly popular, people can browse webpage anywhere or anytime, also therefore Increasing advertisement manufacturer is selected advertisement putting on the internet.The advertisement putting page is launched wide in the network platform Accuse, the methods of using the ad banner on website, text link, multimedia, advertisement is passed to by Internet user by network. Compared with traditional four big communications media (newspaper, magazine, TV, broadcast) advertisement and enjoying the outdoor advertising shown appreciation for somebody, interconnecting Online to launch advertisement and have advantageous advantage, fastest effect is also highly desirable, is advantageous to enterprise's extension and grows, and can be with Trans-regional transnational nationality is commenced business extensively.Advertisement manufacturer can push the sale of one's products or service on the internet, can be with Information interchange is carried out with user, and user obtains product or the related introduction of service by clicking on the advertisement putting page, more preferable Solve product or service.
The advertisement putting page is first from database or server end obtains the related material information of displaying ad content, After obtaining material information, material information is arranged and rendered in the advertisement putting page.These actions are by performing the advertisement putting page Interface, interface makes requests on to server, obtain material information and arrange render after return.Due to substantial amounts of advertisement putting, So that the interface of the advertisement putting page is frequently repeatedly called, it is related to the correct display of numerous advertisement putting pages, therefore, must The correctness that advertisement putting page interface calls must be ensured., it is necessary to be connect to the advertisement putting page when using with later stage O&M Mouth timing test.
Prior art is in order to ensure the correctness of advertisement putting page interface, mostly by manually directly invoking advertisement putting The interface of webpage, after the page is shown, the page after display is checked, to confirm the interface of the advertisement putting page whether just Really.Or advertisement putting page interface is called by the job processing unit system of timing, back page is shown, the page after display is entered The modes such as row inspection.Above-mentioned technological means, it is in implementation procedure to be based on artificial treatment more, from largely limit test when Between, the precision etc. of test.
The content of the invention
In view of the above problems, it is proposed that the present invention so as to provide one kind overcome above mentioned problem or at least in part solve on State a kind of method and device of fixed time test advertisement putting interface of problem.
According to an aspect of the invention, there is provided a kind of method of fixed time test advertisement putting interface, it includes:
The configuration information of advertisement putting interface testing request is obtained, the configuration information of test request is stored in database In;
According to the configuration information of test request, the test request of construction advertisement putting interface;
Test request is sent according to the time interval timing in the configuration information of test request;
It is wide to detect by the result that test request obtains compared with the expected results in the configuration information of test request Whether correct accuse dispensing interface implementing result.
According to another aspect of the present invention, there is provided a kind of device of fixed time test advertisement putting interface, it includes:
Memory module, suitable for obtaining the configuration information of advertisement putting interface testing request, by the configuration information of test request It is stored in database;
Constructing module, suitable for the configuration information according to test request, the test request of construction advertisement putting interface;
Timing sending module, test request is sent suitable for the time interval timing in the configuration information according to test request;
Detection module, carried out suitable for the expected results in the result and the configuration information of test request that obtain test request Compare, it is whether correct to detect advertisement putting interface implementing result.
, please by advertisement putting interface testing according to the method and device of fixed time test advertisement putting interface provided by the invention The configuration information asked is stored in database, and according to the configuration information of test request, the test for constructing advertisement putting interface please Ask.Timing sends test request, and the expected results in result and the configuration information of test request that test request is obtained are carried out Compare, to facilitate detection advertisement putting interface implementing result whether correct.By simply setting configuration information, it is not required to advertisement Launch interface code to be read, user can conveniently realize that timing calls advertisement putting interface to be tested.It will survey The result that examination request obtains reduces the result that user manually obtains to test request and carried out directly compared with expected results The time of detection, reduce the probability of artificial detection error.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention, And can be practiced according to the content of specification, and in order to allow above and other objects of the present invention, feature and advantage can Become apparent, below especially exemplified by the embodiment of the present invention.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, it is various other the advantages of and benefit it is common for this area Technical staff will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the present invention Limitation.And in whole accompanying drawing, identical part is denoted by the same reference numerals.In the accompanying drawings:
Fig. 1 shows the flow chart of the method for fixed time test advertisement putting interface according to an embodiment of the invention;
Fig. 2 shows the flow chart of the method for fixed time test advertisement putting interface in accordance with another embodiment of the present invention;
Fig. 3 shows the functional block diagram of the device of fixed time test advertisement putting interface according to an embodiment of the invention;
Fig. 4 shows the functional block of the device of fixed time test advertisement putting interface in accordance with another embodiment of the present invention Figure.
Embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although the disclosure is shown in accompanying drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here Limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure Completely it is communicated to those skilled in the art.
The content that advertisement putting interface needs to show according to different advertisements, material information related during advertisement putting is obtained, After returning to page rendering, shown in the advertisement putting page.The advertisement putting page is different from Webpage, the advertisement putting page one As embed or be suspended in Webpage, only occupy a part for Webpage.The advertisement putting page can embed and be arranged on net In the head of the network page, text or page bottom, can also suspend and be arranged on the one or both sides of the page, with page window Move and move.Some advertisement putting pages can also be closed by closing function or in the given time hide etc..
When testing advertisement putting interface, test advertisements need to be called to launch interface, server is made requests on, to obtain The page is taken to show required material information.After material information is obtained, material information is rendered simultaneously in the advertisement putting page The correctly display advertisement putting page.
Fig. 1 shows the flow chart of the method for fixed time test advertisement putting interface according to an embodiment of the invention, such as Shown in Fig. 1, the method for fixed time test advertisement putting interface specifically comprises the following steps:
Step S101, the configuration information of advertisement putting interface testing request is obtained, the configuration information of test request is stored In database.
The configuration information of advertisement putting interface testing request is obtained, can be connect by such as inputting advertisement putting in input page The configuration information of mouth test request, reads the input information of the page, obtains the configuration information of test request.Or pass through file record The configuration information of advertisement putting interface testing request, reads file content, obtains the modes such as the configuration information of test request.Obtaining After taking configuration information, configuration information is stored in database.The configuration information of advertisement putting interface testing request includes:Test The interface IP address of request, the agreement of test request, time interval and/or expected results.
URL addresses when the interface IP address of test request is advertisement putting interface testing, for being surveyed to advertisement putting interface Examination use, when calling the interface IP address, that is, perform the corresponding material of the advertisement putting page and obtain operation, page rendering operation, show Show operation etc..
The agreement of test request can be Http agreements (HyperText Transfer Protocol, Hyper text transfer association View) or Https agreements (Hyper Text Transfer Protocol over Secure Socket Layer, to be safely The Http agreements of target).Http agreements are the standard agreements of mutual request and response between client and server end, with plaintext Mode transmission content, does not provide the data encryption of any mode, can directly read data message during use.Https agreements with Http agreement differences are the default port different from Http agreements and have carried out encrypting/authentication.By to data Encrypt and decrypt operation, ensured safety of the data in network transmission.
The time interval of test request is tested advertisement putting interface, sends the time interval of test request.Survey Try request time interval can according to the difference of advertisement putting interface, square one is not configured test request.According to advertisement When launching response time of interface and setting, such as from advertisement putting interface is called, to the material information, right needed for return advertisement putting When display needs 10s after material information is rendered, the time interval of test request can be arranged between 12s or long period Every to carry out single performing test not influenceing the situation that advertisement putting interface normally performs.When needing that advertisement putting is connect When mouth carries out pressure test, the time interval of test request can be arranged to 3s or shorter time interval, launched with test advertisements Interface does not stop the execution state in the case of being called.Or when need test advertisements launch interface use in different clients or clothes Be engaged in device end when response speed, can carry handling capacity when, the time interval of test request according to actual conditions, can be set.
The Expected Results of test request is to envision the result that obtain after performing advertisement putting interface.Expected Results can be with The various content informations shown including the page, such as word content, picture, animation, video, audio, interactive form, navigation Deng, can also include special effects of webpage, page-size, page style, the layout of the page, in the page position of each content set, page Face body is in the position that whole window is shown, page presentation mode etc..Expected Results can be the content of the advertisement putting page Expected Results or the Expected Results of mode that shows of the advertisement putting page, can be carried out according to requirement during test It is corresponding to set.
Step S102, according to the configuration information of test request, the test request of construction advertisement putting interface.
After the configuration information of database purchase test request, when needing advertisement putting interface to be tested, it can utilize Such as HttpClient supports the client programming kit of Http or Https agreements, according to the configuration information of test request, structure Make the test request of the advertisement putting interface based on Http or Https agreements.
The kits such as HttpClient can create corresponding example, and by utilizing the constructed fuction of example according to survey The interface IP address of request is tried, constructs the test request of advertisement putting interface.Test request can be called by example, hold OK, the return value of the test request of calling and/or response contents etc. can also be received by example.
Step S103, test request is sent according to the time interval timing in the configuration information of test request.
Time interval is provided with the configuration information of test request, by using works such as job scheduling framework such as Quartz Tool, the test request that step S102 is constructed is generated in job scheduling framework corresponding to after task, job scheduling framework can Task scheduling timetable is set with the time interval in the configuration information according to test request, by scheduler program, notifies task Perform, so as to realize that timing sends test request.
Job scheduling framework such as Quartz, include the scheduler task pipe related to task creation, tasks carrying etc. Manage function.In use, creating a task in Quartz for test request, and corresponding trigger is added to the task.Root According to the time interval in the configuration information of test request, the task scheduling timetable established in scheduler.Trigger is added and appointed Business schedule time list, carries out Clocked operation.When the time interval in the configuration information that timing time reaches test request, triggering The trigger, task is performed, send test request.
Step S104, the expected results in result and the configuration information of test request that test request is obtained are compared Compared with whether correct to detect advertisement putting interface implementing result.
After sending test request, the result that test request returns is received.To content and expected results included in result In content be compared, when the content in expected results exist in the result that test request obtains and it is consistent when, detection is wide It is correct to accuse and launch the result that interface performs.When the content in expected results exists in the result that test request obtains, but When inconsistent, the result that detection advertisement putting interface performs is wrong.When the content in expected results obtains in test request Result in when being not present, the result that detection advertisement putting interface performs is wrong.
Word " click on advertisement and understand more contents " is provided with result as expected, when in the result that test request returns Include word, and word is " click on advertisement and understand more contents ", the result that detection advertisement putting interface performs is correct. When also including word in the result that test request returns, but word is " click on advertisement and show more contents ", detection advertisement throwing The result for putting interface execution is wrong.When not including word in the result that test request returns, detection advertisement putting interface is held Capable result is wrong.
One content can be set in expected results, multinomial content can also be set.When setting multinomial content relatively, Only when content all in expected results all exists in the result that test request returns and it is consistent when, detection advertisement putting connect The result that mouth performs is correct.Have one test request return result in be not present or be inconsistent when, detection advertisement throw The result for putting interface execution is wrong.
According to the method for fixed time test advertisement putting interface provided by the invention, match somebody with somebody what advertisement putting interface testing was asked Confidence breath is stored in database, according to the configuration information of test request, constructs the test request of advertisement putting interface.Regularly Test request is sent, by the result that test request obtains compared with the expected results in the configuration information of test request, with Whether convenient detection advertisement putting interface implementing result is correct.By simply setting configuration information, it is not required to connect advertisement putting Mouth code is read, and user can conveniently realize that timing calls advertisement putting interface to be tested.By test request Obtained result reduces what user was manually detected to the result that test request obtains directly compared with expected results Time, reduce the probability of artificial detection error.
Fig. 2 shows the flow chart of the method for fixed time test advertisement putting interface in accordance with another embodiment of the present invention, As shown in Fig. 2 the method for fixed time test advertisement putting interface comprises the following steps:
Step S201, the configuration information of advertisement putting interface testing request is obtained, the configuration information of test request is stored In database.
Step S202, according to the configuration information of test request, the test request of construction advertisement putting interface.
Step S203, test request is sent according to the time interval timing in the configuration information of test request.
The description of step S101-S103 in above step reference method embodiment one, will not be repeated here.
Step S204, the result phase value that test request is obtained judge to test compared with the state value in expected results Whether the result phase value and the state value in expected results that request obtains are consistent.
Include the state value of execution in the result that test request obtains, state value is to perform Http or Https agreements After the test request of advertisement putting interface, the state value of return.State value according to the difference of first character, be divided into message, successfully, The types such as redirection, request error, server mistake.The state value of general 2 word beginning represents successfully, the state value of 4 words beginning Represent request error, the state value representative server mistake of 5,6 words beginning.Certainly, can also be self-defined in the advertisement putting page Different return values.The execution set in the state value and expected results that are returned according to advertisement putting test request interface is correct Return to state value to be compared, if unanimously, step S205 can be continued executing with, if inconsistent, perform step S208.
Step S205, field and/or label in the result that test request obtains are extracted, by the field and/or mark of extraction Compared with corresponding with the expected results field of label and/or label, judge field in the result that test request obtains and/or Whether label field corresponding with expected results and/or label are consistent.
When comparing, except in the single resultant content obtained from test request come extract the field in expected results carry out in Hold etc. it is relatively outer, can also be according to the field test request in specific expected results, as field contents need to start with XX, field Meet setting, field length of regular expression etc. to be tested.
Label is the label commonly used in the page setup language such as html language or css language, such as the mark in set location region Label,<div>、<iframe>、<frame>Or it is arranged on position in list<tr>、<td>;Display format label, word is set Form<font>、<b>、<u>Or picture format is set<img>, set control class form<textarea>Etc.;Shape is high wide Label, position, left, right etc..When relatively, such as when there is label in expected results, obtained from test request The label whether included in expected results is extracted in resultant content to be compared.
Further, can also be by field combination tag, the content after being combined to field and label is compared.
If comparative result is consistent, step S206 is continued executing with, if comparative result is inconsistent, performs step S208.
Step S206, the advertisement formwork format information in the result that test request obtains is extracted, by the advertisement formwork of extraction Compared with format information advertisement formwork format information corresponding with expected results, judge in the result that test request obtains Whether advertisement formwork format information advertisement formwork format information corresponding with expected results is consistent.
The result that test request obtains is used for the display of the advertisement putting page, and the advertisement putting page is due to the spy of itself Property, it is also necessary to and advertisement formwork form is compared.The form of advertisement formwork, such as embedded setting, the setting that suspends, distich are set Form.The advertisement formwork form letter that advertisement formwork format information in the result that test request is obtained is set in expected results Breath is compared, if unanimously, performing step S207, if inconsistent, performs step S208.
Above step S204-S206 comparison procedure, can by the way of asserting, to need to compare state value, field, Label, template style etc. are judged, can also need the output error message in asserting according to test.
Step S207, detection advertisement putting interface implementing result are correct.
Step S208, detect advertisement putting interface implementing result mistake.
Detection advertisement putting interface implementing result after, can also correctly or incorrectly counting to implementing result, Examining report, generation error message file, generation test result page mode are such as generated, this can be got information about to wide Accuse the test for launching interface.
According to the method for fixed time test advertisement putting interface provided by the invention, the result obtained to test request and test Expected results in the configuration information of request are compared, by multi-party to state value, field, label, advertisement formwork form etc. The comparison in face, more accurately the implementing result of advertisement putting interface can be detected, to improve detection quality.
Fig. 3 shows the functional block diagram of the device of fixed time test advertisement putting interface according to an embodiment of the invention. As shown in figure 3, the device of fixed time test advertisement putting interface includes following module:
Memory module 301, suitable for obtaining the configuration information of advertisement putting interface testing request, test request is matched somebody with somebody into confidence Breath is stored in database.
Memory module 301, can be by such as in incoming page when obtaining the configuration information of advertisement putting interface testing request The configuration information of face input advertisement putting interface testing request, reads the input information of the page, obtain test request matches somebody with somebody confidence Breath.Or the configuration information asked by file record advertisement putting interface testing, file content is read, obtains matching somebody with somebody for test request The modes such as confidence breath.Configuration information is stored in database by memory module 301 after configuration information is obtained.Advertisement putting connects The configuration information of mouth test request includes:The interface IP address of test request, the agreement of test request, time interval and/or expection As a result.
URL addresses when the interface IP address of test request is advertisement putting interface testing, for being surveyed to advertisement putting interface Examination use, when calling the interface IP address, that is, perform the corresponding material of the advertisement putting page and obtain operation, page rendering operation, show Show operation etc..
The agreement of test request can be Http agreements or Https agreements.Http agreements are between client and server end The mutually standard agreement of request and response, in clear text manner transmission content, do not provide the data encryption of any mode, during use Data message can be directly read.Https agreements are the default port different with Http agreements from Http agreement differences With carried out encrypting/authentication.By the encrypt and decrypt operation to data, safety of the data in network transmission has been ensured.
The time interval of test request is tested advertisement putting interface, sends the time interval of test request.Survey The time interval of examination request set can according to the difference of advertisement putting interface, square one is not configured test request.According to When the response time of advertisement putting interface is set, such as from advertisement putting interface is called, to the material letter returned needed for advertisement putting Breath, material information is rendered after display when needing 10s, when the time interval of test request can be arranged into 12s or longer Between be spaced, to carry out single performing test not influenceing the situation that advertisement putting interface normally performs.When need to advertisement throw When putting interface progress pressure test, the time interval of test request can be arranged to 3s or shorter time interval, with test advertisements Dispensing interface does not stop the execution state in the case of being called.Or when need test advertisements launch interface use in different clients Or response speed during server end, can carry handling capacity when, the time interval of test request according to actual conditions, can be set.
The Expected Results of test request is to envision the result that obtain after performing advertisement putting interface.Expected Results can be with The various content informations shown including the page, such as word content, picture, animation, video, audio, interactive form, navigation Deng, can also include special effects of webpage, page-size, page style, the layout of the page, in the page position of each content set, page Face body is in the position that whole window is shown, page presentation mode etc..Expected Results can be the content of the advertisement putting page Expected Results or the Expected Results of mode that shows of the advertisement putting page, can be carried out according to requirement during test It is corresponding to set.
Constructing module 302, suitable for the configuration information according to test request, the test request of construction advertisement putting interface.
After the configuration information of database purchase test request, when needing advertisement putting interface to be tested, constructing module 302 support the client programming kit of Http or Https agreements using such as HttpClient, according to the configuration of test request Information, construct the test request of the advertisement putting interface based on Http or Https agreements.
The kits such as HttpClient can create corresponding example, and by utilizing the constructed fuction of example according to survey The interface IP address of request is tried, constructs the test request of advertisement putting interface.Test request can be called by example, hold OK, the return value of the test request of calling and/or response contents etc. can also be received by example.
Timing sending module 303, sending test suitable for the time interval timing in the configuration information according to test request please Ask.
Time interval is provided with the configuration information of test request, timing sending module 303 is by using job scheduling frame The instruments such as frame such as Quartz, the test request that constructing module 302 constructs is generated in job scheduling framework corresponding to after task, Job scheduling framework can sets task scheduling timetable according to the time interval in the configuration information of test request, passes through tune Program is spent, notifies tasks carrying, so as to realize that timing sends test request.
Job scheduling framework such as Quartz, include the scheduler task pipe related to task creation, tasks carrying etc. Manage function.In use, creating a task in Quartz for test request, and corresponding trigger is added to the task.Root According to the time interval in the configuration information of test request, the task scheduling timetable established in scheduler.Trigger is added and appointed Business schedule time list, carries out Clocked operation.When the time interval in the configuration information that timing time reaches test request, triggering The trigger, task is performed, send test request.
Detection module 304, suitable for the expected results in the result and the configuration information of test request that obtain test request It is compared, it is whether correct to detect advertisement putting interface implementing result.
After timing sending module 303 sends test request, detection module 304 receives the result that test request returns, and right As a result included content is compared with the content in expected results in.When detection module 304 is detected in expected results Content exist in the result that test request obtains and it is consistent when, the result that detection advertisement putting interface performs is correct.When Content in expected results exists in the result that test request obtains, but it is inconsistent when, detection advertisement putting interface performs Result is wrong.When the content in expected results is not present in the result that test request obtains, detection advertisement putting connects The result that mouth performs is wrong.
Word " click on advertisement and understand more contents " is provided with result as expected, when the detection test of detection module 304 please Ask and word is also included in the result of return, and word is " click on advertisement and understand more contents ", detection module 304 detects advertisement It is correct to launch the result that interface performs.When detection module 304 detect test request return result in also include word, But word is " click on advertisement and show more contents ", and it is wrong that detection module 304, which detects the result that advertisement putting interface performs,. When not including word in the result that detection module 304 detects test request return, detection module 304 detects advertisement putting interface and held Capable result is wrong.
One content can be set in expected results, multinomial content can also be set.When setting multinomial content relatively, Only all exist in the result that test request returns and unanimously when detection module 304 detects all content in expected results When, it is correct that detection module 304, which detects the result that advertisement putting interface performs,.There is one in the result that test request returns When being not present or be inconsistent, it is wrong that detection module 304, which detects the result that advertisement putting interface performs,.
According to the device of fixed time test advertisement putting interface provided by the invention, match somebody with somebody what advertisement putting interface testing was asked Confidence breath is stored in database, according to the configuration information of test request, constructs the test request of advertisement putting interface.Regularly Test request is sent, by the result that test request obtains compared with the expected results in the configuration information of test request, with Whether convenient detection advertisement putting interface implementing result is correct.By simply setting configuration information, it is not required to connect advertisement putting Mouth code is read, and user can conveniently realize that timing calls advertisement putting interface to be tested.By test request Obtained result reduces what user was manually detected to the result that test request obtains directly compared with expected results Time, reduce the probability of artificial detection error.
Fig. 4 shows the functional block of the device of fixed time test advertisement putting interface in accordance with another embodiment of the present invention Figure.As shown in figure 4, being with Fig. 3 differences, in detection module 304, following detection unit further comprises:
State detection unit 3041, suitable for result phase value and the state value ratio in expected results for obtaining test request Compared with if unanimously, it is normal that detection advertisement putting interface performs state;If inconsistent, advertisement putting interface implementing result mistake is detected.
Include the state value of execution in the result that test request obtains, state value is to perform Http or Https agreements After the test request of advertisement putting interface, the state value of return.State value according to the difference of first character, be divided into message, successfully, The types such as redirection, request error, server mistake.The state value of general 2 word beginning represents successfully, the state value of 4 words beginning Represent request error, the state value representative server mistake of 5,6 words beginning.Certainly, can also be self-defined in the advertisement putting page Different return values.In state value and expected results that state detection unit 3041 is returned according to advertisement putting test request interface The execution of setting correctly returns to state value and is compared, if unanimously, state detection unit 3041 detects advertisement putting interface and held Row state is normal, continues executing with subsequent detection unit, if inconsistent, state detection unit 3041 detects advertisement putting interface and performed As a result mistake.
Field label detection unit 3042, suitable for the field and/or label in the obtained result of extraction test request, it will carry Compared with field and/or the label field corresponding with expected results and/or label that take, held with detecting advertisement putting interface Whether row result is correct.
When field label detection unit 3042 detects, except pre- to extract in the single resultant content obtained from test request Field progress content in phase result etc. is relatively outer, can also be according to the field test request in specific expected results, such as word Content need to be started section with XX, field meets the setting of regular expression, field length etc. and tested.
Label is the label commonly used in the page setup language such as html language or css language, such as the mark in set location region Label,<div>、<iframe>、<frame>Or it is arranged on position in list<tr>、<td>;Display format label, word is set Form<font>、<b>、<u>Or picture format is set<img>, set control class form<textarea>Etc.;Shape is high wide Label, position, left, right etc..Field label detection unit 3042 has mark in detection, as worked as in expected results During label, the label whether included in expected results is extracted in the resultant content obtained from test request and is compared.
Further, can also be by field combination tag, after field label detection unit 3042 combines to field and label Content is compared.
If comparative result is consistent, subsequent detection unit is continued executing with, if inconsistent, field label detection unit 3042 detects Advertisement putting interface implementing result mistake.
Template detection unit 3042, suitable for the advertisement formwork format information in the obtained result of extraction test request, it will carry Compared with the advertisement formwork format information advertisement formwork format information corresponding with expected results taken, to detect advertisement putting Whether interface implementing result is correct.
The result that test request obtains is used for the display of the advertisement putting page, and the advertisement putting page is due to the spy of itself Property, it is also necessary to template detection unit 3042 is performed, compared with advertisement formwork form.The form of advertisement formwork, it is such as interior to be embedded Put, the setting that suspends, distich set etc. form.Perform the advertisement mould in the result that template detection unit 3042 obtains test request The advertisement formwork format information that plate format information is set in expected results is compared, if unanimously, detecting advertisement putting interface Implementing result is correct.If inconsistent, template detection unit 3042 detects advertisement putting interface implementing result mistake.
Perform more than each detection unit when, can in detection unit by the way of asserting, to need to compare state value, Field, label, template style etc. are judged, can also need the output error message in asserting according to test.
More than performing after each detection unit, further, result statistical module is can also carry out, to the correct of implementing result Or mistake is counted, examining report, generation error message file, generation test result page mode, Ke Yizhi are such as generated Sight understands this test to advertisement putting interface.
According to the device of fixed time test advertisement putting interface provided by the invention, the result obtained to test request and test Expected results in the configuration information of request are compared, by multi-party to state value, field, label, advertisement formwork form etc. The comparison in face, more accurately the implementing result of advertisement putting interface can be detected, to improve detection quality.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein. Various general-purpose systems can also be used together with teaching based on this.As described above, required by constructing this kind of system Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It should be understood that it can utilize various Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair Bright preferred forms.
In the specification that this place provides, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention Example can be put into practice in the case of these no details.In some instances, known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help to understand one or more of each inventive aspect, Above in the description to the exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:I.e. required guarantor The application claims of shield features more more than the feature being expressly recited in each claim.It is more precisely, such as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following embodiment are expressly incorporated in the embodiment, wherein each claim is in itself Separate embodiments all as the present invention.
Those skilled in the art, which are appreciated that, to be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more equipment different from the embodiment.Can be the module or list in embodiment Member or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or Sub-component.In addition at least some in such feature and/or process or unit exclude each other, it can use any Combination is disclosed to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so to appoint Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power Profit requires, summary and accompanying drawing) disclosed in each feature can be by providing the alternative features of identical, equivalent or similar purpose come generation Replace.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments In included some features rather than further feature, but the combination of the feature of different embodiments means in of the invention Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed One of meaning mode can use in any combination.
The all parts embodiment of the present invention can be realized with hardware, or to be run on one or more processor Software module realize, or realized with combinations thereof.It will be understood by those of skill in the art that it can use in practice Microprocessor or digital signal processor (DSP) realize fixed time test advertisement putting interface according to embodiments of the present invention The some or all functions of some or all parts in device.The present invention is also implemented as being used to perform being retouched here The some or all equipment or program of device (for example, computer program and computer program product) for the method stated. Such program for realizing the present invention can store on a computer-readable medium, or can have one or more signal Form.Such signal can be downloaded from internet website and obtained, either provide on carrier signal or with it is any its He provides form.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference symbol between bracket should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such Element.The present invention can be by means of including the hardware of some different elements and being come by means of properly programmed computer real It is existing.In if the unit claim of equipment for drying is listed, several in these devices can be by same hardware branch To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and run after fame Claim.
The invention also discloses:
A1, a kind of method of fixed time test advertisement putting interface, it includes:
The configuration information of advertisement putting interface testing request is obtained, the configuration information of the test request is stored in data In storehouse;
According to the configuration information of the test request, the test request of construction advertisement putting interface;
The test request is sent according to the time interval timing in the configuration information of the test request;
By the result that the test request obtains compared with the expected results in the configuration information of test request, with inspection Whether correct survey advertisement putting interface implementing result.
A2, the method according to A1, wherein, the configuration information of the test request includes:
The interface IP address of test request, the agreement of test request, time interval and/or expected results.
A3, the method according to A2, wherein, the agreement of the test request is Http agreements or Https agreements.
A4, the method according to any one of A1-A3, wherein, the configuration information according to the test request, construction The test request of advertisement putting interface further comprises:
According to the configuration information of the test request, constructed using HttpClient based on the wide of Http or Https agreements Accuse the test request for launching interface.
A5, the method according to any one of A1-A4, wherein, in the configuration information according to the test request Time interval timing sends the test request and further comprised:
Using job scheduling framework, the survey is sent according to the time interval timing in the configuration information of the test request Examination request.
A6, the method according to any one of A1-A5, wherein, the result that the test request is obtained and test Expected results in the configuration information of request are compared, to detect the whether correct further bag of advertisement putting interface implementing result Include:
The result phase value that the test request is obtained is compared with the state value in expected results, if unanimously, detection is wide It is normal to accuse dispensing interface execution state;If inconsistent, advertisement putting interface implementing result mistake is detected.
A7, the method according to any one of A1-A6, wherein, the result that the test request is obtained and test Expected results in the configuration information of request are compared, to detect the whether correct further bag of advertisement putting interface implementing result Include:
The field and/or label in the result that the test request obtains are extracted, by the field and/or label of extraction Compared with field corresponding with the expected results and/or label, whether just to detect advertisement putting interface implementing result Really.
A8, the method according to A7, wherein, the label is that location tags, display format label and/or shape are high wide Label.
A9, the method according to any one of A1-A8, wherein, the result that the test request is obtained and test Expected results in the configuration information of request are compared, to detect the whether correct further bag of advertisement putting interface implementing result Include:
The advertisement formwork format information in the result that the test request obtains is extracted, by the advertisement formwork lattice of extraction Compared with formula information advertisement formwork format information corresponding with the expected results, knot is performed to detect advertisement putting interface Whether fruit is correct.
B10, a kind of device of fixed time test advertisement putting interface, it includes:
Memory module, suitable for obtaining the configuration information of advertisement putting interface testing request, by the configuration of the test request Information is stored in database;
Constructing module, suitable for the configuration information according to the test request, the test request of construction advertisement putting interface;
Timing sending module, the survey is sent suitable for the time interval timing in the configuration information according to the test request Examination request;
Detection module, suitable for the expected results in the result and the configuration information of test request that obtain the test request It is compared, it is whether correct to detect advertisement putting interface implementing result.
B11, the device according to B10, wherein, the configuration information of the test request includes:
The interface IP address of test request, the agreement of test request, time interval and/or expected results.
B12, the device according to B11, wherein, the agreement of the test request is Http agreements or Https agreements.
B13, the device according to any one of B10-B12, wherein, the constructing module is further adapted for:According to described The configuration information of test request, the test of the advertisement putting interface based on Http or Https agreements is constructed using HttpClient Request.
B14, the device according to any one of B10-B13, wherein, the timing sending module is further adapted for:Utilize Job scheduling framework, the test request is sent according to the time interval timing in the configuration information of the test request.
B15, the device according to any one of B10-B14, wherein, the detection module also includes:
State detection unit, suitable for result phase value and the state value ratio in expected results for obtaining the test request Compared with if unanimously, it is normal that detection advertisement putting interface performs state;If inconsistent, advertisement putting interface implementing result mistake is detected.
B16, the device according to any one of B10-B15, wherein, the detection module also includes:Field label detects Unit, field and/or label in the result obtained suitable for extracting the test request, by the field and/or mark of extraction Compared with label field corresponding with the expected results and/or label, whether to detect advertisement putting interface implementing result Correctly.
B17, the device according to B16, wherein, the label in the expected results is location tags, display format mark Label and/or the high wide label of shape.
B18, the device according to any one of B10-B17, wherein, the detection module also includes:
Template detection unit, the advertisement formwork format information in the result obtained suitable for extracting the test request, will be carried Compared with the advertisement formwork format information advertisement formwork format information corresponding with the expected results taken, with detection Whether advertisement putting interface implementing result is correct.

Claims (10)

1. a kind of method of fixed time test advertisement putting interface, it includes:
The configuration information of advertisement putting interface testing request is obtained, the configuration information of the test request is stored in database In;
According to the configuration information of the test request, the test request of construction advertisement putting interface;
The test request is sent according to the time interval timing in the configuration information of the test request;
It is wide to detect by the result that the test request obtains compared with the expected results in the configuration information of test request Whether correct accuse dispensing interface implementing result.
2. according to the method for claim 1, wherein, the configuration information of the test request includes:
The interface IP address of test request, the agreement of test request, time interval and/or expected results.
3. according to the method for claim 2, wherein, the agreement of the test request is Http agreements or Https agreements.
4. according to the method described in claim any one of 1-3, wherein, the configuration information according to the test request, structure The test request for making advertisement putting interface further comprises:
According to the configuration information of the test request, construct the advertisement based on Http or Https agreements using HttpClient and throw Put the test request of interface.
5. according to the method described in claim any one of 1-4, wherein, in the configuration information according to the test request Time interval timing sends the test request and further comprised:
Using job scheduling framework, sending the test according to the time interval timing in the configuration information of the test request please Ask.
6. according to the method described in claim any one of 1-5, wherein, the result that the test request is obtained and test Expected results in the configuration information of request are compared, to detect the whether correct further bag of advertisement putting interface implementing result Include:
The result phase value that the test request is obtained is compared with the state value in expected results, if unanimously, detection advertisement is thrown It is normal to put interface execution state;If inconsistent, advertisement putting interface implementing result mistake is detected.
7. according to the method described in claim any one of 1-6, wherein, the result that the test request is obtained and test Expected results in the configuration information of request are compared, to detect the whether correct further bag of advertisement putting interface implementing result Include:
The field and/or label in the result that the test request obtains are extracted, by the field and/or label of extraction and institute Corresponding field and/or label in expected results is stated to be compared, it is whether correct to detect advertisement putting interface implementing result.
8. according to the method for claim 7, wherein, the label is that location tags, display format label and/or shape are high Wide label.
9. according to the method described in claim any one of 1-8, wherein, the result that the test request is obtained and test Expected results in the configuration information of request are compared, to detect the whether correct further bag of advertisement putting interface implementing result Include:
The advertisement formwork format information in the result that the test request obtains is extracted, the advertisement formwork form of extraction is believed Compared with breath advertisement formwork format information corresponding with the expected results, it is to detect advertisement putting interface implementing result It is no correct.
10. a kind of device of fixed time test advertisement putting interface, it includes:
Memory module, suitable for obtaining the configuration information of advertisement putting interface testing request, by the configuration information of the test request It is stored in database;
Constructing module, suitable for the configuration information according to the test request, the test request of construction advertisement putting interface;
Timing sending module, sending the test suitable for the time interval timing in the configuration information according to the test request please Ask;
Detection module, carried out suitable for the expected results in the result and the configuration information of test request that obtain the test request Compare, it is whether correct to detect advertisement putting interface implementing result.
CN201610518091.7A 2016-07-04 2016-07-04 The method and device of fixed time test advertisement putting interface Pending CN107577589A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610518091.7A CN107577589A (en) 2016-07-04 2016-07-04 The method and device of fixed time test advertisement putting interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610518091.7A CN107577589A (en) 2016-07-04 2016-07-04 The method and device of fixed time test advertisement putting interface

Publications (1)

Publication Number Publication Date
CN107577589A true CN107577589A (en) 2018-01-12

Family

ID=61049836

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610518091.7A Pending CN107577589A (en) 2016-07-04 2016-07-04 The method and device of fixed time test advertisement putting interface

Country Status (1)

Country Link
CN (1) CN107577589A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108804267A (en) * 2018-05-30 2018-11-13 平安普惠企业管理有限公司 Database polling method, device, computer equipment and storage medium
CN109583936A (en) * 2018-10-25 2019-04-05 北京奇虎科技有限公司 Commercial detection method, server and readable storage medium storing program for executing based on media advertisement position
CN110018906A (en) * 2019-02-26 2019-07-16 上海丽人丽妆网络科技有限公司 Dispatching method, server and scheduling system
CN110415101A (en) * 2019-06-19 2019-11-05 深圳壹账通智能科技有限公司 Products Show test method, device, computer equipment and storage medium
CN111209201A (en) * 2020-01-03 2020-05-29 恩亿科(北京)数据科技有限公司 Advertisement putting test method and device
CN112633908A (en) * 2019-10-09 2021-04-09 上海哔哩哔哩科技有限公司 Advertisement test object generation method and device and computer equipment

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108804267A (en) * 2018-05-30 2018-11-13 平安普惠企业管理有限公司 Database polling method, device, computer equipment and storage medium
CN109583936A (en) * 2018-10-25 2019-04-05 北京奇虎科技有限公司 Commercial detection method, server and readable storage medium storing program for executing based on media advertisement position
CN110018906A (en) * 2019-02-26 2019-07-16 上海丽人丽妆网络科技有限公司 Dispatching method, server and scheduling system
CN110415101A (en) * 2019-06-19 2019-11-05 深圳壹账通智能科技有限公司 Products Show test method, device, computer equipment and storage medium
CN112633908A (en) * 2019-10-09 2021-04-09 上海哔哩哔哩科技有限公司 Advertisement test object generation method and device and computer equipment
CN112633908B (en) * 2019-10-09 2024-02-20 上海哔哩哔哩科技有限公司 Advertisement test object generation method and device and computer equipment
CN111209201A (en) * 2020-01-03 2020-05-29 恩亿科(北京)数据科技有限公司 Advertisement putting test method and device
CN111209201B (en) * 2020-01-03 2023-08-25 恩亿科(北京)数据科技有限公司 Advertisement putting test method and device

Similar Documents

Publication Publication Date Title
CN107577589A (en) The method and device of fixed time test advertisement putting interface
US11461768B2 (en) Systems and methods for data file transfer balancing and control on blockchain
Sheppard et al. Beginning progressive web app development
CN108897691A (en) Data processing method, device, server and medium based on interface analog service
CN103678487B (en) Method and device for generating web page snapshot
US8972936B2 (en) Version labeling in a version control system
CN109359194B (en) Method and apparatus for predicting information categories
CN106294094A (en) The method of testing of game server, client, server and system
CN105975844B (en) A kind of login method and device
CN104065896B (en) The method and apparatus that audio/video information is shown are carried out in a kind of browser
CN107683481A (en) Encryption data is calculated using deferred evaluation
CN109271557B (en) Method and apparatus for outputting information
CN106708704A (en) Method and device for classifying crash logs
JP2024514069A (en) electronic messaging methods
CN105117499A (en) File display method and device based on cloud disk
CN104080016B (en) The method and apparatus that audio/video information is shown are carried out in a kind of browser
CN109739704A (en) A kind of interface test method, server-side and computer readable storage medium
CN110674023B (en) Interface testing method and device
US11095957B2 (en) Method and apparatus for publishing information, and method and apparatus for processing information
CN103646054A (en) Method for playing multimedia data and browser device
CN110140144A (en) For verifying the image processing system of the data of rendering
CN107391771A (en) The generation method and device of a kind of image special effect
CN105450462A (en) On-line state monitoring method and system
KR101994564B1 (en) Method and apparatus for verifying user
KR102034897B1 (en) Terminal apparatus for providing information of object comprised broadcast program and method for operating terminal apparatus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20180112

WD01 Invention patent application deemed withdrawn after publication