CN109726112A - Traverse test method, unit and computer readable storage medium - Google Patents

Traverse test method, unit and computer readable storage medium Download PDF

Info

Publication number
CN109726112A
CN109726112A CN201810951311.4A CN201810951311A CN109726112A CN 109726112 A CN109726112 A CN 109726112A CN 201810951311 A CN201810951311 A CN 201810951311A CN 109726112 A CN109726112 A CN 109726112A
Authority
CN
China
Prior art keywords
test
link
measured
chained list
traversal
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
CN201810951311.4A
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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN201810951311.4A priority Critical patent/CN109726112A/en
Publication of CN109726112A publication Critical patent/CN109726112A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a kind of traversal test methods, test method is traversed the following steps are included: obtaining test configurations information, and according to test configurations information initializing test frame, wherein, test configurations information includes test domain information and test order information, and test frame includes test chained list and test order;Link to be measured is obtained according to test chained list, and requests link to be measured;The content of pages of link to be measured is parsed, and content of pages is verified according to test order, generates content test result;Content test result is written in test report;It returns and link to be measured, and the step of requesting link to be measured is obtained according to test chained list, until the whole link to be measured in traversal test chained list.The invention also discloses a kind of traversal test equipment, device and computer readable storage mediums.Present invention saves test process to the occupancy of storage resource, improves testing efficiency.

Description

Traverse test method, unit and computer readable storage medium
Technical field
The present invention relates to the field of test technology more particularly to a kind of traversal test methods, unit and computer-readable Storage medium.
Background technique
In order to improve the reliability of website, improves user experience, need to carry out traversal test to associated stations.In existing skill In art, by the way that all the elements in test domain limited range, including text, picture, hyperlink, js, css, source code are advised Model etc. all extracts in advance, then is tested one by one the content extracted.However, this test mode will occupy A large amount of storage resource, and test rate is slower, and testing efficiency is caused to reduce.
Above content is only used to facilitate the understanding of the technical scheme, and is not represented and is recognized that above content is existing skill Art.
Summary of the invention
The main purpose of the present invention is to provide a kind of traversal test methods, it is intended to solve above-mentioned test and occupy storage resource Technical problem more, test rate is slow, to improve testing efficiency.
To achieve the above object, the present invention provides a kind of traversal test method, comprising the following steps:
Test configurations information is obtained, and according to the test configurations information initializing test frame, wherein the test is matched Confidence breath includes test domain information and test order information, and the test frame includes test chained list and test order;
Link to be measured is obtained according to the test chained list, and requests the link to be measured;
It parses the content of pages of the link to be measured, and the content of pages is verified according to the test order, in generation Hold test result;
The content test result is written in test report;
It returns and link to be measured, and the step of requesting the link to be measured is obtained according to the test chained list, until traversal institute State the whole link to be measured in test chained list.
Preferably, test configurations information is obtained, and is wrapped according to the step of test configurations information initializing test frame It includes:
Obtain test configurations information, wherein the test domain information includes driven file information;
According to the driven file information, test chained list is generated;
Wherein, the data field of the test chained list includes the content-data of data-driven, the pointer field of the test chained list Direction data including data-driven.
Preferably, after the step of parsing the content of pages of the link to be measured, the traversal test method further includes Following steps:
Extract the page link in the link to be measured;
According to the test domain information, judge whether the page link is in the test domain;
When the page link is in the test domain, the page link is added in the test chained list.
Preferably, when the page link is in the test domain, the page link is added to the test Step in chained list includes:
When the page link is in the test domain, judge to whether there is and the page in the test chained list Link consistent link to be measured;
When in the test chained list there is no with the page link it is consistent it is to be measured link when, the page link is added It adds in the test chained list.
Preferably, link to be measured is being obtained according to the test chained list, and after the step of requesting the link to be measured, institute It is further comprising the steps of to state traversal test method:
The Connecting quantity of the link to be measured is obtained, and the Connecting quantity is verified according to the test order, the company of generation Connect test result;
The connecting test result is written in the test report.
Preferably, the test configurations information further includes default Connecting quantity range;
Link to be measured is obtained according to the test chained list, and the step of requesting the link to be measured includes:
Link to be measured is obtained according to the test chained list, requests the link to be measured, and detects the request link to be measured Connecting quantity in the process;
When the Connecting quantity exceeds the default Connecting quantity range, the link to be measured is requested in pause, and is generated Linkage record;
After the link to be measured not suspended all in traversing the test chained list, according to the linkage record, obtain temporary The link to be measured stopped;
Compare the linkage record number and preset number for corresponding to the link to be measured of same pause;
When the linkage record number is less than the preset number, the link to be measured is requested;
When the linkage record number is greater than or equal to the preset number, stop requesting the link to be measured, and raw At connection prompt information.
Preferably, the test configurations information further includes simulation browser configuration information;
Link to be measured is obtained according to the test chained list, and the step of requesting the link to be measured includes:
Link to be measured is obtained according to the test chained list;
Judge whether the link to be measured needs to pass through browse request;
When the link to be measured needs to pass through browse request, the simulation browser is called, request is described to surveyor's chain It connects;
When the link to be measured does not need to pass through browse request, link to be measured described in direct request.
To achieve the above object, the present invention also proposes that a kind of traversal test equipment, the traversal test equipment include: storage Device, processor and it is stored in the computer program that can be run on the memory and on the processor, the computer journey The step of traversal test method is realized when sequence is executed by the processor, the traversal test method is the following steps are included: obtain Test configurations information, and according to the test configurations information initializing test frame, wherein the test configurations information includes surveying Domain information and test order information are tried, the test frame includes test chained list and test order;It is obtained according to the test chained list Link to be measured is taken, and requests the link to be measured;The content of pages of the link to be measured is parsed, and according to the test order school The content of pages is tested, content test result is generated;The content test result is written in test report;It returns according to Test chained list and obtain link to be measured, and the step of requesting the link to be measured, until traverse in the test chained list all to Surveyor's chain connects.
To achieve the above object, the present invention also proposes that a kind of traversal test device, the traversal test device include test Configuration module, linking request module, content authentication module and report writing module, wherein the test configurations module is to obtain Test configurations information is taken, and according to the test configurations information initializing test frame, wherein the test configurations information includes Domain information and test order information are tested, the test frame includes test chained list and test order;The linking request module To obtain link to be measured according to the test chained list, and request the link to be measured;The content authentication module is to parse The content of pages of the link to be measured, and the content of pages is verified according to the test order, generate content test result;Institute Report writing module is stated the content test result to be written in test report.
To achieve the above object, present invention further propose that a kind of computer readable storage medium, described computer-readable Traversal test program is stored on storage medium, the traversal test program realizes traversal test method when being executed by processor Step, the traversal test method are and initial according to the test configurations information the following steps are included: obtain test configurations information Change test frame, wherein the test configurations information includes test domain information and test order information, and the test frame includes Test chained list and test order;Link to be measured is obtained according to the test chained list, and requests the link to be measured;Parsing it is described to The content of pages that surveyor's chain connects, and the content of pages is verified according to the test order, generate content test result;In will be described Hold in test result write-in test report;It returns and link to be measured is obtained according to the test chained list, and request the link to be measured The step of, until traversing the whole link to be measured in the test chained list.
In the technical solution of the present invention, test method is traversed the following steps are included: obtaining test configurations information, and according to survey Try configuration information initialization test frame, wherein test configurations information includes test domain information and test order information, test block Frame includes test chained list and test order, and test chained list is corresponding with test domain information, test order and test order information phase It is corresponding;Link to be measured is obtained according to test chained list, and requests link to be measured;The content of pages of link to be measured is parsed, and according to survey Examination rule verification content of pages, generates content test result;Content test result is written in test report;It returns according to test Chained list obtains link to be measured, and the step of requesting link to be measured, until the whole link to be measured in traversal test chained list.Pass through survey It tries chained list and traversal test comprehensively is carried out to the content of pages in test domain, different from the prior art by extracting whole in advance Content to be measured concentrate the mode tested again, in the present solution, by include obtain it is to be measured link, request it is to be measured link, it is right The content of pages of link to be measured is parsed and is verified, the write-in of content test result is observed and predicted to one test of formation of the step in accusing Circulation, the storage resource of the occupancy as needed for each test loop is smaller, and test rate is larger, to be conducive to improve traversal Test whole testing efficiency.
Detailed description of the invention
Fig. 1 is the flow diagram of present invention traversal test method first embodiment;
Fig. 2 is the flow diagram of present invention traversal test method 3rd embodiment;
Fig. 3 is the flow diagram of present invention traversal test method fourth embodiment;
Fig. 4 is the flow diagram of present invention traversal the 5th embodiment of test method;
Fig. 5 is the refinement flow diagram of step S200 in present invention traversal test method sixth embodiment;
Fig. 6 is the refinement flow diagram of step S200 in present invention traversal the 7th embodiment of test method;
Fig. 7 is the structural schematic diagram of the traversal test equipment for the hardware running environment that the embodiment of the present invention is related to.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The primary solutions of the embodiment of the present invention are: being carried out based on test chained list to the content of pages in test domain comprehensive Traversal test, executed in each test loop obtain link to be measured, request link to be measured, treat content of pages that surveyor's chain connects into The write-in of content test result is observed and predicted the step in accusing by row parsing and verification.
It due to extracting whole contents to be measured in advance in the prior art, then concentrates and is tested, cause to storage resource Occupancy it is larger, and test rate is slower, and testing efficiency is low.
The present invention provides a solution, carries out traversal comprehensively to the content of pages in test domain based on test chained list and surveys Examination, by including obtaining link to be measured, requesting link to be measured, treat the content of pages that surveyor's chain connects and parsed and verified, by content Test result write-in observes and predicts the step in accusing and forms a test loop, the storage resource of the occupancy as needed for each test loop It is smaller, and test rate is larger, to be conducive to improve the whole testing efficiency of traversal test.
First embodiment of the invention provides a kind of traversal test method, as shown in Figure 1, traversal test method includes following step It is rapid:
Step S100, test configurations information is obtained, and according to test configurations information initializing test frame;
Wherein, test configurations information includes test domain information and test order information, test frame include test chained list and Test order.Specifically, test configurations information usually writes in test profile, test profile can be expansible mark Remember language (Extensible Markup Language, XML) format, by parsing test profile, obtains test and match Confidence breath.Test domain information includes test domain content, test domain switch, filtering policy switch and data-driven the file information etc., To provide specific range to be measured.According to different testing requirements, different test domains can be defined, for example, carrying out part When debugging, debugged subrange can be defined and be test domain with the range of its close association, by test domain switch and Filtering policy switch, opens corresponding test domain content, to improve testing efficiency;When carrying out whole debugging, can define whole A site-bound is test domain, is switched by test domain switch and filtering policy, and the corresponding test domain of whole site-bounds is opened Content, to realize test comprehensively.Certainly, using data-driven tested when, can also according to driven file information, Obtain corresponding range to be measured, i.e. test domain content.Test order information includes regular profile information etc., to enable and stop The flexibility of test is improved to adapt to different testing requirements with corresponding test order.It is initial according to test configurations information Change test frame and specifically includes initialization test chained list and initialization test rule.Wherein, initialization test chained list i.e. root Test chained list is generated according to test domain information, with circulation reads content to be measured from test chained list in test process wait traverse;Initially Change test order and test order is namely loaded according to test order information, is called with staying in traversal test process.In addition, surveying Trying configuration information can also include test environmental information etc., can also include root according to test configurations information initializing test frame Environment is tested accordingly according to test environment information architecture, to ensure being normally carried out for traversal test.Test configurations information can also be with Including test name etc., so that this test is recorded and is distinguished.According to test configurations information initializing test frame It may include the page parsing logic for initializing link to be measured, tap into capable parsing to treat surveyor's chain during the test, and Initialization test result collection method, to arrange test result etc., so that it is quasi- to carry out all early periods for entire traversal test It is standby.
Step S200, link to be measured is obtained according to test chained list, and requests link to be measured;
Test chained list is generated according to test domain information, therefore includes link to be measured.Wherein, test chained list can be with one Secondary generation can also constantly be filled in traversal test process and be continuously generated, hereinafter also will be apparent from.Test chained list Element include data field and pointer field, include specific link to be measured in data field, and in pointer field, include The directional information of next link to be measured, after the test for completing this link to be measured, according to link to be measured next in pointer field Directional information obtain next link to be measured, and continue the test of next link to be measured, to drive entire traversal test Circulation.When measuring this link to be measured, by requesting link to be measured to access the corresponding content of pages of link to be measured.
Step S300, the content of pages of link to be measured is parsed, and content of pages is verified according to test order, content is generated and surveys Test result;
By parsing the content of pages of link to be measured, all kinds of content of pages are extracted and classified, according to corresponding test Rule verification content of pages, generates content test result.Wherein, content of pages can specifically include content of text, image content, Hyperlink content, scripting language (such as JavaScript, js) content, cascading style sheets (Cascading Style Sheets, Css) content and source code normative content etc..Correspondingly, test order includes text test order, picture test order, hyperlink Test order, js test order, css test order and source code normative testing rule etc., and text verification, picture school are carried out respectively It tests, hyperlink verification, js verification, css verification and source code specification validation etc., while generating content test result.
Step S400, content test result is written in test report;
Content test result is written in test report, so that tester checks, to be carried out to respective site Debugging.Specifically, the link to be measured is written in addition in test report in every test for executing primary specific link to be measured Test result, on the one hand advantageously reduce the misregistration of test result, be on the other hand also beneficial to reduce occupy memory Resource, to improve testing efficiency.
S200 is returned to step, until the whole link to be measured in traversal test chained list.
It returns to execute and link to be measured, and the step of requesting link to be measured is obtained according to test chained list, it is next to be measured to obtain Link, and next link to be measured is tested, until the whole link to be measured in traversal test chained list.Specifically, testing Circulation is whether can to correspond to chained list most by judging that the last one test links in the case where carrying out according to linked list order Latter bit element determines, if so, showing to have had stepped through whole links to be measured, then completes this test;If it is not, then according to pointer Next link to be measured, continues to test pointed by domain.It, can be according to phase when test loop is carried out according to other sequences The circular order answered judges whether to have traversed whole links to be measured.After traversal all link to be measured, complete test will be generated Report is checked, to debug to corresponding test domain by exporting test report with personnel to be tested.
In the present embodiment, test method is traversed the following steps are included: obtaining test configurations information, and according to test configurations Information initializing test frame, wherein test configurations information includes test domain information and test order information, and test frame includes Chained list and test order are tested, test chained list is corresponding with test domain information, and test order is corresponding with test order information;Root Link to be measured is obtained according to test chained list, and requests link to be measured;The content of pages of link to be measured is parsed, and according to test order school Content of pages is tested, content test result is generated;Content test result is written in test report;It returns and is obtained according to test chained list Link to be measured, and the step of requesting link to be measured, until the whole link to be measured in traversal test chained list.By testing chained list pair Content of pages in test domain carries out traversal test comprehensively, different from the prior art by extract in advance it is whole it is to be measured in Appearance concentrates the mode tested again, in the present solution, by including obtaining link to be measured, requesting link to be measured, treat surveyor's chain and connect Content of pages parsed and verified, by content test result write-in observe and predict accuse in step formed a test loop, by The storage resource of the occupancy needed for each test loop is smaller, and test rate is larger, so that it is whole to be conducive to raising traversal test The testing efficiency of body.
Based on above-mentioned first embodiment, as shown in Fig. 2, in the second embodiment of the present invention, step S100 includes:
Step S110, test configurations information is obtained, wherein test domain information includes driven file information;
Step S120, according to driven file information, test chained list is generated;
Wherein, the data field for testing chained list includes the content-data of data-driven, and the pointer field for testing chained list includes data The direction data of driving.In the present embodiment, traversal test is based on data-driven version, or is driven based on data What flowing mode carried out.In data-driven version, by the circulation of data-driven test process.According to driven file information, The content of driven file is disposably stuffed entirely in test chained list, with the calling during to be tested.
Based on above-mentioned first embodiment, as shown in Fig. 2, in the third embodiment of the present invention, parsing link to be measured After the step of content of pages, traversal test method is further comprising the steps of:
Step S510, the page link in link to be measured is extracted;
Step S520, according to test domain information, judge whether page link is in test domain;
Step S530, when page link is in test domain, page link is added in test chained list.
In the present embodiment, test chained list is constantly filled during the test and is continuously generated, according to surveyor's chain The content of pages connect constantly obtains other links to be measured, and is filled into test chained list, to drive the circulation of test.Specifically, On the corresponding page of link to be measured, be likely present other page links, these page links some be directed toward test domains with Interior range, also some may be directed toward the range other than test domain, and therefore, it is necessary to be carried out according to test domain information to page link Screening, and the page link in test domain is added in test chained list.For example, when needing to be .abc's to domain suffix When whole pages are tested, it is assumed that the domain name of a certain link to be measured is def.abc, on the corresponding page of link to be measured, It further include the page link that domain name is ghi.def.abc and domain name is mno.jkl, then, according to test domain information it is found that domain name For ghi.def.abc page link within the scope of test domain, ghi.def.abc is added in test chained list, and domain name is The page link of mno.jkl does not add the page link into test chained list not within the scope of test domain.However, it is desirable to It is noted that the test for being directed to this page link of mno.jkl itself is normally included in and treats the test that surveyor's chain meets def.abc In, that is, in step S300, when test order includes hyperlink test order, need according to hyperlink test order Mno.jkl this page link itself is tested, and generates corresponding test result.And due to this page of mno.jkl Link no longer needs to obtain the page of its direction by mno.jkl, and to other on the page not within the scope of test domain Content is tested.In order to ensure the comprehensive of test, in the linking inlet ports of selection test chained list, should select jump as far as possible The homepage for all pages for being included to test domain information, in order to avoid there is test leakage.
It should be noted that above-mentioned second embodiment and 3rd embodiment can also combine, that is, adopted for part With the test of data-driven, a part of test chained list is filled according to driven file information, and is being surveyed according to page link Constantly chained list is tested in filling during examination, to realize complete test.
Based on above-mentioned 3rd embodiment, as shown in figure 3, in the fourth embodiment of the present invention, step S530 includes:
Step S531, when page link is in test domain, judging to test in chained list whether there is and page link one The link to be measured caused;
Step S532, when test chained list in there is no with page link it is consistent it is to be measured link when, page link is added Into test chained list.
In the present embodiment, it is contemplated that in the page pointed by different links to be measured, it is understood that there may be the identical page Link is being got after the page link in test domain in order to avoid retest, also execution deduplication operation, that is, is sentenced Whether had existed in disconnected test chained list and page link is consistent to be measured links, and if it exists, then no longer add the page link Into test chained list, to improve testing efficiency, if it does not exist, then the page link is added in test chained list, with to be tested. For example, duplicate removal can use the grand filter type of cloth, specifically, the data structure based on Hash table, it will by a hash function Whether one element is mapped to a point in a bit array, to judge the element in specific set.Bu Long mistake Filter has good space efficiency and query time, but there are certain false recognition rates.When misidentifying, it is equivalent to this Page link will be repeatedly tested, but generally, and the false recognition rate of the grand filtering of cloth is smaller, the influence and not bery to efficiency decline Greatly, and by duplicate removal, testing efficiency can significantly be improved.It is of course also possible to use other duplicate removal modes are to page link Duplicate removal is carried out, to improve testing efficiency.
Based on the various embodiments described above, as shown in figure 4, traversal test method is further comprising the steps of after step S200:
Step S600, the Connecting quantity of link to be measured is obtained, and Connecting quantity is verified according to test order, connection is generated and surveys Test result;
Step S700, connecting test result is written in test report.
Wherein, step S600 and step S700 synchronous with step S300 and step S400 can be carried out, or successively be carried out, Connecting quantity that surveyor's chain connects is treated respectively and content of pages is tested, to realize more comprehensive test.Wherein, to connection The test of parameter specifically include to request return code verification, request response time verification, request returned data size verification and The verification etc. of other preset rules improves user experience so that tester optimizes the connection procedure of link to be measured.According to test Rule verification the resulting connecting test result of Connecting quantity can be written into same test report, or with content test result It is respectively written into different test report, so that tester checks.Specific writing mode can basis in the step s 100 It is defined when test configurations information initializing test frame, to meet the needs of tester.
Test configurations information further includes default Connecting quantity range, the various embodiments described above is based on, as shown in figure 5, in this hair In bright sixth embodiment, step S200 includes:
Step S210, link to be measured is obtained according to test chained list, requests link to be measured, and detect request link process to be measured In Connecting quantity;
Step S220, when Connecting quantity exceeds default Connecting quantity range, link to be measured is requested in pause, and generates connection Record;
Step S230, it after the link to be measured not suspended all in traversal test chained list, according to linkage record, obtains temporary The link to be measured stopped;
Step S240, the linkage record number and preset number for corresponding to the link to be measured of same pause are compared;
Step S251, when linkage record number is less than preset number, link to be measured is requested;
Step S252, when linkage record number is greater than or equal to preset number, stop requesting link to be measured, and the company of generation Connect prompt information.
In the present embodiment, in order to avoid there are problems for the connection of some link to be measured, lead to the stagnation of testing process, drop Low testing efficiency regulates and controls the connection procedure of each link to be measured by default Connecting quantity range.Wherein, connection ginseng is preset Number range can specifically include between connection time-out time range, request returned data magnitude range, request return code range, request Waiting time range, number of threads range etc., when the connection time-out time of the link to be measured has been more than connection time-out time range, Or request returned data size be more than request returned data magnitude range, or request return code not request return code range it It is interior, or between request the waiting time be more than waiting time range between request, or the number of threads of link to be measured connected simultaneously is super Whens having crossed number of threads range etc., then suspends and request the link to be measured, and generate linkage record, it is specific in connection procedure to record The problem of, continue the test of next link to be measured.In view of the pause of certain links to be measured may be since accidentalia causes , in order to mitigate the burden of tester, after traversal completes the link to be measured not suspended all in test chained list, according to even Record is connect, the link to be measured suspended before test is returned.Correspond to the linkage record of the link to be measured of same pause by comparing Number and preset number determine the number of the link test crash to be measured, when the number of test crash is less than preset number, table Pause before bright may be to request the link to be measured as caused by accidentalia;And linkage record number is greater than or equal to When preset number, show that the link to be measured is abnormal always, then considers to stop requesting link to be measured, and raw there are other failures At connection prompt information, to prompt tester to check.
Test configurations information further includes simulation browser configuration information, is based on the various embodiments described above, as shown in fig. 6, at this In 7th embodiment of invention, step S200 includes:
Step S260, link to be measured is obtained according to test chained list;
Step S270, judge whether link to be measured needs to pass through browse request;
Step S281, when link to be measured needs to pass through browse request, simulation browser is called, link to be measured is requested;
Step S282, when link to be measured does not need to pass through browse request, direct request link to be measured.
In the present embodiment, it is contemplated that under the conditions of certain security restrictions, part link to be measured may must pass through browsing Device request can obtain, and therefore, after obtaining link to be measured, judge whether the link to be measured needs through browse request, When it is to be measured link need to pass through browse request when, call simulation browser, request link to be measured, with drive test it is normal into Row;Otherwise, direct request link to be measured, to improve testing efficiency.Specifically, judging whether a certain link to be measured needs to pass through When browse request, examination request first can be carried out for the link to be measured, when examination request failure, call directly simulation browser The link to be measured is requested again, or according to the failure information of examination request, determine whether the link to be measured needs to pass through browser Request.
As shown in fig. 7, Fig. 7 is the terminal for the hardware running environment that the embodiment of the present invention is related to, i.e. traversal test is set Standby structural schematic diagram.
The terminal of that embodiment of the invention can be server, PC, be also possible to smart phone, tablet computer, e-book reading Device, MP3 (Moving Picture Experts Group Audio Layer III, dynamic image expert's compression standard audio Level 3) player, MP4 (Moving Picture Experts Group Audio Layer IV, dynamic image expert compression Standard audio level 3) the packaged type terminal device having a display function such as player, portable computer.
As shown in fig. 7, the terminal may include: processor 1001, such as CPU, network interface 1004, user interface 1003, memory 1005, communication bus 1002.Wherein, communication bus 1002 is for realizing the connection communication between these components. User interface 1003 may include display screen (Display), input unit such as keyboard (Keyboard), optional user interface 1003 can also include standard wireline interface and wireless interface.Network interface 1004 optionally may include that the wired of standard connects Mouth, wireless interface (such as WI-FI interface).Memory 1005 can be high speed RAM memory, be also possible to stable memory (non-volatile memory), such as magnetic disk storage.Memory 1005 optionally can also be independently of aforementioned processor 1001 storage device.
Optionally, terminal can also include camera, RF (Radio Frequency, radio frequency) circuit, sensor, audio Circuit, WiFi module etc..Wherein, sensor such as optical sensor, motion sensor and other sensors.Specifically, light Sensor may include ambient light sensor and proximity sensor, wherein ambient light sensor can according to the light and shade of ambient light come The brightness of display screen is adjusted, proximity sensor can close display screen and/or backlight when mobile terminal is moved in one's ear.As One kind of motion sensor, gravity accelerometer can detect the size of (generally three axis) acceleration in all directions, quiet Size and the direction that can detect that gravity when only, the application that can be used to identify mobile terminal posture are (such as horizontal/vertical screen switching, related Game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap) etc.;Certainly, mobile terminal can also match The other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor are set, details are not described herein.
It will be understood by those skilled in the art that the restriction of the not structure paired terminal of terminal structure shown in Fig. 7, can wrap It includes than illustrating more or fewer components, perhaps combines certain components or different component layouts.
As shown in fig. 7, as may include that operating system, network are logical in a kind of memory 1005 of computer storage medium Believe module, Subscriber Interface Module SIM and traversal test program.
In terminal shown in Fig. 7, network interface 1004 is mainly used for connecting background server, carries out with background server Data communication;User interface 1003 is mainly used for connecting client (user terminal), carries out data communication with client;And processor 1001 can be used for calling the traversal test program stored in memory 1005, and execute following operation:
Test configurations information is obtained, and according to test configurations information initializing test frame, wherein test configurations packet Test domain information and test order information are included, test frame includes test chained list and test order;
Link to be measured is obtained according to test chained list, and requests link to be measured;
The content of pages of link to be measured is parsed, and content of pages is verified according to test order, generates content test result;
Content test result is written in test report;
It returns and link to be measured, and the step of requesting link to be measured is obtained according to test chained list, until in traversal test chained list Whole link to be measured.
Further, processor 1001 can be used for calling the traversal test program stored in memory 1005, obtains and surveys Configuration information is tried, and includes: according to the operation of test configurations information initializing test frame
Obtain test configurations information, wherein test domain information includes driven file information;
According to driven file information, test chained list is generated;
Wherein, the data field for testing chained list includes the content-data of data-driven, and the pointer field for testing chained list includes data The direction data of driving.
Further, processor 1001 can be used for calling the traversal test program stored in memory 1005, parse After the operation of the content of pages of link to be measured, following operation is also executed:
Extract the page link in link to be measured;
According to test domain information, judge whether page link is in test domain;
When page link is in test domain, page link is added in test chained list.
Further, processor 1001 can be used for calling the traversal test program stored in memory 1005, work as the page When link is in test domain, include: by the operation that page link is added in test chained list
When page link is in test domain, judge to test in chained list with the presence or absence of consistent to surveyor's chain with page link It connects;
When test chained list in there is no with page link it is consistent it is to be measured link when, page link is added to test chained list In.
Further, processor 1001 can be used for calling the traversal test program stored in memory 1005, in basis It tests chained list and obtains link to be measured, and after requesting the operation of link to be measured, also execute following operation:
The Connecting quantity of link to be measured is obtained, and Connecting quantity is verified according to test order, generates connecting test result;
Connecting test result is written in test report.
Further, processor 1001 can be used for calling the traversal test program stored in memory 1005, and test is matched Confidence breath further includes default Connecting quantity range;
Link to be measured is obtained according to test chained list, and requests the operation of link to be measured to include:
Link to be measured is obtained according to test chained list, requests link to be measured, and detect the connection requested in link process to be measured Parameter;
When Connecting quantity exceeds default Connecting quantity range, link to be measured is requested in pause, and generates linkage record;
After the link to be measured not suspended all in traversal test chained list, according to linkage record, the to be measured of pause is obtained Link;
Compare the linkage record number and preset number for corresponding to the link to be measured of same pause;
When linkage record number is less than preset number, link to be measured is requested;
When linkage record number is greater than or equal to preset number, stop requesting link to be measured, and generates connection prompt letter Breath.
Further, processor 1001 can be used for calling the traversal test program stored in memory 1005, and test is matched Confidence breath further includes simulation browser configuration information;
Link to be measured is obtained according to test chained list, and requests the operation of link to be measured to include:
Link to be measured is obtained according to test chained list;
Judge whether link to be measured needs to pass through browse request;
When link to be measured needs to pass through browse request, simulation browser is called, link to be measured is requested;
When link to be measured does not need to pass through browse request, direct request link to be measured.
In addition, the embodiment of the present invention also proposes that a kind of traversal test device, traversal test device include:
Test configurations module, to obtain test configurations information, and according to test configurations information initializing test frame, In, test configurations information includes test domain information and test order information, and test frame includes test chained list and test order;
Linking request module to obtain link to be measured according to test chained list, and requests link to be measured;
Content authentication module verifies content of pages to parse the content of pages of link to be measured, and according to test order, raw At content test result;
Writing module is reported, content test result to be written in test report.
Further, test configurations module includes:
Information acquisition unit, to obtain test configurations information, wherein test domain information includes driven file letter Breath;
Chained list generation unit, to generate test chained list according to driven file information;
Wherein, the data field for testing chained list includes the content-data of data-driven, and the pointer field for testing chained list includes data The direction data of driving.
Further, test device is traversed further include:
Extraction module is linked, to extract the page link in link to be measured;
Test domain judgment module, to judge whether page link is in test domain according to test domain information;
Chained list adding module, when page link is in test domain, page link to be added in test chained list.
Further, chained list adding module includes:
Duplicate removal unit is linked, whether there is and page when page link is in test domain, to judge to test in chained list Face links consistent link to be measured;
Chained list adding unit, to when test chained list in there is no with page link it is consistent it is to be measured link when, by the page Link is added in test chained list.
Further, test device is traversed further include:
Correction verification module is connected, verifies Connecting quantity to obtain the Connecting quantity of link to be measured, and according to test order, it is raw At connecting test result;
Report writing module also connecting test result to be written in test report.
Further, test configurations information further includes default Connecting quantity range;
Linking request module includes:
Connection unit requests link to be measured, and detect request link to be measured to obtain link to be measured according to test chained list Connecting quantity in the process;
Stop unit, to when Connecting quantity exceeds default Connecting quantity range, link to be measured is requested in pause, and is generated Linkage record;
Acquiring unit is linked, after whole links to be measured not suspended in traversal test chained list, is remembered according to connection Record, obtains the link to be measured of pause;
Comparing unit, to compare the linkage record number and preset number that correspond to the link to be measured of same pause;
Connection unit is also to request link to be measured when linkage record number is less than preset number;
Stop unit also when linkage record number is greater than or equal to preset number, to stop requesting link to be measured, and Generate connection prompt information.
Further, test configurations information further includes simulation browser configuration information;
Linking request module includes:
Connection unit, to obtain link to be measured according to test chained list;
Judging unit, to judge whether link to be measured needs to pass through browse request;
Connection unit is to call simulation browser, request to surveyor's chain when link to be measured needs to pass through browse request It connects;
Connection unit also to when it is to be measured link do not need to pass through browse request when, direct request link to be measured.
In addition, the embodiment of the present invention also proposes a kind of computer readable storage medium, deposited on computer readable storage medium Traversal test program is contained, traversal test program realizes following operation when being executed by processor:
Test configurations information is obtained, and according to test configurations information initializing test frame, wherein test configurations packet Test domain information and test order information are included, test frame includes test chained list and test order;
Link to be measured is obtained according to test chained list, and requests link to be measured;
The content of pages of link to be measured is parsed, and content of pages is verified according to test order, generates content test result;
Content test result is written in test report;
It returns and link to be measured, and the step of requesting link to be measured is obtained according to test chained list, until in traversal test chained list Whole link to be measured.
Further, when traversal test program is executed by processor, test configurations information is obtained, and believe according to test configurations Breath initialization test frame operation include:
Obtain test configurations information, wherein test domain information includes driven file information;
According to driven file information, test chained list is generated;
Wherein, the data field for testing chained list includes the content-data of data-driven, and the pointer field for testing chained list includes data The direction data of driving.
Further, traversal test program is when being executed by processor, the operation for parsing the content of pages of link to be measured it Afterwards, following operation is also executed:
Extract the page link in link to be measured;
According to test domain information, judge whether page link is in test domain;
When page link is in test domain, page link is added in test chained list.
Further, when traversal test program is executed by processor, when page link is in test domain, by page chain Connecing the operation being added in test chained list includes:
When page link is in test domain, judge to test in chained list with the presence or absence of consistent to surveyor's chain with page link It connects;
When test chained list in there is no with page link it is consistent it is to be measured link when, page link is added to test chained list In.
Further, when traversal test program is executed by processor, link to be measured is being obtained according to test chained list, and request After the operation of link to be measured, following operation is also executed:
The Connecting quantity of link to be measured is obtained, and Connecting quantity is verified according to test order, generates connecting test result;
Connecting test result is written in test report.
Further, when traversal test program is executed by processor, test configurations information further includes default Connecting quantity model It encloses;
Link to be measured is obtained according to test chained list, and requests the operation of link to be measured to include:
Link to be measured is obtained according to test chained list, requests link to be measured, and detect the connection requested in link process to be measured Parameter;
When Connecting quantity exceeds default Connecting quantity range, link to be measured is requested in pause, and generates linkage record;
After the link to be measured not suspended all in traversal test chained list, according to linkage record, the to be measured of pause is obtained Link;
Compare the linkage record number and preset number for corresponding to the link to be measured of same pause;
When linkage record number is less than preset number, link to be measured is requested;
When linkage record number is greater than or equal to preset number, stop requesting link to be measured, and generates connection prompt letter Breath.
Further, when traversal test program is executed by processor, test configurations information further includes simulation browser configuration Information;
Link to be measured is obtained according to test chained list, and requests the operation of link to be measured to include:
Link to be measured is obtained according to test chained list;
Judge whether link to be measured needs to pass through browse request;
When link to be measured needs to pass through browse request, simulation browser is called, link to be measured is requested;
When link to be measured does not need to pass through browse request, direct request link to be measured.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in one as described above In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that terminal device (it can be mobile phone, Computer, server, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of traversal test method, which is characterized in that the traversal test method the following steps are included:
Test configurations information is obtained, and according to the test configurations information initializing test frame, wherein the test configurations letter Breath includes test domain information and test order information, and the test frame includes test chained list and test order;
Link to be measured is obtained according to the test chained list, and requests the link to be measured;
The content of pages of the link to be measured is parsed, and the content of pages is verified according to the test order, content is generated and surveys Test result;
The content test result is written in test report;
It returns and link to be measured, and the step of requesting the link to be measured is obtained according to the test chained list, until traversing the survey Try the whole link to be measured in chained list.
2. traversal test method as described in claim 1, which is characterized in that obtain test configurations information, and according to the survey Try configuration information initialization test frame the step of include:
Obtain test configurations information, wherein the test domain information includes driven file information;
According to the driven file information, test chained list is generated;
Wherein, the data field of the test chained list includes the content-data of data-driven, and the pointer field of the test chained list includes The direction data of data-driven.
3. traversal test method as described in claim 1, which is characterized in that parsing the content of pages of the link to be measured After step, the traversal test method is further comprising the steps of:
Extract the page link in the link to be measured;
According to the test domain information, judge whether the page link is in the test domain;
When the page link is in the test domain, the page link is added in the test chained list.
4. traversal test method as claimed in claim 3, which is characterized in that when the page link is in the test domain When, include: by the step that the page link is added in the test chained list
When the page link is in the test domain, judge to whether there is and the page link in the test chained list Consistent link to be measured;
When in the test chained list there is no with the page link it is consistent it is to be measured link when, the page link is added to In the test chained list.
5. traversal test method as described in claim 1, which is characterized in that obtain according to the test chained list to surveyor's chain It connects, and after the step of requesting the link to be measured, the traversal test method is further comprising the steps of:
The Connecting quantity of the link to be measured is obtained, and the Connecting quantity is verified according to the test order, connection is generated and surveys Test result;
The connecting test result is written in the test report.
6. the traversal test method as described in any one of claims 1 to 5, which is characterized in that the test configurations information is also Including presetting Connecting quantity range;
Link to be measured is obtained according to the test chained list, and the step of requesting the link to be measured includes:
Link to be measured is obtained according to the test chained list, requests the link to be measured, and detects the request link process to be measured In Connecting quantity;
When the Connecting quantity exceeds the default Connecting quantity range, the link to be measured is requested in pause, and generates connection Record;
After the link to be measured not suspended all in traversing the test chained list, according to the linkage record, pause is obtained Link to be measured;
Compare the linkage record number and preset number for corresponding to the link to be measured of same pause;
When the linkage record number is less than the preset number, the link to be measured is requested;
When the linkage record number is greater than or equal to the preset number, stop requesting the link to be measured, and the company of generation Connect prompt information.
7. the traversal test method as described in any one of claims 1 to 5, which is characterized in that the test configurations information is also Including simulation browser configuration information;
Link to be measured is obtained according to the test chained list, and the step of requesting the link to be measured includes:
Link to be measured is obtained according to the test chained list;
Judge whether the link to be measured needs to pass through browse request;
When the link to be measured needs to pass through browse request, the simulation browser is called, the link to be measured is requested;
When the link to be measured does not need to pass through browse request, link to be measured described in direct request.
8. a kind of traversal test equipment, which is characterized in that the traversal test equipment includes: memory, processor and is stored in On the memory and the computer program that can run on the processor, the computer program are executed by the processor The step of traversal test method of the Shi Shixian as described in any one of claims 1 to 7.
9. a kind of traversal test device, which is characterized in that the traversal test device includes:
Test configurations module, to obtain test configurations information, and according to the test configurations information initializing test frame, In, the test configurations information includes test domain information and test order information, and the test frame includes test chained list and survey Examination rule;
Linking request module to obtain link to be measured according to the test chained list, and requests the link to be measured;
Content authentication module verifies the page to parse the content of pages of the link to be measured, and according to the test order Face content generates content test result;
Writing module is reported, the content test result to be written in test report.
10. a kind of computer readable storage medium, which is characterized in that be stored with traversal on the computer readable storage medium and survey Program is tried, the traversal test program realizes the traversal test as described in any one of claims 1 to 7 when being executed by processor The step of method.
CN201810951311.4A 2018-08-17 2018-08-17 Traverse test method, unit and computer readable storage medium Pending CN109726112A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810951311.4A CN109726112A (en) 2018-08-17 2018-08-17 Traverse test method, unit and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810951311.4A CN109726112A (en) 2018-08-17 2018-08-17 Traverse test method, unit and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN109726112A true CN109726112A (en) 2019-05-07

Family

ID=66295403

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810951311.4A Pending CN109726112A (en) 2018-08-17 2018-08-17 Traverse test method, unit and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109726112A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111083010A (en) * 2019-12-17 2020-04-28 深圳市网心科技有限公司 Speed measurement method and device and computer readable storage medium
CN111737152A (en) * 2020-07-29 2020-10-02 中国人民解放军国防科技大学 Method and device for realizing WEB automatic test by inputting data through webpage

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019937A (en) * 2012-12-13 2013-04-03 广东欧珀移动通信有限公司 Human-machine interaction interface traverse test method
CN103164336A (en) * 2013-02-22 2013-06-19 广东欧珀移动通信有限公司 Automation test method and device of application programs of mobile terminals
CN107908552A (en) * 2017-10-30 2018-04-13 阿里巴巴集团控股有限公司 A kind of test method based on link, device and equipment
CN108183962A (en) * 2018-01-04 2018-06-19 上海瀚之友信息技术服务有限公司 A kind of simulated testing system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019937A (en) * 2012-12-13 2013-04-03 广东欧珀移动通信有限公司 Human-machine interaction interface traverse test method
CN103164336A (en) * 2013-02-22 2013-06-19 广东欧珀移动通信有限公司 Automation test method and device of application programs of mobile terminals
CN107908552A (en) * 2017-10-30 2018-04-13 阿里巴巴集团控股有限公司 A kind of test method based on link, device and equipment
CN108183962A (en) * 2018-01-04 2018-06-19 上海瀚之友信息技术服务有限公司 A kind of simulated testing system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111083010A (en) * 2019-12-17 2020-04-28 深圳市网心科技有限公司 Speed measurement method and device and computer readable storage medium
CN111737152A (en) * 2020-07-29 2020-10-02 中国人民解放军国防科技大学 Method and device for realizing WEB automatic test by inputting data through webpage

Similar Documents

Publication Publication Date Title
CN107704356B (en) Exception stack information acquisition method, device and computer readable storage medium
CN109582579B (en) Application program testing method and device, electronic equipment and storage medium
CN105677571B (en) Mobile terminal software device for testing compatibility and method
CN107038112B (en) Application interface debugging method and device
CN107133174A (en) Test case code automatically generating device and method
CN107678937A (en) Page compatibility detection method, device, server and medium
CN108415739A (en) A kind of the hook method, apparatus and storage medium of Dynamic Link Library Function
CN108463832A (en) Electronic equipment and process execution method based on hardware diagnostic result
CN102981954B (en) The compatibility test method and electronic installation of a kind of input method
EP3179388A1 (en) Web page operation method and electronic device for supporting the same
CN105183630B (en) Applied program testing method and device
US20150178253A1 (en) Method and apparatus for outputting digital content
CN107016282A (en) A kind of information processing method and device
CN109783351A (en) Interface detection method, apparatus and computer readable storage medium
CN107704245A (en) Protocol accessing method, device and computer-readable recording medium
CN108536594A (en) Page test method, device and storage device
CN109726110A (en) Document test method, unit and computer readable storage medium
CN109726112A (en) Traverse test method, unit and computer readable storage medium
CN108182149A (en) Built-in browser adjustment method, debugging terminal and computer readable storage medium
CN107016043A (en) A kind of information processing method and device
CN114281631A (en) Method and device for testing image processing chip and electronic equipment
KR20150083718A (en) Apparatus and Method for displaying texts in electronic device
CN108717357A (en) Page presentation code conversion method, device, equipment and computer storage media
CN110168486A (en) Electronic device and the in an electronic method of the shortcut of creation webpage
CN109726113A (en) Method for generating test case, unit and computer readable storage medium

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
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20190507

WD01 Invention patent application deemed withdrawn after publication