CN110109827A - For method for early warning and relevant apparatus on the line of the page - Google Patents
For method for early warning and relevant apparatus on the line of the page Download PDFInfo
- Publication number
- CN110109827A CN110109827A CN201910296082.1A CN201910296082A CN110109827A CN 110109827 A CN110109827 A CN 110109827A CN 201910296082 A CN201910296082 A CN 201910296082A CN 110109827 A CN110109827 A CN 110109827A
- Authority
- CN
- China
- Prior art keywords
- page
- data
- tested
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/32—Monitoring with visual or acoustical indication of the functioning of the machine
- G06F11/324—Display of status information
- G06F11/327—Alarm or error message display
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3692—Test management for test results analysis
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Debugging And Monitoring (AREA)
Abstract
This application involves the improvement of the testing process of page the field of test technology, and in particular to method for early warning and relevant apparatus on a kind of line for the page, method includes: that data i to be tested is obtained from data set to be tested when page test function is in starting state;Determine whether data i to be tested is page data;If data i to be tested is page data, treats test data i and carry out page test, obtain the corresponding page test result of data i to be tested;If the corresponding page test result of data i to be tested is page exception, early warning operation on the line for the page is executed.The efficiency of early warning on the line for the page can be improved using the embodiment of the present application.
Description
Technical field
This application involves page the field of test technology, and in particular to method for early warning and related dress on a kind of line for the page
It sets.
Background technique
It refers to when detecting that page test result is page exception for early warning on the line of the page using the side on line
Formula executes early warning operation (such as sending warning information, transmitting pre-warning signal etc.).Currently, due to being adopted for early warning on the line of the page
Mode manually, therefore it is directed to the early warning low efficiency of the page.
Summary of the invention
The embodiment of the present application provides method for early warning and relevant apparatus on a kind of line for the page, is directed to the page for improving
Line on early warning efficiency.
In a first aspect, the embodiment of the present application provides method for early warning on a kind of line for the page, which comprises
When page test function is in starting state, data i to be tested is obtained from data set to be tested;
Determine whether the data i to be tested is page data;
If the data i to be tested is page data, page test is carried out to the data i to be tested, is obtained described
The corresponding page test result of data i to be tested;
If the corresponding page test result of the data i to be tested is page exception, execute pre- on the line for the page
Alert operation.
Second aspect, the embodiment of the present application provide prior-warning device on a kind of line for the page, and described device includes:
Acquiring unit, for being obtained from data set to be tested to be tested when page test function is in starting state
Data i;
Determination unit, for determining whether the data i to be tested is page data;
First execution unit carries out the data i to be tested if being page data for the data i to be tested
Page test, obtains the corresponding page test result of the data i to be tested;
Second execution unit executes if being used for the corresponding page test result of the data i to be tested is page exception
It is operated for early warning on the line of the page.
The third aspect, the embodiment of the present application provide a kind of electronic device, including processor, memory, communication interface, and
One or more programs, said one or multiple programs are stored in above-mentioned memory, and are configured by above-mentioned processor
It executes, above procedure is included the steps that for executing the instruction in method described in the embodiment of the present application first aspect.
Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium, above-mentioned computer-readable storage
For storing computer program, above-mentioned computer program is executed by processor medium, to realize such as the embodiment of the present application first party
Step some or all of described in method described in face.
5th aspect, the embodiment of the present application provide a kind of computer program product, and above-mentioned computer program product includes
The non-transient computer readable storage medium of computer program is stored, above-mentioned computer program is operable to hold computer
Step some or all of described in method of the row as described in the embodiment of the present application first aspect.The computer program product can
Think a software installation packet.
As can be seen that in the embodiment of the present application, data i to be tested is obtained from data set to be tested, when number to be tested
According to i be page data when, treat test data i carry out page test, obtain the corresponding page test result of data i to be tested,
If the corresponding page test result of data i to be tested is page exception, early warning operation on the line for the page is executed.Compared to
Early warning on line for the page is carried out using manual type, improves the efficiency of early warning on the line for the page.
These aspects or other aspects of the application can more straightforward in the following description.
Detailed description of the invention
Technical solution in ord to more clearly illustrate embodiments of the present application or in background technique below will be implemented the application
Attached drawing needed in example or background technique is illustrated.
Fig. 1 is the flow diagram of method for early warning on a kind of line for the page provided by the embodiments of the present application;
Fig. 2 is the flow diagram of method for early warning on another line for the page provided by the embodiments of the present application;
Fig. 3 is the flow diagram of method for early warning on another line for the page provided by the embodiments of the present application;
Fig. 4 is the functional unit composition block diagram of prior-warning device on a kind of line for the page provided by the embodiments of the present application;
Fig. 5 is a kind of structural schematic diagram of electronic device provided by the embodiments of the present application.
Specific implementation
In order to make those skilled in the art more fully understand application scheme, below in conjunction in the embodiment of the present application
Attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is only
The embodiment of the application a part, instead of all the embodiments.Based on the embodiment in the application, ordinary skill people
Member's every other embodiment obtained without making creative work, all should belong to the model of the application protection
It encloses.
It is described in detail separately below.
The description and claims of this application and term " first ", " second ", " third " and " in the attached drawing
Four " etc. are not use to describe a particular order for distinguishing different objects.In addition, term " includes " and " having " and it
Any deformation, it is intended that cover and non-exclusive include.Such as it contains the process, method of a series of steps or units, be
System, product or equipment are not limited to listed step or unit, but optionally further comprising the step of not listing or list
Member, or optionally further comprising other step or units intrinsic for these process, methods, product or equipment.
Referenced herein " embodiment " is it is meant that a particular feature, structure, or characteristic described can wrap in conjunction with the embodiments
It is contained at least one embodiment of the application.Each position in the description occur the phrase might not each mean it is identical
Embodiment, nor the independent or alternative embodiment with other embodiments mutual exclusion.Those skilled in the art explicitly and
Implicitly understand, embodiment described herein can be combined with other embodiments.
Electronic device involved by the embodiment of the present application is page test device, which can integrate
In mobile terminal.
It describes in detail below to the embodiment of the present application.
Referring to Fig. 1, Fig. 1 is the process signal of method for early warning on a kind of line for the page provided by the embodiments of the present application
Figure, should be directed to method for early warning on the line of the page include:
Step 101: when page test function is in starting state, electronic device obtains to be measured from data set to be tested
Try data i.
In a possible example, electronic device is before obtaining data i to be tested in data set to be tested, the side
Method further include:
Electronic device obtains multiple data to be tested;
Electronic device initializes the multiple data to be tested, multiple data to be tested after being initialized;
Electronic device is based on the multiple data to be tested and test profile generation data to be tested after the initialization
Collection.
Wherein, multiple data to be tested are what tester inputted in Excel.
Specifically, electronic device initializes multiple data to be tested, multiple numbers to be tested after being initialized
According to embodiment can be with are as follows: be in the case that M M is integer greater than 1 in the quantity of multiple data to be tested, to m-th to
Test data, which executes, corrects operation;It is a to be tested to (m+1) after executing correction operation to m-th of data to be tested
Data, which execute, corrects operation;Until m=M, stopping treats test data and executes correction operation, and M after being corrected are to be tested
Data, m be initial value be 1, with 1 for interval incrementing integers;Using M data to be tested after correction as more after initialization
A data to be tested.
Specifically, electronic device m-th of data to be tested is executed correct the embodiment of operation can be with are as follows: determine test
Identical as m-th of data to be tested with the presence or absence of test data in data set, test data set includes multiple test datas, test
Data set is pre-stored in electronic device;If so, keeping m-th of data to be tested constant;If it is not, being concentrated from test data
P test data identical with the length of m-th of data to be tested is chosen, P is more than or equal to 1 and whole less than or equal to M
Number;The matching degree for determining each test data and m-th of data to be tested in P test data, obtains P test data pair
The P matching degree answered;The corresponding test data of matching degree maximum in P matching degree is replaced into m-th of data to be tested.
Specifically, it is determined that the implementation of the matching degree of each test data and m-th of data to be tested in P test data
Mode can be with are as follows: read test data n obtains corresponding first data sequence of test data n, and test data n is P test number
Any one in;M-th of data to be tested is read, corresponding second data sequence of m-th of data to be tested is obtained;It determines
Position and data content data amount check all the same are target number in first data sequence and the second data sequence;By target
Several matching degrees with the ratio of the data amount check of m-th of data to be tested as test data n and m-th of data to be tested;To P
(P-1) a test data in a test data in addition to test data n executes identical operation, obtains P test data pair
The P matching degree answered.
Wherein, test profile is what electronic device was generated based on Creative Driven xml Data.jar.
Specifically, electronic device generates number to be tested based on multiple data test profiles to be tested after initialization
It can be with according to the embodiment of collection are as follows: in the quantity of multiple data to be tested be in the case that M M is integer greater than 1, to obtain M
The generation time of each data to be tested in data to be tested obtains the M data to be tested corresponding M generation time;According to
M data to be tested are ranked up by chronological order, obtain third data sequence;Using third data sequence as to be tested
Data set.
Specifically, electronic device is based on the multiple data to be tested and test profile generation number to be tested after initialization
It can be with according to the embodiment of collection are as follows: in the quantity of multiple data to be tested be in the case that M M is integer greater than 1, to obtain M
The generation time of each data to be tested and data class in data to be tested, when obtaining M data to be tested and corresponding to M generation
Between and M data class, data class can be image data, text data, video data etc.;M data to be tested are drawn
It is divided into Q data subsets to be tested, at least one data to be tested that each data subset to be tested includes, at least one is to be measured
It is identical for trying the data class of data;According to chronological order by each of Q data subset to be tested number to be tested
It is sorted for the first time according to subset, the Q after being sorted for the first time data subsets to be tested;It obtains and is deposited in advance in test profile
The data class of storage puts in order, and is put in order based on data class and determine Q after sorting for the first time data to be tested
Collect corresponding goal ordering;Q data subsets to be tested after being sorted for the first time based on goal ordering carry out minor sort again, obtain
Q after minor sort data subsets to be tested again;Using Q data subsets to be tested after minor sort again as data to be tested
Collection.
Step 102: electronic device determines whether the data i to be tested is page data.
In a possible example, electronic device determines whether the data i to be tested is page data, comprising:
Electronic device reads the data i to be tested, obtain the checkpoint title of the data i to be tested, test-types,
Test domain, expected time-out, expectation state code, characteristic information;
Electronic device determines whether the checkpoint title of the data i to be tested is non-empty, whether test-types are transmission
Whether request or reception request, test domain are started with hypertext transfer protocol;
If the entitled non-empty in checkpoint of the data i to be tested, test-types are to send request or reception request, test
Domain is started with hypertext transfer protocol, then electronic device determines whether the expected time-out of the data i to be tested is number, is expected
Whether state code is non-empty;
If the expected time-out of the data i to be tested is number, expecting state code is non-empty, electronic device determines institute
Whether the characteristic information for stating data i to be tested includes page feature;
If the characteristic information of the data i to be tested includes page feature, electronic device determines the data i to be tested
For page data.
Step 103: if the data i to be tested is page data, electronic device carries out page to the data i to be tested
Face test, obtains the corresponding page test result of the data i to be tested.
In a possible example, electronic device carries out page test to the data i to be tested, obtains described to be measured
Try the corresponding page test result of data i, comprising:
Electronic device carries out jth time interface testing to the data i to be tested, the interface after obtaining jth time interface testing
Test result;
If the interface testing result after the jth time interface testing is that interface is abnormal, electronic device is when first is default
(j+1) secondary interface testing is carried out to the data i to be tested after length, the interface testing after obtaining (j+1) secondary interface testing
As a result;
Until j=N, electronic device stops carrying out interface testing to the data i to be tested, obtains n-th interface testing
Rear interface testing as a result, it is 1 that j, which is initial value, with 1 for interval incrementing integers, the N is the integer greater than 1;
If the interface testing result after the n-th interface testing is that interface is normal, electronic device is to described to be tested
Data i carries out kth time page test, the page test result after obtaining kth time page test;
If the page test result after the kth time page test is page exception, electronic device is when second is default
It carries out (k+1) secondary page to the data i to be tested after length to test, the page test after obtaining (k+1) secondary page test
As a result;
Until k=N, electronic device stops carrying out page test to the data i to be tested, obtains the test of the n-th page
Page test result afterwards, k be initial value be 1, with 1 for interval incrementing integers;
If the page test result after the n-th page test is that the page is normal, electronic device determines described to be measured
Trying the corresponding page test result of data i is that the page is normal.
Wherein, the first preset duration can be identical with the second preset duration, be also possible to different.
Further, the method also includes:
If the page test result after the test of the n-th page is page exception, electronic device determines i pairs of data to be tested
The page test result answered is page exception.
As an example it is assumed that N is the 3, first preset duration and the second preset duration is 0.5s, electronic device is to be tested
Data i carries out the 1st interface testing, and the interface testing after obtaining the 1st interface testing is as a result, if after the 1st interface testing
Interface testing result is that interface is abnormal, then treats test data i after 0.5s and carry out the 2nd interface testing, obtain the 2nd interface
Interface testing after test is treated after 0.5s as a result, if the interface testing result after the 2nd interface testing is that interface is abnormal
Test data i carries out the 3rd interface testing, and the interface testing after obtaining the 3rd interface testing is as a result, if the 3rd interface testing
Interface testing result afterwards is that interface is normal, then treats test data i and carry out the 1st page test, obtain the 1st page test
Page test result afterwards, if the page test result after the test of the 1st page is page exception, treat test data i into
The 2nd page test of row, the page test result after obtaining the 2nd page test, if the page test after the 2nd page test
As a result it is page exception, then treats test data i and carry out the 3rd page test, the page test after obtaining the 3rd page test
As a result, if the page test result after the test of the 3rd page is that the page is normal, it is determined that the corresponding page of data i to be tested is surveyed
Test result is that the page is normal, if the page test result after the 3rd page test is page exception, it is determined that data i to be tested
Corresponding page test result is page exception.
In a possible example, electronic device carries out jth time interface testing to the data i to be tested, obtains jth
Interface testing result after secondary interface testing, comprising:
Electronic device is to target interface transmission interface test request, and when obtaining the first load of the target interface
Long, return code and return value;
Electronic device determines whether the first load duration is less than or equal to first threshold;
If the first load duration is less than or equal to the first threshold, electronic device determines the test configurations text
It is identical as the return code with the presence or absence of status code in part;
If existence code is identical as the return code in the test profile, electronic device determines the return
Whether identical as target value it is worth;
If the return value and the target value be not identical, electronic device determines connecing after the jth time interface testing
Mouth test result is that interface is abnormal;
If the return value is identical as the target value, electronic device determines the interface after the jth time interface testing
Test result is that interface is normal.
Wherein, target interface is the corresponding test interface of data i to be tested.
In a possible example, electronic device carries out kth time page test to the data i to be tested, obtains kth
Page test result after secondary page test, comprising:
Electronic device initializes browser, the browser after being initialized;
Electronic device carries out page load to the data i to be tested based on the browser after the initialization, obtains institute
State the corresponding second load duration of data i to be tested, page loading result and page info;
Electronic device determines whether the second load duration is less than or equal to second threshold;
If the second load duration is less than or equal to the second threshold, electronic device determines the page load knot
Whether fruit is to load successfully;
If the page loading result is to load successfully, electronic device determines whether the page info is correct;
If the page info is correct, electronic device determines that the page test result after the kth time page test is
The page is normal;
If the page info mistake, electronic device determines that the page test result after the kth time page test is
Page exception.
Wherein, the browser after initialization is in the state of the page to be loaded, and the browser after initialization is in silent mould
Formula.
Specifically, electronic device treats test data i based on the browser after initialization and carries out page load, obtains to be measured
Trying the corresponding second load duration of data i, the embodiment of page loading result and page info can be with are as follows: parses number to be tested
According to i, the corresponding destination Uniform Resource finger URL of data i to be tested is obtained;It is unified by the browser resolves target after initialization
Resource Locator obtains the corresponding IP address of destination Uniform Resource finger URL;Establish initialization after browser and server it
Between TCP connection;It is sent with carrying the corresponding IP of destination Uniform Resource finger URL by the browser after initialization to server
The request of location, request are used to indicate server feedback page load information;It is anti-that server is received by the browser after initialization
The page load information of feedback, page load information include the second load duration, page loading result and page info.
Wherein, electronic device determines that the whether correct method of page info is the prior art, no longer describes herein.
In a possible example, the method also includes:
If the interface testing result after the n-th interface testing is that interface is abnormal, electronic device determines described to be measured
Trying the corresponding page test result of data i is page exception.
Step 104: if the corresponding page test result of the data i to be tested is page exception, electronic device is executed
It is operated for early warning on the line of the page.
It wherein, can be warning information for early warning operation on the line of the page, or pre-warning signal.
As can be seen that in the embodiment of the present application, data i to be tested is obtained from data set to be tested, when number to be tested
According to i be page data when, treat test data i carry out page test, obtain the corresponding page test result of data i to be tested,
If the corresponding page test result of data i to be tested is page exception, early warning operation on the line for the page is executed.Compared to
Early warning on line for the page is carried out using manual type, improves the efficiency of early warning on the line for the page.In addition, using fixed
The test profile of inhibition and generation improves the speed of page test;It is treated using dual test (interface testing and page test)
Test data i carries out page test, improves the accuracy of page test.
It is consistent with above-mentioned embodiment shown in FIG. 1, referring to Fig. 2, Fig. 2 is another needle provided by the embodiments of the present application
To the flow diagram of method for early warning on the line of the page, should include: for method for early warning on the line of the page
Step 201: when page test function is in starting state, electronic device obtains to be measured from data set to be tested
Try data i.
Step 202: electronic device determines whether the data i to be tested is page data.
Step 203: if the data i to be tested is page data, electronic device carries out the to the data i to be tested
J interface testing, the interface testing result after obtaining jth time interface testing.
Step 204: if the interface testing result after the jth time interface testing is that interface is abnormal, electronic device is the
(j+1) secondary interface testing is carried out to the data i to be tested after one preset duration, after obtaining (j+1) secondary interface testing
Interface testing result.
Step 205: until j=N, electronic device stops carrying out interface testing to the data i to be tested, obtains n-th
Interface testing after interface testing as a result, it is 1 that j, which is initial value, with 1 for interval incrementing integers, the N is the integer greater than 1.
Step 206: if the interface testing result after the n-th interface testing is that interface is normal, electronic device is to institute
It states data i to be tested and carries out kth time page test, the page test result after obtaining kth time page test.
Step 207: if the page test result after the kth time page test is page exception, electronic device is the
It carries out (k+1) secondary page to the data i to be tested after two preset durations to test, after obtaining (k+1) secondary page test
Page test result.
Step 208: until k=N, electronic device stops carrying out page test to the data i to be tested, obtains n-th
The page test after page test result, k be initial value be 1, with 1 for interval incrementing integers.
Step 209: if the page test result after n-th page test is page exception, electronic device is determined
The corresponding page test result of the data i to be tested is page exception, and executes early warning operation on the line for the page.
It should be noted that the specific implementation process of each step of method shown in Fig. 2 can be found in described in the above method
Specific implementation process, no longer describe herein.
It is consistent with above-mentioned Fig. 1 and embodiment shown in Fig. 2, referring to Fig. 3, Fig. 3 is provided by the embodiments of the present application another
The flow diagram of method for early warning on a kind of line for the page should include: for method for early warning on the line of the page
Step 301: electronic device obtains multiple data to be tested.
Step 302: electronic device initializes the multiple data to be tested, multiple to be measured after being initialized
Try data.
Step 303: electronic device based on after the initialization multiple data to be tested and test profile generate to
Test data set.
Step 304: when page test function is in starting state, electronic device obtains to be measured from data set to be tested
Try data i.
Step 305: electronic device determines whether the data i to be tested is page data.
Step 306: if the data i to be tested is page data, electronic device carries out the to the data i to be tested
J interface testing, the interface testing result after obtaining jth time interface testing.
Step 307: if the interface testing result after the jth time interface testing is that interface is abnormal, electronic device is the
(j+1) secondary interface testing is carried out to the data i to be tested after one preset duration, after obtaining (j+1) secondary interface testing
Interface testing result.
Step 308: until j=N, electronic device stops carrying out interface testing to the data i to be tested, obtains n-th
Interface testing after interface testing as a result, it is 1 that j, which is initial value, with 1 for interval incrementing integers, the N is the integer greater than 1.
Step 309: if the interface testing result after the n-th interface testing is that interface is normal, electronic device is to institute
It states data i to be tested and carries out kth time page test, the page test result after obtaining kth time page test.
Step 310: if the page test result after the kth time page test is page exception, electronic device is the
It carries out (k+1) secondary page to the data i to be tested after two preset durations to test, after obtaining (k+1) secondary page test
Page test result.
Step 311: until k=N, electronic device stops carrying out page test to the data i to be tested, obtains n-th
The page test after page test result, k be initial value be 1, with 1 for interval incrementing integers.
Step 312: if the page test result after n-th page test is page exception, electronic device is determined
The corresponding page test result of the data i to be tested is page exception, and executes early warning operation on the line for the page.
It should be noted that the specific implementation process of each step of method shown in Fig. 3 can be found in described in the above method
Specific implementation process, no longer describe herein.
It is above-mentioned that mainly the scheme of the embodiment of the present application is described from the angle of method side implementation procedure.It is understood that
, in order to realize the above functions for prior-warning device on the line of the page, it comprises execute each corresponding hardware knot of function
Structure and/or software module.Those skilled in the art should be readily appreciated that, described in conjunction with the examples disclosed in this document
Each exemplary unit and algorithm steps, the application can be realized with the combining form of hardware or hardware and computer software.Certain
A function is executed in a manner of hardware or computer software driving hardware actually, depending on technical solution specific application and
Design constraint.Professional technician specifically can realize described function using distinct methods to each,
But this realization is it is not considered that exceed scope of the present application.
The embodiment of the present application can carry out functional unit to for prior-warning device on the line of the page according to above method example
Division two or more functions can also be integrated for example, each functional unit of each function division can be corresponded to
In one processing unit.Above-mentioned integrated unit both can take the form of hardware realization, can also use software function list
The form of member is realized.It should be noted that being schematical, only a kind of logic to the division of unit in the embodiment of the present application
Function division, there may be another division manner in actual implementation.
Referring to Fig. 4, Fig. 4 is the function of prior-warning device 400 on a kind of line for the page provided by the embodiments of the present application
Unit composition block diagram should include acquiring unit 401, the execution of determination unit 402, first for prior-warning device 400 on the line of the page
Unit 403 and the second execution unit 404, in which:
Acquiring unit 401, for being obtained from data set to be tested to be measured when page test function is in starting state
Try data i;
Determination unit 402, for determining whether the data i to be tested is page data;
First execution unit 403, if for the data i to be tested be page data, to the data i to be tested into
The test of the row page, obtains the corresponding page test result of the data i to be tested;
Second execution unit 404, if being used for the corresponding page test result of the data i to be tested is page exception,
Execute early warning operation on the line for the page.
As can be seen that in the embodiment of the present application, data i to be tested is obtained from data set to be tested, when number to be tested
According to i be page data when, treat test data i carry out page test, obtain the corresponding page test result of data i to be tested,
If the corresponding page test result of data i to be tested is page exception, early warning operation on the line for the page is executed.Compared to
Early warning on line for the page is carried out using manual type, improves the efficiency of early warning on the line for the page.
In a possible example, prior-warning device 400 on the above-mentioned line for the page further include:
First acquisition unit 405, for obtaining multiple data to be tested;
Third execution unit 406, it is multiple after being initialized for being initialized to the multiple data to be tested
Data to be tested;
Generation unit 407, for based on after the initialization multiple data to be tested and test profile generate to
Test data set.
It is above-mentioned determining single in terms of determining whether the data i to be tested is page data in a possible example
Member 402 is specifically used for:
Read the data i to be tested, obtain the checkpoint title of the data i to be tested, test-types, test domain,
It is expected that time-out, expectation state code, characteristic information;
Determine whether the checkpoint title of the data i to be tested is non-empty, whether test-types are to send request or connect
Receive request, whether test domain is started with hypertext transfer protocol;
If the entitled non-empty in checkpoint of the data i to be tested, test-types are to send request or reception request, test
Domain is started with hypertext transfer protocol, it is determined that whether the expected time-out of the data i to be tested is number, expecting state code
It whether is non-empty;
If the expected time-out of the data i to be tested is number, expecting state code is non-empty, it is determined that described to be tested
Whether the characteristic information of data i includes page feature;
If the characteristic information of the data i to be tested includes page feature, it is determined that the data i to be tested is page number
According to.
In a possible example, page test is being carried out to the data i to be tested, is obtaining the data to be tested
In terms of the corresponding page test result of i, above-mentioned execution unit 403 is specifically used for:
Jth time interface testing is carried out to the data i to be tested, the interface testing result after obtaining jth time interface testing;
If the interface testing result after the jth time interface testing is that interface is abnormal, to institute after the first preset duration
It states data i to be tested and carries out (j+1) secondary interface testing, the interface testing result after obtaining (j+1) secondary interface testing;
Until j=N, stop carrying out interface testing to the data i to be tested, the interface after obtaining n-th interface testing
Test result, j are that initial value is 1, with 1 for interval incrementing integers, the N is integer greater than 1;
If the interface testing result after the n-th interface testing is that interface is normal, the data i to be tested is carried out
Kth time page test, the page test result after obtaining kth time page test;
If the page test result after the kth time page test is page exception, to institute after the second preset duration
It states data i to be tested and carries out (k+1) secondary page test, the page test result after obtaining (k+1) secondary page test;
Until k=N, stop carrying out page test to the data i to be tested, the page after obtaining the test of the n-th page
Test result, k be initial value be 1, with 1 for interval incrementing integers;
If the page test result after the n-th page test is that the page is normal, it is determined that described i pairs of data to be tested
The page test result answered is that the page is normal.
In a possible example, jth time interface testing is being carried out to the data i to be tested, is obtaining jth time interface
In terms of interface testing result after test, above-mentioned execution unit 403 is specifically used for:
To target interface transmission interface test request, and obtain the first load duration, return code of the target interface
And return value;
Determine whether the first load duration is less than or equal to first threshold;
If it is described first load duration be less than or equal to the first threshold, it is determined that in the test profile whether
Existence code is identical as the return code;
If existence code is identical as the return code in the test profile, it is determined that the return value whether with
Target value is identical;
If the return value and the target value be not identical, it is determined that the interface testing knot after the jth time interface testing
Fruit is that interface is abnormal;
If the return value is identical as the target value, it is determined that the interface testing result after the jth time interface testing
It is normal for interface.
In a possible example, kth time page test is being carried out to the data i to be tested, is obtaining the kth time page
In terms of page test result after test, above-mentioned execution unit 403 is specifically used for:
Browser is initialized, the browser after being initialized;
Page load is carried out to the data i to be tested based on the browser after the initialization, is obtained described to be tested
The corresponding second load duration of data i, page loading result and page info;
Determine whether the second load duration is less than or equal to second threshold;
If it is described second load duration be less than or equal to the second threshold, it is determined that the page loading result whether be
It loads successfully;
If the page loading result is to load successfully, it is determined that whether the page info is correct;
If the page info is correct, it is determined that the page test result after the kth time page test is that the page is normal;
If the page info mistake, it is determined that the page test result after the kth time page test is page exception.
In a possible example, prior-warning device 400 on the above-mentioned line for the page further include:
First determination unit 408, if being that interface is abnormal for the interface testing result after the n-th interface testing,
Determine that the corresponding page test result of the data i to be tested is page exception.
It is consistent with above-mentioned Fig. 1, Fig. 2 and embodiment shown in Fig. 3, referring to Fig. 5, Fig. 5 is that the embodiment of the present application provides
A kind of electronic device structural schematic diagram, which includes processor, memory, communication interface and one or more
A program, said one or multiple programs are stored in above-mentioned memory, and are configured to be executed by above-mentioned processor, above-mentioned
Program includes the instruction for executing following steps:
When page test function is in starting state, data i to be tested is obtained from data set to be tested;
Determine whether the data i to be tested is page data;
If the data i to be tested is page data, page test is carried out to the data i to be tested, is obtained described
The corresponding page test result of data i to be tested;
If the corresponding page test result of the data i to be tested is page exception, execute pre- on the line for the page
Alert operation.
As can be seen that in the embodiment of the present application, data i to be tested is obtained from data set to be tested, when number to be tested
According to i be page data when, treat test data i carry out page test, obtain the corresponding page test result of data i to be tested,
If the corresponding page test result of data i to be tested is page exception, early warning operation on the line for the page is executed.Compared to
Early warning on line for the page is carried out using manual type, improves the efficiency of early warning on the line for the page.
In a possible example, above procedure includes the instruction specifically for executing following steps:
Obtain multiple data to be tested;
The multiple data to be tested are initialized, multiple data to be tested after being initialized;
Based on the multiple data to be tested and test profile generation data set to be tested after the initialization.
In a possible example, in terms of determining whether the data i to be tested is page data, above procedure packet
Include the instruction for being specifically used for executing following steps:
Read the data i to be tested, obtain the checkpoint title of the data i to be tested, test-types, test domain,
It is expected that time-out, expectation state code, characteristic information;
Determine whether the checkpoint title of the data i to be tested is non-empty, whether test-types are to send request or connect
Receive request, whether test domain is started with hypertext transfer protocol;
If the entitled non-empty in checkpoint of the data i to be tested, test-types are to send request or reception request, test
Domain is started with hypertext transfer protocol, it is determined that whether the expected time-out of the data i to be tested is number, expecting state code
It whether is non-empty;
If the expected time-out of the data i to be tested is number, expecting state code is non-empty, it is determined that described to be tested
Whether the characteristic information of data i includes page feature;
If the characteristic information of the data i to be tested includes page feature, it is determined that the data i to be tested is page number
According to.
In a possible example, page test is being carried out to the data i to be tested, is obtaining the data to be tested
In terms of the corresponding page test result of i, above procedure includes the instruction specifically for executing following steps:
Jth time interface testing is carried out to the data i to be tested, the interface testing result after obtaining jth time interface testing;
If the interface testing result after the jth time interface testing is that interface is abnormal, to institute after the first preset duration
It states data i to be tested and carries out (j+1) secondary interface testing, the interface testing result after obtaining (j+1) secondary interface testing;
Until j=N, stop carrying out interface testing to the data i to be tested, the interface after obtaining n-th interface testing
Test result, j are that initial value is 1, with 1 for interval incrementing integers, the N is integer greater than 1;
If the interface testing result after the n-th interface testing is that interface is normal, the data i to be tested is carried out
Kth time page test, the page test result after obtaining kth time page test;
If the page test result after the kth time page test is page exception, to institute after the second preset duration
It states data i to be tested and carries out (k+1) secondary page test, the page test result after obtaining (k+1) secondary page test;
Until k=N, stop carrying out page test to the data i to be tested, the page after obtaining the test of the n-th page
Test result, k be initial value be 1, with 1 for interval incrementing integers;
If the page test result after the n-th page test is that the page is normal, it is determined that described i pairs of data to be tested
The page test result answered is that the page is normal.
In a possible example, jth time interface testing is being carried out to the data i to be tested, is obtaining jth time interface
In terms of interface testing result after test, above procedure includes the instruction specifically for executing following steps:
To target interface transmission interface test request, and obtain the first load duration, return code of the target interface
And return value;
Determine whether the first load duration is less than or equal to first threshold;
If it is described first load duration be less than or equal to the first threshold, it is determined that in the test profile whether
Existence code is identical as the return code;
If existence code is identical as the return code in the test profile, it is determined that the return value whether with
Target value is identical;
If the return value and the target value be not identical, it is determined that the interface testing knot after the jth time interface testing
Fruit is that interface is abnormal;
If the return value is identical as the target value, it is determined that the interface testing result after the jth time interface testing
It is normal for interface.
In a possible example, kth time page test is being carried out to the data i to be tested, is obtaining the kth time page
In terms of page test result after test, above procedure includes the instruction specifically for executing following steps:
Browser is initialized, the browser after being initialized;
Page load is carried out to the data i to be tested based on the browser after the initialization, is obtained described to be tested
The corresponding second load duration of data i, page loading result and page info;
Determine whether the second load duration is less than or equal to second threshold;
If it is described second load duration be less than or equal to the second threshold, it is determined that the page loading result whether be
It loads successfully;
If the page loading result is to load successfully, it is determined that whether the page info is correct;
If the page info is correct, it is determined that the page test result after the kth time page test is that the page is normal;
If the page info mistake, it is determined that the page test result after the kth time page test is page exception.
In a possible example, above procedure further includes the instruction for executing following steps:
If the interface testing result after the n-th interface testing is that interface is abnormal, it is determined that described i pairs of data to be tested
The page test result answered is page exception.
The embodiment of the present application also provides a kind of computer storage medium, and the computer storage medium is for storing computer journey
Sequence, above-mentioned computer program are executed by processor, with realize part as either recorded method in above method embodiment or
Overall Steps.
The embodiment of the present application also provides a kind of computer program product, and above-mentioned computer program product includes storing calculating
The non-transient computer readable storage medium of machine program, above-mentioned computer program are operable to that computer is made to execute such as above-mentioned side
Some or all of either record method step in method embodiment.The computer program product can be a software installation
Packet.
It should be noted that for the various method embodiments described above, for simple description, therefore, it is stated as a series of
Combination of actions, but those skilled in the art should understand that, the application is not limited by the described action sequence because
According to the application, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know
It knows, the embodiments described in the specification are all preferred embodiments, related actions and modules not necessarily the application
It is necessary.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment
Point, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed device, it can be by another way
It realizes.For example, the apparatus embodiments described above are merely exemplary, such as the division of said units, it is only a kind of
Logical function partition, there may be another division manner in actual implementation, such as multiple units or components can combine or can
To be integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual
Coupling, direct-coupling or communication connection can be through some interfaces, the indirect coupling or communication connection of device or unit,
It can be electrical or other forms.
Above-mentioned unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
If above-mentioned integrated unit is realized in the form of SFU software functional unit and sells or use as independent product
When, it can store in a computer-readable access to memory.Based on this understanding, the technical solution of the application substantially or
Person says that all or part of the part that contributes to existing technology or the technical solution can body in the form of software products
Reveal and, which is stored in a memory, including some instructions are used so that a computer equipment
(can be personal computer, server or network equipment etc.) executes all or part of each embodiment above method of the application
Step.And memory above-mentioned includes: USB flash disk, read-only memory (ROM, Read-Only Memory), random access memory
The various media that can store program code such as (RAM, Random Access Memory), mobile hard disk, magnetic or disk.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of above-described embodiment is can
It is completed with instructing relevant hardware by program, which can store in a computer-readable memory, memory
May include: flash disk, read-only memory (English: Read-Only Memory, referred to as: ROM), random access device (English:
Random Access Memory, referred to as: RAM), disk or CD etc..
The embodiment of the present application is described in detail above, specific case used herein to the principle of the application and
Embodiment is expounded, the description of the example is only used to help understand the method for the present application and its core ideas;
At the same time, for those skilled in the art can in specific implementation and application range according to the thought of the application
There is change place, to sum up above-mentioned, the contents of this specification should not be construed as limiting the present application.
Claims (10)
1. method for early warning on a kind of line for the page, which is characterized in that the described method includes:
When page test function is in starting state, data i to be tested is obtained from data set to be tested;
Determine whether the data i to be tested is page data;
If the data i to be tested is page data, page test is carried out to the data i to be tested, is obtained described to be measured
Try the corresponding page test result of data i;
If the corresponding page test result of the data i to be tested is page exception, early warning behaviour on the line for the page is executed
Make.
2. the method according to claim 1, wherein described obtain data i to be tested from data set to be tested
Before, the method also includes:
Obtain multiple data to be tested;
The multiple data to be tested are initialized, multiple data to be tested after being initialized;
Based on the multiple data to be tested and test profile generation data set to be tested after the initialization.
3. method according to claim 1 or 2, which is characterized in that whether the determination data i to be tested is the page
Data, comprising:
The data i to be tested is read, checkpoint title, test-types, the test domain, expection of the data i to be tested is obtained
Time-out, expectation state code, characteristic information;
Determine whether the checkpoint title of the data i to be tested is non-empty, whether test-types are to send request or receive to ask
It asks, whether test domain is started with hypertext transfer protocol;
If the entitled non-empty in checkpoint of the data i to be tested, test-types be send request or receive request, test domain with
Hypertext transfer protocol beginning, it is determined that the expected time-out of the data i to be tested whether be number, expecting state code whether
For non-empty;
If the expected time-out of the data i to be tested is number, expecting state code is non-empty, it is determined that the data to be tested
Whether the characteristic information of i includes page feature;
If the characteristic information of the data i to be tested includes page feature, it is determined that the data i to be tested is page data.
4. according to the method described in claim 3, obtaining it is characterized in that, described carry out page test to the data i to be tested
To the corresponding page test result of the data i to be tested, comprising:
Jth time interface testing is carried out to the data i to be tested, the interface testing result after obtaining jth time interface testing;
If the interface testing result after the jth time interface testing is that interface is abnormal, after the first preset duration to it is described to
Test data i carries out (j+1) secondary interface testing, the interface testing result after obtaining (j+1) secondary interface testing;
Until j=N, stop carrying out interface testing to the data i to be tested, the interface testing after obtaining n-th interface testing
As a result, it is 1 that j, which is initial value, with 1 for interval incrementing integers, the N is integer greater than 1;
If the interface testing result after the n-th interface testing is that interface is normal, kth is carried out to the data i to be tested
Secondary page test, the page test result after obtaining kth time page test;
If the page test result after the kth time page test is page exception, after the second preset duration to it is described to
Test data i carries out (k+1) secondary page test, the page test result after obtaining (k+1) secondary page test;
Until k=N, stop carrying out page test to the data i to be tested, the page test after obtaining the test of the n-th page
As a result, k be initial value be 1, with 1 for interval incrementing integers;
If the page test result after the n-th page test is that the page is normal, it is determined that the data i to be tested is corresponding
Page test result is that the page is normal.
5. according to the method described in claim 4, it is characterized in that, described carry out jth time interface survey to the data i to be tested
Examination, the interface testing result after obtaining jth time interface testing, comprising:
To target interface transmission interface test request, and obtains the first load duration, return code of the target interface and return
Return value;
Determine whether the first load duration is less than or equal to first threshold;
If the first load duration is less than or equal to the first threshold, it is determined that whether there is in the test profile
Status code is identical as the return code;
If existence code is identical as the return code in the test profile, it is determined that the return value whether with target
It is worth identical;
If the return value and the target value be not identical, it is determined that the interface testing result after the jth time interface testing is
Interface is abnormal;
If the return value is identical as the target value, it is determined that the interface testing result after the jth time interface testing is to connect
Mouth is normal.
6. according to the method described in claim 4, it is characterized in that, described carry out kth time page survey to the data i to be tested
Examination, the page test result after obtaining kth time page test, comprising:
Browser is initialized, the browser after being initialized;
Page load is carried out to the data i to be tested based on the browser after the initialization, obtains the data i to be tested
Corresponding second load duration, page loading result and page info;
Determine whether the second load duration is less than or equal to second threshold;
If the second load duration is less than or equal to the second threshold, it is determined that whether the page loading result is load
Success;
If the page loading result is to load successfully, it is determined that whether the page info is correct;
If the page info is correct, it is determined that the page test result after the kth time page test is that the page is normal;
If the page info mistake, it is determined that the page test result after the kth time page test is page exception.
7. according to the method described in claim 4, it is characterized in that, the method also includes:
If the interface testing result after the n-th interface testing is that interface is abnormal, it is determined that the data i to be tested is corresponding
Page test result is page exception.
8. prior-warning device on a kind of line for the page, which is characterized in that described device includes:
Acquiring unit, for obtaining data to be tested from data set to be tested when page test function is in starting state
i;
Determination unit, for determining whether the data i to be tested is page data;
First execution unit carries out the page to the data i to be tested if being page data for the data i to be tested
Test, obtains the corresponding page test result of the data i to be tested;
Second execution unit, if being used for the corresponding page test result of the data i to be tested is page exception, execution is directed to
Early warning operates on the line of the page.
9. a kind of electronic device, which is characterized in that including processor, memory, communication interface, and one or more programs,
One or more of programs are stored in the memory, and are configured to be executed by the processor, described program packet
Include the instruction for executing the step in the method according to claim 1 to 7.
10. a kind of computer readable storage medium, which is characterized in that the computer readable storage medium is for storing computer
Program, the computer program are executed by processor, to realize the method according to claim 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910296082.1A CN110109827A (en) | 2019-04-12 | 2019-04-12 | For method for early warning and relevant apparatus on the line of the page |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910296082.1A CN110109827A (en) | 2019-04-12 | 2019-04-12 | For method for early warning and relevant apparatus on the line of the page |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110109827A true CN110109827A (en) | 2019-08-09 |
Family
ID=67483944
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910296082.1A Pending CN110109827A (en) | 2019-04-12 | 2019-04-12 | For method for early warning and relevant apparatus on the line of the page |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110109827A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104427627A (en) * | 2013-08-23 | 2015-03-18 | 阿里巴巴集团控股有限公司 | Test data obtaining method, client and server |
CN108491319A (en) * | 2018-02-11 | 2018-09-04 | 广州小百合信息技术有限公司 | Web automated testing methods and system based on this method |
CN109062806A (en) * | 2018-09-14 | 2018-12-21 | 杭州数梦工场科技有限公司 | A kind of program testing method, system, device and computer readable storage medium |
CN109254911A (en) * | 2018-08-13 | 2019-01-22 | 兴业证券股份有限公司 | Transaction software market monitoring method and storage medium |
CN109597729A (en) * | 2018-10-29 | 2019-04-09 | 深圳壹账通智能科技有限公司 | A kind of monitoring method and device based on analog subscriber test |
-
2019
- 2019-04-12 CN CN201910296082.1A patent/CN110109827A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104427627A (en) * | 2013-08-23 | 2015-03-18 | 阿里巴巴集团控股有限公司 | Test data obtaining method, client and server |
CN108491319A (en) * | 2018-02-11 | 2018-09-04 | 广州小百合信息技术有限公司 | Web automated testing methods and system based on this method |
CN109254911A (en) * | 2018-08-13 | 2019-01-22 | 兴业证券股份有限公司 | Transaction software market monitoring method and storage medium |
CN109062806A (en) * | 2018-09-14 | 2018-12-21 | 杭州数梦工场科技有限公司 | A kind of program testing method, system, device and computer readable storage medium |
CN109597729A (en) * | 2018-10-29 | 2019-04-09 | 深圳壹账通智能科技有限公司 | A kind of monitoring method and device based on analog subscriber test |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106095673A (en) | Automated testing method based on WEB interface and system | |
CN109428878A (en) | Leak detection method, detection device and detection system | |
CN103885876B (en) | Method of testing and equipment | |
CN106294094A (en) | The method of testing of game server, client, server and system | |
CN109634841A (en) | Electronic device, automatic interface testing method and storage medium | |
CN109474359A (en) | A kind of frequency sweeping method and terminal device | |
CN109460353A (en) | UDS auto-check system | |
CN107634964A (en) | A kind of method of testing and device for WAF | |
CN108111367A (en) | Performance test methods and device | |
CN104063307B (en) | A kind of method for testing software and system | |
CN107689030A (en) | A kind of method and device of image procossing | |
CN106533622B (en) | The data fields method of calibration and device of data frame based on CAN FD bus | |
CN108596624A (en) | Handling result, payment result acquisition methods and the device of service request | |
CN106294106B (en) | The test method and device of Web application system | |
CN110109827A (en) | For method for early warning and relevant apparatus on the line of the page | |
CN104933178B (en) | Official website determines method and system and the sort method of official website | |
CN109407655A (en) | A kind of method and device for debugging chip | |
CN109885444A (en) | Test method, device, storage medium and terminal device based on gesture identification | |
CN109977745A (en) | Face image processing process and relevant apparatus | |
CN109710329A (en) | Web page rendering method, apparatus and terminal device | |
CN111008130B (en) | Intelligent question-answering system testing method and device | |
CN110109826A (en) | For method for early warning and relevant apparatus on the line of interface | |
CN110297770A (en) | Application testing method and relevant apparatus | |
CN109002441A (en) | Determination method, the exception of Apply Names similarity apply detection method and system | |
CN110109825A (en) | Method for early warning and relevant apparatus on line |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |